Re: [CLOS] Ensuring a method exists



Ken Tilton wrote:


Pascal Costanza wrote:
Ken Tilton wrote:

Pascal Costanza wrote:

Ken Tilton wrote:

Now maybe that is what is going on and the OP is just leveraging 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 (instead of staring at AMOP looking for support for something not really OO-able).



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 and the CLOS MOP can be more convenient when meta-level stuff is required at run time.


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.



Relevant Pages

  • 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: [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. ... What parameters does a macro function take, and what does it eventually return? ... And your sketch of a solution doesn't yet deal with doing the check only once for each list of specializers. ...
    (comp.lang.lisp)
  • Re: [CLOS] Ensuring a method exists
    ... Both macros and the CLOS MOP are means to do metaprogramming. ... special actions at runtime. ... Macros can expand to code that gets run at load time, which code records (say, in, symbol properties) information to be used by runtime code, such as an around method to check that a method has been defined for the specific types of the arguments. ...
    (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. ... 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. ... 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
    ... 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)