[elephant-devel] A thorny problem....
James Anderson
janderson at ravenpack.com
Fri Feb 17 16:08:37 UTC 2006
hello;
-----Original Message-----
From: elephant-devel-bounces at common-lisp.net [mailto:elephant-devel-bounces at common-lisp.net]On Behalf Of Robert L. Read
Sent: Friday, February 17, 2006 16.17
To: Elephant-devel mailing list
Subject: [elephant-devel] A thorny problem....
I think I've a identified a serious problem relating to the
the dependencies on various modules that I offer up
for you comment.
i have a naive know ledge of elephant, but would be surprised that this is a problem.
one writes a macro which targets a generic function.
a macro does several useful things.
1. it preforms syntactic rewriting
2. it delays evaluation.
3. if it is to be useful, this king of macro provides a standard interface to varying implementations.
when i skim over the definitions which i find in utils.lisp and berkeley.lisp, i observe that thay do lots of 1, none of 2 and half of three, and that it appears that their siginficance to a bit of application code depends on the active package.
in order to avoid what you describe as a thorny problem, you would need to
- have one macro only. not different ones with analogous names in different packages.
- have that macro always take the same syntax (which those seem, mostly, to do)
- prepare all arguments to pass to an implementation-specific function
- capture the body in a closure
- invoke the implementation-specific function with a specializing argument, the closure, and the keyword arguments.
the implementation-specific function is generic, with a method defined by each backend.
the approach is good parcive in general for macros - means you don't need to recompile code if the implementation changes, but is essential to implement and use modular back.ends.
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20060217/cf884e9e/attachment.html>
More information about the elephant-devel
mailing list