[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do we have to worry about the names of generic functions?

From: Andy Wingo
Subject: Re: Do we have to worry about the names of generic functions?
Date: Fri, 14 May 2004 20:53:20 +0100

Hi Rob,

On Thu, 2004-05-13 at 13:38 -0500, Rob Browning wrote:
> I just asked basically the same question on guile-devel, not realizing
> you'd already done so here :>

Hehe ;)

> > To put it another way: what's the difference between (output x) and the
> > more smalltalk-like (x 'output)? 
> One thing to consider is that at least in CLOS (and I'd presume GOOPS,
> though I'm not as familiar with it), there are more sophisticated
> multiple argument dispatch and multiple inheritance issues that may
> distinguish the C++/python-esque "" from CLOS/GOOPS "(foo x)",

True. But consider this: The set of python objects which have a foo
method is similar to the set of GOOPS objects which exist in the
specializers of a foo method. Specialization can only tighten the set of
objects to which foo can apply, which makes foo's dent on the namespace
even smaller.

> * Using generics might be less readable.
> Yes, though choosing more distinguishing function names does have the
> advantage that you can easily do things like
>   fgrep '(gtk-close' *.scm

Although in the context of g-wrap we're dealing with generics that have
no procedural counterparts, (gnome gtk) for gtk2 provides both. So in
this case the choice is with the programmer. Furthermore, as Andreas
mentioned you can always use a prefix renamer.

At this point my brain is saying "don't worry about the names" and my
gut is saying "don't export anything without a prefix" ;) But it doesn't
seem like there's a technical reason to restrict the names, so long as
they don't conflict with non-generics.

Andy Wingo <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]