This is the mail archive of the guile@cygnus.com 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: "Current" solution for generalized set!


Chris.Bitmead@misys.com.au writes:

> What you want is to use the one function name, like "car" as the
> name of a getter and setter, depending on the usage.

I think you should read what has been said about "static" setf! in
the previous discussion.

> It suggests to me that you actually want to dispatch similar to CLOS
> except not on type, but on identity.
>
> Wouldn't it be cool if the CLOS system were expanded to encompass
> this idea?  Generic functions are normally declared (define-generic
> name ((arg1 <arg1type>) ...))  What if instead of a type you could
> have a symbol? Like this..  (define-generic setter ((proc 'car))
> set-car! )

CLOS supports this.  It is called eql specializers.

We're not planning to add support for this to Goops.  The reason is
that doing dispatch only on type gives more freedom to optimize
generic function dispatch.

> Chris.Bitmead@misys.com.au writes:
> 
> > dispatch_table[scm->type]->display(scm);

[...]

(Ehrmm...  I already had a copy of my 136-line letter.  :)

/mdj