Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generic method names for collections
>> > (set! (ref vector 0) "foo")
>> better, but still ugly.
>Why? It's precisely parallel to "a = 7;" vs. "b = 99;" vs "x.y =
>77" in C. Assignment to locations is made generic. This is a big win
>because you only have to remember the names of accessors, not the
>names of mutators.
I think it's quite pretty to look it, but I would have thought that it
unnecessary extra restrictions on the implementation.
For example, if the implementation represented Scheme objects as C
and passed around pointers to these objects within the Scheme run-time.
(typedef struct SchemeObject * SCM; ). This works fine in standard Scheme,
but for the ref implementation above, (ref ..) would have to return a
to a pointer to a structure in order to modify it. Which wouldn't work in
Or am I missing something?
Guile Home |
Main Index |