Re: [CLOS] Ensuring a method exists





Simon Katz wrote:
On Thu, 28 Sep 2006 08:34:01 +0200, Pascal Costanza <pc@xxxxxxxxx>
wrote:


Ken Tilton wrote:


Pascal Costanza wrote:

Ken Tilton wrote:


Pascal Costanza wrote:


Both macros and the CLOS MOP are means to do metaprogramming. The distinction is that macros can be used for compile-time processing of code [1]


??? Hunh? I never use macros for compile-time pro... OK, once.


You _always_ use macros for compile-time processing of code.

Gee, that explains the runtime errors I get when I try to call macros then. <sigh>

I think this may be a non-native speaker thing. "use-for" does not mean what you think it means ("use-at"). I use macros for (to achieve) new syntax and to hide implementation.

Maybe. What I was trying to get at was that macros work at compile time

No sh*t, Einstein. Too bad that is not what you said (nice try, tho):

>>>>You _always_ use macros for compile-time processing of code.

Offered in contradiction to my:

>>>>>??? Hunh? I never use macros for compile-time pro... OK, once.

The once is ix-layer-expand, which takes keywords from a shorthand DSL for building up Cello panes from so many "layers" and generates code to be eval'ed at runtime and expands them into a lambda form. I guess like cl-who, tho my data arguments in the DSL evaluate at runtime.

This is OpenGL code which wants to be fast for (in order to get!) decent frame rates. The expansion of my mini-layering DSL into OpenGL calls can be done at compile time, so (read my lips, will ya?) /in this one case/ I use macros /for/ compile-time processing (interpretation of the DSL) instead of the usual purposes of syntax transformation and/or implementation-hiding.

and the CLOS MOP can be more convenient when meta-level stuff is required at run time.

<thump> <thump> Is this thing on?

FWIW, that was clear to this particular native speaker of English.

I wouldn't go around bragging about that.

Ken: "Cute puppy. Did you get it for companionship or to pick up chicks?"
Simon: "Hunh? My puppy /always/ gives me companionship."

hth, ken

--
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
-- Smiling husband to scowling wife, New Yorker cartoon
.



Relevant Pages

  • Re: [CLOS] Ensuring a method exists
    ... I never use macros for compile-time pro... ... You _always_ use macros for compile-time processing of code. ... The distinction is that macros can be used for compile-time processing of code, while the CLOS MOP is useful for meta-programs that require special actions at runtime. ... The expansion of my mini-layering DSL into OpenGL calls can be done at compile time, so /in this one case/ I use macros /for/ compile-time processing instead of the usual purposes of syntax transformation and/or implementation-hiding. ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... Pascal Costanza wrote: ... CLOS as a convenient internal tool to the larger API, but then that is why I suggest going /further/ and hide the CLOS behind some macrology, at which point the OP can enforce anything they want really really easily. ... Both macros and the CLOS MOP are means to do metaprogramming. ... You _always_ use macros for compile-time processing of code. ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... I never use macros for compile-time pro... ... You _always_ use macros for compile-time processing of code. ... What I was trying to get at was that macros work at compile time ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... CLOS as a convenient internal tool to the larger API, but then that is why I suggest going /further/ and hide the CLOS behind some macrology, at which point the OP can enforce anything they want really really easily. ... Both macros and the CLOS MOP are means to do metaprogramming. ... You _always_ use macros for compile-time processing of code. ...
    (comp.lang.lisp)
  • Re: C++ Compiler with a -Wwarn-use-of-strcpy or similar option??
    ... macros to watch the string and memory routines and inform at ... similar macros used to track memory leaks and similar offenses ... The macro does compile time checking ... As a general rule you should compile with the maximum warning ...
    (comp.lang.cpp)