Reputation: 11
I have it like this (sigma (list 1 2 3 2 1))
and I need it like this (sigma 1 2 3 2 1)
. I think I need a function to convert it or rewrite it to make it work.
Upvotes: 0
Views: 33
Reputation: 236124
Try this:
(define (sigma . args)
...)
That's the syntax for having a variable number of arguments, now you can call it like this:
(sigma 1 2 3 2 1)
And inside your procedure, treat args
as a list of arguments to do whatever you need with them.
Upvotes: 1