Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

(second), (third), etc. in common lisp

Name: shitting lollybox 2012-10-15 5:45

so if I want to express the third element of some list I can write
(third '(a b c))
This works all the way up to (tenth).

WTF? Why would they include built in functions like this? Seems insane coming from C and Java

Name: Anonymous 2012-10-15 17:57

>>17
Newlisp also evaluates the functor first, just like scheme.
Doesn't it make more sense to evaluate the arguments first, and then the functor?  Think about it, if it's implemented as a stack machine, evaluating (+ (+ (+ 1 2) 3) 4) requires a stack depth of 5, as opposed to 3 if you evaluate the functor last.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List