domain

From the SETL Wiki

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

Contents

Purpose

Get the set of all keys in a map

Synopsis

 domain m

Description

Returns the set of keys occurring in m, which must be a map.

Equivalent to {k: [k, v] in m}

Examples

  1. domain {}
    

    Result: {}

  2. domain {[1, 10], [1, 11], [2, 20]}
    

    Result: {1, 2}

  3. (SETL2 only)
    domain({[1, 10], [1, 11], [2]})
    

    Result: {1, 2}, though m(2) = om.


Notes

  • This is one of few prefix operators in SETL2. Most prefix operators from SETL are implemented as built-in procedures in SETL2.
Personal tools