[prev in list] [next in list] [prev in thread] [next in thread]
List: racket-users
Subject: [plt-scheme] Conditionals define ==> (when #t (define....
From: grettke () acm ! org (Grant Rettke)
Date: 2009-04-30 1:42:30
Message-ID: 756daca50904291842h63908a5g94f41ca15f46807e () mail ! gmail ! com
[Download RAW message or body]
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)))?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic