This is the mail archive of the mailing list for the Guile project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Trouble understanding define (!)

Michael Livshin <> writes:

> generic functions are *not* ordinary objects,

They should be, from the point of view of the module systems.

> they themselves are namespaces, [...]

In what way are they namespaces?

They are about dispatching to different functions depending on the type
of the arguments.  These types don't have names.

> this places the corresponding obligation on GOOPS which is:
> if
>   0. GF0 and GF1 are generic functions.
>   1. (eq? (generic-name GF0) (generic-name GF1))
>   2. (eq? (class-of GF0) (class-of GF1))
> then
>   (eq? GF0 GF1)

[ I don't think you can define `eq?' in this way, generally.  You can
  define `eqv?' and `equal?`, but not `eq?'. ]

I still strongly think that generic functions do not have names.
Thus, there is no function `generic-name' that could be used to define
the above condition.  And why does the (meta-) class of the generic
function object matter?  It should be an implementation detail.

In Scheme, objects do not have names.  The debugger might be able to
give some hints about the way certain objects are probably supposed to
be referred to from source code, but we can't use these hints to
define the semantics of the language.

Either we stick to this, or do no longer pretend to be implementing a
Scheme.  Which would be OK, too.  I find the thought of just leaving
Scheme behind and following a more fleshed out standard like ANSI
Common Lisp quite appealing.  Guile is not a research project in
language design, but it more and more turns out to be one, because
basic things like the object system, the module system, or a useful
I/O system tend to be designed from scratch.  I don't think this is a
good way to spend our scarce resources.

- Marius

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]