ansiDefmethod
ansiDefmethod(s_namel_specg_body) =>t
Description
A SKILL++ defmethod macro for supporting lexical scoping in callNextMethod. It creates a closure for a method.
Arguments
Value Returned
Examples
(defclass Parent () ())
(defclass Child (Parent) ())
(defmethod Printer ((self Parent) function)
(error "This line is never reached"))
(defmethod Printer ((self Child) function)
(printf "The function returns %L\n" (funcall function)))
(defmethod Caller ((self Parent))
'Parent)
(ansiDefmethod Caller ((self Child))
(Printer self callNextMethod))
(Caller (makeInstance 'Child))
The function returns Parent
=> t
Related Topics
Return to top