Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

tailp

tailp( 
l_arg1 
l_arg2 
) 
=> l_arg1 / nil

Description

Returns arg1 if a list cell eq to arg1 is found by cdr down arg2 zero or more times. It returns nil otherwise. Because eq is being used for comparison l_arg1 must point to a tail list in l_arg2 for this predicate to return a non-nil value.

The suffix p is usually added to the name of a function to indicate that it is a predicate function.

Arguments

l_arg1

A list.

l_arg2

Another list, which can contain l_arg1 as its tail.

Value Returned

l_arg

If a list cell eq to l_arg1 is found by cdr down l_arg2 zero or more times.

nil

If a list cell eq to l_arg1 is not found by cdr down l_arg2 zero or more times.

Examples

y = '(b c)
z = cons( 'a y )
=> (a b c)
tailp( y z )        
=> (b c)
tailp( '(b c) z )   
=> nil

nil was returned because '(b c) is not eq the cdr( z ).

Related Topics

tconc


Return to top
 ⠀
X