unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
Cc: Guile Users <guile-user@gnu.org>
Subject: Re: Do we have to worry about the names of generic functions?
Date: Fri, 14 May 2004 20:53:20 +0100	[thread overview]
Message-ID: <1084564399.32494.86.camel@localhost> (raw)
In-Reply-To: <87isf0qiiw.fsf@trouble.defaultvalue.org>

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 "x.foo()" 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.

Cheers,
-- 
Andy Wingo <wingo@pobox.com>


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


      reply	other threads:[~2004-05-14 19:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-12 10:34 Do we have to worry about the names of generic functions? Andy Wingo
2004-05-12 16:14 ` Paul Jarc
2004-05-12 20:34   ` Andreas Rottmann
2004-05-13 17:53     ` Rob Browning
2004-05-13 18:08       ` Andreas Rottmann
2004-05-13 19:49         ` Rob Browning
2004-05-14 19:40   ` Andy Wingo
2004-05-15 19:53     ` Paul Jarc
2004-05-13 18:38 ` Rob Browning
2004-05-14 19:53   ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1084564399.32494.86.camel@localhost \
    --to=wingo@pobox.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).