From: Mikael Djurfeldt <djurfeldt@nada.kth.se>
Cc: Rob Browning <rlb@defaultvalue.org>
Subject: Re: New module system option :duplicates
Date: Tue, 11 Mar 2003 13:12:02 +0100 [thread overview]
Message-ID: <xy7smturtkd.fsf@nada.kth.se> (raw)
In-Reply-To: <rmi3clxgby6.fsf@fnord.ir.bbn.com> (Greg Troxel's message of "08 Mar 2003 09:38:57 -0500")
Greg Troxel <gdt@ir.bbn.com> writes:
> All that said, it troubles me somewhat to have a new extended-generic
> type. Is it possible to just
>
> construct a new generic function
>
> add all the methods from each of the generics in the modules to the
> new generic function
>
> and be done with special treatment?
>
> Finally, I did not understand
>
> This implies that x in (math 2D-vectors) can see the methods of x in
> (my-module) and vice versa, while x in (math 2D-vectors) doesn't see
> the methods of x in (math 3D-vectors), thus preserving modularity.
>
> Why would any method in (math 2D-vectors), or use of gf x, ever see
> methods defined in my-module?
These two things have a common answer: The GF represents some
generalized action and the methods specializes this action to certain
types.
Example:
An object-oriented graphics package (graphics object) exports the GF
`draw'. So does the pixel-oriented graphics package (graphics paint).
These two packages are developed independently by different developers
but use a common representation of the output device, provided by a
third module.
Now we're developing a module (graphics object picture) which provides
the class <picture> which is a subclass of <graphics-object> exported
by (graphics object). Internally, <picture> objects store a <bitmap>
from the (graphics paint) module. Therefore (draw picture) internally
calls (draw bitmap). This works, because `draw' in (graphics object
picture) is an <extended-generic> which shares methods with draw in
(graphics object) and draw in (graphics paint).
However, when the X window is redisplayed and all objects need to be
redrawn, the update function in the (graphics object) package calls
`draw' on each <graphics-object> on the list of visible objects. This
may include our <picture> object, so it is essential that draw in
(graphics object) shares the (draw <picture>) method with draw in
(graphics object picture).
Does this answer your questions?
M
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-03-11 12:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-07 13:19 New module system option :duplicates Mikael Djurfeldt
2003-03-07 14:28 ` tomas
2003-03-07 14:49 ` Marius Vollmer
2003-03-07 15:08 ` Mikael Djurfeldt
2003-03-07 15:28 ` Marius Vollmer
2003-03-07 16:56 ` Rob Browning
2003-03-08 14:38 ` Greg Troxel
2003-03-10 23:39 ` Mikael Djurfeldt
2003-03-11 12:12 ` Mikael Djurfeldt [this message]
2003-03-11 12:21 ` Mikael Djurfeldt
2003-03-11 14:29 ` Greg Troxel
2003-03-11 14:47 ` Mikael Djurfeldt
2003-03-10 23:18 ` Mikael Djurfeldt
2003-03-12 15:05 ` Marius Vollmer
2003-03-12 15:18 ` Mikael Djurfeldt
2003-03-12 16:34 ` Marius Vollmer
2003-03-07 16:30 ` Rob Browning
2003-03-10 23:38 ` Mikael Djurfeldt
2003-03-11 0:14 ` Rob Browning
2003-03-11 10:32 ` Mikael Djurfeldt
2003-03-11 10:50 ` Mikael Djurfeldt
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=xy7smturtkd.fsf@nada.kth.se \
--to=djurfeldt@nada.kth.se \
--cc=rlb@defaultvalue.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).