Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.lisp

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-15-2012, 10:45 PM
budden
Guest
 
Posts: n/a
Default incongruent lambda list

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.
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 08-16-2012, 12:07 AM
Pascal J. Bourguignon
Guest
 
Posts: n/a
Default Re: incongruent lambda list

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 {}.
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 08:19 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.