libera/commonlisp - IRC Chatlog
Search
10:24:11
jackdaniel
first you need to know how many bits there is, otherwise you will add garbage to the result
10:25:39
jackdaniel
in principle this could be done the same as with the constant si:cl-fixnum-bits (that is - fill it when ecl is built); oh well, I'll add single and double and signal an error for long float for now (but api-wise it will be covered!)
10:34:28
jackdaniel
shouldn't they be handled the same as single float? (I don't think that there is an implementation implementing them as half-precision)
11:19:21
rendar
can we say that everything in CL is represented (in C, for instance) by `struct Cons { elem * car; elem * cdr; };` ?
11:20:26
rendar
the book i'm reading speaks about the LIST function which fills the car pointers and the cdr pointers, so i have imagined something like that
11:21:05
jackdaniel
rendar: how will you represent a number 42 as struct Cons { elem * car; elem * cdr; }; ?
11:21:10
hayley
A cons cell can be represented like your description, but not everything is a cons cell.
11:21:50
rendar
jackdaniel, well, that is the "elem" the Cons struct points to, so 42 is an elem, and (42) is cons.car->42,cdr->nil
11:22:24
jackdaniel
but you said, that everything is represented as that struct; is it that integer does not fall in the category "everything"?
11:25:55
jackdaniel
Shinmera: https://gitlab.com/embeddable-common-lisp/ecl/-/commit/1ce4713804e704dd29a1c56bfabe3ea5a129a0f5?view=inline
11:29:16
Shinmera
jackdaniel: very nice. now the only question left is: how do I make the library not completely break on older ECL versions
11:30:36
jackdaniel
(when (find-symbol "BITS-SINGLE-FLOAT" "SYSTEM") (push 'float-features::ecl-can-do-this *features*)) ;comes to mind
11:32:12
jackdaniel
there is also ext:+ecl-version-number+ for checking (a monotonic version number)
11:34:45
_death
rendar: as an optimization some objects (say fixnums or characters) may be stored in place of the pointer.. also, while lisp has a cons/atom dichotomy, the atoms may be aggregates (think arrays)
11:55:02
yitzi
Shinmera: do you know where the LispWorks version reader macro is documented? Please don't look if you don't, I can find if you don't know right off of the top of your head.
11:55:29
Shinmera
But I remember seeing it in library code and missing it on other implementations ever since
12:28:28
Shinmera
Ooh. Just got an automated quicklisp issue ticket. Maybe a new dist release is going to appear soon :)
19:21:16
contrapunctus
Is there any Emacs package to automatically display Common Lisp docstrings for the symbol at point? I've searched and searched, but to no avail :\