This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Trouble understanding define (!)
- To: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Subject: Re: Trouble understanding define (!)
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 02 Feb 2000 12:05:41 +0100
- Cc: Michael Livshin <mlivshin at bigfoot dot com>, Neil Jerram <neil at ossau dot uklinux dot net>, guile at sourceware dot cygnus dot com, djurfeldt at nada dot kth dot se
- References: <200001142054.UAA00622@ossau> <p2tzou4o5ov.fsf@pampelmuse.zrz.tu-berlin.de> <200001182250.WAA00624@ossau> <xy7ya9nezzz.fsf@mdj.nada.kth.se> <200001221200.MAA00478@ossau> <xy7bt6e82ru.fsf@mdj.nada.kth.se> <s3zotxrqoz.fsf@verisity.com> <xy7iu0cbc1z.fsf@mdj.nada.kth.se> <s3iu0bq1x5.fsf@verisity.com> <xy71z6z35os.fsf@mdj.nada.kth.se> <s33drfpm9d.fsf@verisity.com> <xy73drec8ap.fsf@mdj.nada.kth.se>
Hi,
I donīt understand this part:
> The problem, as I see it, is that it is uncomfortable for the user to
> manage the question of which GFs of the same name really should be
> represented as one GF.
>
> We might have one graphics library which provides a set of methods for
> the GF `draw'. Then we might use this in a Poker game where we have a
> GF `draw' which draws cards in different ways depending on what kind
> of pack of cards we have.
You have a module "draw" which exports several names:
draw<int>...
draw<grapics><line>...
draw<grapics><point>...
draw<cards><field>...
draw<cards><card>...
If draw<cards>... should only visible to client module "game", just do
a selective export and youīre done. Or do I miss something important?
I have problems with the sentence "depending on what kind of pack the
cards have". What does this mean?
> It is clear that these two GFs represent different concepts, and one
> way of handling the situation in the module system is to import with
> renaming: g:draw, card:draw.
In Clos generic functions donīt represent different concepts as they
donīt belong to classes. I you want a strong method---class coupling,
you canīt use GFīs anyway: You canīt force a user who creates Mī from
M to also create drawī.
Jost
PS: An alternative for selective export would be "parametric modules", IMHO.