[CM] Gauche and define-method

Bill Schottstaedt bil@ccrma.Stanford.EDU
Tue, 25 Apr 2006 11:40:30 -0700


I just realized that Gauche has done methods right!  25 years ago I battled
with (was it MacLisp? ACL?) and lost, then 7-8 years ago with Guile and lost, and
today:

:(define-method + ((v1 <vct>) (v2 <vct>)) (vct-add! v1 v2))
#<generic + (1)>
:(define hi (make-vct 3 2))
hi
:(define ho (make-vct 3 3))
ho
:(+ hi ho)
#<vct[len=3]: 5.000 5.000 5.000>

Hooray!  Now to mix two files: (+ file1 file2) -- I'm smiling from ear to ear.