Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!ZERMATT.LCS.MIT.EDU!death From: death@ZERMATT.LCS.MIT.EDU (Mark A. Sheldon) Newsgroups: comp.lang.scheme Subject: Scheme Digest #106 Message-ID: <19890425161147.8.DEATH@MICKEY-MOUSE.LCS.MIT.EDU> Date: 25 Apr 89 16:11:00 GMT References: Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 22 One crucial problem with DEFINEs placed willy-nilly in programs arises from DEFINE's being an environment mutator. Consider this modification to our standing example: (define (foo bool) (if bool (define (result) #t) 'do-nothing (result))) Allowing DEFINEs everywhere gives us a weird sort of dynamic scoping. Restricting DEFINEs to beginnings of blocks allows us to think of a block of internal DEFINEs as a LETREC (though CALL/CC may expose implementations that don't implement these blocks as a LETREC). If Scheme is a statically scoped language, then this sort of DEFINE is anathema. If Scheme is to support dynamic scoping, then I think FLUID-LET is cleaner because I don't have to think about environment mutation. Top level DEFINEs don't bother me so much because I think of the top level as a debugger. -Mark A. Sheldon