|
|||
|
Hi! Any normal blub programmer feels a pain
when faced with congruent lambda lists. What about the following: (defgeneric event1 (o) ...) (defgeneric event3 (o a b) ...) (def-overloaded-generic event (event1 event3) ...) def-overloaded-method macro creates new (generic?) function and a compiler macro. Compiler macro attempts to resolve event to either of event1 or event3 based on signature or argument types. If it fails to do so, it delays resolution until runtime. |
|
|
||||
|
||||
|
|
|
|||
|
budden <budden-lisp@mail.ru> writes:
> Hi! Any normal blub programmer feels a pain > when faced with congruent lambda lists. What > about the following: > > (defgeneric event1 (o) ...) > (defgeneric event3 (o a b) ...) > (def-overloaded-generic event (event1 event3) ...) > > def-overloaded-method macro creates new > (generic?) function and a compiler macro. > > Compiler macro attempts to resolve event to > either of event1 or event3 based on > signature or argument types. If it fails > to do so, it delays resolution until runtime. You need to define first a real function, before defining a compiler macro. There is no standard function to get the lambda lists (function-lambda-expression can return nil), so you need to use another macro than defgeneric to implement the needed book-keeping, or you need to use implementation specific extensions such as the MOP. Otherwise, sure, why not? -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|