Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 3493 days ago | link | parent

(One bug is that vtables for iso is not initialized anyplace. Exercise for the reader.)

If I may:

   (mac defmethod(name type args . body)
  -  `(= ((vtables* ',name) ',type)
  +  `(= ((or= (vtables* ',name) (table)) ',type)
         (fn ,args
Does that work for you? ^_^

1 point by akkartik 3493 days ago | link

I hadn't thought of that :)

The drawback is that it's every defmethod's responsibility to make sure it sets the vtable entry if necessary.

I was thinking more of wrapping the implementation of either defgeneric or defmethod in a `(do (or= ..) ...)