[plt-scheme] Conditionals define ==> (when #t (define....
On Wed, Apr 29, 2009 at 2:23 AM, Ziboon <ziboon at gmail.com> wrote:
> Why I can't do this :
>
> (if (= n 0)
> (define lst (list 1 2 3))
> (define lst2 (list 1 2 )) )
I've never tried such a thing. Reading the documentation, it explains
that the true and false body must be expressions. define is not an
expression. That is why you can't do it.
> How I can do this ?
Is that what you really want to do? How will you access the variables later on?
Do you really want (define lst (if (= n 0) (list 1 2 3) (list 1 2)))?