Opened 6 years ago

Closed 6 years ago

#173 closed defect (fixed)

Unifying BEGINs

Reported by: cowan Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description

In R5RS, there are three kinds of BEGINs:

1) All subforms are expressions; this can be used wherever an expression can be used. (4.2.3)

2) All subforms are definitions; this can be used wherever an internal definition can be used. (5.2.2)

3) Subforms can be definitions or expressions intermixed in any order; this can be used only at top level. (In R7RS we extend this to module top level as well). (5.1)

In particular,

(define (x)
 (define y 32)
 (begin
   (define z 45)
   (set! y z))
 y)

is not licensed by any of these provisions, and consequently is not valid R5RS Scheme. Nevertheless, all of my usual Schemes accept the above definition except Scheme48/scsh and SSCM -- actually, SSCM fails when you invoke x rather than when you define it. So I'm proposing that we unify them for R7RS.

Change History (1)

comment:1 Changed 6 years ago by alexshinn

  • Resolution set to fixed
  • Status changed from new to closed

We voted not to change this.

Note: See TracTickets for help on using tickets.