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

T compiler

    Date: 12-May-82 8:21PM-EDT (Wed)
    From: Chris Riesbeck <Riesbeck>
    Re:   T compiler

    ... But now that you mention it, how
    do I tell TC about my macros?   Also, can macros be compiled?

Funny you should ask.  The interface is sort of minimal at the moment.
Of course macros can be compiled; T touts compatibility between
interpreted and compiled code, right?  In fact, currently the ONLY
semi-clean way you can get compiled file A to know about macros defined
by file B is to compile file B first, and put the following as the
very first form in file A:


The compiler, you will notice, puts out three "object" files for every
source file compiled: LAP, SUPPORT, and NOISE.  LAP, of course, is what
you ship over, assemble, and fasload.  The NOISE file has the
compilation report - all the random statistics and environment info, to
be read by humans (it's like a Maclisp UNFASL file).  The SUPPORT file
gets information about the things that are defined by the file,
including macro definitions, integrable-procedure definitions, constant
definitions, and number-of-args info.  The compiler will make use of
this information when it compiles some OTHER file, if that other file
asks to get that information by including the support file name in the
ENV clause of its HERALD.

The HERALD form shown above says that the environment (ENV) which you
want to be in effect for this file contains the standard T stuff (that's
what the T is there for) together with stuff from the file B.  HERALD is
not a special form or macro; rather it is a peculiar thing seen by file
transducers like the compiler and LOAD, which gives information about
the nature and context of this file.  It must be the first S-expression
in the file.

It is a bug that you need to compile your macro definitions before you
can use them to compile another file.  This will be remedied at some

The CADR of the HERALD is identification which is passed on through to
the fasl file; currently there aren't any programs which look at this.
I suggest making this identification be the same as the filename (less
directory and extension).