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

Internal Definitions

I think the right way to handle internal definitions is that a
definition effects the entire lexical scope, but it does not take
effect until evaluated. Here is an example:

(define x 0)

(define (f)
 (set! x 1))

(define (g)
 (set! x 3))

(define-syntax foo
 (syntax-rules ()
    (begin (define (pr) (write x))
           (define x 2)
           (define x 4)

(foo) (write x) (newline)

should write: 012243

With this there is no early scanning of left hand sides and no
restrictions on the placement of definitions or syntax