Procedural Fascicle for R7RS Large Scheme

21 points by aag


Scheme Working Group 2 is pleased to announce the first draft of the second part of the R7RS-Large Foundations, the "Procedural Fascicle." This draft encompasses the familiar block programming forms, such as lambda, let, if, or, and set!.

The draft is available here:

https://r7rs.org/large/fascicles/proc/

The biggest new feature is the ability to mix definitions and expressions in bodies, such as the body of a lambda. For example, the following is now valid:

(define (map f lst)
  (unless (list? lst)
    (error 'map "not a list" lst))
  (define (map* lst acc)
    (if (null? lst)
        (reverse acc)
        (map* (cdr lst) (cons (f (car lst)) acc))))
  (map* lst '()))

We welcome any and all comments on the draft. Anyone can comment by:

mplant

I think ultimately I like the new expression/definition mixing because ultimately - as I understand it, and I could be wrong - it matches the permissiveness you’d find in library bodies and REPLs. Sure, it’s a little weird when interacting with call/cc, but I think that any of the code where the difference in evaluation order would come up is pathologically weird enough to not make a huge difference

williewillus

Mixed defines is a very welcome addition and the thing I miss the most from Racket when working in Chez Scheme.