3 ms·
ouch.
by agumonkey 10y ago
ouch.
- sigjuice 10y agoWould this be an issue in Common Lisp? I believe CL function arguments are evaluated left-to-right.
- lispm 10y agoThat's right. The standard says left to right. It's not good style to exploit that, but you can.
- fiddlerwoaroof 10y agoIt is undefined in Common Lisp whether or not the car of a form is resolved to a function before or after the other arguments, iirc
- Johnny_Brahms 10y agoYup. Did not feel great. The worst part is that I admitted to writing code that rely on order of evaluation on Hackernews. To my defense it is _very_ old code that I converted from an even older turbo Pascal program I wrote as a teenager
- Johnny_Brahms 10y agoTo clarify: the bug took about 3 minutes to figure out. Learning the evaluation order of procedure arguments is undefined took 20 years though :)
- agumonkey 10y agoAnd I had no idea it was officially fixed ordered in standard. I've read mentions in papers but I never realized what they meant.
- Johnny_Brahms 10y agoWell: The thing is that it is _not_ fixed. It is defined as unspecified.