Author Topic: [Scheme/Lisp] Purpose/use of procedures that take arbitrary amount of arguments  (Read 1578 times)

0 Members and 1 Guest are viewing this topic.

squidgetx

• Food.
• CoT Emeritus
• LV10 31337 u53r (Next: 2000)
• Posts: 1881
• Rating: +503/-17
• rawr.
[Scheme/Lisp] Purpose/use of procedures that take arbitrary amount of arguments
« 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;
Code: [Select]
(define len  (lambda args    (length args)))>(len 1 2 3)3What 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?

Streetwalrus

• LV12 Extreme Poster (Next: 5000)
• Posts: 3820
• Rating: +80/-8
Re: [Scheme/Lisp] Purpose/use of procedures that take arbitrary amount of arguments
« Reply #1 on: October 13, 2013, 08:10:58 am »
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*
send it

squidgetx

• Food.
• CoT Emeritus
• LV10 31337 u53r (Next: 2000)
• Posts: 1881
• Rating: +503/-17
• rawr.
Re: [Scheme/Lisp] Purpose/use of procedures that take arbitrary amount of arguments
« Reply #2 on: October 13, 2013, 09:37:52 pm »
Figured it out

(it's the apply procedure)

And yeah, I've been away for a while, haven't I?

Streetwalrus

• LV12 Extreme Poster (Next: 5000)
• Posts: 3820
• Rating: +80/-8
Re: [Scheme/Lisp] Purpose/use of procedures that take arbitrary amount of arguments
« Reply #3 on: October 14, 2013, 07:03:07 am »
Yup, nice to see you back. I hope you stick around.
send it