Product Documentation
Cadence SKILL++ Object System Reference
Product Version IC23.1, June 2023

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

None.

Value Returned

t

There is a next method

nil

There is no next method.

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

Generic Functions and Methods

defmethod

callNextMethod


Return to top
 ⠀
X