From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,571930b4ff0bc1ee X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-27 12:27:50 PST Newsgroups: comp.lang.ada From: Ted Dennison Sender: usenet@www.newsranger.com References: <3AC03CCE.70E3C2D5@mida.se> <87ae67qdrv.fsf@deneb.enyo.de> <87lmprow3a.fsf@deneb.enyo.de> Subject: Re: Compile time executed functions Message-ID: Date: Tue, 27 Mar 2001 20:23:53 GMT NNTP-Posting-Host: 127.0.0.1 X-Complaints-To: abuse@newsranger.com X-Trace: www.newsranger.com 985724633 127.0.0.1 (Tue, 27 Mar 2001 15:23:53 EST) NNTP-Posting-Date: Tue, 27 Mar 2001 15:23:53 EST Organization: http://www.newsranger.com Path: supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!stueberl.r-kom.de!news0.de.colt.net!colt.net!news.maxwell.syr.edu!newsfeed.stanford.edu!feed.textport.net!newsranger.com!www.newsranger.com!not-for-mail Xref: supernews.google.com comp.lang.ada:6137 Date: 2001-03-27T20:23:53+00:00 List-Id: In article <87lmprow3a.fsf@deneb.enyo.de>, Florian Weimer says... > >Ted Dennison writes: > >> However, I have used Common Lisp, and I never came across that >> capability before. How do you do it? > >You build the function (or a lambda expression) using the usual >methods, and then call COMPILE on it. Simple, isn't it? ;-) > Admittedly, there are probably tons of nifty Lisp tricks I've never learned. But that just generates code for the function, right? It doesn't actually execute the code, find the resulting return value, then place that value in a data object *during compile time*. To do that, you'd have to use define-compiler-macro. Again, I'm no Lisp expert, but I don't see why define-compiler-macro would have been placed in the language, if its effect could be achieved without it. (Although it seems to me that even define-compiler-macro for a complicated function would just expand to the code required to compute the value, not to the value itself). --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html home email - mailto:dennison@telepath.com