Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generic method names for collections

[apologies, my internet access is limited and "pine" doesn't work,
 this email is from "/bin/mail"] writes:
> On Sun, 8 Nov 1998, Maciej Stachowiak wrote:
> > (set! (vector-ref vector 0) "foo")
> > 
> > That's the solution that Common Lisp takes essentially, and there is
> > no ambiguity or vast potential for error here.
> no offense, but that's just plain ugly.
> (vector-ref foo 2)                ;; ERROR
> (lookup foo 2) => "two"     
> (vector? foo) => #f
> (vector? (slot-value foo 'proxy)) => #t

<Maciejever jovial Maciej says above is silly>

[[, I feel like I'm blind]via[the reason to do the 'proxy thing is that we can now write classes
that inherit from "mop-vector" (or whatever it's called).
E.g., a vector with indices m to n,a vector allowing negative
indices (a[-4] == a[len(a) - 4]), a simple-mided-["simple-minded-hash-table" class
overriding lookup and retrieval by hashing the key first
("simple-minded-hash-table" is-a "mop-vector" and has-a "association-lists".mop-alist"s).


Guile Home | Main Index | Thread Index