Newsgroups: comp.lang.clos,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-peer.gsl.net!news.gsl.net!ix.netcom.com!www.nntp.primenet.com!nntp.primenet.com!nntp.uio.no!voskovec.radio.cz!btnet-feed2!unlisys!cs.tu-berlin.de!news.uni-hamburg.de!news.Hanse.DE!wavehh.hanse.de!cracauer
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: Re: Generic function efficiency
Message-ID: <1996Dec18.100600.15076@wavehh.hanse.de>
Reply-To: cracauer@wavehh.hanse.de
Organization: Private site
References: <5965s8$hak$1@mhafc.production.compuserve.com>
Date: Wed, 18 Dec 96 10:06:00 GMT
Lines: 38
Xref: glinda.oz.cs.cmu.edu comp.lang.clos:4095 comp.lang.lisp:24294

Marc BATTYANI <73474.2257@CompuServe.COM> writes:

>Hi,

>I'm using methods with eql specifiers. 
>Is this handled efficiently or should I use a case instead?

>example:
>I have about 40 actions

>(defmethod Process ((obj object) (action (eql action1)))
>..)

>(defmethod Process ((obj object) (action (eql 'action2)))
>..)

>or 

>(defmethod Process ((obj object) action))
>(case action
>   (action1 (...))
>   (action2 (...))
>   ...))

That is definitivly implementation-dependent.

I'd suspect that an implementation with a good compiler and a weak
CLOS implemention (like CMUCL) handles the latter better.

Why don't write a short benchmark and post it together with some
results :-)?

Martin
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin_Cracauer@wavehh.hanse.de http://cracauer.cons.org  Fax.: +4940 5228536
"As far as I'm concerned,  if something is so complicated that you can't ex-
 plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin
