Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!jarthur!elroy.jpl.nasa.gov!ames!pacbell!att!cbnewsc!lgm From: lgm@cbnewsc.ATT.COM (lawrence.g.mayka) Newsgroups: comp.lang.misc Subject: Re: Q Design Goals Message-ID: <13896@cbnewsc.ATT.COM> Date: 24 Feb 90 04:46:49 GMT References: <111966@ti-csl.csc.ti.com> Reply-To: lgm@cbnewsc.ATT.COM (lawrence.g.mayka,ihp,) Organization: AT&T Bell Laboratories Lines: 46 In article <111966@ti-csl.csc.ti.com> gateley@m2.csc.ti.com (John Gateley) writes: >In article <24995:06:42:28@stealth.acf.nyu.edu> brnstnd@stealth.acf.nyu.edu (Dan Bernstein) writes: > >This problem is either already solved (see Common Lisp macros and >type system), or is very challenging (read impossible). CL is easily >extensible through its use of macros. However, writing a new construct >which is EFFICIENTLY integrated with the existing language is difficult. >For most new constructs, there are many optimizations which can only >easily be applied if you see the original constructs. With macros, >they are translated into CL before the compiler sees them, thus the >optimizations can't be performed. This is an interesting problem >to attack. ANSI Common Lisp indeed attacks the problem of optimizing new constructs via *compiler macros.* These are macros applicable only during compilation. A compiler macro may have the same name as a function. Indeed, that is (apparently) its intended role: to optimize at compile time what would otherwise be an ordinary function call. A compiler macro, like any macro, has access to its original, unevaluated, unexpanded, source-code arguments and can perform "smart" optimizations (or other transformations) on them as desired. ANSI Common Lisp also defines constructs for: - Obtaining information (about variables, functions, and declarations) from a lexical environment. - Augmenting a lexical environment with additional such information. - Enclosing a function in an environment. - Defining a handler for a declaration. I don't know of any specific language extensions designed using all these facilities yet, though. Lawrence G. Mayka AT&T Bell Laboratories lgm@ihlpf.att.com Standard disclaimer.