Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!labrea!polya!max From: max@polya.Stanford.EDU (Max Hailperin) Newsgroups: comp.lang.scheme Subject: top level definitions Message-ID: <8912@polya.Stanford.EDU> Date: 3 May 89 16:17:50 GMT References: <8905030850.AA21221@chamartin.AI.MIT.EDU> Sender: Max Hailperin Reply-To: mxh@sumex-aim.Stanford.EDU (Max Hailperin) Organization: Stanford University Lines: 23 I like the wrap-it-all-with-a-let semantics for top-level definitions. However, note that this is not in keeping with R3RS, in that it disallows such programs as (define pi 3.14159) (define radius 10) (define circumference (* 2 pi radius)) circumference [Abelson and Sussman, p. 8], which would be legal under R3RS's set!-like semantics for top-level definitions. Of course, you could patch things up by switching from letrec to letrec*. My preference is to adopt the letrec-based version as official (making the above example not standard scheme), with the letrec*-based version as an incouraged extension for interactive implementations (note that letrec* is a legal implementation of letrec, as remarked in R3RS). There is also an issue of what to do with multiple definitions of the same variable in the same scope, which R3RS doesn't address for internal definitions and is a bigger issue for top-level interactions. Again, it's probably best to make any use of this feature non-standard, with some encouraged extension for interactive top-levels.