Re: Candy Everybody Wants (was Re: Why do we need let?)
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Tue, 01 Jan 2008 15:03:07 +0100
Abdulaziz Ghuloum wrote:
David Rush wrote:
Of course, R6RS doesn't *say* what the scope effects of the sequencing
version actually *ARE* nor does it provide a context-free way of
determining which sort of meaning is *intended* for a particular BEGIN
form.
Since when could you parse any Scheme in a context-free way?
What's the meaning of (foo) without knowing its surrounding
context?
So if you write a macro using BEGIN, it could, in fact have
different meaning in different contexts.
First off, I don't know what "write a macro using BEGIN" means.
I define macros using define-syntax and use them by name. Is
there another way?
Can you also shed some light with an example of the macro you
have in mind when you said that it has "different meaning in
different contexts"?
A typical kind of macro is the define-xyz macro, which may have to be expanded into a sequence of other define-xyz forms.
For example:
(define-macro (define-record name make test . fields)
`(begin
(define ,make
(lambda fields
(apply vector ',name fields))
(define ,test
(lambda (record)
(and (vector? record)
(eq? (vector-ref record 0) ',name))))
...))
define-record will have different meaning in different contexts.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- Follow-Ups:
- Re: Candy Everybody Wants (was Re: Why do we need let?)
- From: Abdulaziz Ghuloum
- Re: Candy Everybody Wants (was Re: Why do we need let?)
- References:
- Re: Candy Everybody Wants (was Re: Why do we need let?)
- From: Abdulaziz Ghuloum
- Re: Candy Everybody Wants (was Re: Why do we need let?)
- Prev by Date: Re: Candy Everybody Wants (was Re: Why do we need let?)
- Next by Date: Re: What happened to the online R5RS?
- Previous by thread: Re: Candy Everybody Wants (was Re: Why do we need let?)
- Next by thread: Re: Candy Everybody Wants (was Re: Why do we need let?)
- Index(es):
Relevant Pages
|