<Bike>
you could do that with compiler macros, but it wouldn't cover things like (let ((z (g x))) (f z))
shifty has joined #lisp
fixing_auth_hold is now known as lalilulelo
Josh_2 has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
paul0 has joined #lisp
chosenone has quit [Quit: Ping timeout (120 seconds)]
chosenone has joined #lisp
igemnace has quit [Ping timeout: 240 seconds]
igemnace has joined #lisp
froggey has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 240 seconds]
froggey has joined #lisp
midre has joined #lisp
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
froggey has quit [Ping timeout: 246 seconds]
Aurora_v_kosmose has joined #lisp
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 264 seconds]
<sveit>
Bike: yes, i understand. actually in my case that's exactly what I want :)
<sveit>
actually, 2 more questions on that: 1) can i guarantee that it will NOT fire in that case? and 2) will any inlinable functions be inlined at compiler macro expansion time?
jbgg has quit [Ping timeout: 260 seconds]
lonjil has quit [Ping timeout: 256 seconds]
froggey has joined #lisp
abhixec has joined #lisp
uedasan has quit [Quit: WeeChat 2.3]
epony has quit [Ping timeout: 258 seconds]
froggey has quit [Ping timeout: 258 seconds]
ldb has joined #lisp
<ldb>
goog morning
<ldb>
sveit: for case 1: it cannot ensure if functions get redefined
<ldb>
and for 2: I don't think inline is usually done at compiler macro exp time
froggey has joined #lisp
<Bike>
well, the compiler macro function gets a form as input. so it'll get, like, the list (F Z).
<Bike>
your code will prsumably see the Z and go "well, this isn't in the form of (G something)" and give up.
<Bike>
i don't understand why you wouldn't want it to fire in that case, though. semantically it's identical
<White_Flame>
(assuming Z doesn't get overwritten inbetween, of course)
froggey has quit [Ping timeout: 256 seconds]
smazga has quit [Ping timeout: 240 seconds]
mangoicedtea has quit [Quit: Leaving]
<Bike>
i don't think any actual implementation would rewrite (let ((z (g x))) (f z)) to (f (g x)) in such a way that a compiler macro would notice, but i'm not sure that it's explicitly forbidden either
jbgg has joined #lisp
<sveit>
Bike: the reason is that, in my case, (G (H X)) is preferrable to (F (G X)), but if there is reuse of G, it is better to compute it once: (let ((g (G X))) (F g) (F2 g)) is preferable to (progn (G (H X)) (G (H2 X)))
smazga has joined #lisp
edgar-rft has joined #lisp
gioyik has quit [Ping timeout: 240 seconds]
epony has joined #lisp
froggey has joined #lisp
space_otter has joined #lisp
smazga has quit [Ping timeout: 246 seconds]
jw4 has quit [Quit: tot siens]
jw4 has joined #lisp
anewuser has joined #lisp
jesse1010 has quit [Ping timeout: 246 seconds]
Alloc has quit [Ping timeout: 240 seconds]
Alloc has joined #lisp
epony has quit [Remote host closed the connection]
epony has joined #lisp
toorevitimirp has quit [Ping timeout: 258 seconds]
ldb has quit [Quit: Connection closed]
smazga has joined #lisp
smazga has quit [Ping timeout: 246 seconds]
<Bike>
oh, well, that's different, the compiler is definitely not going to do that since the function could have side effects
<Bike>
and to answer your other question, as far as i know all implementations inline after expanding compiler macros.
<Bike>
(provided they do either at all, of course)
Alloc has quit [Ping timeout: 240 seconds]
Alloc has joined #lisp
smazga has joined #lisp
Alloc has quit [Ping timeout: 256 seconds]
Alloc has joined #lisp
smazga has quit [Ping timeout: 258 seconds]
gioyik has joined #lisp
shangul has joined #lisp
Alfr__ has joined #lisp
M4NN1M4CR0 has joined #lisp
Alfr_ has quit [Ping timeout: 244 seconds]
smazga has joined #lisp
smazga has quit [Ping timeout: 256 seconds]
Bike has quit [Quit: Lost terminal]
<beach>
Good morning everyone!
Oladon has joined #lisp
rumbler31 has joined #lisp
smazga has joined #lisp
Necktwi has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Ping timeout: 264 seconds]
jasom has joined #lisp
smazga has quit [Ping timeout: 240 seconds]
Lycurgus has quit [Ping timeout: 258 seconds]
dominic34 has joined #lisp
terpri_ is now known as terpri
ldb has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
Necktwi has joined #lisp
orivej has joined #lisp
anewuser has quit [Quit: Leaving]
abhixec has quit [Quit: zzzZZZ]
dominic34 has quit [Ping timeout: 258 seconds]
gravicappa has joined #lisp
_paul0 has joined #lisp
rumbler31_ has quit [Ping timeout: 240 seconds]
paul0 has quit [Ping timeout: 240 seconds]
smazga has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 244 seconds]
Lord_of_Life_ is now known as Lord_of_Life
smazga has quit [Ping timeout: 240 seconds]
toorevitimirp has joined #lisp
smazga has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
torbo has quit [Remote host closed the connection]
smazga has quit [Ping timeout: 240 seconds]
terpri_ has joined #lisp
kami has joined #lisp
<kami>
Good morning
<beach>
Hello kami.
terpri has quit [Ping timeout: 240 seconds]
<kami>
Does anybody know how to reach Kevin Rosenberg? I have a question regarding cl-base64.
zaquest has quit [Quit: Leaving]
dominic34 has joined #lisp
Oladon has quit [Quit: Leaving.]
smazga has joined #lisp
zaquest has joined #lisp
dominic34 has quit [Ping timeout: 240 seconds]
duuqnd has joined #lisp
smazga has quit [Ping timeout: 264 seconds]
prite has quit [Ping timeout: 246 seconds]
pfr has quit [Quit: WeeChat 2.8]
bocaneri has joined #lisp
smazga has joined #lisp
karlosz has quit [Quit: karlosz]
smazga has quit [Ping timeout: 240 seconds]
narimiran has joined #lisp
jonatack has quit [Ping timeout: 272 seconds]
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
Cymew has joined #lisp
smazga has joined #lisp
<edgar-rft>
kami: there is an email address in the .asd file, but no idea if still valid
nicktick has quit [Ping timeout: 240 seconds]
<kami>
edgar-rft: thank you. I think I'll give it a try :)
smazga has quit [Ping timeout: 240 seconds]
jprajzne has joined #lisp
smazga has joined #lisp
hiroaki has quit [Ping timeout: 265 seconds]
<edgar-rft>
I was born in 1965, not 64, so I rather might be base65 instead.
<aeth>
just change the year system so year 0000 starts later.
<HiRE>
quick and probably dumb question... I would like to load a configuration file. Ideally this file would itself be a bunch of sexps kind of how emacs does it. What would I have to do to eval/load the definitions in this file into the current file?
smazga has quit [Ping timeout: 265 seconds]
<HiRE>
im trying to be as lispy as possible.don't want to do something non canonical in the process
<HiRE>
for example defining a class and shoving everything in there like you would in java/c++/whatever
<aeth>
HiRE: the key parts are (1) turn off *read-eval* so things like #.(+ 1 1) don't work. (2) create a concatenated stream that wraps the file in ( at the start and ) at the end, and (3) if you don't reach EOF at the end then your parens are imbalanced.
jonatack has joined #lisp
<aeth>
Not as robust as defining your own .sxp format, but it reuses the CL reader so it's very trivial
Necktwi has quit [Quit: leaving]
<HiRE>
clever. I had thought you could just eval it maybe but you are correct and if I understand this you are preventing RCE by doing it this way.
Necktwi has joined #lisp
Necktwi has quit [Client Quit]
bilegeek has quit [Quit: Leaving]
<aeth>
HiRE: oh and for data, use plists (or plist tails)... they're the simplest to deal with because you can treat them as &key in a destructuring-bind, or use a plist iteration like alexandria:doplist
<aeth>
You'll have to write your own (de)serialization, but you'll know it's safe, unlike using something that saves/loads arbitrary objects
mangul has joined #lisp
<HiRE>
good point. I appreciate your help. This will be a good start for me.
<aeth>
And in case you're wondering, #3 works because you just wrapped the stream in () so it should just be one form. Iirc. It has been years.
<aeth>
(You could also read/collect in a loop, but it's not as elegant. It might be faster. Depends on how concatenated-streams work.)
shka_ has joined #lisp
lonjil has joined #lisp
shangul has quit [Ping timeout: 258 seconds]
<aeth>
Hm, right, it's just one READ, so if you don't reach EOF on the next READ then you might have something like an extra ) at the end of the file or, worse, ) (hello world) (see?
<aeth>
the ( added to the start and the ) added to the end would make that valid syntax, but it would take more than one READ to read it, so checking for eof will catch it.
<aeth>
(the second one would be valid syntax, I mean)
<HiRE>
interesting. I hadn't expected it to be so involved because of ~lisp magic~ but this is certainly a smarter way to approach it
<aeth>
Technically, I think you should (gensym "EOF") instead of using :eof for the EOF value like I did there. That way, it can't be read, while in my case, I think that the user could end their file with ) :eof
<aeth>
This is one of the rare cases of using a gensym outside of a macro!
Necktwi has joined #lisp
<aeth>
hah, I was right, I have to fix my function now
<White_Flame>
if I need a unique token, I (cons nil nil) and EQ test
<aeth>
I think I could (defconstant +eof+ (gensym "EOF")) to avoid creating a new gensym each time the function runs
pve has joined #lisp
<aeth>
oh, hmm, no, the SBCL compiler runs it (at least twice) and that gets a redefinition error
Necktwi has quit [Quit: leaving]
smazga has joined #lisp
orivej has quit [Ping timeout: 264 seconds]
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
scymtym has quit [Ping timeout: 265 seconds]
<phoe>
aeth: alexandria:define-constant with a custom test
smazga has quit [Ping timeout: 240 seconds]
schweers has joined #lisp
<aeth>
phoe: ah, a custom test, that's what I was missing
<aeth>
I think the simple solution is fine, though because a tiny bit of consing in a function that extremely conses probably isn't a big deal.
<phoe>
a convention is to use the stream itself as the eof value and eq-check that
<phoe>
but then again anything can really go there
<aeth>
ah, interesting
<phoe>
I mean, reading Lisp data will never return the stream object unless read-eval trickery happens
<phoe>
but with read-eval disabled you can't get the stream you are reading from.
ljavorsk has joined #lisp
<aeth>
I was thinking GENSYM because in R7RS, Scheme has an (eof-object) which might not be unique, but which must pass eof-object? and I'm considering using a GENSYM (in alexandria:define-constant, I guess) to do that. Although I guess a complicating factor is that something cannot be both a symbol? and an eof-object?
fixing_auth_hold has joined #lisp
iamFIREcracker has joined #lisp
jonatack has joined #lisp
jonatack has quit [Client Quit]
jonatack has joined #lisp
rumbler31 has joined #lisp
iamFIREc1 has quit [Ping timeout: 246 seconds]
lalilulelo has quit [Ping timeout: 244 seconds]
jonatack has quit [Ping timeout: 256 seconds]
kami has quit [Ping timeout: 258 seconds]
rumbler31 has quit [Ping timeout: 240 seconds]
<phoe>
no need to do that in CL since READ will return whatever you give it as eof-value in case of EOF
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
wxie has joined #lisp
FreeBirdLjj has joined #lisp
vutral has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
kaftejiman has quit [Remote host closed the connection]
ljavorsk has quit [Ping timeout: 240 seconds]
bitmapper has quit [Ping timeout: 240 seconds]
Alloc has quit [Ping timeout: 256 seconds]
save-lisp-or-die has joined #lisp
pve has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
gko_ has joined #lisp
toorevitimirp has quit [Ping timeout: 256 seconds]
toorevitimirp has joined #lisp
frgo has joined #lisp
wxie has joined #lisp
Bike has joined #lisp
ggole has joined #lisp
orivej has joined #lisp
smazga has joined #lisp
gmeister has quit [Quit: WeeChat 2.8]
wsinatra has joined #lisp
dominic34 has joined #lisp
smazga has quit [Ping timeout: 265 seconds]
edgar-rft has joined #lisp
aap has quit [Read error: Connection reset by peer]
aap has joined #lisp
heredoc has quit [Ping timeout: 240 seconds]
heredoc has joined #lisp
rixard_ has joined #lisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
rixard has quit [Ping timeout: 264 seconds]
nicktick has joined #lisp
stepnem has quit [Ping timeout: 240 seconds]
stepnem has joined #lisp
natter has quit [Remote host closed the connection]
natter has joined #lisp
Josh_2 has joined #lisp
Necktwi has joined #lisp
toorevitimirp has quit [Ping timeout: 260 seconds]
<Josh_2>
afternoon
EvW has joined #lisp
mseddon has joined #lisp
iamFIREcracker has quit [Ping timeout: 240 seconds]
iamFIREcracker has joined #lisp
smazga has joined #lisp
CrazyEddy has quit [Ping timeout: 265 seconds]
smazga has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 260 seconds]
sjl_ has joined #lisp
prite has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
davepdot_ has joined #lisp
tourjin has joined #lisp
smazga has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
davepdot_ has quit [Remote host closed the connection]
davepdotorg has joined #lisp
EvW1 has joined #lisp
davepdot_ has joined #lisp
smazga has quit [Ping timeout: 258 seconds]
rumbler31_ has joined #lisp
davepdotorg has quit [Ping timeout: 260 seconds]
Bourne has quit [Ping timeout: 258 seconds]
bsd4me has joined #lisp
schweers has quit [Ping timeout: 260 seconds]
dominic34 has quit [Quit: dominic34]
narimiran has quit [Ping timeout: 256 seconds]
elxbarbosa has joined #lisp
jgodbout has joined #lisp
EvW1 has quit [Ping timeout: 240 seconds]
bsd4me has left #lisp ["Leaving"]
smazga has joined #lisp
elxbarbosa has quit [Ping timeout: 240 seconds]
smazga has quit [Ping timeout: 258 seconds]
random-nick has quit [Remote host closed the connection]
random-nick has joined #lisp
chiota has joined #lisp
davepdot_ has quit [Remote host closed the connection]
davepdotorg has joined #lisp
frgo has quit [Remote host closed the connection]
smazga has joined #lisp
ebrasca has joined #lisp
terpri__ has joined #lisp
Alloc has joined #lisp
terpri_ has quit [Ping timeout: 240 seconds]
bitmapper has joined #lisp
edgar-rft has quit [Quit: Leaving]
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
dominic34 has joined #lisp
Aurora_v_kosmose has joined #lisp
tourjin has quit [Ping timeout: 258 seconds]
davepdot_ has joined #lisp
frgo has joined #lisp
tourjin has joined #lisp
mseddon has quit [Quit: Leaving]
terpri__ is now known as terpri
davepdotorg has quit [Ping timeout: 240 seconds]
frgo has quit [Ping timeout: 240 seconds]
gko_ has quit [Ping timeout: 240 seconds]
<phoe>
luis: is CFFI::RETRY supposed to be exported?
<phoe>
I just found someone who attempts to use the CFFI::RETRY restart when loading a foreign library, but the restart name is not exported
<phoe>
is the restart in question supposed to be internal for whatever reason?
<luis>
phoe: someone opened a launchpad bug about that today. I think I only expected that restart to be invoked interactively
dddddd has quit [Remote host closed the connection]
<luis>
phoe: do you have a pointer to that use case? I'm intrigued.
<phoe>
oh, must be the same use case
<phoe>
"i filed a cffi bug. What I'm doing is reloading the cffi libs after an image restore but some .so files aren't in the same location, so I handle the load-foreign-library-error and ask cffi to load the .so from another directory"
<phoe>
"After redefining the cffi:define-foreign-library to include a special dir, I'd like to (invoke-restart 'retry)
<luis>
But I think the underlying problem is problem is probably having dumped a Lisp image with hardcoded foreign libs. If that's the case, that's the root problem that needs fixing.
davepdot_ has quit [Remote host closed the connection]
davepdotorg has joined #lisp
<phoe>
"Unfortunately, via that condition seems the only way for me to pull the original .so filenames from the origina define-foreign-library in another system
<phoe>
[18:01]
<phoe>
I am suggesting that they use CFFI:LIST-FOREIGN-LIBRARIES and inspect the libs there
<luis>
phoe: best bet is to close the libraries before dumping the image. Or ensuring they're loaded without hardcoded paths.
davepdot_ has joined #lisp
nadare has joined #lisp
nadare has quit [Client Quit]
zulu-inuoe has joined #lisp
davepdotorg has quit [Ping timeout: 264 seconds]
shimizutan has quit [Quit: WeeChat 2.3]
frgo has joined #lisp
frgo_ has joined #lisp
save-lisp-or-die has quit [Quit: ERC (IRC client for Emacs 26.3)]
frgo__ has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
frgo has quit [Ping timeout: 240 seconds]
frgo_ has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
<Josh_2>
I'd like to print the stacktrace to *error-output* just like Hunchentoot does
<Josh_2>
is there a library for this?
<mfiano>
Try dissect. Also, the verbose library uses dissect to do this, by being able to log condition objects to a faucet
Blukunfando has joined #lisp
<Josh_2>
that works thanks mfiano
<Bike>
there's also trivial-backtrace
lnostdal has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
fixing_auth_hold has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life has joined #lisp
yitzi has joined #lisp
<Josh_2>
trivial-backtrace also works
yitzi_ has joined #lisp
yitzi has quit [Ping timeout: 265 seconds]
yitzi_ is now known as yitzi
frgo__ is now known as frgo
jeosol has quit [Remote host closed the connection]
tourjin has quit [Ping timeout: 240 seconds]
pve has quit [Ping timeout: 240 seconds]
pve has joined #lisp
karlosz has joined #lisp
cosimone has joined #lisp
gravicappa has quit [Read error: Connection reset by peer]
lalilulelo has joined #lisp
rippa has joined #lisp
fixing_auth_hold has quit [Ping timeout: 244 seconds]
gravicappa has joined #lisp
yamashitasama has joined #lisp
karlosz has quit [Quit: karlosz]
secretmyth has joined #lisp
karlosz has joined #lisp
yamashitasama has quit [Client Quit]
saitousan has joined #lisp
secretmyth is now known as dpd88
lalilulelo has quit [Read error: Connection reset by peer]
Zianic has joined #lisp
lalilulelo has joined #lisp
narimiran has joined #lisp
orivej has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
hiroaki has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
edgar-rft has joined #lisp
bocaneri has quit [Remote host closed the connection]
yitzi has quit [Quit: yitzi]
jcowan has joined #lisp
minion has quit [Remote host closed the connection]
specbot has quit [Remote host closed the connection]
minion has joined #lisp
specbot has joined #lisp
yitzi has joined #lisp
ibinderwolf has quit [Quit: No Ping reply in 180 seconds.]
ibinderwolf has joined #lisp
<jcowan>
On Sept 8 at 2200 UTC, Andrew Sengul will be giving a 2-hour presentation about April, his APL compiler targeting Common Lisp. It's virtual, so anyone can go if they're awake. Sign up at https://www.meetup.com/LispNYC/events/vqhmbpybcmblb/
prefixt has joined #lisp
<prefixt>
Hello! I'm looking for an interactive lisp tutorial, preferably in emacs. Do you fine folks recommend any in particular?
brj has joined #lisp
saitousan has quit [Quit: WeeChat 2.3]
<jcowan>
prefixt: Answers may be slow in coming here.
kaftejiman has joined #lisp
<jcowan>
I recommend joining #clschool, which is specifically for newbies
<prefixt>
Thank you jcowan
brettgilio has quit [Ping timeout: 240 seconds]
ck_ has joined #lisp
Jesin has quit [Quit: Leaving]
cosimone has quit [Remote host closed the connection]
<pve>
i think they were recently updated by someone (phoe?)
rme has joined #lisp
jmercouris has quit [Ping timeout: 240 seconds]
<jgodbout>
indeed
jmercouris has joined #lisp
<jgodbout>
Phoe did a rather large rewrite
random-nick has quit [Ping timeout: 240 seconds]
<prefixt>
pve, jgodbout, my week has been made. Thank you! <3
<pve>
prefixt: have fun
shangul has quit [Ping timeout: 256 seconds]
random-nick has joined #lisp
* prefixt
disappears
prefixt has quit [Quit: Leaving]
EvW has joined #lisp
cosimone has joined #lisp
<jasom>
haha, I have abcl in doppio working well enough to get this error: Failed to require ASDF because 'Congratulations for trying ASDF on an operating system that is neither Unix, nor Windows, nor Genera, nor even old MacOS. Now you port it.'
yitzi has quit [Read error: Connection reset by peer]
EvW has quit [Ping timeout: 240 seconds]
<jasom>
told it it was unix and got further, but $HOME isn't writable. Well other things to do now; I'll publish what I have so far tonight
bilegeek has joined #lisp
dra_ has joined #lisp
dra_ is now known as dra
hiroaki has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
mmohammadi9812 has joined #lisp
wsinatra has quit [Quit: WeeChat 2.9]
Inline has quit [Quit: Leaving]
gravicappa has quit [Ping timeout: 265 seconds]
Zianic has quit [Quit: leaving]
Aurora_v_kosmose has quit [Remote host closed the connection]
duuqnd has quit [Remote host closed the connection]
lnostdal has quit [Ping timeout: 240 seconds]
Aurora_v_kosmose has joined #lisp
sonologico has joined #lisp
vutral has joined #lisp
<phoe>
gasp
<phoe>
yes, it was me
narimiran has quit [Quit: leaving]
nicktick has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 258 seconds]
lnostdal has joined #lisp
brj has quit [Ping timeout: 256 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
brj has joined #lisp
<phoe>
sjl: that Twitter post is amazing
<phoe>
what are the bugs?
<phoe>
jcowan: will Andrew mind if I repost this over to the Online Lisp Meetings mailing list?
cosimone has quit [Quit: Quit.]
mmohammadi9812 has quit [Remote host closed the connection]
<sjl_>
4. Managed to somehow fuzz my way into a broken EQUAL hash table in ABCL such that it has an entry for "" in inspect, but (gethash "" ht) returned nil nil
<sjl_>
I haven't managed to narrow down 4 to a small test case yet, unfortunately.
aap has quit [Read error: Connection reset by peer]
minion has quit [Remote host closed the connection]
aap has joined #lisp
dra has quit [Read error: Connection reset by peer]
minion has joined #lisp
<phoe>
2. is kinda awful
rogersm has quit [Remote host closed the connection]
<phoe>
did you make a ccl bugticket for that?
abhixec has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
<sjl_>
Not yet. Discovered it at midnight last night and took it as a sign from the universe to close the laptop. I was gonna report it after work today.
<phoe>
I am trying to trace the issue now
smazga has quit [Quit: leaving]
dra_ is now known as dra
<sjl_>
In my case I can trivially work around it by changing a < to a <= in one function, but yeah. The spec says random returns a number "less than limit" so I think it's a bug.
secbird has joined #lisp
<phoe>
yes
<phoe>
I have found the root cause in source code - if you post the bugticket, I can add the analysis
<sjl_>
I'll make a ticket in an hour or so (in a meeting atm)
<phoe>
Ok
<jcowan>
phoe: I'm sure he won't
Jesin has quit [Quit: Leaving]
EvW has quit [Ping timeout: 244 seconds]
Jesin has joined #lisp
<phoe>
jcowan: thanks, I'll do that. Will the recording be available anywhere?
Oddity has quit [Remote host closed the connection]
random-nick has quit [Ping timeout: 265 seconds]
Oddity has joined #lisp
elflng has quit [Read error: No route to host]
elflng has joined #lisp
nicktick has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
Misha_B has quit [Quit: memory leak]
<jasom>
phoe: A general solution is to discard any problematic values and try again. That can never introduce bias, so as long as all non-problematic values are unbiased it's a general solution.
Misha_B has joined #lisp
<jasom>
that being said, there are known ways to generate a uniform floatingpoint value in the range [0,1.0) and then you can just multiply by the limit to get the right answer
<jasom>
though I imagine it might not work for corner cases like where the limit is a denormal value.
<jasom>
And indeed, sbcl doesn't handle denormals: (loop with limit = 5.605194e-45 repeat 10000 do (assert (< (float limit) limit)))
<jasom>
To show I'm not cheating: (> 5.605194e-45 0) => t
<aeth>
This is why expressing your assumption in types is often useful for floating point, and numbers in general.
<jasom>
Forget everything I said, I had a typo in my test-case
mangoicedtea has joined #lisp
<jasom>
But it does work with a sligtly smaller value
orivej has joined #lisp
dominic34 has quit [Read error: Connection reset by peer]
<jasom>
Here we go: (loop with limit = (loop for x = (random 1.4012985e-45) unless (zerop x) return x) do (assert (< (random limit) limit)))
yitzi has joined #lisp
<jasom>
Due to weirdness of denormals (random 1.4012985e-45) sometimes returns a value that prints identically, and (decode-float) is identical, but is treated as smaller by #'<
<jasom>
I don't know how to get at the bit-representation of floats in SBCL, but that woudl be a more efficient way of doing it. This has the nice effect of being portable, and never terminating if (random X) always returns a value that is CL:< X
<jasom>
well, reported it in #sbcl. I personally don't think it's worth fixing, but at least they now know about it.