[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Internal Definitions
- To: srfi-93@xxxxxxxxxxxxxxxxx
- Subject: Internal Definitions
- From: "Edwin Zacharias" <ezacharias@xxxxxxxxx>
- Date: Fri, 23 Jun 2006 04:32:13 -0400
- Delivered-to: srfi-93@xxxxxxxxxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=STwxR0X5RNgb1QpMsvNC677iPbm0XGZEyYCQCZgwQ5uvqLXWa2BIQRs39Qix6Hr3YpQ5j/GVsjmtHyM9Xie+6EvVWt6sAqhp2uX27p86aL4oIn6CKA0a6HmRx9MryHXV5HKBvcjRhpVtJ8z2hdzckQ4hn9v6qIB2DKHb4wv5yLU=
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 ()
((foo)
(begin (define (pr) (write x))
(pr)
(f)
(pr)
(define x 2)
(pr)
(g)
(pr)
(define x 4)
(pr)))))
(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
definitions.
--Edwin