[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help : call function with args
From: |
calcium |
Subject: |
Re: help : call function with args |
Date: |
Thu, 5 Apr 2018 10:16:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
> I think you'll find it easier to reason first about an f
> which takes as many args as your conditionals produce, so
> you won't be struggling to splice your "bunch of values"
> into a bigger argument list.
yes, thank you tomas,
i stopped trying to return multiples values, and instead call the
functions with the right numbers of args, and using the cond statement
to change the values of args.
(define (f a b c d)
(+ a b c d))
(let ((a 1)
(b #f)
(c #f)
(d 10))
(cond (#t (set! b 2)
(set! c 3))
(else
(set! b 6)
(set! c 10)))
(f a b c d))