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 11:18:59 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!hub.org!hub.org!sunsite.dk!newsfeed1.uni2.dk!news.algonet.se!algonet!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: 27 Mar 2001 21:22:49 +0200 Organization: Enyo's not your organization Message-ID: <87lmprow3a.fsf@deneb.enyo.de> References: <3AC03CCE.70E3C2D5@mida.se> <87ae67qdrv.fsf@deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: supernews.google.com comp.lang.ada:6134 Date: 2001-03-27T21:22:49+02:00 List-Id: Ted Dennison writes: > >FORTH, Common Lisp (if there's any compilation at all) and Java (in > >some sense) can do this. > > FORTH I don't know. FORTH is a bit unfair anyway because it's not clear if typical implementations are compilers or interpreters. > 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? ;-) > What mechanisim tells the Lisp compiler to run the code in a > complicated function at compile time rather than run time? Since functions are first-class objects, no such mechanisms are required.