On 10/13/2009 06:07 PM, John Cowan wrote:
> Brian Harvey scripsit:
>
>> In my opinion the single biggest wart in Scheme is that DEFINE isn't
>> allowed anywhere.  The metacircular evaluator can handle it anywhere,
>
> Really?  What is the meaning of (+ 2 (define x 3)), and what is the
> scope of x?
>
> I think the restrictions on define (at the REPL or at the beginning of
> a body) are eminently sensible.

OTOH, it would be nice to allow define in the middle of a body, to avoid
having to add too much "let-nesting":

(define (foo)
   (define t1 ....)
   (bar t1)
   (define t2 (baz t1))
   (whatever t1 t2))

rather than:

(define (foo)
   (let ((t1 ...))
     (bar t1)
     (let ((t2 (baz t1)))
        (whatever t1 t2))))

or:

(define (foo)
   (define t1 ....)
   (define t2 'unused)
   (bar t1)
   (set! t2 (baz t1))
   (whatever t1 t2))

Having to add an extra level of nesting and indentation
in order to add a local variable is a flaw in a language, IMO.
It's one cause of the "too many silly parentheses"-problem.
-- 
        --Per Bothner
[email protected]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to