[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Stack-consed &REST args?
- To: info-mcl@digitool.com
- Subject: Stack-consed &REST args?
- From: chucko@whitman.arc.nasa.gov (Chuck Fry )
- Date: Fri, 23 Dec 1994 21:50:28 GMT
- Organization: RECOM Technologies, Code IC, NASA Ames, Moffett Field, CA
- Sender: owner-info-mcl@digitool.com
Thanks to all who answered my earlier question about who-calls. The
MCL FTP site contains several who-calls implementations, and one of
these is included in the examples directory of the MCL release.
Next question: I was unable to find anywhere in the MCL 2.0
documentation, or the FAQ, any reference to the DYNAMIC-EXTENT
declaration, and particularly the use of this declaration on &REST
arguments of functions. Several other CL implementations support this
idiom by stack-consing &REST args for such functions. Does MCL? If
not by default, is there a patch or hack available to add this
support?
E.g. in the example below:
(define foo (&rest nums)
(declare (dynamic-extent nums))
(reduce #'+ nums))
A compiler supporting this idiom would allocate the list of actual
arguments on the call stack, where it would automatically disappear
when FOO returned. The default behavior per CLtL[12] and X3J13 is to
allocate the parameter list on the heap, where it must be GC'd later.
Again, thanks in advance.
-- Chuck, still learning MCL, but learning to appreciate it
--
Chuck Fry Work: chucko@ptolemy.arc.nasa.gov Play: chucko@rahul.net
I alone am responsible for the contents of this post.
Keep NASA and RECOM Technologies out of this.