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

Re: Internal defines



    OK.  So this means that

    (define-syntax define ...)
    (let () (define a 4) a)

    will return 4.

No, it won't, because the DEFINE-SYNTAX form presumably makes DEFINE
denote something other than the keyword used for internal definitions.

    Now what about the interaction of BEGIN and DEFINE?

    (define-syntax define ...)
    (define-syntax begin ...)
    (let () (begin (define a 4) (define b 5)) (+ a b))

Likewise the DEFINE-SYNTAX forms presumably make DEFINE and BEGIN
denote something other than the keywords used for internal definitions,
so this presumably does not return 9.

    The transformation of BEGIN here cannot accomplished by a macro
    definition of BEGIN because it affects surrounding clauses.  Must BEGIN
    be a keyword of any syntax definition with a body?

If by this you mean that you want to define a new macro that, like LET,
has a body in which internal definitions are to be allowed, then the
only way to accomplish that is to transcribe uses of the macro into
uses of LET, LAMBDA, or some other expression type for which internal
definitions are allowed.  I am by no means sure that this is what you
are asking about, however.

Will