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 14:13:07 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!news.maxwell.syr.edu!newsfeed.icl.net!news.tele.dk!151.189.0.75!newsfeed.germany.net!newsfeed2.easynews.net!easynews.net!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Compile time executed functions Date: 28 Mar 2001 00:15:58 +0200 Organization: Enyo's not your organization Message-ID: <874rweoo2p.fsf@deneb.enyo.de> References: <3AC03CCE.70E3C2D5@mida.se> <87ae67qdrv.fsf@deneb.enyo.de> <87lmprow3a.fsf@deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: supernews.google.com comp.lang.ada:6142 Date: 2001-03-28T00:15:58+02:00 List-Id: Ted Dennison writes: > >You build the function (or a lambda expression) using the usual > >methods, and then call COMPILE on it. Simple, isn't it? ;-) > But that just generates code for the function, right? Yes, but this way, values can be computed prior to run time which appear to be constants (even during compile time) but are in fact not. > It doesn't actually execute the code, find the resulting return > value, then place that value in a data object *during compile time*. I think the concepts 'compile time' and 'run time' are a bit blurry with Common Lisp (a CL enthusiast would protest, of course), simply because we're used to the fact that 'run time' follows 'compile time', and not the other way round. With CL (and FORTH as well, and most Java implementations), this is no longer true. > To do that, you'd have to use define-compiler-macro. Or some eval-when construct, I think.