Neil Jerram <[EMAIL PROTECTED]> writes:

> Not that I know of.  I'll take a look at the code though.

Well, the following seems to work ...

(use-modules (oop goops))
(define-method (second (l <list>)) (cadr l))
(define-method (set-second (l <list>) val) (set-car! (cdr l) val))
(define-method (second (l <vector>)) (vector-ref l 1))
(define-method (set-second (l <vector>) val) (vector-set! l 1 val))
(define sec (make-procedure-with-setter second set-second))
(sec '(1 2 3)) => 2
(sec #(1 2 3)) => 2
(define l (list 'a 'b 'c))
(set! (sec l) 'fff)
l => (a fff c)
(define l (vector 'a 'b 'c))
(set! (sec l) 'fff)
l => #(a fff c)

In other words, it appears that the args of make-procedure-with-setter
can be generics.

Regards,
     Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to