OpenEuphoria: Euphoria v4.1

# OpenEuphoria Manual

## Euphoria v4.1

routine or constant name search

| Up |  |  | TOC | Index
<< 7 Included Tools | < 8.10 Multi-Tasking | Up: 8 API Reference | 8.12 Utilities > | 9 Release Notes >>

## 8.11 Types - Extended

#### 8.11.0.1 OBJ_UNASSIGNED

    include std/types.e
    namespace types
    public constant OBJ_UNASSIGNED

Object not assigned

#### 8.11.0.2 OBJ_INTEGER

    include std/types.e
    namespace types
    public constant OBJ_INTEGER

Object is integer

#### 8.11.0.3 OBJ_ATOM

    include std/types.e
    namespace types
    public constant OBJ_ATOM

Object is atom

#### 8.11.0.4 OBJ_SEQUENCE

    include std/types.e
    namespace types
    public constant OBJ_SEQUENCE

Object is sequence

#### 8.11.0.5 object

    <built-in> type object(object x)

returns information about the object type of the supplied argument `x`.

##### Returns:

1. An integer,
   - `OBJ_UNASSIGNED` if `x` has not been assigned anything yet.
   - `OBJ_INTEGER` if `x` holds an integer value.
   - `OBJ_ATOM` if `x` holds a number that is not an integer.
   - `OBJ_SEQUENCE` if `x` holds a sequence value.

##### Example 1:

    ? object(1) --> OBJ_INTEGER
    ? object(1.1) --> OBJ_ATOM
    ? object("1") --> OBJ_SEQUENCE
    object x
    ? object(x) --> OBJ_UNASSIGNED

##### See Also:

sequence, integer, atom

#### 8.11.0.6 integer

    <built-in> type integer(object x)

tests the supplied argument `x` to see if it is an integer or not.

##### Returns:

1. An integer.
   - 1 if `x` is an integer.
   - 0 if `x` is not an integer.

##### Example 1:

    ? integer(1) --> 1
    ? integer(1.1) --> 0
    ? integer("1") --> 0

##### See Also:

sequence, object, atom

#### 8.11.0.7 atom

    <built-in> type atom(object x)

tests the supplied argument `x` to see if it is an atom or not.

##### Returns:

1. An integer,
   - 1 if `x` is an atom.
   - 0 if `x` is not an atom.

##### Example 1:

    ? atom(1) --> 1
    ? atom(1.1) --> 1
    ? atom("1") --> 0

##### See Also:

sequence, object, integer

#### 8.11.0.8 sequence

    <built-in> type sequence( object x)

tests the supplied argument `x` to see if it is a sequence or not.

##### Returns:

1. An
   - 1 if `x` is a sequence.
   - 0 if `x` is not an sequence.

##### Example 1:

    ? sequence(1) --> 0
    ? sequence({1}) --> 1
    ? sequence("1") --> 1

##### See Also:

integer, object, atom

#### 8.11.0.9 FALSE

    include std/types.e
    namespace types
    public constant FALSE

Boolean FALSE value

#### 8.11.0.10 TRUE

    include std/types.e
    namespace types
    public constant TRUE

Boolean TRUE value

### 8.11.1 Predefined Character Sets

#### 8.11.1.1 CS_FIRST

    include std/types.e
    namespace types
    public enum CS_FIRST

#### 8.11.1.2 CS_Consonant

    include std/types.e
    namespace types
    public enum CS_Consonant

#### 8.11.1.3 CS_Vowel

    include std/types.e
    namespace types
    public enum CS_Vowel

#### 8.11.1.4 CS_Hexadecimal

    include std/types.e
    namespace types
    public enum CS_Hexadecimal

#### 8.11.1.5 CS_Whitespace

    include std/types.e
    namespace types
    public enum CS_Whitespace

#### 8.11.1.6 CS_Punctuation

    include std/types.e
    namespace types
    public enum CS_Punctuation

#### 8.11.1.7 CS_Printable

    include std/types.e
    namespace types
    public enum CS_Printable

#### 8.11.1.8 CS_Displayable

    include std/types.e
    namespace types
    public enum CS_Displayable

#### 8.11.1.9 CS_Lowercase

    include std/types.e
    namespace types
    public enum CS_Lowercase

#### 8.11.1.10 CS_Uppercase

    include std/types.e
    namespace types
    public enum CS_Uppercase

#### 8.11.1.11 CS_Alphanumeric

    include std/types.e
    namespace types
    public enum CS_Alphanumeric

#### 8.11.1.12 CS_Identifier

    include std/types.e
    namespace types
    public enum CS_Identifier

#### 8.11.1.13 CS_Alphabetic

    include std/types.e
    namespace types
    public enum CS_Alphabetic

#### 8.11.1.14 CS_ASCII

    include std/types.e
    namespace types
    public enum CS_ASCII

#### 8.11.1.15 CS_Control

    include std/types.e
    namespace types
    public enum CS_Control

#### 8.11.1.16 CS_Digit

    include std/types.e
    namespace types
    public enum CS_Digit

#### 8.11.1.17 CS_Graphic

    include std/types.e
    namespace types
    public enum CS_Graphic

#### 8.11.1.18 CS_Bytes

    include std/types.e
    namespace types
    public enum CS_Bytes

#### 8.11.1.19 CS_SpecWord

    include std/types.e
    namespace types
    public enum CS_SpecWord

#### 8.11.1.20 CS_Boolean

    include std/types.e
    namespace types
    public enum CS_Boolean

#### 8.11.1.21 CS_LAST

    include std/types.e
    namespace types
    public enum CS_LAST

### 8.11.2 Support Functions

#### 8.11.2.1 char_test

    include std/types.e
    namespace types
    public function char_test(object test_data, sequence char_set)

determines whether one or more characters are in a given character set.

##### Parameters:

1. `test_data` : an object to test, either a character or a string
2. `char_set` : a sequence, either a list of allowable characters, or a list of pairs representing allowable ranges.

##### Returns:

An integer, 1 if all characters are allowed, else 0.

##### Comments:

`pCharset` is either a simple sequence of characters (such as `"qwertyuiop[]\"`) or a sequence of character pairs, which represent allowable ranges of characters. For example Alphabetic is defined as ``.

To add an isolated character to a character set which is defined using ranges, present it as a range of length 1, like in `{%,%}`.

##### Example 1:

    char_test("ABCD", {{'A', 'D'}})
    -- TRUE, every char is in the range 'A' to 'D'

    char_test("ABCD", {{'A', 'C'}})
    -- FALSE, not every char is in the range 'A' to 'C'

    char_test("Harry", {{'a', 'z'}, {'D', 'J'}})
    -- TRUE, every char is either in the range 'a' to 'z',
    --       or in the range 'D' to 'J'

    char_test("Potter", "novel")
    -- FALSE, not every character is in the set 'n', 'o', 'v', 'e', 'l'

#### 8.11.2.2 set_default_charsets

    include std/types.e
    namespace types
    public procedure set_default_charsets()

sets all the defined character sets to their default definitions.

##### Example 1:

    set_default_charsets()

#### 8.11.2.3 get_charsets

    include std/types.e
    namespace types
    public function get_charsets()

gets the definition for each of the defined character sets.

##### Returns:

A sequence, of pairs. The first element of each pair is the character set id ( such as `CS_Whitespace` ) and the second is the definition of that character set.

##### Comments:

This is the same format required for the set_charsets routine.

##### Example 1:

    sequence sets
    sets = get_charsets()

##### See Also:

set_charsets, set_default_charsets

#### 8.11.2.4 set_charsets

    include std/types.e
    namespace types
    public procedure set_charsets(sequence charset_list)

sets the definition for one or more defined character sets.

##### Parameters:

1. `charset_list` : a sequence of zero or more character set definitions.

##### Comments:

`charset_list` must be a sequence of pairs. The first element of each pair is the character set id (such as `CS_Whitespace`) and the second is the definition of that character set.

This is the same format returned by the get_charsets routine.

You cannot create new character sets using this routine.

##### Example 1:

    set_charsets({{CS_Whitespace, " \t"}})
    t_space('\n') --> FALSE

    t_specword('$') --> FALSE
    set_charsets({{CS_SpecWord, "_-#$%"}})
    t_specword('$') --> TRUE

##### See Also:

get_charsets

### 8.11.3 Types

#### 8.11.3.1 boolean

    include std/types.e
    namespace types
    public type boolean(object test_data)

test for an integer boolean.

##### Returns:

Returns TRUE if argument is 1 or 0

Returns FALSE if the argument is anything else other than 1 or 0.

##### Example 1:

    boolean(-1)            -- FALSE
    boolean(0)             -- TRUE
    boolean(1)             -- TRUE
    boolean(1.234)         -- FALSE
    boolean('A')           -- FALSE
    boolean('9')           -- FALSE
    boolean('?')           -- FALSE
    boolean("abc")         -- FALSE
    boolean("ab3")         -- FALSE
    boolean({1,2,"abc"})   -- FALSE
    boolean({1, 2, 9.7)    -- FALSE
    boolean({})            -- FALSE (empty sequence)

#### 8.11.3.2 t_boolean

    include std/types.e
    namespace types
    public type t_boolean(object test_data)

tests elements for boolean.

##### Returns:

Returns TRUE if argument is boolean (1 or 0) or if every element of the argument is boolean.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-boolean elements

##### Example 1:

    t_boolean(-1)            -- FALSE
    t_boolean(0)             -- TRUE
    t_boolean(1)             -- TRUE
    t_boolean({1, 1, 0})     -- TRUE
    t_boolean({1, 1, 9.7})    -- FALSE
    t_boolean({})            -- FALSE (empty sequence)

#### 8.11.3.3 t_alnum

    include std/types.e
    namespace types
    public type t_alnum(object test_data)

tests for alphanumeric character.

##### Returns:

Returns TRUE if argument is an alphanumeric character or if every element of the argument is an alphanumeric character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-alphanumeric elements

##### Example 1:

    t_alnum(-1)            -- FALSE
    t_alnum(0)             -- FALSE
    t_alnum(1)             -- FALSE
    t_alnum(1.234)         -- FALSE
    t_alnum('A')           -- TRUE
    t_alnum('9')           -- TRUE
    t_alnum('?')           -- FALSE
    t_alnum("abc")         -- TRUE (every element is alphabetic or a digit)
    t_alnum("ab3")         -- TRUE
    t_alnum({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_alnum({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_alnum({})            -- FALSE (empty sequence)

#### 8.11.3.4 t_identifier

    include std/types.e
    namespace types
    public type t_identifier(object test_data)

tests string if it is an valid identifier.

##### Returns:

Returns TRUE if argument is an alphanumeric character or if every element of the argument is an alphanumeric character and that the first character is not numeric and the whole group of characters are not all numeric.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-alphanumeric elements

##### Example 1:

    t_identifier(-1)            -- FALSE
    t_identifier(0)             -- FALSE
    t_identifier(1)             -- FALSE
    t_identifier(1.234)         -- FALSE
    t_identifier('A')           -- TRUE
    t_identifier('9')           -- FALSE
    t_identifier('?')           -- FALSE
    t_identifier("abc")         -- TRUE (every element is alphabetic or a digit)
    t_identifier("ab3")         -- TRUE
    t_identifier("ab_3")        -- TRUE (underscore is allowed)
    t_identifier("1abc")        -- FALSE (identifier cannot start with a number)
    t_identifier("102")         -- FALSE (identifier cannot be all numeric)
    t_identifier({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_identifier({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_identifier({})            -- FALSE (empty sequence)

#### 8.11.3.5 t_alpha

    include std/types.e
    namespace types
    public type t_alpha(object test_data)

tests for alphabetic characters.

##### Returns:

Returns TRUE if argument is an alphabetic character or if every element of the argument is an alphabetic character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-alphabetic elements

##### Example 1:

    t_alpha(-1)            -- FALSE
    t_alpha(0)             -- FALSE
    t_alpha(1)             -- FALSE
    t_alpha(1.234)         -- FALSE
    t_alpha('A')           -- TRUE
    t_alpha('9')           -- FALSE
    t_alpha('?')           -- FALSE
    t_alpha("abc")         -- TRUE (every element is alphabetic)
    t_alpha("ab3")         -- FALSE
    t_alpha({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_alpha({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_alpha({})            -- FALSE (empty sequence)

#### 8.11.3.6 t_ascii

    include std/types.e
    namespace types
    public type t_ascii(object test_data)

tests for ASCII characters.

##### Returns:

Returns TRUE if argument is an ASCII character or if every element of the argument is an ASCII character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-ASCII elements

##### Example 1:

    t_ascii(-1)            -- FALSE
    t_ascii(0)             -- TRUE
    t_ascii(1)             -- TRUE
    t_ascii(1.234)         -- FALSE
    t_ascii('A')           -- TRUE
    t_ascii('9')           -- TRUE
    t_ascii('?')           -- TRUE
    t_ascii("abc")         -- TRUE (every element is ascii)
    t_ascii("ab3")         -- TRUE
    t_ascii({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_ascii({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_ascii({})            -- FALSE (empty sequence)

#### 8.11.3.7 t_cntrl

    include std/types.e
    namespace types
    public type t_cntrl(object test_data)

tests for control characters.

##### Returns:

Returns TRUE if argument is an Control character or if every element of the argument is an Control character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-Control elements

##### Example 1:

    t_cntrl(-1)            -- FALSE
    t_cntrl(0)             -- TRUE
    t_cntrl(1)             -- TRUE
    t_cntrl(1.234)         -- FALSE
    t_cntrl('A')           -- FALSE
    t_cntrl('9')           -- FALSE
    t_cntrl('?')           -- FALSE
    t_cntrl("abc")         -- FALSE (every element is ascii)
    t_cntrl("ab3")         -- FALSE
    t_cntrl({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_cntrl({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_cntrl({1, 2, 'a'})    -- FALSE (contains a non-control)
    t_cntrl({})            -- FALSE (empty sequence)

#### 8.11.3.8 t_digit

    include std/types.e
    namespace types
    public type t_digit(object test_data)

tests for digits.

##### Returns:

Returns TRUE if argument is an digit character or if every element of the argument is an digit character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-digits

##### Example 1:

    t_digit(-1)            -- FALSE
    t_digit(0)             -- FALSE
    t_digit(1)             -- FALSE
    t_digit(1.234)         -- FALSE
    t_digit('A')           -- FALSE
    t_digit('9')           -- TRUE
    t_digit('?')           -- FALSE
    t_digit("abc")         -- FALSE
    t_digit("ab3")         -- FALSE
    t_digit("123")         -- TRUE
    t_digit({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_digit({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_digit({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_digit({})            -- FALSE (empty sequence)

#### 8.11.3.9 t_graph

    include std/types.e
    namespace types
    public type t_graph(object test_data)

test for glyphs (printable) characters.

##### Returns:

Returns TRUE if argument is a glyph character or if every element of the argument is a glyph character. (One that is visible when displayed)

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-glyph

##### Example 1:

    t_graph(-1)            -- FALSE
    t_graph(0)             -- FALSE
    t_graph(1)             -- FALSE
    t_graph(1.234)         -- FALSE
    t_graph('A')           -- TRUE
    t_graph('9')           -- TRUE
    t_graph('?')           -- TRUE
    t_graph(' ')           -- FALSE
    t_graph("abc")         -- TRUE
    t_graph("ab3")         -- TRUE
    t_graph("123")         -- TRUE
    t_graph({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_graph({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_graph({1, 2, 'a'})    -- FALSE (control chars (1,2) don't have glyphs)
    t_graph({})            -- FALSE (empty sequence)

#### 8.11.3.10 t_specword

    include std/types.e
    namespace types
    public type t_specword(object test_data)

tests for a special word character.

##### Returns:

Returns TRUE if argument is a special word character or if every element of the argument is a special word character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-special-word characters.

##### Comments:

A special word character is any character that is not normally part of a word but in certain cases may be considered. This is most commonly used when looking for words in programming source code which allows an underscore as a word character.

##### Example 1:

    t_specword(-1)            -- FALSE
    t_specword(0)             -- FALSE
    t_specword(1)             -- FALSE
    t_specword(1.234)         -- FALSE
    t_specword('A')           -- FALSE
    t_specword('9')           -- FALSE
    t_specword('?')           -- FALSE
    t_specword('_')           -- TRUE
    t_specword("abc")         -- FALSE
    t_specword("ab3")         -- FALSE
    t_specword("123")         -- FALSE
    t_specword({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_specword({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_specword({1, 2, 'a'})    -- FALSE (control chars (1,2) don't have glyphs)
    t_specword({})            -- FALSE (empty sequence)

#### 8.11.3.11 t_bytearray

    include std/types.e
    namespace types
    public type t_bytearray(object test_data)

tests for bytes.

##### Returns:

Returns TRUE if argument is a byte or if every element of the argument is a byte. (Integers from 0 to 255)

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-byte

##### Example 1:

    t_bytearray(-1)            -- FALSE (contains value less than zero)
    t_bytearray(0)             -- TRUE
    t_bytearray(1)             -- TRUE
    t_bytearray(10)            -- TRUE
    t_bytearray(100)           -- TRUE
    t_bytearray(1000)          -- FALSE (greater than 255)
    t_bytearray(1.234)         -- FALSE (contains a floating number)
    t_bytearray('A')           -- TRUE
    t_bytearray('9')           -- TRUE
    t_bytearray('?')           -- TRUE
    t_bytearray(' ')           -- TRUE
    t_bytearray("abc")         -- TRUE
    t_bytearray("ab3")         -- TRUE
    t_bytearray("123")         -- TRUE
    t_bytearray({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_bytearray({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_bytearray({1, 2, 'a'})    -- TRUE
    t_bytearray({})            -- FALSE (empty sequence)

#### 8.11.3.12 t_lower

    include std/types.e
    namespace types
    public type t_lower(object test_data)

tests for lowercase characters.

##### Returns:

Returns TRUE if argument is a lowercase character or if every element of the argument is an lowercase character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-lowercase

##### Example 1:

    t_lower(-1)            -- FALSE
    t_lower(0)             -- FALSE
    t_lower(1)             -- FALSE
    t_lower(1.234)         -- FALSE
    t_lower('A')           -- FALSE
    t_lower('9')           -- FALSE
    t_lower('?')           -- FALSE
    t_lower("abc")         -- TRUE
    t_lower("ab3")         -- FALSE
    t_lower("123")         -- TRUE
    t_lower({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_lower({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_lower({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_lower({})            -- FALSE (empty sequence)

#### 8.11.3.13 t_print

    include std/types.e
    namespace types
    public type t_print(object test_data)

tests for ASCII glyph characters.

##### Returns:

Returns TRUE if argument is a character that has an ASCII glyph or if every element of the argument is a character that has an ASCII glyph.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains characters that do not have an ASCII glyph.

##### Example 1:

    t_print(-1)            -- FALSE
    t_print(0)             -- FALSE
    t_print(1)             -- FALSE
    t_print(1.234)         -- FALSE
    t_print('A')           -- TRUE
    t_print('9')           -- TRUE
    t_print('?')           -- TRUE
    t_print("abc")         -- TRUE
    t_print("ab3")         -- TRUE
    t_print("123")         -- TRUE
    t_print("123 ")        -- FALSE (contains a space)
    t_print("123\n")       -- FALSE (contains a new-line)
    t_print({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_print({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_print({1, 2, 'a'})    -- FALSE
    t_print({})            -- FALSE (empty sequence)

#### 8.11.3.14 t_display

    include std/types.e
    namespace types
    public type t_display(object test_data)

tests for printable characters.

##### Returns:

Returns TRUE if argument is a character that can be displayed or if every element of the argument is a character that can be displayed.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains characters that cannot be displayed.

##### Example 1:

    t_display(-1)            -- FALSE
    t_display(0)             -- FALSE
    t_display(1)             -- FALSE
    t_display(1.234)         -- FALSE
    t_display('A')           -- TRUE
    t_display('9')           -- TRUE
    t_display('?')           -- TRUE
    t_display("abc")         -- TRUE
    t_display("ab3")         -- TRUE
    t_display("123")         -- TRUE
    t_display("123 ")        -- TRUE
    t_display("123\n")       -- TRUE
    t_display({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_display({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_display({1, 2, 'a'})    -- FALSE
    t_display({})            -- FALSE (empty sequence)

#### 8.11.3.15 t_punct

    include std/types.e
    namespace types
    public type t_punct(object test_data)

tests for punctuation characters.

##### Returns:

Returns TRUE if argument is an punctuation character or if every element of the argument is an punctuation character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-punctuation symbols.

##### Example 1:

    t_punct(-1)            -- FALSE
    t_punct(0)             -- FALSE
    t_punct(1)             -- FALSE
    t_punct(1.234)         -- FALSE
    t_punct('A')           -- FALSE
    t_punct('9')           -- FALSE
    t_punct('?')           -- TRUE
    t_punct("abc")         -- FALSE
    t_punct("(-)")         -- TRUE
    t_punct("123")         -- TRUE
    t_punct({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_punct({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_punct({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_punct({})            -- FALSE (empty sequence)

#### 8.11.3.16 t_space

    include std/types.e
    namespace types
    public type t_space(object test_data)

tests for whitespace characters.

##### Returns:

Returns TRUE if argument is a whitespace character or if every element of the argument is an whitespace character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-whitespace character.

##### Example 1:

    t_space(-1)            -- FALSE
    t_space(0)             -- FALSE
    t_space(1)             -- FALSE
    t_space(1.234)         -- FALSE
    t_space('A')           -- FALSE
    t_space('9')           -- FALSE
    t_space('\t')          -- TRUE
    t_space("abc")         -- FALSE
    t_space("123")         -- FALSE
    t_space({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_space({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_space({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_space({})            -- FALSE (empty sequence)

#### 8.11.3.17 t_upper

    include std/types.e
    namespace types
    public type t_upper(object test_data)

tests for uppercase characters.

##### Returns:

Returns TRUE if argument is an uppercase character or if every element of the argument is an uppercase character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-uppercase characters.

##### Example 1:

    t_upper(-1)            -- FALSE
    t_upper(0)             -- FALSE
    t_upper(1)             -- FALSE
    t_upper(1.234)         -- FALSE
    t_upper('A')           -- TRUE
    t_upper('9')           -- FALSE
    t_upper('?')           -- FALSE
    t_upper("abc")         -- FALSE
    t_upper("ABC")         -- TRUE
    t_upper("123")         -- FALSE
    t_upper({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_upper({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_upper({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_upper({})            -- FALSE (empty sequence)

#### 8.11.3.18 t_xdigit

    include std/types.e
    namespace types
    public type t_xdigit(object test_data)

tests for hexadecimal characters.

##### Returns:

Returns TRUE if argument is an hexadecimal digit character or if every element of the argument is an hexadecimal digit character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-hexadecimal character.

##### Example 1:

    t_xdigit(-1)            -- FALSE
    t_xdigit(0)             -- FALSE
    t_xdigit(1)             -- FALSE
    t_xdigit(1.234)         -- FALSE
    t_xdigit('A')           -- TRUE
    t_xdigit('9')           -- TRUE
    t_xdigit('?')           -- FALSE
    t_xdigit("abc")         -- TRUE
    t_xdigit("fgh")         -- FALSE
    t_xdigit("123")         -- TRUE
    t_xdigit({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_xdigit({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_xdigit({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_xdigit({})            -- FALSE (empty sequence)

#### 8.11.3.19 t_vowel

    include std/types.e
    namespace types
    public type t_vowel(object test_data)

tests for vowel characters.

##### Returns:

Returns TRUE if argument is a vowel or if every element of the argument is a vowel character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-vowels

##### Example 1:

    t_vowel(-1)            -- FALSE
    t_vowel(0)             -- FALSE
    t_vowel(1)             -- FALSE
    t_vowel(1.234)         -- FALSE
    t_vowel('A')           -- TRUE
    t_vowel('9')           -- FALSE
    t_vowel('?')           -- FALSE
    t_vowel("abc")         -- FALSE
    t_vowel("aiu")         -- TRUE
    t_vowel("123")         -- FALSE
    t_vowel({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_vowel({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_vowel({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_vowel({})            -- FALSE (empty sequence)

#### 8.11.3.20 t_consonant

    include std/types.e
    namespace types
    public type t_consonant(object test_data)

tests for consonant characters.

##### Returns:

Returns TRUE if argument is a consonant character or if every element of the argument is an consonant character.

Returns FALSE if the argument is an empty sequence, or contains sequences, or contains non-consonant character.

##### Example 1:

    t_consonant(-1)            -- FALSE
    t_consonant(0)             -- FALSE
    t_consonant(1)             -- FALSE
    t_consonant(1.234)         -- FALSE
    t_consonant('A')           -- FALSE
    t_consonant('9')           -- FALSE
    t_consonant('?')           -- FALSE
    t_consonant("abc")         -- FALSE
    t_consonant("rTfM")        -- TRUE
    t_consonant("123")         -- FALSE
    t_consonant({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_consonant({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_consonant({1, 2, 'a'})    -- FALSE (contains a non-digit)
    t_consonant({})            -- FALSE (empty sequence)

#### 8.11.3.21 integer_array

    include std/types.e
    namespace types
    public type integer_array(object x)

tests for integer elements.

##### Returns:

TRUE if argument is a sequence that only contains zero or more integers.

##### Example 1:

    integer_array(-1)            -- FALSE (not a sequence)
    integer_array("abc")         -- TRUE (all single characters)
    integer_array({1, 2, "abc"}) -- FALSE (contains a sequence)
    integer_array({1, 2, 9.7})    -- FALSE (contains a non-integer)
    integer_array({1, 2, 'a'})    -- TRUE
    integer_array({})            -- TRUE

#### 8.11.3.22 t_text

    include std/types.e
    namespace types
    public type t_text(object x)

tests for text characters.

##### Returns:

TRUE if argument is a sequence that only contains zero or more characters.

##### Comments:

A character is defined as a positive integer or zero. This is a broad definition that may be refined once proper UNICODE support is implemented.

##### Example 1:

    t_text(-1)            -- FALSE (not a sequence)
    t_text("abc")         -- TRUE (all single characters)
    t_text({1, 2, "abc"}) -- FALSE (contains a sequence)
    t_text({1, 2, 9.7})    -- FALSE (contains a non-integer)
    t_text({1, 2, 'a'})    -- TRUE
    t_text({1, -2, 'a'})   -- FALSE (contains a negative integer)
    t_text({})            -- TRUE

#### 8.11.3.23 number_array

    include std/types.e
    namespace types
    public type number_array(object x)

tests for atom elements.

##### Returns:

TRUE if argument is a sequence that only contains zero or more numbers.

##### Example 1:

    number_array(-1)            -- FALSE (not a sequence)
    number_array("abc")         -- TRUE (all single characters)
    number_array({1, 2, "abc"}) -- FALSE (contains a sequence)
    number_array(1, 2, 9.7})    -- TRUE
    number_array(1, 2, 'a'})    -- TRUE
    number_array({})            -- TRUE

#### 8.11.3.24 sequence_array

    include std/types.e
    namespace types
    public type sequence_array(object x)

tests for sequence with possible nested sequences.

##### Returns:

TRUE if argument is a sequence that only contains zero or more sequences.

##### Example 1:

    sequence_array(-1)            -- FALSE (not a sequence)
    sequence_array("abc")         -- FALSE (all single characters)
    sequence_array({1, 2, "abc"}) -- FALSE (contains some atoms)
    sequence_array({1, 2, 9.7})   -- FALSE
    sequence_array({1, 2, 'a'})   -- FALSE
    sequence_array({"abc", {3.4, 99182.78737}}) -- TRUE
    sequence_array({})            -- TRUE

#### 8.11.3.25 ascii_string

    include std/types.e
    namespace types
    public type ascii_string(object x)

tests for ASCII elements.

##### Returns:

TRUE if argument is a sequence that only contains zero or more ASCII characters.

##### Comments:

An ASCII 'character' is defined as a integer in the range [0 to 127].

##### Example 1:

    ascii_string(-1)            -- FALSE (not a sequence)
    ascii_string("abc")         -- TRUE (all single ASCII characters)
    ascii_string({1, 2, "abc"}) -- FALSE (contains a sequence)
    ascii_string({1, 2, 9.7})    -- FALSE (contains a non-integer)
    ascii_string({1, 2, 'a'})    -- TRUE
    ascii_string({1, -2, 'a'})   -- FALSE (contains a negative integer)
    ascii_string({})            -- TRUE

#### 8.11.3.26 string

    include std/types.e
    namespace types
    public type string(object x)

tests for a string sequence.

##### Returns:

TRUE if argument is a sequence that only contains zero or more byte characters.

##### Comments:

A byte 'character' is defined as a integer in the range [0 to 255].

##### Example 1:

    string(-1)            -- FALSE (not a sequence)
    string("abc'6")       -- TRUE (all single byte characters)
    string({1, 2, "abc'6"}) -- FALSE (contains a sequence)
    string({1, 2, 9.7})    -- FALSE (contains a non-integer)
    string({1, 2, 'a'})    -- TRUE
    string({1, 2, 'a', 0}) -- TRUE (even though it contains a null byte)
    string({1, -2, 'a'})   -- FALSE (contains a negative integer)
    string({})            -- TRUE

#### 8.11.3.27 cstring

    include std/types.e
    namespace types
    public type cstring(object x)

tests for a string sequence (that has no null character).

##### Returns:

TRUE if argument is a sequence that only contains zero or more non-null byte characters.

##### Comments:

A non-null byte 'character' is defined as a integer in the range [1 to 255].

##### Example 1:

    cstring(-1)            -- FALSE (not a sequence)
    cstring("abc'6")       -- TRUE (all single byte characters)
    cstring({1, 2, "abc'6"}) -- FALSE (contains a sequence)
    cstring({1, 2, 9.7})    -- FALSE (contains a non-integer)
    cstring({1, 2, 'a'})    -- TRUE
    cstring({1, 2, 'a', 0}) -- FALSE (contains a null byte)
    cstring({1, -2, 'a'})   -- FALSE (contains a negative integer)
    cstring({})            -- TRUE

#### 8.11.3.28 INVALID_ROUTINE_ID

    include std/types.e
    namespace types
    public constant INVALID_ROUTINE_ID

Value returned from routine_id when the routine does not exist or is out of scope. This is typically seen as -1 in legacy code.

#### 8.11.3.29 NO_ROUTINE_ID

    include std/types.e
    namespace types
    public constant NO_ROUTINE_ID

To be used as a flag for no routine_id supplied.

#### 8.11.3.30 t_integer32

    include std/types.e
    namespace types
    public type t_integer32(object o)

tests for Euphoria integer.

##### Returns:

TRUE if the argument is a valid 31-bit Euphoria integer.

##### Comments:

This function is the same as `integer(o)` on 32-bit Euphoria, but is portable to 64-bit architectures.

| Up |  |  | TOC | Index
<< 7 Included Tools | < 8.10 Multi-Tasking | Up: 8 API Reference | 8.12 Utilities > | 9 Release Notes >>