---
This message is a formal comment which was submitted to [EMAIL PROTECTED], 
following the requirements described at: http://www.r6rs.org/process.html
---
Type: Simplification and enhancement
Priority: Major
Component: Concepts (?)
Version: 5.92

Scheme should allow expressions and declarations to be mixed in
all bodies, not just top-level bodies.

For example:

(define (f x)
   (define y (use x))
   (display y)
   (define z (use x y))
   (display z)
   (use x y z))

This illustrates one use-case: adding debugging commands.

Another use case:

   (define (fun)
     (define var1 ...)
     ... do some calculations or whatever ...
     (define var2 depending-on-those-calculations)
     ...rest...)

Of course this use-case can be handled using an inner let,
but that adds needless nesting and indentation.  The latter,
especially, is often a limited resource.

The semantics are sketched out in the last paragraph of
8. "Expansion process".

This is a simplification, since it makes normal bodies the
same as top-level bodies.

"Programming languages should be designed not by piling
feature on top of feature, but by removing the weaknesses
and restrictions that make additional features appear
necessary."

"the language described in this report is intended to:
... no unnecessary restrictions on how they are composed."

Originally proposed in:
http://lists.r6rs.org/pipermail/r6rs-discuss/2007-January/001333.html
--
        --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