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] |
YO, Maciej! I got your "set!" right here pal! On Fri, 6 Nov 1998, Maciej Stachowiak wrote: > > jglascoe@jay.giss.nasa.gov writes: > > > > the big three basic operations: > > > > dictionary-insert! > > dictionary-lookup > > dictionary-remove! > > > > In my opition, consistency is even more important than > meaningfulness. Hence, these should be renamed to `dictionary-set!', > `dictionary-ref' and `dictionary-delete!' respectively. Imagine that we're choosing names for generic methods on collection data structures... now, what's wrong with this picture: (set! vector 0 "foo") (set! vector 0) ;; oops, forgot the third argument, I'm screwed now! or even worse: (set! btree "fiz") what happens? what does it mean? On Fri, 6 Nov 1998, Maciej Stachowiak wrote: > > * `vector-set!' is entirely different from plain old `set!' because it > modifies a vector, not a variable, and I don't see why this is > confusing at all... <snip> > The reason these are preferable to insert!/lookup/remove! is because > they are parallel with the operations on Scheme basic types, as > defined in R5RS, a standards document that is a lot harder to change > than random data structure implementations. For that matter, one could > make up similar arguments against insert!/lookup/remove!, e.g.: Too bad they weren't thinking of generic functions when they dreamed up the dual meanings of "set!". > > - Maciej > > Jay Glascoe jglascoe@jay.giss.nasa.gov