This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: goops/guile doc (was Re: Simple example program to illustrate Goops)
- To: Gary Houston <ghouston at arglist dot com>
- Subject: Re: goops/guile doc (was Re: Simple example program to illustrate Goops)
- From: Jim Blandy <jimb at red-bean dot com>
- Date: 01 Mar 2000 18:20:03 -0500
- Cc: guile at sourceware dot cygnus dot com
- References: <20000127120716.29627.qmail@web1805.mail.yahoo.com> <200001280904.JAA00754@ossau> <38918B07.F7DDA4A7@enteract.com> <m3vh3at4d9.fsf@savonarola.red-bean.com> <20000229135108.746.qmail@d2-s46-142-telehouse.mistral.co.uk>
> > This has more practical consequences, too. For example, folks were
> > just talking about binary I/O functions, and it was pointed out that
> > it makes sense to apply them not only to streams, but also to strings,
> > byte arrays, hypothetical pointer types, and so on.
> >
> > Well, suppose we defined generic functions `fetch' and `store'. Then
> > suppose we define a GOOPS class <representation>, which has elements
> > like 16-bit-be-unsigned-int ("be" == "big-endian"), 32-bit-le-signed-int,
> > 64-bit-ieee-float, and so on.
>
> Do you mean 16-bit-be-unsigned-int is a class that inherits from
> <representation>?
Yes, to make GOOPS help you choose the right primitive for both the
source and the type.
But in general, I should apologize --- my example was total fiction.
I've never actually implemented anything like that, so it may be
totally bogus. I should have been patient and found something better.
I guess my point is that, when you think about an algorithm, you may
have in mind specific types for several of its arguments, not just
one. CLOS/GOOPS lets you say things like that.