Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!kth!draken!tut!pk From: pk@tut.fi (Kellom{ki Pertti) Newsgroups: comp.lang.scheme Subject: Re: where define is legal Message-ID: Date: 21 Apr 89 08:22:28 GMT References: <8904201554.AA13117@spt.entity.com> Sender: News@tut.fi Organization: Tampere Univ. of Technology, Finland. Lines: 27 In-reply-to: alms@spt.entity.COM's message of 20 Apr 89 19:54:43 GMT In article <8904201554.AA13117@spt.entity.com> alms@spt.entity.COM (andrew lm shalit) writes: Offhand, the following definition seems bogus: (define (foo bool) (if bool (define (result) #true) (define (result) #false)) (result)) And indeed, when I try to run this in MacScheme, I get an error message. I agree with the semantics, but I couldn't find anything in the R3 description of DEFINE which restricts where it may appear. See section 5.2. Definitions: "Definitions are valid in some, but not all, contexts where expressions are. The are vlid only at the top level of a and, in some implementations, at the beginning of a . [that is, the body of a lambda, let, let*, letrec or define expression (from 5.2.2)]" pertti -- Pertti Kellom\"aki (TeX format) # pk@tut.fi # Wasting time is Tampere Univ. of Technology # # an important part Software Systems Lab # # of living