Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.kreonet.re.kr!overload.lbl.gov!lll-winken.llnl.gov!uwm.edu!math.ohio-state.edu!howland.reston.ans.net!tank.news.pipex.net!pipex!oleane!jussieu.fr!univ-lyon1.fr!news-rocq.inria.fr!news2.EUnet.fr!news.fnet.fr!ilog!news
From: davis@ilog.fr (Harley Davis)
Subject: Re: EuLisp status
In-Reply-To: "Stefan Monnier"'s message of 11 Sep 1995 14:46:17 GMT
Message-ID: <DAVIS.95Sep11184050@halles.ilog.fr>
Lines: 54
Sender: news@ilog.fr
Nntp-Posting-Host: halles
Organization: Ilog SA, Gentilly, France
References: <9509051545.aa14389@mc.lcs.mit.edu> <DEpGEr.BGL@cogsci.ed.ac.uk>
	<431i3p$q32@info.epfl.ch>
Date: 11 Sep 1995 16:40:50 GMT


In article <431i3p$q32@info.epfl.ch> "Stefan Monnier" <stefan.monnier@epfl.ch> writes:

> What I meant (don't know exactly what Julian understood) is that
> 
> 	(defun toto (x y)
> 		...)
> 
> Is not the same as
> 
> 	(defmethod toto (x y)
> 		...)
> 
> Because, for example you cannot later say
> 
> 	(defmethod toto ((x integer) (y list))
> 		...)
> 
> and I fail to see what is the reason of such a distinction. The only
> actual reason could be that it might be harder to generate efficient
> code in the case where a defmethod is used as a defun (which means
> that the generic function only has 1 method). But I'm not even sure
> that the impact on efficiency would be that big.

When you start discussing this possibility, those of us who are
efficiency freaks complain because you have to have an extra
indirection to call functions even when there is only one global
method.  The response is to think of clever optimizations like Dylan's
sealing which will avoid this cost in certain cases.  But all of those
optimizations require clever compilers, and one of EuLisp's explicit
goals is to allow simple *and* efficient implementations.

Indeed, the cost is that you have to think ahead about whether a
particular function will be generic or not.  But this has not proved
an enormous burden up to now for Lisp programmers, the major cost
being, as you point out, function names which are less than optimal
from time to time.  Given the existence of the module system, which
can provide the names you want for any given function, this was not
considered serious.  Requiring implementors to write Really Smart
Compilers to get decent function call efficiency was considered
serious.  That is the EuLisp way of thinking.  If you prefer the Dylan
way of thinking, then you can use Dylan -- as soon as the efficient
compilers appear...

-- Harley Davis

-- 

-------------------++** Ilog has moved! **++----------------------------
Harley Davis                            net: davis@ilog.fr
Ilog S.A.                               tel: +33 1 49 08 35 00
9, rue de Verdun, BP 85                 fax: +33 1 49 08 35 10
94253 Gentilly Cedex, France            url: http://www.ilog.com/

