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: generic method names for collections


Maciej Stachowiak <mstachow@mit.edu> writes:

> And it will work. In fact, unlike with Common Lisp `setf', the
> following will work right as well:
> 
> (define v '#(1 2 3))
> (define foobar vector-ref)
> (setf! (foobar v 0) 99)
> 
> Even something like
> 
> (define v '(#(1 2 3) #(4 5 6)))
> (setf! (vector-ref (cadr v) 1) 99)
> 
> Will cause v to have the expected final value of
> (#(1 2 3) #(4 99 6)) 
> 
> with only the code above. Neat, eh?

It sounds like this generic setter arrangement is more general than
Common Lisp's in some ways.  

My question is this; assume that hobbit was trained to understand
generic setters; would your system provide enough information to the
compiler to allow for complete compile time translation of generic
setters?  

This is what is neat about Common Lisp's system, IMHO.  It's a
compile-time dance, so you pay no speed penalty.

-russ

--
Computers are not intelligent.  They only think they are.