-USING: arrays assocs classes.algebra.private classes.tuple combinators
-command-line effects generic generic.math generic.single help.markup
-help.syntax io.pathnames kernel math parser sequences vocabs.loader
-vocabs.parser words words.alias words.constant words.symbol ;
+USING: arrays assocs classes.algebra.private classes.maybe
+classes.tuple combinators command-line effects generic
+generic.math generic.single help.markup help.syntax io.pathnames
+kernel math parser sequences vocabs.loader vocabs.parser words
+words.alias words.constant words.symbol ;
IN: syntax
ARTICLE: "parser-algorithm" "Parser algorithm"
ARTICLE: "syntax-hashtables" "Hashtable syntax"
{ $subsections POSTPONE: H{ }
-"Hashtables are documented in " { $link "hashtables" } "." ;
+{ $subsections POSTPONE: IH{ }
+"Hashtables are documented in " { $link "hashtables" } " and " { $vocab-link "hashtables.identity" } "." ;
ARTICLE: "syntax-hash-sets" "Hash set syntax"
{ $subsections POSTPONE: HS{ }
-"Hashtables are documented in " { $link "hash-sets" } "." ;
+"Hash sets are documented in " { $link "hash-sets" } " and " { $vocab-link "hash-sets.identity" } "." ;
ARTICLE: "syntax-tuples" "Tuple syntax"
{ $subsections POSTPONE: T{ }
{ $values { "elements" "a list of classoids" } }
{ $description "Marks the beginning of a literal " { $link anonymous-intersection } " class." } ;
+HELP: maybe{
+{ $syntax "maybe{ elements... }" }
+{ $values { "elements" "a list of classoids" } }
+{ $description "Marks the beginning of a literal " { $link maybe } " class." } ;
+
+HELP: not{
+{ $syntax "not{ elements... }" }
+{ $values { "elements" "a list of classoids" } }
+{ $description "Marks the beginning of a literal " { $link anonymous-complement } " class." } ;
+
+HELP: union{
+{ $syntax "union{ elements... }" }
+{ $values { "elements" "a list of classoids" } }
+{ $description "Marks the beginning of a literal " { $link anonymous-union } " class." } ;
+
+{ POSTPONE: intersection{ POSTPONE: union{ POSTPONE: not{ POSTPONE: maybe{ } related-words
+
HELP: H{
{ $syntax "H{ { key value }... }" }
{ $values { "key" object } { "value" object } }
{ $description "Marks the beginning of a literal hash set, given as a list of its members. Literal hashtables are terminated by " { $link POSTPONE: } } "." }
{ $examples { $code "HS{ 3 \"foo\" }" } } ;
+HELP: IH{
+{ $syntax "IH{ { key value }... }" }
+{ $values { "key" object } { "value" object } }
+{ $description "Marks the beginning of a literal identity hashtable, given as a list of two-element arrays holding key/value pairs. Literal identity hashtables are terminated by " { $link POSTPONE: } } "." }
+{ $examples { $code "IH{ { \"tuna\" \"fish\" } { \"jalapeno\" \"vegetable\" } }" } } ;
+
HELP: C{
{ $syntax "C{ real-part imaginary-part }" }
{ $values { "real-part" "a real number" } { "imaginary-part" "a real number" } }
} ;
{ POSTPONE: call( POSTPONE: execute( } related-words
+
+HELP: BUILTIN:
+{ $syntax "BUILTIN: class slots ... ;" }
+{ $values { "class" "a builtin class" } { "definition" "a word definition" } }
+{ $description "A representation of a builtin class from the VM. This word cannot define new builtins but is meant to provide a paper trail to which vocabularies define the builtins. To define new builtins requires adding them to the VM." } ;
+
+HELP: PRIMITIVE:
+{ $syntax "PRIMITIVE: word ( stack -- effect )" }
+{ $description "A reference to a primitive word of from the VM. This word cannot define new primitives but is meant to provide a paper trail to which vocabularies define the primitives. To define new primitves requires adding them to the VM." } ;
+
+HELP: MEMO:
+{ $syntax "MEMO: word ( stack -- effect ) definition... ;" }
+{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
+{ $description "Defines the given word at parse time as one which memoizes its output given a particular input. The stack effect is mandatory." } ;
+
+HELP: IDENTITY-MEMO:
+{ $syntax "IDENTITY-MEMO: word ( stack -- effect ) definition... ;" }
+{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
+{ $description "Defines the given word at parse time as one which memoizes its output given a particular input which is identical to another input. The stack effect is mandatory." } ;
+
+HELP: IDENTITY-MEMO::
+{ $syntax "IDENTITY-MEMO:: word ( stack -- effect ) definition... ;" }
+{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
+{ $description "Defines the given word at parse time as one which memoizes its output given a particular input with locals which is identical to another input. The stack effect is mandatory." } ;