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

random query rationale



... and another random query: How do you write BOUNDP in T?  (Global
value only, of course.)

Rationale: I am creating a subset of ILISP, Franz, and T, so much of
my code will run on any of 3 machines.  It won't look like pretty T,
but I am the only one likely to read it.  There are good ideas in
all 3 languages (believe it or not), although some of that goodness
is relative to old-fashioned lisp concepts.  For instance, Franz
has two functions GETD and PUTD, which get the function definition\n from a symbol, and set it.  This is a nice abstraction, since the
value of a GETD in one implementation doesn't have to resemble that
in another implementation in any way; it just has to be the sort of
thing you can give to PUTD.  GETD on a macro returns a macro
definition.  This is old fashioned in some ways, but so what.
To have this feature in T, GETD must get the global value of a
symbol, unless it's magic, when it must get the magic-val of it.
Hence the need for BOUNDP.  

For completeness, I have a function IS-COMPILED, which distinguishes
between EXPRs and SUBRs, etc.  I don't think I use for it anything,
but it could be valuable.  Kent Pitman pointed out how nebulous this
distinction is; perhaps its practical meaning is, "Test if the original
source of the function is available."  Oh well.

IS-MACRO is much more useful.  "Processors" (like the compiler or
NISP's DECL macro) need to go over program text, and often do
something special with macros.  MACRO-EXPAND fits right in, but
we need a MACRO? test, too.

To implement PUTD, one needs what lisp used to call SET.  And something
special for the magic ones.  One can use EVAL, but nice people don't
do that.
-------