Ask YC: Questions about defun and lisp in general
I've been reading PG's ACL book, and since coders are restless beings, of course I don't want to read the whole book to understand what went wrong with what I did. See, here at page 15 he defines this nice 'SUM-GREATER' function. It takes 3 arguments and returns true if the sum of the first two is greater than the third. Here it goes:
(defun sum-greater (x y z) (> (+ x y) z))
Not that hard. NOW, I know that the + function can accept any ammount of parameters so I was trying to figure out how to pass a list as one of the first two parameters (or both) and do not crash the function. Passing another sum doesn't count as a solution. What I am looking for is more on the lines of a C "..." parameter type.
Now, if I haven't annoyed enough yet, I know there is a mirc channel about lisp somewhere, but on which mirc net? I think I should ask future questions there.
2 comments
[ 3.0 ms ] story [ 24.9 ms ] threadAnyway, the syntax you're looking for is &REST
Good luck.Where would it be the right forum?