type

From the SETL Wiki

Jump to: navigation, search
type
Category general
Syntax prefix
Compatibility
CIMS SETL yes
SETL-S yes
SETL2 yes
GNU SETL yes

Contents

Purpose

Determine the type of any SETL value

Synopsis

 type x

Description

Returns one of the following predefined strings depending on the primary type of x: 'ATOM', 'BOOLEAN', 'INTEGER', 'REAL', 'SET', 'STRING', 'TUPLE'

GNU SETL and SETL2 may also return 'PROCEDURE'.
SETL2 may also return the name of a user-defined class.

Examples

  • type 42
    

    Result: 'INTEGER'

  • type '42'
    

    Result: 'STRING'


Notes

  • GNU SETL returns the string 'OM' for type om, while SETL2 and CIMS SETL return om itself. SETL-S does not allow the type operator to be applied to om and will abort with a run-time error.
Personal tools