Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!VOID.AI.MIT.EDU!jar From: jar@VOID.AI.MIT.EDU (Jonathan Rees) Newsgroups: comp.lang.scheme Subject: where define is legal Message-ID: <8904211557.AA00047@void.ai.mit.edu> Date: 21 Apr 89 15:57:49 GMT References: <8904201554.AA13117@spt.entity.com> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: jar@zurich.ai.mit.edu Organization: The Internet Lines: 23 Date: 20 Apr 89 15:54:43 EDT (Thu) From: alms@spt.entity.com (andrew lm shalit) (define (foo bool) (if bool (define (result) #true) (define (result) #false)) (result)) 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. There is nothing in section 5 that could allow one to deduce that definitions are permitted anywhere other than at top level or at the beginning of a lambda, let, etc. body. And the expression you have written isn't generated by the grammar of section 7.1, since (define ...) is never an . Some implementations do permit DEFINE forms in other places, but those implementations are extending the language.