Re: [Scheme-reports] Legacy caar to cddddr
Aubrey Jaffer 20 Oct 2011 20:17 UTC
| Date: Thu, 20 Oct 2011 13:45:51 -0400
| From: John Cowan <cowan@mercury.ccil.org>
|
| Ray Dillinger scripsit:
|
| > It was possible to implement a general macro version (that parsed
| > the token and expanded it as far as necessary) of the "c(a|d)+r"
| > operators using the old "explode" and "implode" commands to
| > destructure the symbol itself, but those have been eliminated
| > since, I think, R4RS. And I don't think it would work with
| > current macrology anyway.
|
| Surely it would not.
|
| I once wrote a traditional Lisp (not Scheme or CL) interpreter once
| that handled these directly in EVAL. If a symbol in operator
| position had no definition, it was checked for being of the right
| form, and if so, its argument was evaluated and the c*r was
| executed on the spot. It didn't work in APPLY, more by oversight
| than anything else.
In SCM, C*R and single-argument real-valued numerical functions (both
have type-code tc7_cxr) are dispatched in the interpreter. The C*R
objects have a null CDR; their dispatch is based on their symbol
strings. Apply executes them correctly as well.
In JACAL, polynomials are lists (of variable and coefficients) so that
polynomial operations use the fastest operations that SCM (and other
Scheme implementations) offers. Changing polynomials to boxed record
types would have a disastrous impact on memory usage, cache locality,
and execution speed of JACAL.
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports