Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!bloom-beacon.mit.edu!gatech!psuvax1!news.ecn.bgu.edu!siemens!princeton!news.princeton.edu!blume
From: blume@dynamic.cs.princeton.edu (Matthias Blume)
Subject: Re: Scheme top-level [Was: Re: redefinition of builtin procedures]
In-Reply-To: pertti@white.cs.rhbnc.ac.uk's message of 1 Dec 1994 12:20:16 GMT
Message-ID: <BLUME.94Dec3141126@dynamic.cs.princeton.edu>
Originator: news@hedgehog.Princeton.EDU
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: dynamic.cs.princeton.edu
Organization: Princeton University
References: <BLUME.94Nov28101600@dynamic.cs.princeton.edu> <6q1Jwc2w165w@sytex.com>
	<3bff6q$q9n@nyheter.chalmers.se>
	<BLUME.94Nov29110158@dynamic.cs.princeton.edu>
	<3bkf20$46m@sun.rhbnc.ac.uk>
Date: Sat, 3 Dec 1994 19:11:26 GMT
Lines: 46

In article <3bkf20$46m@sun.rhbnc.ac.uk> pertti@white.cs.rhbnc.ac.uk
(Pertti Kellomaki) writes:

   [ I wrote about my trouble with understanding the strong resistance
     against a cleaned-up behavior of the interactive top-level ]

   One reason may be that you described it as "SML-like". That scared
   at least me, as I interpreted that to mean that top level
   definitions are immutable, which would make it rather hard to
   support a specific programming style which can be described as
   "interactive program development" or "hacking definitions to the
   top level", depending on whom you ask. SML's modules make this less
   of an issue there, but without them it would be a pain IMHO.  --

I agree with you.  Robert Harper reminded me in private mail to
address the issue of interactive programming environments (like the
Scheme-mode in GNU Emacs).  Many people (including myself) tend to
write and update their code in some file while occasionally sending
s-expressions, reagions, or the entire buffer to a Scheme subprocess.
Currently what Emacs does is sending the text literally -- regardless
of whether it is the first time or not.  Fixing a bug in a procedure
is done by re-sending its definitions.  With my proposed top-level
this would not lead to the desired effect of SET!ting the value of
something that has been DEFINEd earlier.

However, I don't think that this is a language issue.  This is an
issue of the programming environment.  The Emacs scheme-mode could be
modified in a way such that certain keystrokes send a slightly
modified version of the text which causes all top-level DEFINEs to be
treated as SET!s.

Probably it isn't feasible to do the necessary modifications on the
program text being sent -- it would be very hard for Emacs to keep
track of macro which expand into definitions and so forth.  But a
simple syntactic wrapper like:

	(unquote <definition>)

or something similar could do trick.  (UNQUOTE is a good choice, IMO,
because the modifications to Emacs' scheme-mode become trivial: just
send a , (comma) before you send the actual definition.)  The real
work would be done in the top-level interpreter (compiler front-end),
where all the necessary information is in place.

--
-Matthias
