[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locales vs. contours



    From: meltsner@mit-charon (Ken Meltsner)
    Date: 21 Aug 1984 1033-EDT (Tuesday)

    In Scheme, when one defines a function inside of a function, the inner
    function is hidden.  Likewise, with internal variables and such.

    In T, you appear to require the explicit declaration of a locale.  Why
    have you differentiated between locales and contours?  Is this likely
    to change?

As I remember it, at the time T began to happen (1981), we perceived
that the semantics of MIT Scheme were still in flux.  I wasn't sure
that the define and lset stuff was going to stick, and Kent and I had
some philosophical differences with it.  Also, I wasn't sure I knew how
to implement them cleanly or well.

Now that the 6.001 book is out and MIT Scheme is pretty stable, I'm
considering changing T's define/lset semantics to match MIT Scheme's.
I still don't think MIT define/lset are incredibly clean but I don't
feel strongly enough about it to stay gratuitously incompatible.  The
implementation is messy but feasible.  (Source-code rewrites can turn
MIT Scheme into T, or vice versa.)  I have a feeling that it will break
a lot of existing T code, so I'm not quite sure how to accomplish the
transition without making people angry (I've found that people want
stability much more than they want either features or compatibility),
but it seems like the right thing to do.  The version of T I'm using
now issues a warning when it comes across code which would behave
differently according to the MIT define/lset semantics, e.g.

	(let ((x ...)) ... (define y ...) ...)

The two flavors of define could coexist very happily in different
syntax tables within the same T.  Probably the best thing would be to
give people a choice during the transition period.

This fall there will be a meeting (summit?) in which it is hoped that
the MIT, Indiana, TI, Yale, and other Schemes will come to some
agreement on this and other issues.  Then there will be less
opportunity for confusion as users move from one dialect to another.

[For those of who don't know how MIT Scheme works: it's as if there's
an implicit (locale () ...) inside of every LAMBDA body.  This makes it
very convenient to define procedures which are local to a given
procedure.  E.g.
	(define (foo ...)
	  (define (bar ...)
	    ...)
	  ...)
in MIT Scheme is like
	(define (foo ...)
	  (locale ()
	    (define (bar ...)
	      ...)
	    ...))
or, equivalently,
	(define (foo ...)
	  (labels (((bar ...)
	            ...))
	    ...))
in T.]

Jonathan