Other Special Characters
Functional modifiers — variable, schema, optional, nullable, and sign characters.
Special characters work alongside structural characters and literals to add functionality or context to an Internet Object document. Each has a specific semantic meaning and modifies the behavior of schemas, values, or parsing.
Special character set
@
At sign
U+0040
Variable
Prefixed to a name, declares or references a variable
$
Dollar sign
U+0024
Schema
Prefixed to a name, declares or references a schema
?
Question mark
U+003F
Schema
Suffixed to a bare member name, marks the member optional
*
Asterisk
U+002A
Schema
Suffixed to a bare member name, marks the member nullable; bare on its own, makes a schema accept undeclared members. Quoted ("*") it is an ordinary name, in a schema or in data
-
Hyphen / minus
U+002D
Numeric
Marks a negative value
+
Plus
U+002B
Numeric
Marks a positive value
Usage examples
Variable references and schema definitions
# Variable declarations
~ @r: red
~ @g: green
~ @b: blue
# A schema using variables in an inline constraint
~ $schema: {
name: string,
email: email,
joiningDt: date,
color: {string, choices: [@r, @g, @b]}
}
---
# Data using variable references
~ John Doe, '[email protected]', d'2020-01-01', @rSchema modifiers
Numeric signs
Character rules
Context sensitive — a character's meaning depends on its position and context.
Variable prefix —
@prefixes variable declarations and references.Schema prefix —
$prefixes schema definitions and references.Schema suffixes —
?and*are suffixed to bare member names in a schema; a quoted name uses the keyedoptional:and"null":options instead.Bare versus quoted — a special character is only special when written bare.
"*"is a member name, not the wildcard;"a?"is a name ending in?, not an optionala.Numeric prefixes —
+and-prefix numeric values to indicate sign.Case sensitive — all special characters are case-sensitive.
Reserved usage — these characters are reserved for their specific functions.
See Also
Definitions — variables and schema references
Numeric Values — numeric formatting and signs
Structural Elements — overview of all structural characters
Last updated
Was this helpful?
