factor: fix docs.
vocab-roots get [ vocabs-from ] map concat [ modern-docs-path ] map [ exists? ] filter [ dup <pathname> . flush path>literals ] map-ziplocals-and-roots
parent
f533d04304
commit
19796a26bb
|
@ -33,7 +33,7 @@ $nl
|
|||
|
||||
about: "bit-arrays"
|
||||
|
||||
HELP: ?{
|
||||
HELP: \ ?{
|
||||
{ $syntax "?{ elements... }" }
|
||||
{ $values { "elements" "a list of booleans" } }
|
||||
{ $description "Marks the beginning of a literal bit array. Literal bit arrays are terminated by " { $link postpone\ } } "." }
|
||||
|
|
|
@ -32,7 +32,7 @@ HELP: >bit-vector
|
|||
{ $values { "seq" sequence } { "vector" bit-vector } }
|
||||
{ $description "Outputs a freshly-allocated bit vector with the same elements as a given sequence." } ;
|
||||
|
||||
HELP: ?V{
|
||||
HELP: \ ?V{
|
||||
{ $syntax "?V{ elements... }" }
|
||||
{ $values { "elements" "a list of booleans" } }
|
||||
{ $description "Marks the beginning of a literal bit vector. Literal bit vectors are terminated by " { $link postpone\ } } "." }
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
in: byte-arrays.hex
|
||||
USING: byte-arrays help.markup help.syntax ;
|
||||
|
||||
HELP: HEX{
|
||||
HELP: \ HEX{
|
||||
{ $syntax "HEX{ 0123 45 67 89abcdef }" }
|
||||
{ $description "Constructs a " { $link byte-array } " from data specified in hexadecimal format. Whitespace between the curly braces is ignored. There must be an even number of hex digits or an error is thrown." } ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.markup help.syntax kernel math sequences ;
|
||||
in: persistent.vectors
|
||||
|
||||
HELP: PV{
|
||||
HELP: \ PV{
|
||||
{ $syntax "PV{ elements... }" }
|
||||
{ $description "Parses a literal " { $link persistent-vector } "." } ;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
USING: help.markup help.syntax byte-arrays alien math sequences ;
|
||||
in: specialized-arrays
|
||||
|
||||
HELP: specialized-array:
|
||||
HELP: \ specialized-array:
|
||||
{ $syntax "specialized-array: type" }
|
||||
{ $values { "type" "a C type" } }
|
||||
{ $description "Brings a specialized array for holding values of " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-array-words" } "." } ;
|
||||
|
||||
HELP: SPECIALIZED-ARRAYS:
|
||||
HELP: \ SPECIALIZED-ARRAYS:
|
||||
{ $syntax "SPECIALIZED-ARRAYS: type type type ... ;" }
|
||||
{ $values { "type" "a C type" } }
|
||||
{ $description "Brings a set of specialized arrays for holding values of each " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-array-words" } "." } ;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
USING: help.markup help.syntax byte-vectors alien byte-arrays classes.struct ;
|
||||
in: specialized-vectors
|
||||
|
||||
HELP: specialized-vector:
|
||||
HELP: \ specialized-vector:
|
||||
{ $syntax "specialized-vector: type" }
|
||||
{ $values { "type" "a C type" } }
|
||||
{ $description "Brings a specialized vector for holding values of " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-vector-words" } "." } ;
|
||||
|
||||
HELP: SPECIALIZED-VECTORS:
|
||||
HELP: \ SPECIALIZED-VECTORS:
|
||||
{ $syntax "SPECIALIZED-VECTORS: type type type ... ;" }
|
||||
{ $values { "type" "a C type" } }
|
||||
{ $description "Brings a set of specialized vectors for holding values of each " { $snippet "type" } " into the vocabulary search path. The generated words are documented in " { $link "specialized-vector-words" } "." } ;
|
||||
|
||||
{ postpone\ specialized-vector: postpone\ SPECIALIZED-VECTORS: } related-words
|
||||
{ \ specialized-vector: \ SPECIALIZED-VECTORS: } related-words
|
||||
|
||||
ARTICLE: "specialized-vector-words" "Specialized vector words"
|
||||
"The " { $link postpone\ specialized-vector: } " parsing word generates the specialized vector type if it hasn't been generated already, and adds the following words to the vocabulary search path, where " { $snippet "T" } " is the C type in question:"
|
||||
|
|
|
@ -10,7 +10,7 @@ HELP: >suffix-array
|
|||
{ "array" array } }
|
||||
{ $description "Creates a suffix array from the input sequence. Suffix arrays are arrays of slices." } ;
|
||||
|
||||
HELP: SA{
|
||||
HELP: \ SA{
|
||||
{ $description "Creates a new literal suffix array at parse-time." } ;
|
||||
|
||||
HELP: suffixes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.syntax help.markup assocs ;
|
||||
in: trees.avl
|
||||
|
||||
HELP: AVL{
|
||||
HELP: \ AVL{
|
||||
{ $syntax "AVL{ { key value }... }" }
|
||||
{ $values { "key" "a key" } { "value" "a value" } }
|
||||
{ $description "Literal syntax for an AVL tree." } ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.syntax help.markup assocs ;
|
||||
in: trees.splay
|
||||
|
||||
HELP: SPLAY{
|
||||
HELP: \ SPLAY{
|
||||
{ $syntax "SPLAY{ { key value }... }" }
|
||||
{ $values { "key" "a key" } { "value" "a value" } }
|
||||
{ $description "Literal syntax for an splay tree." } ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.syntax help.markup assocs ;
|
||||
in: trees
|
||||
|
||||
HELP: TREE{
|
||||
HELP: \ TREE{
|
||||
{ $syntax "TREE{ { key value }... }" }
|
||||
{ $values { "key" "a key" } { "value" "a value" } }
|
||||
{ $description "Literal syntax for an unbalanced tree." } ;
|
||||
|
@ -23,7 +23,7 @@ ARTICLE: "trees" "Binary search trees"
|
|||
tree
|
||||
<tree>
|
||||
>tree
|
||||
postpone\ TREE{
|
||||
\ TREE{
|
||||
} ;
|
||||
|
||||
about: "trees"
|
||||
|
|
|
@ -28,7 +28,7 @@ ARTICLE: "tuple-declarations" "Tuple slot declarations"
|
|||
{ $list
|
||||
"class declaration: values must satisfy the class predicate"
|
||||
{ "whether a slot is read only or not (" { $link read-only } ")" }
|
||||
{ "an initial value (" { $link initial: } ")" }
|
||||
{ "an initial value (" { $link \ initial: } ")" }
|
||||
}
|
||||
{ $subsections
|
||||
"slot-read-only-declaration"
|
||||
|
|
|
@ -62,7 +62,7 @@ $nl
|
|||
{ $see-also "slots" "mirrors" } ;
|
||||
|
||||
ARTICLE: "slot-initial-values" "Initial values of slots"
|
||||
"An initial value for a slot can be specified with the " { $link initial: } " slot declaration attribute. For certain classes, the initial value is optional; in these cases, it does not need to be specified. For others, it is required. Initial values can be used independently of class declaration, but if specified, the value must satisfy the class predicate."
|
||||
"An initial value for a slot can be specified with the " { $link \ initial: } " slot declaration attribute. For certain classes, the initial value is optional; in these cases, it does not need to be specified. For others, it is required. Initial values can be used independently of class declaration, but if specified, the value must satisfy the class predicate."
|
||||
$nl
|
||||
"The following classes have default initial values:"
|
||||
{ $table
|
||||
|
@ -77,7 +77,7 @@ $nl
|
|||
{ $list
|
||||
{ "If the class is a union or mixin class which " { $emphasis "contains" } " one of the above known classes, then the initial value of the class is that of the known class, with preference given to classes earlier in the list. For example, if the slot is declared " { $link object } " (this is the default), the initial value is " { $link f } ". Similarly for " { $link sequence } " and " { $link assoc } "." }
|
||||
{ "If the class is a tuple class, the initial value of the slot is a new, shared instance of the class created with " { $link new } "." }
|
||||
{ "Otherwise, a " { $link bad-initial-value } " error is thrown. In this case, an initial value must be specified explicitly using " { $link initial: } "." }
|
||||
{ "Otherwise, a " { $link bad-initial-value } " error is thrown. In this case, an initial value must be specified explicitly using " { $link \ initial: } "." }
|
||||
}
|
||||
"A word can be used to check if a class has an initial value or not:"
|
||||
{ $subsections initial-value } ;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
USING: arrays effects help.markup help.syntax locals math quotations words ;
|
||||
in: typed
|
||||
|
||||
HELP: TYPED:
|
||||
HELP: \ TYPED:
|
||||
{ $syntax
|
||||
"TYPED: word ( a b: class ... -- x: class y ... )
|
||||
body ;" }
|
||||
|
@ -20,7 +20,7 @@ TYPED: add-floats ( a: float b: float -- c: float )
|
|||
1 2+1/2 add-floats ."
|
||||
"3.5" } } ;
|
||||
|
||||
HELP: TYPED::
|
||||
HELP: \ TYPED::
|
||||
{ $syntax
|
||||
"TYPED:: word ( a b: class ... -- x: class y ... )
|
||||
body ;" }
|
||||
|
|
|
@ -7,7 +7,7 @@ HELP: run-apple-script
|
|||
{ $description "Runs the provided uncompiled AppleScript code." }
|
||||
{ $notes "Currently, return values are unsupported." } ;
|
||||
|
||||
HELP: APPLESCRIPT:
|
||||
HELP: \ APPLESCRIPT:
|
||||
{ $syntax "APPLESCRIPT: word ...applescript... APPLESCRIPT;" }
|
||||
{ $values { "word" "a new word to define" } { "...applescript..." "AppleScript source text" } }
|
||||
{ $description "Defines a word that when called will run the provided uncompiled AppleScript. The word has stack effect " { $snippet "( -- )" } " due to return values being currently unsupported." } ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.markup help.syntax strings alien hashtables ;
|
||||
in: cocoa.subclassing
|
||||
|
||||
HELP: CLASS:
|
||||
HELP: \ CLASS:
|
||||
{ $syntax "CLASS: name < superclass protocols... imeth... ;" }
|
||||
{ $values { "name" "a new class name" } { "superclass" "a superclass name" } { "protocols" "zero or more protocol names" } { "imeth" "instance method definitions using " { $link postpone\ METHOD: } } }
|
||||
{ $description "Defines a new Objective C class. Instance methods are defined with the " { $link postpone\ METHOD: } " parsing word."
|
||||
|
@ -10,7 +10,7 @@ $nl
|
|||
|
||||
{ define-objc-class postpone\ CLASS: postpone\ METHOD: } related-words
|
||||
|
||||
HELP: METHOD:
|
||||
HELP: \ METHOD:
|
||||
{ $syntax "METHOD: return foo: type1 arg1 bar: type2 arg2 baz: ... [ body ] ;" }
|
||||
{ $values { "return" "a C type name" } { "type1" "a C type name" } { "arg1" "a local variable name" } { "body" "arbitrary code" } }
|
||||
{ $description "Defines a method inside of a " { $link postpone\ CLASS: } " form." } ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
in: python.syntax
|
||||
USING: hashtables python.syntax help.markup help.syntax ;
|
||||
|
||||
HELP: PY-FROM:
|
||||
HELP: \ PY-FROM:
|
||||
{ $syntax "PY-FROM: module => name-effects ;" }
|
||||
{ $values
|
||||
{ "module" "fully qualified name of a python module" }
|
||||
|
@ -16,7 +16,7 @@ HELP: PY-FROM:
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: PY-QUALIFIED-FROM:
|
||||
HELP: \ PY-QUALIFIED-FROM:
|
||||
{ $syntax "PY-QUALIFIED-FROM: module => name-effects ;" }
|
||||
{ $values
|
||||
{ "module" "fully qualified name of a python module" }
|
||||
|
@ -26,7 +26,7 @@ HELP: PY-QUALIFIED-FROM:
|
|||
"Like " { $link \ PY-FROM: } " except all words are created with module as the given prefix."
|
||||
} ;
|
||||
|
||||
HELP: PY-METHODS:
|
||||
HELP: \ PY-METHODS:
|
||||
{ $syntax "PY-METHODS: class => name-effects ;" }
|
||||
{ $values
|
||||
{ "class" "name of a class to associate the bindings with" }
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
USING: help.markup help.syntax io kernel math quotations ;
|
||||
in: windows.com.syntax
|
||||
|
||||
HELP: guid:
|
||||
HELP: \ guid:
|
||||
{ $syntax "guid: \"{01234567-89ab-cdef-0123-456789abcdef}\"" }
|
||||
{ $description "\nCreate a COM globally-unique identifier (GUID) literal at parse time, and push it onto the data stack." } ;
|
||||
|
||||
HELP: COM-INTERFACE:
|
||||
HELP: \ COM-INTERFACE:
|
||||
{ $syntax "COM-INTERFACE: <interface> <parent> <iid>
|
||||
<function-1> ( <params1> )
|
||||
<function-2> ( <params2> )
|
||||
|
|
|
@ -40,7 +40,7 @@ HELP: <multi-index-range>
|
|||
}
|
||||
{ $description "Constructs a " { $link multi-index-range } " tuple." } ;
|
||||
|
||||
HELP: UNIFORM-TUPLE:
|
||||
HELP: \ UNIFORM-TUPLE:
|
||||
{ $syntax "UNIFORM-TUPLE: class-name
|
||||
{ \"slot\" uniform-type dimension }
|
||||
{ \"slot\" uniform-type dimension }
|
||||
|
|
|
@ -29,16 +29,16 @@ HELP: feedback-format:
|
|||
{ $syntax "feedback-format: vertex-format" }
|
||||
{ $description "When used as part of a " { $link postpone\ GLSL-PROGRAM: } " definition, this syntax specifies the " { $link vertex-format } " in which transform feedback output will be generated." } ;
|
||||
|
||||
HELP: GLSL-PROGRAM:
|
||||
HELP: \ GLSL-PROGRAM:
|
||||
{ $syntax "GLSL-PROGRAM: program-name shader shader ... [vertex-format vertex-format ...] [feedback-format: vertex-format] ;" }
|
||||
{ $description "Defines a new " { $link program } " named " { $snippet "program-name" } ". When the program is instantiated with " { $link <program-instance> } ", it will link together instances of all of the specified " { $link shader } "s to create the program instance. If any " { $link vertex-format } "s are specified, their attributes will be pre-assigned attribute indexes at link time, to ensure that their indexes remain constant if the program is refreshed with " { $link refresh-program } ". A transform feedback vertex format may optionally be specified with " { $link postpone\ feedback-format: } "; if the program is used to collect transform feedback, the given vertex format will be used for the output." }
|
||||
{ $notes "Transform feedback requires OpenGL 3.0 or one of the " { $snippet "GL_EXT_transform_feedback" } " or " { $snippet "GL_ARB_transform_feedback" } " extensions." } ;
|
||||
|
||||
HELP: GLSL-SHADER-FILE:
|
||||
HELP: \ GLSL-SHADER-FILE:
|
||||
{ $syntax "GLSL-SHADER-FILE: shader-name shader-kind \"filename\" ;" }
|
||||
{ $description "Defines a new " { $link shader } " of kind " { $link shader-kind } " named " { $snippet "shader-name" } ". The shader will read its source code from " { $snippet "filename" } " in the current Factor source file's directory." } ;
|
||||
|
||||
HELP: GLSL-SHADER:
|
||||
HELP: \ GLSL-SHADER:
|
||||
{ $syntax "GLSL-SHADER: shader-name shader-kind
|
||||
|
||||
shader source
|
||||
|
@ -46,7 +46,7 @@ shader source
|
|||
;" }
|
||||
{ $description "Defines a new " { $link shader } " of kind " { $link shader-kind } " named " { $snippet "shader-name" } ". The shader will read its source code from the current Factor source file between the " { $snippet "GLSL-SHADER:" } " line and the first subsequent line with a single semicolon on it." } ;
|
||||
|
||||
HELP: VERTEX-FORMAT:
|
||||
HELP: \ VERTEX-FORMAT:
|
||||
{ $syntax "VERTEX-FORMAT: format-name
|
||||
{ \"attribute\"/f component-type dimension normalize? }
|
||||
{ \"attribute\"/f component-type dimension normalize? }
|
||||
|
@ -54,7 +54,7 @@ HELP: VERTEX-FORMAT:
|
|||
{ \"attribute\"/f component-type dimension normalize? } ;" }
|
||||
{ $description "Defines a new binary " { $link vertex-format } " for structuring vertex data stored in " { $link buffer } "s. Each " { $snippet "attribute" } " name either corresponds to an input parameter of a vertex shader, or is " { $link f } " to include padding in the vertex format. The " { $link component-type } " determines the format of the components, and the " { $snippet "dimension" } " determines the number of components. If the " { $snippet "component-type" } " is an integer type and " { $snippet "normalize?" } " is true, the component values will be scaled to the range 0.0 to 1.0 when fed to the vertex shader; otherwise, they will be cast to floats retaining their integral values." } ;
|
||||
|
||||
HELP: VERTEX-STRUCT:
|
||||
HELP: \ VERTEX-STRUCT:
|
||||
{ $syntax "VERTEX-STRUCT: struct-name format-name" }
|
||||
{ $description "Defines a struct class (like " { $link postpone\ STRUCT: } ") with the same binary format and component types as the given " { $link vertex-format } "." } ;
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ HELP: textured-background
|
|||
HELP: dialog-window
|
||||
{ $description "Provides a hint to the window manager to create a floating, dialog-style window. Currently, this is only implemented for the GTK backend." } ;
|
||||
|
||||
HELP: WINDOW:
|
||||
HELP: \ WINDOW:
|
||||
{ $syntax "WINDOW: window-word { attributes }
|
||||
attribute-code ;" }
|
||||
{ $description "Defines a word for the current vocabulary named " { $snippet "window-word" } " that opens a UI window when run. The " { $snippet "attributes" } " specify the key-value pairs of the window's " { $link world-attributes } ". The " { $snippet "attribute-code" } " is run with the " { $snippet "world-attributes" } " on the stack; this allows the word to construct gadget objects to place in the " { $snippet "gadget" } " slot or set other runtime-dependent world attributes." }
|
||||
|
@ -357,7 +357,7 @@ WINDOW: hello { { title \"Hi\" } }
|
|||
\"Hello world\" <label> >>gadgets ;"
|
||||
} } ;
|
||||
|
||||
HELP: MAIN-WINDOW:
|
||||
HELP: \ MAIN-WINDOW:
|
||||
{ $syntax "MAIN-WINDOW: window-word { attributes }
|
||||
attribute-code ;" }
|
||||
{ $description "Defines a " { $link postpone\ main: } " word for the current vocabulary named " { $snippet "window-word" } " that opens a UI window when the vocabulary is " { $link run } ". The " { $snippet "attributes" } " specify the key-value pairs of the window's " { $link world-attributes } ". The " { $snippet "attribute-code" } " is run with the " { $snippet "world-attributes" } " on the stack; this allows the word to construct gadget objects to place in the " { $snippet "gadget" } " slot or set other runtime-dependent world attributes." }
|
||||
|
|
|
@ -16,7 +16,7 @@ HELP: <c-array>
|
|||
{ $notes "The appropriate specialized array vocabulary must be loaded; otherwise, an error will be thrown. See the " { $vocab-link "specialized-arrays" } " vocabulary for details on the underlying sequence type constructed." }
|
||||
{ $errors "Throws an error if the type does not exist, the necessary specialized array vocabulary is not loaded, or the requested size is negative." } ;
|
||||
|
||||
HELP: c-array{
|
||||
HELP: \ c-array{
|
||||
{ $description "Literal syntax, consists of a C-type followed by a series of values terminated by " { $snippet "}" } }
|
||||
{ $notes "The appropriate specialized array vocabulary must be loaded; otherwise, an error will be thrown. See the " { $vocab-link "specialized-arrays" } " vocabulary for details on the underlying sequence type constructed." }
|
||||
{ $errors "Throws an error if the type does not exist, the necessary specialized array vocabulary is not loaded, or the requested size is negative." } ;
|
||||
|
|
|
@ -4,7 +4,7 @@ USING: help.markup help.syntax kernel math quotations
|
|||
classes.struct ;
|
||||
in: alien.endian
|
||||
|
||||
HELP: BE-PACKED-STRUCT:
|
||||
HELP: \ BE-PACKED-STRUCT:
|
||||
{ $description "Defines a packed " { $link struct } " where endian-unaware types become big-endian types. Note that endian-aware types will override the big-endianness of this " { $link struct } " declaration; little-endian types will stay little-endian. On big-endian platforms, the endian-unaware types will not change since they are the correct endianness already." }
|
||||
{ $unchecked-example
|
||||
"! When run on a big-endian platform, this struct should prettyprint the same as defined"
|
||||
|
@ -17,7 +17,7 @@ in: scratchpad
|
|||
STRUCT: s1 { a char[7] } { b be32 initial: 0 } ;"
|
||||
} ;
|
||||
|
||||
HELP: BE-STRUCT:
|
||||
HELP: \ BE-STRUCT:
|
||||
{ $description "Defines a " { $link struct } " where endian-unaware types become big-endian types. Note that endian-aware types will override the big-endianness of this " { $link struct } " declaration; little-endian types will stay little-endian. On big-endian platforms, the endian-unaware types will not change since they are the correct endianness already." }
|
||||
{ $unchecked-example
|
||||
"! When run on a big-endian platform, this struct should prettyprint the same as defined"
|
||||
|
@ -30,7 +30,7 @@ in: scratchpad
|
|||
STRUCT: s1 { a be32 initial: 0 } { b le32 initial: 0 } ;"
|
||||
} ;
|
||||
|
||||
HELP: LE-PACKED-STRUCT:
|
||||
HELP: \ LE-PACKED-STRUCT:
|
||||
{ $description "Defines a packed " { $link struct } " where endian-unaware types become little-endian types. Note that endian-aware types will override the little-endianness of this " { $link struct } " declaration; big-endian types will stay big-endian. On little-endian platforms, the endian-unaware types will not change since they are the correct endianness already." }
|
||||
{ $unchecked-example
|
||||
"! When run on a little-endian platform, this struct should prettyprint the same as defined"
|
||||
|
@ -43,7 +43,7 @@ in: scratchpad
|
|||
STRUCT: s1 { a char[7] } { b int initial: 0 } ;"
|
||||
} ;
|
||||
|
||||
HELP: LE-STRUCT:
|
||||
HELP: \ LE-STRUCT:
|
||||
{ $description "Defines a " { $link struct } " where endian-unaware types become little-endian types. Note that endian-aware types will override the little-endianness of this " { $link struct } " declaration; big-endian types will stay big-endian. On little-endian platforms, the endian-unaware types will not change since they are the correct endianness already." }
|
||||
{ $unchecked-example
|
||||
"! When run on a little-endian platform, this struct should prettyprint the same as defined"
|
||||
|
@ -141,10 +141,10 @@ ARTICLE: "alien.endian" "Alien endian-aware types"
|
|||
}
|
||||
"Syntax for making endian-aware structs out of native types:"
|
||||
{ $subsections
|
||||
postpone\ LE-STRUCT:
|
||||
postpone\ BE-STRUCT:
|
||||
postpone\ LE-PACKED-STRUCT:
|
||||
postpone\ BE-PACKED-STRUCT:
|
||||
\ LE-STRUCT:
|
||||
\ BE-STRUCT:
|
||||
\ LE-PACKED-STRUCT:
|
||||
\ BE-PACKED-STRUCT:
|
||||
} ;
|
||||
|
||||
about: "alien.endian"
|
||||
|
|
|
@ -29,15 +29,15 @@ ARTICLE: "alien.fortran-types" "Fortran types"
|
|||
}
|
||||
"When declaring the parameters of Fortran functions, an output argument can be specified by prefixing an exclamation point to the type name. This will cause the function word to leave the final value of the parameter on the stack." ;
|
||||
|
||||
HELP: FUNCTION:
|
||||
HELP: \ FUNCTION:
|
||||
{ $syntax "FUNCTION: RETURN-TYPE NAME ( [!]ARGUMENT-TYPE NAME, ... ) ;" }
|
||||
{ $description "Declares a Fortran function binding with the given return type and arguments. See " { $link "alien.fortran-types" } " for a list of supported types." } ;
|
||||
|
||||
HELP: SUBROUTINE:
|
||||
HELP: \ SUBROUTINE:
|
||||
{ $syntax "SUBROUTINE: NAME ( [!]ARGUMENT-TYPE NAME, ... ) ;" }
|
||||
{ $description "Declares a Fortran subroutine binding with the given arguments. See " { $link "alien.fortran-types" } " for a list of supported types." } ;
|
||||
|
||||
HELP: library:
|
||||
HELP: \ library:
|
||||
{ $syntax "library: name" }
|
||||
{ $values { "name" "a logical library name" } }
|
||||
{ $description "Sets the logical library for subsequent " { $link postpone\ FUNCTION: } " and " { $link postpone\ SUBROUTINE: } " definitions. The given library name must have been opened with a previous call to " { $link add-fortran-library } "." } ;
|
||||
|
@ -60,9 +60,9 @@ ARTICLE: "alien.fortran" "Fortran FFI"
|
|||
"alien.fortran-types"
|
||||
"alien.fortran-abis"
|
||||
add-fortran-library
|
||||
postpone\ library:
|
||||
postpone\ FUNCTION:
|
||||
postpone\ SUBROUTINE:
|
||||
\ library:
|
||||
\ FUNCTION:
|
||||
\ SUBROUTINE:
|
||||
fortran-invoke
|
||||
} ;
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@ in: alien.syntax
|
|||
USING: alien alien.c-types alien.enums alien.libraries classes.struct
|
||||
help.markup help.syntax see ;
|
||||
|
||||
HELP: DLL"
|
||||
HELP: \ DLL"
|
||||
{ $syntax "DLL\" path\"" }
|
||||
{ $values { "path" "a pathname string" } }
|
||||
{ $description "Constructs a DLL handle at parse time." } ;
|
||||
|
||||
HELP: alien:
|
||||
HELP: \ alien:
|
||||
{ $syntax "alien: address" }
|
||||
{ $values { "address" "a non-negative hexadecimal integer" } }
|
||||
{ $description "Creates an alien object at parse time." }
|
||||
|
@ -19,13 +19,13 @@ ARTICLE: "syntax-aliens" "Alien object literal syntax"
|
|||
postpone\ DLL"
|
||||
} ;
|
||||
|
||||
HELP: library:
|
||||
HELP: \ library:
|
||||
{ $syntax "library: name" }
|
||||
{ $values { "name" "a logical library name" } }
|
||||
{ $description "Sets the logical library for consequent " { $link postpone\ FUNCTION: } ", " { $link postpone\ C-GLOBAL: } " and " { $link postpone\ CALLBACK: } " definitions, as well as " { $link postpone\ &: } " forms." }
|
||||
{ $notes "Logical library names are defined with the " { $link add-library } " word." } ;
|
||||
|
||||
HELP: FUNCTION:
|
||||
HELP: \ FUNCTION:
|
||||
{ $syntax "FUNCTION: return name ( parameters )" }
|
||||
{ $values { "return" "a C return type" } { "name" "a C function name" } { "parameters" "a comma-separated sequence of type/name pairs; " { $snippet "type1 arg1, type2 arg2, ..." } } }
|
||||
{ $description "Defines a new word " { $snippet "name" } " which calls the C library function with the same " { $snippet "name" } " in the logical library given by the most recent " { $link postpone\ library: } " declaration."
|
||||
|
@ -47,7 +47,7 @@ $nl
|
|||
"Using the " { $link c-string } " type instead of " { $snippet "char*" } " causes the FFI to automatically convert Factor strings to C strings. See " { $link "c-strings" } " for more information on using strings with the FFI."
|
||||
{ $notes "To make a Factor word with a name different from the C function, use " { $link postpone\ FUNCTION-ALIAS: } "." } ;
|
||||
|
||||
HELP: FUNCTION-ALIAS:
|
||||
HELP: \ FUNCTION-ALIAS:
|
||||
{ $syntax "FUNCTION-ALIAS: factor-name
|
||||
return c_name ( parameters ) ;" }
|
||||
{ $values { "factor-name" "a Factor word name" } { "return" "a C return type" } { "name" "a C function name" } { "parameters" "a comma-separated sequence of type/name pairs; " { $snippet "type1 arg1, type2 arg2, ..." } } }
|
||||
|
@ -56,15 +56,15 @@ $nl
|
|||
"The new word must be compiled before being executed." }
|
||||
{ $notes "Note that the parentheses and commas are only syntax sugar and can be omitted. They serve no purpose other than to make the declaration easier to read." } ;
|
||||
|
||||
{ postpone\ FUNCTION: postpone\ FUNCTION-ALIAS: } related-words
|
||||
{ \ FUNCTION: \ FUNCTION-ALIAS: } related-words
|
||||
|
||||
HELP: TYPEDEF:
|
||||
HELP: \ TYPEDEF:
|
||||
{ $syntax "TYPEDEF: old new ;" }
|
||||
{ $values { "old" "a C type" } { "new" "a C type" } }
|
||||
{ $description "Aliases the C type " { $snippet "old" } " under the name " { $snippet "new" } "." }
|
||||
{ $notes "This word differs from " { $link typedef } " in that it runs at parse time, to ensure correct ordering of operations when loading source files. Words defined in source files are compiled before top-level forms are run, so if a source file defines C binding words and uses " { $link typedef } ", the type alias won't be available at compile time." } ;
|
||||
|
||||
HELP: ENUM:
|
||||
HELP: \ ENUM:
|
||||
{ $syntax "ENUM: type words... ;" "ENUM: type < base-type words..." }
|
||||
{ $values { "type" { $maybe "a name to typedef to int" } } { "words" "a sequence of word names" } }
|
||||
{ $description "Creates a c-type that boxes and unboxes integer values to symbols. A symbol is defined for each member word. The base c-type can optionally be specified and defaults to " { $link int } ". A constructor word " { $snippet "<type>" } " is defined for converting from integers to singletons. The generic word " { $link enum>number } " converts from singletons to integers. Enum-typed values are automatically prettyprinted as their singleton words. Unrecognizing enum numbers are kept as numbers." }
|
||||
|
@ -81,7 +81,7 @@ HELP: ENUM:
|
|||
{ $code "ENUM: tv_peripherals_4 < uint\n{ appletv 1 } { chromecast 2 } { roku 4 } ;" }
|
||||
} ;
|
||||
|
||||
HELP: c-type:
|
||||
HELP: \ c-type:
|
||||
{ $syntax "c-type: type" }
|
||||
{ $values { "type" "a new C type" } }
|
||||
{ $description "Defines a new, opaque C type. Since it is opaque, " { $snippet "type" } " will not be directly usable as a parameter or return type of a " { $link postpone\ FUNCTION: } " or as a slot of a " { $link postpone\ STRUCT: } ". However, it can be used as the type of a " { $link pointer } "." $nl
|
||||
|
@ -91,7 +91,7 @@ STRUCT: backward { x forward* } ;
|
|||
STRUCT: forward { x backward* } ;" } }
|
||||
{ $notes "Primitive C types are displayed using " { $snippet "c-type:" } " syntax when they are " { $link see } "n." } ;
|
||||
|
||||
HELP: CALLBACK:
|
||||
HELP: \ CALLBACK:
|
||||
{ $syntax "CALLBACK: return type ( parameters )" }
|
||||
{ $values { "return" "a C return type" } { "type" "a type name" } { "parameters" "a comma-separated sequence of type/name pairs; " { $snippet "type1 arg1, type2 arg2, ..." } } }
|
||||
{ $description "Defines a new function pointer C type word " { $snippet "type" } ". The newly defined word works both as a C type and as a wrapper for " { $link alien-callback } " for callbacks that accept the given return type and parameters. The ABI of the callback is decided from the ABI of the active " { $link postpone\ library: } " declaration." }
|
||||
|
@ -108,7 +108,7 @@ HELP: CALLBACK:
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: &:
|
||||
HELP: \ &:
|
||||
{ $syntax "&: symbol" }
|
||||
{ $values { "symbol" "A C global variable name" } }
|
||||
{ $description "Pushes the address of a symbol named " { $snippet "symbol" } " from the current library, set with " { $link postpone\ library: } "." } ;
|
||||
|
@ -120,7 +120,7 @@ HELP: typedef
|
|||
|
||||
{ postpone\ TYPEDEF: typedef } related-words
|
||||
|
||||
HELP: C-GLOBAL:
|
||||
HELP: \ C-GLOBAL:
|
||||
{ $syntax "C-GLOBAL: type name ;" }
|
||||
{ $values { "type" "a C type" } { "name" "a C global variable name" } }
|
||||
{ $description "Defines a getter " { $snippet "name" } " and setter " { $snippet "set-name" } " for the global value in the current library, set with " { $link postpone\ library: } "." } ;
|
||||
|
|
|
@ -27,7 +27,7 @@ HELP: <struct>
|
|||
|
||||
{ <struct> <struct-boa> malloc-struct memory>struct } related-words
|
||||
|
||||
HELP: STRUCT:
|
||||
HELP: \ STRUCT:
|
||||
{ $syntax "STRUCT: class { slot type } { slot type } ... ;" }
|
||||
{ $values { "class" "a new " { $link struct } " class to define" } { "slots" "a list of slot specifiers" } }
|
||||
{ $description "Defines a new " { $link struct } " type. The syntax is nearly identical to " { $link postpone\ TUPLE: } "; however, there are some additional restrictions on struct types:"
|
||||
|
@ -38,24 +38,24 @@ HELP: STRUCT:
|
|||
}
|
||||
"Additionally, structs may use bit fields. A slot specifier may use the syntax " { $snippet "bits: n" } " to specify that the bit width of the slot is " { $snippet "n" } ". Bit width may be specified on signed or unsigned integer slots. The layout of bit fields is not guaranteed to match that of any particular C compiler." } ;
|
||||
|
||||
HELP: S{
|
||||
HELP: \ S{
|
||||
{ $syntax "S{ class slots... }" }
|
||||
{ $values { "class" "a " { $link struct } " class word" } { "slots" "slot values" } }
|
||||
{ $description "Marks the beginning of a literal struct. The syntax is identical to tuple literal syntax with " { $link postpone\ T{ } { $snippet " }" } "; either the assoc syntax (that is, " { $snippet "S{ class { slot value } { slot value } ... }" } ") or the simple syntax (" { $snippet "S{ class f value value ... }" } ") can be used." } ;
|
||||
|
||||
HELP: S@
|
||||
HELP: \ S@
|
||||
{ $syntax "S@ class alien" }
|
||||
{ $values { "class" "a " { $link struct } " class word" } { "alien" "a literal alien" } }
|
||||
{ $description "Marks the beginning of a literal struct at a specific C address. The prettyprinter uses this syntax when the memory backing a struct object is invalid. This syntax should not generally be used in source code." } ;
|
||||
|
||||
{ postpone\ S{ postpone\ S@ } related-words
|
||||
{ \ S{ \ S@ } related-words
|
||||
|
||||
HELP: UNION-STRUCT:
|
||||
HELP: \ UNION-STRUCT:
|
||||
{ $syntax "UNION-STRUCT: class { slot type } { slot type } ... ;" }
|
||||
{ $values { "class" "a new " { $link struct } " class to define" } { "slots" "a list of slot specifiers" } }
|
||||
{ $description "Defines a new " { $link struct } " type where all of the slots share the same storage. See " { $link postpone\ STRUCT: } " for details on the syntax." } ;
|
||||
|
||||
HELP: PACKED-STRUCT:
|
||||
HELP: \ PACKED-STRUCT:
|
||||
{ $syntax "PACKED-STRUCT: class { slot type } { slot type } ... ;" }
|
||||
{ $values { "class" "a new " { $link struct } " class to define" } { "slots" "a list of slot specifiers" } }
|
||||
{ $description "Defines a new " { $link struct } " type with no alignment padding between slots or at the end. In all other respects, behaves like " { $link postpone\ STRUCT: } "." } ;
|
||||
|
@ -110,7 +110,7 @@ HELP: read-struct
|
|||
HELP: struct
|
||||
{ $class-description "The parent class of all struct types." } ;
|
||||
|
||||
{ struct postpone\ STRUCT: postpone\ UNION-STRUCT: } related-words
|
||||
{ struct \ STRUCT: \ UNION-STRUCT: } related-words
|
||||
|
||||
HELP: struct-class
|
||||
{ $class-description "The metaclass of all " { $link struct } " classes." } ;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
USING: help.syntax help.markup words ;
|
||||
in: descriptive
|
||||
|
||||
HELP: DESCRIPTIVE:
|
||||
HELP: \ DESCRIPTIVE:
|
||||
{ $syntax "DESCRIPTIVE: word ( inputs -- outputs ) definition ;" }
|
||||
{ $description "Defines a word such that, if an error is thrown from within it, that error is wrapped in a " { $link descriptive-error } " with the arguments to that word." } ;
|
||||
|
||||
HELP: DESCRIPTIVE::
|
||||
HELP: \ DESCRIPTIVE::
|
||||
{ $syntax "DESCRIPTIVE:: word ( inputs -- outputs ) definition ;" }
|
||||
{ $description "Defines a word which uses locals such that, if an error is thrown from within it, that error is wrapped in a " { $link descriptive-error } " with the arguments to that word." } ;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ HELP: eval
|
|||
{ $notes "The code string is parsed and called in a new dynamic scope with an initial vocabulary search path consisting of just the " { $snippet "syntax" } " vocabulary. The evaluated code can use " { $link "word-search-syntax" } " to alter the search path." }
|
||||
{ $errors "Throws an error if the input is malformed, or if the evaluation itself throws an error." } ;
|
||||
|
||||
HELP: eval(
|
||||
HELP: \ eval(
|
||||
{ $syntax "eval( inputs -- outputs )" }
|
||||
{ $description "Parses Factor source code from the string at the top of the stack, and calls the resulting quotation, which must have the given stack effect." }
|
||||
{ $notes
|
||||
|
@ -61,7 +61,7 @@ ARTICLE: "eval" "Evaluating strings at run time"
|
|||
$nl
|
||||
"The main entry point is a parsing word, which wraps a library word:"
|
||||
{ $subsections
|
||||
postpone\ eval(
|
||||
\ eval(
|
||||
eval
|
||||
}
|
||||
"This pairing is analogous to that of " { $link postpone\ call( } " with " { $link call-effect } "."
|
||||
|
|
|
@ -26,7 +26,7 @@ HELP: $
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: $[
|
||||
HELP: \ $[
|
||||
{ $syntax "$[ code ]" }
|
||||
{ $description "Calls " { $snippet "code" } " at parse time and adds the result(s) to the parser accumulator." }
|
||||
{ $notes "Since " { $snippet "code" } " is " { $link call } "ed at parse time, it cannot reference any words defined in the same compilation unit." }
|
||||
|
@ -41,7 +41,7 @@ HELP: $[
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: ${
|
||||
HELP: \ ${
|
||||
{ $syntax "${ code }" }
|
||||
{ $description "Outputs an array containing the results of executing " { $snippet "code" } " at parse time." }
|
||||
{ $notes { $snippet "code" } "'s definition is looked up and " { $link call } "ed at parse time, so words that reference words in the current compilation unit cannot be used with " { $snippet "$" } "." }
|
||||
|
@ -57,9 +57,9 @@ HELP: ${
|
|||
}
|
||||
} ;
|
||||
|
||||
{ postpone\ $ postpone\ $[ postpone\ ${ } related-words
|
||||
{ \ $ \ $[ \ ${ } related-words
|
||||
|
||||
HELP: flags{
|
||||
HELP: \ flags{
|
||||
{ $values { "values" sequence } }
|
||||
{ $description "Constructs a constant flag value from a sequence of integers or words that output integers. The resulting constant is computed at parse-time, which makes this word as efficient as using a literal integer." }
|
||||
{ $examples
|
||||
|
@ -84,9 +84,9 @@ ARTICLE: "literals" "Interpolating code results into literal values"
|
|||
"{ 5 5 6 8 }"
|
||||
}
|
||||
{ $subsections
|
||||
postpone\ $
|
||||
postpone\ $[
|
||||
postpone\ ${
|
||||
\ $
|
||||
\ $[
|
||||
\ ${
|
||||
} ;
|
||||
|
||||
about: "literals"
|
||||
|
|
|
@ -23,7 +23,7 @@ HELP: match-cond
|
|||
}
|
||||
{ $see-also match postpone\ MATCH-VARS: replace-patterns match-replace } ;
|
||||
|
||||
HELP: MATCH-VARS:
|
||||
HELP: \ MATCH-VARS:
|
||||
{ $syntax "MATCH-VARS: var ... ;" }
|
||||
{ $values { "var" "a match variable name beginning with '?'" } }
|
||||
{ $description "Creates a symbol that can be used in " { $link match } " and " { $link match-cond } " for binding values in the matched sequence. The symbol name is created as a word that is defined to get the value of the symbol out of the current namespace. This can be used in " { $link match-cond } " to retrive the values in the quotation body." }
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
USING: help.markup help.syntax ;
|
||||
in: method-chains
|
||||
|
||||
HELP: AFTER:
|
||||
HELP: \ AFTER:
|
||||
{ $syntax "AFTER: class generic
|
||||
implementation ;" }
|
||||
{ $description "Defines a method on " { $snippet "generic" } " for " { $snippet "class" } " which executes the new " { $snippet "implementation" } " code after invoking the parent class method on " { $snippet "generic" } "." } ;
|
||||
|
||||
HELP: BEFORE:
|
||||
HELP: \ BEFORE:
|
||||
{ $syntax "BEFORE: class generic
|
||||
implementation ;" }
|
||||
{ $description "Defines a method on " { $snippet "generic" } " for " { $snippet "class" } " which executes the new " { $snippet "implementation" } " code, then invokes the parent class method on " { $snippet "generic" } "." } ;
|
||||
|
@ -15,8 +15,8 @@ HELP: BEFORE:
|
|||
ARTICLE: "method-chains" "Method chaining syntax"
|
||||
"The " { $vocab-link "method-chains" } " vocabulary provides syntax for extending method implementations in class hierarchies."
|
||||
{ $subsections
|
||||
postpone\ AFTER:
|
||||
postpone\ BEFORE:
|
||||
\ AFTER:
|
||||
\ BEFORE:
|
||||
} ;
|
||||
|
||||
about: "method-chains"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: help.markup help.syntax strings ;
|
||||
in: multiline
|
||||
|
||||
HELP: STRING:
|
||||
HELP: \ STRING:
|
||||
{ $syntax "STRING: name\nfoo\n;" }
|
||||
{ $description "Forms a multiline string literal, or 'here document' stored in the word called name. A semicolon is used to signify the end, and that semicolon must be on a line by itself, not preceeded or followed by any whitespace. The string will have newlines in between lines but not at the end, unless there is a blank line before the semicolon." } ;
|
||||
|
||||
|
@ -16,7 +16,7 @@ HELP: /*
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: HEREDOC:
|
||||
HELP: \ HEREDOC:
|
||||
{ $syntax "HEREDOC: marker\n...text...\nmarker" }
|
||||
{ $values { "marker" "a word (token)" } { "text" "arbitrary text" } { "value" string } }
|
||||
{ $description "Returns a string delimited by an arbitrary user-defined token. This delimiter must be exactly the text beginning at the first non-blank character after " { $link postpone\ HEREDOC: } " until the end of the line containing " { $link postpone\ HEREDOC: } ". Text is captured until a line is found containing exactly this delimiter string." }
|
||||
|
|
|
@ -11,7 +11,7 @@ HELP: force
|
|||
{ $values { "promise" "a promise object" } { "value" "a factor object" } }
|
||||
{ $description "Calls the quotation associated with the promise if it has not been called before, and returns the value. If the promise has been forced previously, returns the value from the previous call." } ;
|
||||
|
||||
HELP: LAZY:
|
||||
HELP: \ LAZY:
|
||||
{ $syntax "LAZY: word ( stack -- effect ) definition... ;" }
|
||||
{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
|
||||
{ $description "Creates a lazy word in the current vocabulary. When executed the word will return a " { $link promise } " that when forced, executes the word definition. Any values on the stack that are required by the word definition are captured along with the promise." }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: help.markup help.syntax ;
|
||||
in: slots.syntax
|
||||
|
||||
HELP: slots[
|
||||
HELP: \ slots[
|
||||
{ $description "Outputs several slot values to the stack." }
|
||||
{ $example "USING: kernel prettyprint slots.syntax ;"
|
||||
"in: slots.syntax.example"
|
||||
|
@ -13,7 +13,7 @@ HELP: slots[
|
|||
5"
|
||||
} ;
|
||||
|
||||
HELP: slots{
|
||||
HELP: \ slots{
|
||||
{ $description "Outputs an array of slot values from a tuple." }
|
||||
{ $example "USING: prettyprint slots.syntax ;"
|
||||
"in: slots.syntax.example"
|
||||
|
@ -22,7 +22,7 @@ HELP: slots{
|
|||
"{ 3 5 }"
|
||||
} ;
|
||||
|
||||
HELP: set-slots{
|
||||
HELP: \ set-slots{
|
||||
{ $description "Sets slot values in a tuple from an array." }
|
||||
{ $example "USING: prettyprint slots.syntax kernel ;"
|
||||
"in: slots.syntax.example"
|
||||
|
@ -31,7 +31,7 @@ HELP: set-slots{
|
|||
"T{ rectangle { width 3 } { height 5 } }"
|
||||
} ;
|
||||
|
||||
HELP: set-slots[
|
||||
HELP: \ set-slots[
|
||||
{ $description "Sets slot values in a tuple from the stack." }
|
||||
{ $example "USING: prettyprint slots.syntax kernel ;"
|
||||
"in: slots.syntax.example"
|
||||
|
@ -40,7 +40,7 @@ HELP: set-slots[
|
|||
"T{ rectangle { width 3 } { height 5 } }"
|
||||
} ;
|
||||
|
||||
HELP: copy-slots{
|
||||
HELP: \ copy-slots{
|
||||
{ $description "Copy slots from the first object to the second and return the second object." }
|
||||
{ $example "USING: prettyprint slots.syntax kernel ;"
|
||||
"in: slots.syntax.example"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
in: tuple-arrays
|
||||
USING: help.markup help.syntax sequences ;
|
||||
|
||||
HELP: TUPLE-ARRAY:
|
||||
HELP: \ TUPLE-ARRAY:
|
||||
{ $syntax "TUPLE-ARRAY: class" }
|
||||
{ $values { "class" "a final tuple class" } }
|
||||
{ $description "Generates a new data type in the current vocabulary named " { $snippet { $emphasis "class" } "-array" } " for holding instances of " { $snippet "class" } ", which must be a tuple class word. Together with the class itself, this also generates words named " { $snippet "<" { $emphasis "class" } "-array>" } " and " { $snippet ">" { $emphasis "class" } "-array" } ", for creating new instances of this tuple array type." } ;
|
||||
|
|
|
@ -3,7 +3,7 @@ USING: arrays classes classes.singleton classes.tuple help.markup
|
|||
help.syntax kernel multiline slots quotations ;
|
||||
in: variants
|
||||
|
||||
HELP: VARIANT:
|
||||
HELP: \ VARIANT:
|
||||
{ $syntax "
|
||||
VARIANT: class-name
|
||||
singleton
|
||||
|
@ -24,7 +24,7 @@ VARIANT: list
|
|||
;
|
||||
" } } ;
|
||||
|
||||
HELP: VARIANT-MEMBER:
|
||||
HELP: \ VARIANT-MEMBER:
|
||||
{ $description "Defines a new member of a variant class without restricting such definitions to a single statement or source file. The variant class should be listed first, and the class member should follow." }
|
||||
{ $examples { $code "
|
||||
USING: kernel variants ;
|
||||
|
|
|
@ -23,12 +23,12 @@ HELP: compile-attr
|
|||
{ $values { "value" "an attribute value" } }
|
||||
{ $description "Compiles code which pushes an attribute value previously extracted by " { $link required-attr } " or " { $link optional-attr } " on the stack. If the attribute value begins with " { $snippet "@" } ", compiles into code which pushes the a form value." } ;
|
||||
|
||||
HELP: CHLOE:
|
||||
HELP: \ CHLOE:
|
||||
{ $syntax "CHLOE: name definition... ;" }
|
||||
{ $values { "name" "the tag name" } { "definition" { $quotation ( tag -- ) } } }
|
||||
{ $description "Defines compilation semantics for the Chloe tag named " { $snippet "tag" } ". The definition body receives a " { $link tag } " on the stack." } ;
|
||||
|
||||
HELP: component:
|
||||
HELP: \ component:
|
||||
{ $syntax "component: name" }
|
||||
{ $description "Defines a Chloe tag named " { $snippet "name" } " rendering the HTML component with class word " { $snippet "name" } ". See " { $link "html.components" } "." } ;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ HELP: log-critical
|
|||
{ $values { "error" "an error" } { "word" word } }
|
||||
{ $description "Logs a critical error." } ;
|
||||
|
||||
HELP: LOG:
|
||||
HELP: \ LOG:
|
||||
{ $syntax "LOG: name level" }
|
||||
{ $values { "name" "a new word name" } { "level" "a log level" } }
|
||||
{ $description "Creates a word with stack effect " { $snippet "( object -- )" } " which logs its input and does nothing else." } ;
|
||||
|
|
|
@ -270,7 +270,7 @@ HELP: <empty-vector>
|
|||
{ $values { "length" "The length of the new vector" } { "exemplar" blas-vector-base blas-matrix-base } { "vector" blas-vector-base } }
|
||||
{ $description "Return a vector of zeros with the given " { $snippet "length" } " and the same element type as " { $snippet "v" } "." } ;
|
||||
|
||||
HELP: smatrix{
|
||||
HELP: \ smatrix{
|
||||
{ $syntax "smatrix{
|
||||
{ 1.0 0.0 0.0 1.0 }
|
||||
{ 0.0 1.0 0.0 2.0 }
|
||||
|
@ -279,7 +279,7 @@ HELP: smatrix{
|
|||
}" }
|
||||
{ $description "Construct a literal " { $link float-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ;
|
||||
|
||||
HELP: dmatrix{
|
||||
HELP: \ dmatrix{
|
||||
{ $syntax "dmatrix{
|
||||
{ 1.0 0.0 0.0 1.0 }
|
||||
{ 0.0 1.0 0.0 2.0 }
|
||||
|
@ -288,7 +288,7 @@ HELP: dmatrix{
|
|||
}" }
|
||||
{ $description "Construct a literal " { $link double-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ;
|
||||
|
||||
HELP: cmatrix{
|
||||
HELP: \ cmatrix{
|
||||
{ $syntax "cmatrix{
|
||||
{ 1.0 0.0 0.0 1.0 }
|
||||
{ 0.0 C{ 0.0 1.0 } 0.0 2.0 }
|
||||
|
@ -297,7 +297,7 @@ HELP: cmatrix{
|
|||
}" }
|
||||
{ $description "Construct a literal " { $link complex-float-blas-matrix } ". Note that although BLAS matrices are stored in column-major order, the literal is specified in row-major order." } ;
|
||||
|
||||
HELP: zmatrix{
|
||||
HELP: \ zmatrix{
|
||||
{ $syntax "zmatrix{
|
||||
{ 1.0 0.0 0.0 1.0 }
|
||||
{ 0.0 C{ 0.0 1.0 } 0.0 2.0 }
|
||||
|
|
|
@ -145,19 +145,19 @@ HELP: Vsub
|
|||
{ $values { "v" blas-vector-base } { "start" integer } { "length" integer } { "sub" blas-vector-base } }
|
||||
{ $description "Slice a subvector out of " { $snippet "v" } " starting at " { $snippet "start" } " with the given " { $snippet "length" } ". The subvector will share storage with the parent vector." } ;
|
||||
|
||||
HELP: svector{
|
||||
HELP: \ svector{
|
||||
{ $syntax "svector{ 1.0 -2.0 3.0 }" }
|
||||
{ $description "Construct a literal " { $link float-blas-vector } "." } ;
|
||||
|
||||
HELP: dvector{
|
||||
HELP: \ dvector{
|
||||
{ $syntax "dvector{ 1.0 -2.0 3.0 }" }
|
||||
{ $description "Construct a literal " { $link double-blas-vector } "." } ;
|
||||
|
||||
HELP: cvector{
|
||||
HELP: \ cvector{
|
||||
{ $syntax "cvector{ 1.0 -2.0 C{ 3.0 -1.0 } }" }
|
||||
{ $description "Construct a literal " { $link complex-float-blas-vector } "." } ;
|
||||
|
||||
HELP: zvector{
|
||||
HELP: \ zvector{
|
||||
{ $syntax "dvector{ 1.0 -2.0 C{ 3.0 -1.0 } }" }
|
||||
{ $description "Construct a literal " { $link complex-double-blas-vector } "." } ;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: help.markup help.syntax ;
|
||||
in: math.derivatives.syntax
|
||||
|
||||
HELP: DERIVATIVE:
|
||||
HELP: \ DERIVATIVE:
|
||||
{ $description "Defines the derivative of a word by setting its " { $snippet "derivative" } " word property. Reads a word followed by " { $snippet "n" } " quotations, giving the " { $snippet "n" } " partial derivatives of the word with respect to each of its arguments successively. Each quotation should take " { $snippet "n + 1" } " inputs, where the first input is an increment and the last " { $snippet "n" } " inputs are the point at which to evaluate the derivative. The derivative should be a linear function of the increment, and should have the same number of outputs as the original word." }
|
||||
{ $examples
|
||||
{ $unchecked-example "USING: math math.functions math.derivatives.syntax ;"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
USING: help.markup help.syntax multiline ;
|
||||
in: qw
|
||||
|
||||
HELP: qw{
|
||||
HELP: \ qw{
|
||||
{ $syntax "qw{ lorem ipsum }" }
|
||||
{ $description "Marks the beginning of a literal array of strings. Component strings are delimited by whitespace." }
|
||||
{ $examples
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
USING: classes.mixin help.markup help.syntax kernel multiline roles ;
|
||||
in: roles
|
||||
|
||||
HELP: ROLE:
|
||||
HELP: \ ROLE:
|
||||
{ $syntax "ROLE: name slots... ;
|
||||
ROLE: name < role slots... ;
|
||||
ROLE: name <{ roles... } slots... ;" }
|
||||
|
@ -14,9 +14,9 @@ $nl
|
|||
{ { $snippet "{ name attributes... }" } " - a slot which can hold any object, with optional attributes" }
|
||||
{ { $snippet "{ name class attributes... }" } " - a slot specialized to a specific class, with optional attributes" }
|
||||
}
|
||||
"Slot attributes are lists of slot attribute specifiers followed by values; a slot attribute specifier is one of " { $link initial: } " or " { $link read-only } ". See " { $link "tuple-declarations" } " for details." } ;
|
||||
"Slot attributes are lists of slot attribute specifiers followed by values; a slot attribute specifier is one of " { $link \ initial: } " or " { $link read-only } ". See " { $link "tuple-declarations" } " for details." } ;
|
||||
|
||||
HELP: ROLE-TUPLE:
|
||||
HELP: \ ROLE-TUPLE:
|
||||
{ $syntax "ROLE-TUPLE: name slots ;
|
||||
ROLE-TUPLE: name < estate slots ;
|
||||
ROLE-TUPLE: name <{ estates... } slots... ;" }
|
||||
|
@ -30,30 +30,30 @@ $nl
|
|||
{ { $snippet "{ name attributes... }" } " - a slot which can hold any object, with optional attributes" }
|
||||
{ { $snippet "{ name class attributes... }" } " - a slot specialized to a specific class, with optional attributes" }
|
||||
}
|
||||
"Slot attributes are lists of slot attribute specifiers followed by values; a slot attribute specifier is one of " { $link initial: } " or " { $link read-only } ". See " { $link "tuple-declarations" } " for details." } ;
|
||||
"Slot attributes are lists of slot attribute specifiers followed by values; a slot attribute specifier is one of " { $link \ initial: } " or " { $link read-only } ". See " { $link "tuple-declarations" } " for details." } ;
|
||||
|
||||
{
|
||||
postpone\ ROLE:
|
||||
postpone\ ROLE-TUPLE:
|
||||
\ ROLE:
|
||||
\ ROLE-TUPLE:
|
||||
} related-words
|
||||
|
||||
HELP: role
|
||||
{ $class-description "The superclass of all role classes. A " { $snippet "role" } " is a " { $link mixin-class } " that includes a set of slot definitions that can be added to " { $link tuple } " classes alongside other " { $snippet "role" } "s." } ;
|
||||
|
||||
HELP: multiple-inheritance-attempted
|
||||
{ $class-description "This error is thrown if a " { $link postpone\ ROLE-TUPLE: } " definition attempts to inherit more than one " { $link tuple } " class." } ;
|
||||
{ $class-description "This error is thrown if a " { $link \ ROLE-TUPLE: } " definition attempts to inherit more than one " { $link tuple } " class." } ;
|
||||
|
||||
HELP: role-slot-overlap
|
||||
{ $class-description "This error is thrown if a " { $link postpone\ ROLE-TUPLE: } " or " { $link postpone\ ROLE: } " definition attempts to inherit a set of " { $link role } "s in which more than one attempts to define the same slot." } ;
|
||||
{ $class-description "This error is thrown if a " { $link \ ROLE-TUPLE: } " or " { $link \ ROLE: } " definition attempts to inherit a set of " { $link role } "s in which more than one attempts to define the same slot." } ;
|
||||
|
||||
ARTICLE: "roles" "Roles"
|
||||
"The " { $vocab-link "roles" } " vocabulary provides a form of tuple interface that can be implemented by concrete tuple classes. A " { $link role } " definition is a mixin class that also prescribes a set of tuple slots. Roles are not tuple classes by themselves and cannot be instantiated by " { $link new } ". The vocabulary extends " { $link postpone\ ROLE-TUPLE: } " syntax to allow concrete tuple types to declare membership to one or more roles, automatically including their prescribed slots." $nl
|
||||
"The " { $vocab-link "roles" } " vocabulary provides a form of tuple interface that can be implemented by concrete tuple classes. A " { $link role } " definition is a mixin class that also prescribes a set of tuple slots. Roles are not tuple classes by themselves and cannot be instantiated by " { $link new } ". The vocabulary extends " { $link \ ROLE-TUPLE: } " syntax to allow concrete tuple types to declare membership to one or more roles, automatically including their prescribed slots." $nl
|
||||
"The role superclass:"
|
||||
{ $subsections role }
|
||||
"Syntax for making a new role:"
|
||||
{ $subsection postpone\ ROLE: }
|
||||
{ $subsection \ ROLE: }
|
||||
"Syntax for making tuples that use roles:"
|
||||
{ $subsection postpone\ ROLE-TUPLE: }
|
||||
{ $subsection \ ROLE-TUPLE: }
|
||||
"Errors with roles:"
|
||||
{ $subsections multiple-inheritance-attempted role-slot-overlap } ;
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ about: "unicode.categories"
|
|||
ARTICLE: "unicode.categories" "Unicode category syntax"
|
||||
"There is special syntax sugar for making predicate classes which are unions of Unicode general categories, plus some other code."
|
||||
{ $subsections
|
||||
postpone\ CATEGORY:
|
||||
postpone\ CATEGORY-NOT:
|
||||
\ CATEGORY:
|
||||
\ CATEGORY-NOT:
|
||||
} ;
|
||||
|
||||
HELP: CATEGORY:
|
||||
HELP: \ CATEGORY:
|
||||
{ $syntax "CATEGORY: foo Nl Pd Lu | \"Diacritic\" property? ;" }
|
||||
{ $description "This defines a predicate class which is a subset of code points. In this example, " { $snippet "foo" } " is the class of characters which are in the general category Nl or Pd or Lu, or which have the Diacritic property." } ;
|
||||
|
||||
HELP: CATEGORY-NOT:
|
||||
HELP: \ CATEGORY-NOT:
|
||||
{ $syntax "CATEGORY-NOT: foo Nl Pd Lu | \"Diacritic\" property? ;" }
|
||||
{ $description "This defines a predicate class which is a subset of code points, the complement of what " { $link postpone\ CATEGORY: } " would define. In this example, " { $snippet "foo" } " is the class of characters which are neither in the general category Nl or Pd or Lu, nor have the Diacritic property." } ;
|
||||
|
|
|
@ -19,13 +19,13 @@ ARTICLE: { "xml.syntax" "tags" } "Dispatch on XML tag names"
|
|||
"and to define a new 'method' for this word, use"
|
||||
{ $subsections postpone\ TAG: } ;
|
||||
|
||||
HELP: TAGS:
|
||||
HELP: \ TAGS:
|
||||
{ $syntax "TAGS: word effect ;" }
|
||||
{ $values { "word" "a new word to define" } }
|
||||
{ $description "Creates a new word to which dispatches on XML tag names." }
|
||||
{ $see-also postpone\ TAG: } ;
|
||||
|
||||
HELP: TAG:
|
||||
HELP: \ TAG:
|
||||
{ $syntax "TAG: tag word definition... ;" }
|
||||
{ $values { "tag" "an XML tag name" } { "word" "an XML process" } }
|
||||
{ $description "Defines a 'method' on a word created with " { $link postpone\ TAGS: } ". It determines what such a word should do for an argument that is has the given name." }
|
||||
|
@ -41,11 +41,11 @@ ARTICLE: { "xml.syntax" "literals" } "XML literals"
|
|||
"These can be used for creating an XML literal, which can be used with variables or a fry-like syntax to interpolate data into XML."
|
||||
{ $subsections { "xml.syntax" "interpolation" } } ;
|
||||
|
||||
HELP: <XML
|
||||
HELP: \ <XML
|
||||
{ $syntax "<XML <?xml version=\"1.0\"?><document>...</document> XML>" }
|
||||
{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML document (" { $link xml } ") on the stack. It can be used for interpolation as well, if interpolation slots are used. For more information about XML interpolation, see " { $link { "xml.syntax" "interpolation" } } "." } ;
|
||||
|
||||
HELP: XML[[
|
||||
HELP: \ XML[[
|
||||
{ $syntax "XML[[ foo <x>...</x> bar <y>...</y> baz XML]]" }
|
||||
{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML chunk (" { $link xml-chunk } ") on the stack. For more information about XML interpolation, see " { $link { "xml.syntax" "interpolation" } } "." } ;
|
||||
|
||||
|
|
|
@ -484,7 +484,7 @@ HELP: $references
|
|||
{ $description "Prints a heading followed by a series of links." }
|
||||
{ $notes "This element type is used by the cookbook-style introductory articles in the " { $link "handbook" } "." } ;
|
||||
|
||||
HELP: HELP:
|
||||
HELP: \ HELP:
|
||||
{ $syntax "HELP: word content... ;" }
|
||||
{ $values { "word" "a word" } { "content" "markup elements" } }
|
||||
{ $description "Defines documentation for a word." }
|
||||
|
@ -499,7 +499,7 @@ HELP: HELP:
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: ARTICLE:
|
||||
HELP: \ ARTICLE:
|
||||
{ $syntax "ARTICLE: topic title content... ;" }
|
||||
{ $values { "topic" object } { "title" string } { "content" "markup elements" } }
|
||||
{ $description "Defines a help article. String topic names are reserved for core documentation. Contributed modules should name articles by arrays, where the first element of an array identifies the module; for example, " { $snippet "{ \"httpd\" \"intro\" }" } "." }
|
||||
|
@ -512,7 +512,7 @@ HELP: ARTICLE:
|
|||
}
|
||||
} ;
|
||||
|
||||
HELP: about:
|
||||
HELP: \ about:
|
||||
{ $syntax "about: article" }
|
||||
{ $values { "article" "a help article" } }
|
||||
{ $description "Defines the main documentation article for the current vocabulary." } ;
|
||||
|
|
|
@ -27,7 +27,7 @@ TIP: "To save time on reloading big libraries such as the " { $vocab-link "furna
|
|||
|
||||
TIP: "Use the " { $link leaks. } " combinator to track down resource leaks." ;
|
||||
|
||||
HELP: TIP:
|
||||
HELP: \ TIP:
|
||||
{ $syntax "TIP: content ;" }
|
||||
{ $values { "content" "a markup element" } }
|
||||
{ $description "Defines a new tip of the day." } ;
|
||||
|
|
|
@ -24,7 +24,7 @@ HELP: breakpoint-if
|
|||
HELP: B
|
||||
{ $description "An alias for " { $link break } ", defined in the " { $vocab-link "syntax" } " vocabulary so that it is always available." } ;
|
||||
|
||||
HELP: B:
|
||||
HELP: \ B:
|
||||
{ $description "A breakpoint for parsing words. When this word is executed, it copies the definition of the following parsing word, prepends a " { $link break } " to it so that it is the first word to be executed when the definition is called, and calls this new definition.\n\nWhen the walker tool opens, execution will still be inside " { $link postpone\ B: } ". To step out of B: and into the parsing word, do just that: jump out with O, then into with I." } ;
|
||||
|
||||
HELP: step-into
|
||||
|
@ -41,8 +41,8 @@ $nl
|
|||
"Breakpoints can be inserted directly into code:"
|
||||
{ $subsections
|
||||
break
|
||||
postpone\ B
|
||||
postpone\ B:
|
||||
\ B
|
||||
\ B:
|
||||
}
|
||||
"Note that because the walker calls various core library and UI words while rendering its own user interface, setting a breakpoint on a word such as " { $link append } " or " { $link + } " will hang the UI." ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue