]> gitweb.factorcode.org Git - factor.git/blob - basis/bootstrap/image/primitives/primitives-docs.factor
ce435ac5a73a529d0e5fd3bfb36cd698a254a00b
[factor.git] / basis / bootstrap / image / primitives / primitives-docs.factor
1 USING: assocs help.markup help.syntax quotations strings words ;
2 IN: bootstrap.image.primitives
3
4 HELP: all-primitives
5 { $description "A constant " { $link assoc } " containing all primitives. Keys are vocab names and values are sequences of tuples declaring words. The format of the tuples are { name effect vm-func inputs outputs extra-props }:"
6   { $list
7     { "name: Name of the primitive." }
8     { "effect: The primitives stack effect." }
9     { "vm-func: If it is a " { $link string } " then the primitive will call a function implemented in C++ code. If 'vm-func' is " { $link f } " then it is a sub-primitive and implemented in one of the files in 'basis/bootstrap/assembler/'." }
10     { "inputs: The primitives \"input-classes\", if any." }
11     { "outputs: The primitives \"output-classes\", if any." }
12     { "extra-word: An " { $link word } " that is run with the created word as argument to add extra properties to it. Usually, it would be " { $link make-foldable } " or " { $link make-flushable } " to make the word foldable or flushable respectively." }
13   }
14 }
15 "See " { $link "word-props" } " for documentation of what all word properties do." ;
16
17 HELP: primitive-quot
18 { $values { "word" word } { "vm-func" $maybe { string } } { "quot" quotation } }
19 { $description "Creates the defining quotation for the primitive. If 'vm-func' is a string, then it is prefixed with 'primitive_' and a quotation calling that C++ function is generated." } ;
20
21 ARTICLE: "bootstrap.image.primitives" "Bootstrap primitives"
22 "This vocab contains utilities for declaring primitives to be added to the bootstrap image. It is used by the file " { $snippet "resource:core/bootstrap/primitives.factor" }
23 $nl
24 { $link all-primitives } " is an assoc where all primitives are declared. See that constant for a description of the format." ;
25
26 ABOUT: "bootstrap.image.primitives"