Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Current" solution for generalized set!
Ken Anderson <kanderso@bbn.com> writes:
> Your proposal reminds me of funcallable-instances, fin's, of PCL. These
> were functions with slots. Fin's were the building blocks that generic
> functions were built on top of.
The exist in Goops, and are called "entities".
All instances of classes which have a subclass of <entity-class> as
metaclass behave as procedures. You set the procedure with
`set-object-procedure!'.
I see two problems with using them as a representation of the
<getter-with-setter> (or <procedure-with-setter>):
1. Since Goops is not a part of guile-core but a separate package, and
since set! is supposed to belong to guile-core, we can't rely too
heavily on object system mechanisms in guile-core. For this
reason, although it would be nice, we can't let our getter/setter
pair be a subclass of <generic>.
However, there is support for basic entities in guile-core, but
since there is probably no big advantage in using that
representation instead of the currently suggested closures with
setter slot.
2. It is essential that there doesn't exist a way to mutate the setter
of a getter. For this we have to include support for read-only
slots. This is perhaps possible to add to Goops, though.
So, yes, to use an entity as the representation for a
<procedure-with-setter> may be an alternative.
/mdj
Guile Home |
Main Index |
Thread Index