range

From the SETL Wiki

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

Contents

Purpose

Get the set of all values in a map

Synopsis

 range m

Description

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

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

Examples

  1. range {}
    

    Result: {}

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

    Result: {10, 11, 20}

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

    Result: {om, 10, 11}.


Notes

  • This is the only built-in operator that can insert om into a set, and it does so only in SETL2.
  • This is one of few prefix operators in SETL2. Most prefix operators from SETL are implemented as built-in procedures in SETL2.
Personal tools