Tag! datatype

1. Abstract

Tag! values represent markup language tags and elements.

Tag! is a member of the following typesets: any-string!, series!

2. Creation

Tag! values can be created using literal syntax, or at runtime by using a make constructor or to conversion.

>> make tag! "foo"
== <foo>
>> to tag! 'bar
== <bar>

3. Literal syntax

One or more characters enclosed by a open angle bracket < and closing angle bracket >.

The first position after the opening angle bracket cannot contain <, >, =, or literal whitespace.

>> <<foo>
*** Script Error: < operator is missing an argument
*** Where: catch
*** Stack:

>> <>foo>
*** Script Error: <> operator is missing an argument
*** Where: catch
*** Stack:

>> <=foo>
*** Syntax Error: invalid value at "<=foo>"
*** Where: do
*** Stack: load

>> < foo>
*** Script Error: < operator is missing an argument
*** Where: catch
*** Stack:

< is allowed after the first position.

>> type? <f<oo>
== tag!
Note
It is possible to create tag! values using make that are not affected by current lexer limitations.
>> make tag! " foo"
== < foo>

>> make tag! "<foo"
== <<foo>

>> make tag! ">foo"
== <>foo>

>> make tag! "=foo"
== <=foo>

>> make tag! " foo"
== < foo>

4. Comparisons

All comparators can be applied on tag!: =, ==, <>, >, <, >=, <=, =?. In addition, min, and max are also supported.

5. Testing values

Use tag? to check if a value is of the tag! datatype.

>> tag? <foo>
== true

Use type? to return the datatype of a given value.

>> type? <foo>
== tag!

6. Predefined words

6.1. Functions

tag?, to-tag

results matching ""

    No results matching ""