Omnimaga
General Discussion => Technology and Development => Computer Programming => Topic started by: squidgetx on October 12, 2013, 05:34:44 pm
-
In class (scheme) we recently learned about the syntax that allows a function to take an arbitrary amount of arguments eg;
(define len
(lambda args
(length args)))
>(len 1 2 3)
3
What are the advantages of using this form over simply passing the arguments as a single list in the first place? How do you even pass arguments to these kinds of functions within a program (and not on the command line)? Is there a way to make a procedure that returns a series of values that aren't wrapped within a list?
-
Well, I don't know Lisp and I don't know people who do so I can't help you. :/
Also how dare you post after a hiatus without updating us on A:P ? *runs*
-
Figured it out
(it's the apply procedure)
And yeah, I've been away for a while, haven't I?
-
Yup, nice to see you back. I hope you stick around. ;)