Re: Runtime macros
- From: "Coby Beck" <cbeck@xxxxxxxxxxxxx>
- Date: Sun, 26 Jun 2005 18:15:16 GMT
"Randall Randall" <randall@xxxxxxxxxxxxxxxxxx> wrote in message
news:42bedf36$1_4@xxxxxxxxxxxxxxxxxxxxx
> be a static type to the programmer). Runtime macros with optional
> replacement would allow DEFUN forms, for example, to register the
> "function"
> as a macro rather than a function, and at runtime, the macro could examine
> the actual arguments it got, in addition to their names, and provide
> appropriate declarations in its output, and then ask the compiler to
> replace it with the function in question. The programmer need not write
> declarations again (except for those cases where it wouldn't be possible
> to figure out the proper declaration from a single example), and yet,
It seems to me this last qualification dooms your idea in the way I was
about to try to explain! When is a single example *ever* going to tell you
what to expect everytime? ISTM, if there are cases where you as a
programmer can know that the first type seen indicates it is always that
type that that can only be an artifact of some implementation detail about
your whole system, eg harware, or third party code etc. If this is the
case, you should be able to determine these things at complile time. If it
really must wait til runtime, then just delay compilation until then (which
is all you are doing in a round-about way with your plan anyway).
You could have a special defun type form that checks if it has yet been
called, if this is the first time, check the types of its arguments, put the
declarations into the body of its code, compile it and them setf the
symbol-function so that next time it just proceeds.
--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
.
- Follow-Ups:
- Re: Runtime macros
- From: Randall Randall
- Re: Runtime macros
- References:
- Runtime macros
- From: Randall Randall
- Runtime macros
- Prev by Date: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
- Next by Date: Re: character classification functions
- Previous by thread: Runtime macros
- Next by thread: Re: Runtime macros
- Index(es):
Relevant Pages
|