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

callAs

callAs( 
us_class 
s_genericFunction 
g_arg1 
[ g_arg2 ... ]
) 
=> g_value 

Description

Calls a method specialized for some super class of the class of a given object directly, bypassing the usual method inheritance and overriding of a generic function.

It is an error if the given arguments do not satisfy the condition (classp g_obj us_class).

Arguments

us_class

A class name or class object.

s_genericFunction

A generic function name.

g_arg1

A SKILL object whose class is us_class or a subclass of us_class.

g_arg2

Arguments to pass to the generic function.

Value Returned

g_value

The result of applying the selected method to the given arguments.

Examples

defclass( GeometricObj () ())
=> t
defclass( Point (GeometricObj ) () )
=> t
defgeneric( whoami (obj) println("default"))
=> t
defmethod( whoami (( obj Point )) println("Point"))
=> t
defmethod( whoami (( obj GeometricObj))
println( "GeometricObj"))
=> t
p = makeInstance( 'Point )
=> stdobj:0x325018
whoami(p) ;prints "Point"
=> nil
callAs( 'GeometricObj 'whoami p ) ;prints "GeometricObj"
=> nil

Related Topics

Generic Functions and Methods

nextMethodp

callNextMethod


Return to top
 ⠀
X