nextMethodp
nextMethodp( ) =>t/nil
Description
Checks if there is a next applicable method for the current method’s generic function. The current method is the method that is calling nextMethodp.
nextMethodp is a predicate function which returns t if there is a next applicable method for the current method’s generic function. This next method is specialized on a superclass of the class on which the current method is specialized.
Prerequisites
This function should only be used within the body of a method to determine whether a next method exists.
The return value and the effect of this function are unspecified if called outside of a method body.
Arguments
Value Returned
Examples
The following example prints Point.
defclass( GeometricObj () ())
=> t
defclass( Point ( GeometricObj ) () )
=> t
defmethod( whoami (( obj Point ))
if( nextMethodp()
then printf("Point, which is a " )
callNextMethod()
else printf("Point")))
=> t
p = makeInstance( 'Point )
=> stdobj:0x325030
whoami(p)
=> t
The following example prints Point, which is a “GeometricObj”
defmethod( whoami (( obj GeometricObj))
println( "GeometricObj"))
=> t
whoami( p)
=> nil
Related Topics
Return to top