Would it be hard to make (cons take multiple arguments?
Example
(cons 'a 'b 'c) => (a b c)
Eddie
cons
I agree with Sam: 'cons' with multiple args for 'cons' is like using 'list' , also
'cons' is also a lot like 'push' becuase it can take a list as the second argument:
(set 'lst '(b c))
(cons 'a lst) => (a b c)
(push 'a lst) => 'a
lst => (a b c)
the difference beeing, that push is non-destructive and returns the new list, while push has the side effect of changing the list.
If it where for me, I would just dump 'cons', because I think having 'list' and 'push', you got all you ever need, but ... there are many traditional LISPers who wouldn't want to 'lisp' without it. Personally, I think, I never have used it.
Lutz
'cons' is also a lot like 'push' becuase it can take a list as the second argument:
(set 'lst '(b c))
(cons 'a lst) => (a b c)
(push 'a lst) => 'a
lst => (a b c)
the difference beeing, that push is non-destructive and returns the new list, while push has the side effect of changing the list.
If it where for me, I would just dump 'cons', because I think having 'list' and 'push', you got all you ever need, but ... there are many traditional LISPers who wouldn't want to 'lisp' without it. Personally, I think, I never have used it.
Lutz