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

early binding



    Date: Thu 17 Apr 86 10:52:41-CST
    From: David Bartley <Bartley%ti-csl.csnet at CSNET-RELAY.ARPA>

    If only the top level forms get macro expanded, then a DEFINE at the
    top level of a macro called FOO would not be recognized in the top
    level form (BEGIN (FOO A)(FOO B)), right?  That is, if (FOO A)
    macro-expands into (DEFINE A 42), we'd have (BEGIN (DEFINE A
    42)(DEFINE B 42)), but you'd not catch these particular ``top level''
    defines?

    Similarly, suppose (BAR X Y Z) were a macro that expanded into 
    (BEGIN X Y Z).  What would happen to (BAR (FOO A)(FOO B))?  Would it
    be fully expanded into (BEGIN (DEFINE A 42)(DEFINE B 42)) in order
    to catch the definitions?

    The same question applies to macro expanding the bodies of lambdas in
    order to detect ``top level'' DEFINEs to be collected into a LETREC.
    To be honest, I'm not sure how deep my own PC Scheme goes in macro
    expansion to detect such definitions.

Sorry I wasn't clear.  All of these define's are found by CLSCH.  Bodies
of begins are considered to be top level if the begin is at top level.
But only enough macro expansion is done to be able to find all possible
defines and begins.

Since exactly the same scanner is used for lambda-expressions, the same
answers apply.

Jonathan