Set-word! datatype

1. Abstract

A set-word! sets a reference to a value.

If used outside of an object! or map! value, a set-word will set a reference in the current context to the value of the expression that follows the set-word.

foo: 2 * 21

Set-word! is a member of the following typesets: any-word!, all-word!, immediate!

2. Creation

Set-word! values can be created using literal syntax, or at runtime using a to conversion from the datatypes: char!, logic!, string!, datatype!, issue!, refinement!, and lit-word!.

>> to set-word! #"X"
== X:

>> to set-word! true
== true:

>> to set-word! "Hello"
== Hello:

>> to set-word! float!
== float!:

>> to set-word! #A42
== A42:

>> to set-word! /only
== only:

>> to set-word! 'foo
== foo:

3. Literal syntax

One or more characters from the entire Unicode range, including punctuation characters from the ASCII subset: ! & ' * + - . < = > ? _ | ~`, followed by a colon :.

Illegal characters are control characters, whitespace characters, and punctuation characters from the ASCII subset: / \ ^ , [ ] ( ) { } " # $ % @ : ;

A set-word! value cannot begin with a number.

4. Testing values

Use set-word? to check if a value is of the set-word! datatype.

>> set-word? first [foo: 'bar baz]
== true

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

>> type? first [foo: 'bar baz]
== set-word!

5. Pre-defined words

5.1. Functions

to-set-word

results matching ""

    No results matching ""