Re: accessor with 2/3 parameters

2006-08-19 Thread Neil Jerram
Marco Maggi [EMAIL PROTECTED] writes: So a working example is: ;; (use-modules (oop goops)) (debug-enable 'debug) (debug-enable 'backtrace) (debug-enable 'trace) (define-class my-vec () (v #:init-keyword #:value)) (define elm

Re: accessor with 2/3 parameters

2006-08-19 Thread Neil Jerram
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

accessor with 2/3 parameters

2006-08-18 Thread Marco Maggi
Ciao, I wanted to create an accessor called ELM with synopsis: (set! (elm obj key) value) (elm obj key) which is the same required by the VECTOR-SET! and VECTOR-REF pair. For this both the #:accessor keyword of class definition and the explicit definition: (define-method (elm (obj