freenode/lisp - IRC Chatlog
Search
14:24:16
Gnuxie[m]
ey: I think the bridge broke, but yes you can't rely on TCO if you want your code to be portable
16:17:07
sjl
stas' macbook got funded despite the paypall issues so presumably SBCL will eventually run there without rosetta
17:55:09
n3t
Hello. I'm looking for general (i.e. not only CL) LISP-related Freenode channels. Where should I go?
18:34:35
samlamamma
You can't get the direct superclasses given some class, right? Like #'compute-direct-superclasses doesn't exist in the standard
18:37:25
jackdaniel
samlamamma: how about (c2mop:class-direct-superclasses (find-class 'integer)) ;?
21:02:25
Xach
aeth: that's one option. (load "asdf.lisp") is another. you could mix a compile-file into there too.
21:05:02
aeth
This seems to keep the version the same even though it loads (if you turn silent off): (list (asdf:asdf-version) (progn (ql:quickload :asdf :silent t) (asdf:asdf-version)))
21:06:31
Xach
ralt: I am not interested in pushing an implementation's version past where the implementation maintainers have chosen.
21:07:39
aeth
There are a bunch of fixes from 2020 for package-local-nicknames in newer ASDF versions than most (any?) implementations seem to provide. e.g. https://github.com/fare/asdf/search?q=nickname&type=commits
21:13:12
Xach
You can quickload asdf if you download asdf sources and put it someplace asdf can find it.
21:14:42
aeth
So I guess if you use something fixed in 2020, you have to get everyone to upgrade ASDF, and you have to have your CI check out the ASDF repo into local-projects
22:28:06
phantomics
a question: why does entering numbers in scientific notation always yield a float? Like 10e10 returns a float when the number can be expressed as an integer. Is there a way to enter numbers in e-notation yielding ints when possible?
22:29:55
aeth
You can do (round 10d10) but you'd need enough precision in the original, e.g. 10e10 (equivalent to 10f10 by default) won't give you the exact answer
22:40:27
_death
phantomics: when writing numbers in scientific notation, you deal with real values.. that some of them can also be represented as integers is incidental.. if these translate to a different type, it would be inconvenient because usually a programmer's choice of whether to use floats or integers is explicit
23:01:47
aeth
_death: well, I mean... 9.8e10 is an integer and 9.8e0 isn't, but it's not like you couldn't have scientific notation that results in a rational (bignum/bignum, rather than an integer) or error if it's not an integer, or have some rounding rule, or...
23:04:11
tinga
I'm trying to run an existing project and it complains that ASDF package doesnt exist, so I added (load "/usr/lib/sbcl/contrib/asdf.fasl") to the init file, now it complains that package QL doesnt exist. I suspect it might be quicklisp but while (load "/usr/share/common-lisp/source/quicklisp/quicklisp.lisp") pointed me to run (quicklisp-quickstart:install), which I did, it now still complains about QL not existing.
23:06:29
_death
aeth: 9.8e10 is not an integer in Lisp.. it is an integer in math, but some languages choose to support multiple representations for a single mathematical value..
23:08:01
aeth
_death: I mean a mathematical integer. The fact that some words are overloaded with math words with separate meanings can be confusing at times. In Scheme land, they don't do that (except with vector), but then you get the confusion of 9.8 being an integer? so when you're a programmer you really want an exact-integer? instead when you want an integer... and so on.
23:09:53
aeth
Anything that can be a float can also become a rational, as long as it's either an exact operation (like 9.8 * 10^10 is) or has a specified rounding precision.
23:10:38
aeth
CL has both RATIONAL and RATIONALIZE to do this, with the latter generally producing more intuitive results when working on base-2 (rather than base-10) floats.
23:11:21
_death
all I'm saying is that it would be inconvenient if 9.8e10 is an integer while 9.81e10 is not
23:12:43
aeth
_death: You said earlier that scientific notation deals with reals, which isn't true in programming.
23:13:18
scymtym
while phoe is joking, SBCL actually has http://www.sbcl.org/manual/index.html#Decimal-Syntax-for-Rationals
23:13:22
aeth
The only reason why stuff like the scientific notation literals, SQRT, etc., don't produce rationals is that you'd need some global or extra parameter for precision. Floats have fixed precision.
23:15:54
aeth
_death: mathematical real numbers (not the type CL:REAL) are infinite, whereas floating point are fixed-length. They are not reals. You can't even get all reals on a magic computer with infinite precision and infinite RAM: you can only get computable numbers.
23:16:47
aeth
The main difference between a RATIONAL and a FLOAT is the way the printer treats them: 258/25 vs 10.32
23:17:53
aeth
It works. Mostly. It still prints rationals as rationals, instead of as the default floating point type.
23:19:26
aeth
_death: Actually, exactly the opposite. Every other field has infinite pedantry. Mathematics is precise. The only confusing thing when applying mathematics in a computer science concept is that a lot of the terms have two meanings (like math's real numbers vs. CL:REAL)
23:20:21
phantomics
In that cast, if I want to read e-numbers as either float or decimal, depending on whether the output is a whole number, I can just check if the output from nEn has a fractional part that's bigger than the float epsilon, and if it isn't I evaluate the same number as nRn
23:20:28
aeth
_death: And in this case, it actually has an application. The application is that CL:RATIONALs can be used as "exact" floating points with just a little bit of work.
23:21:51
aeth
Someone probably has already written a SQRT* that will call SQRT if a float, but keep rationals as rationals to the desired level of precision. (Note: This isn't ISQRT, which rounds down)
23:49:53
Xach
kpoeck: thanks. how can i find that out for myself? i looked for things named asdf and none of them seemed to be asdf. (maybe i looked wrong)
23:53:06
kpoeck
In our build script it refers to the asdf version: https://github.com/clasp-developers/clasp/blob/master/wscript#L320
23:57:07
Xach
kpoeck: thanks, i thought there might be an asdf.lisp or similar. thank you for the link to the script.
0:04:55
Bike
yeah it does the source concatenation dealie so asdf.lisp isn't actually in the distribution
0:05:58
kpoeck
yes this is done by ${MAKE-make} --quiet in https://github.com/clasp-developers/clasp/blob/master/wscript#L324
0:09:14
kpoeck
so basically we pull the asdf sources from https://gitlab.common-lisp.net/asdf/asdf.git and build asdf.lisp with ./waf update_dependencies in the clasp build process