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

Re: T -> Scheme

    From: Lewis Johnson <johnson%YALE-MBUILD@YALE>
    Date: 21 Aug 84 19:10:20 EDT (Tue)

    You claim that it is easy to eliminate T expressions which define
    symbols inside of LAMBDAs.  I see how that works for certain cases,
    but how would you rewrite this [in MIT Scheme]?

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

Good question.  This needs some serious thought.  The obvious solution

	(define m
	  (locale m
	    (define x ...)
	    (define y ...)
	    (define z ...)

	(import m y z)

which I believe is sort of like the way one does modules in MIT Scheme
[modulo syntax - its syntax is something more like this:

	(define m
	    (define x ...)
	    (define y ...)
	    (define z ...)))

	(define y (access m y))
	(define z (access m z))  ].

However, this has protection and compilation problems; protection in
the sense that anyone who has access to the environment containing m
has access to m and therefore can access the value of x, which you'd
rather he couldn't see, and compilation problems for a similar reason,
that any analysis you do either to m or to the outer environment may be
invalidated by virtue of escaping values, shadowing, etc.

John Lamping is working on a module system which may be able to address
these problems, and allow one to express "small modules" concisely.