Re: CL vs scheme macros, namespaces.
Adrian Kubala <adrian-news@xxxxxxxxxxxxxxxxxx> writes:
> On 2006-01-27, jayessay <nospam@xxxxxxx> wrote:
> > ((lambda (x) (funcall x 0)) (symbol-function 'vec))
> > You're next comment will probably be something like 'that's
> > ugly/verbose/...', not realizing that you can easily "fix" that as
> > well (hint: macros).
>
> No, you need to be able to have both these work:
> ((lambda (x) (x 0)) vec)
> ((lambda (x) (aref x 0)) vec)
>
> That's the whole point of the original trick; being able to use a vector
> as either a function OR a vector. Of course, it can't work, because the
> dual-meaning is tied to the symbol, not the value.
No, the dual _meanings_ come from different _usage patterns_. These,
of course, can be distinguished. If you say you don't want to make
such distinction, then you really do not want what you said you want
above.
/Jon
--
'j' - a n t h o n y at romeo/charley/november com
.
Relevant Pages
- Re: Control flow hints
... >in GCC it is possible to give the compiler a hint about expected ... >One can define two macros: ... (microsoft.public.vc.language) - 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: Special forms vs. Macros
... > happens to have its own macros and special operators. ... > language it may shed some light on the distinction in Common Lisp. ... than your special form implementation. ... (comp.lang.lisp) - Re: Trouble with IADs
... using those macros. ... What are you good reasons to avoid _T? ... To quote myself from the article you responded to here (it's a good to read what you respond to, hint hint): ... (microsoft.public.vc.language) - Re: When to use macros.
... I know the clear distinction between macro and function. ... (I presume you are talking about function-like macros.) ... it is because macros are expanded inline ... (comp.lang.c) |
|