factor: fixing colon words

locals-and-roots
Doug Coleman 2016-06-22 09:24:49 -07:00
parent 49531c7275
commit 426013bf80
31 changed files with 135 additions and 135 deletions

View File

@ -5,7 +5,7 @@ classes.struct combinators destructors io.backend io.files
io.files.acls.macosx.ffi kernel libc literals locals math.order
prettyprint sequences unix unix.ffi unix.groups unix.types
unix.users ;
qualified: io
QUALIFIED: io
IN: io.files.acls.macosx
PRIVATE<

View File

@ -6,10 +6,10 @@ prettyprint.custom sequences specialized-arrays vocabs.generated
vocabs.loader vocabs.parser ;
FROM: sequences.private => nth-unsafe ;
FROM: specialized-arrays.private => nth-c-ptr direct-like ;
qualified: vectors.functor
QUALIFIED: vectors.functor
IN: specialized-vectors
mixin: specialized-vector
MIXIN: specialized-vector
PRIVATE<

View File

@ -1,7 +1,7 @@
USING: accessors alien alien.accessors alien.c-types
alien.syntax byte-arrays continuations fry kernel layouts math
namespaces prettyprint sequences tools.memory tools.test ;
qualified: sets
QUALIFIED: sets
IN: alien.tests
{ t } [ -1 <alien> alien-address 0 > ] unit-test

View File

@ -148,7 +148,7 @@ ARTICLE: "c-types.ambiguity" "Word name clashes with C types"
"FUNCTION: float magic_number ( ) ;"
"magic_number 3.0 + ."
}
"The correct solution is to use one of " { $link postpone\ FROM: } ", " { $link postpone\ qualified: } " or " { $link postpone\ QUALIFIED-WITH: } " to disambiguate word lookup:"
"The correct solution is to use one of " { $link postpone\ FROM: } ", " { $link \ QUALIFIED: } " or " { $link postpone\ QUALIFIED-WITH: } " to disambiguate word lookup:"
{ $code
"USING: alien.syntax math prettyprint ;"
"QUALIFIED-WITH: alien.c-types c"

View File

@ -4,7 +4,7 @@ USING: assocs hash-sets hashtables hashtables.identity
hashtables.wrapped init io io.files kernel kernel.private make
memory namespaces parser parser.notes sequences system vocabs
vocabs.loader vocabs.hierarchy ;
qualified: bootstrap.image.private
QUALIFIED: bootstrap.image.private
IN: bootstrap.stage1
"Bootstrap stage 1..." print flush

View File

@ -1,5 +1,5 @@
USING: assocs graphs kernel namespaces sorting tools.test ;
qualified: sets
QUALIFIED: sets
H{ } "g" set
{ 1 2 3 } "v" set

View File

@ -519,8 +519,8 @@ IN: qualified.tests.bar
IN: qualified.tests.baz
: x ( -- a ) 3 ;
qualified: qualified.tests.foo
qualified: qualified.tests.bar
QUALIFIED: qualified.tests.foo
QUALIFIED: qualified.tests.bar
{ 1 2 3 } [ qualified.tests.foo:x qualified.tests.bar:x x ] unit-test
QUALIFIED-WITH: qualified.tests.bar p ;

View File

@ -42,7 +42,7 @@ ARTICLE: "syntax-integers" "Integer syntax"
}
"Integers are entered in base 10 unless prefixed with a base-changing prefix. " { $snippet "0x" } " begins a hexadecimal literal, " { $snippet "0o" } " an octal literal, and " { $snippet "0b" } " a binary literal. A sign, if any, goes before the base prefix."
{ $example
"use: prettyprint"
"USE: prettyprint"
"10 ."
"0b10 ."
"-0o10 ."
@ -150,7 +150,7 @@ ARTICLE: "syntax-words" "Word syntax"
\ \
\ postpone\
}
"The implementation of the " { $link postpone\ \ } " word is discussed in detail in " { $link "reading-ahead" } ". Words are documented in " { $link "words" } "." ;
"The implementation of the " { $link \ \ } " word is discussed in detail in " { $link "reading-ahead" } ". Words are documented in " { $link "words" } "." ;
ARTICLE: "escape" "Character escape codes"
{ $table
@ -174,57 +174,57 @@ ARTICLE: "escape" "Character escape codes"
ARTICLE: "syntax-strings" "Character and string syntax"
"Factor has no distinct character type. Integers representing Unicode code points can be read by specifying a literal character, or an escaped representation thereof."
{ $subsections
postpone\ char:
postpone\ "
\ char:
\ "
"escape"
}
"Strings are documented in " { $link "strings" } "." ;
ARTICLE: "syntax-sbufs" "String buffer syntax"
{ $subsections postpone\ SBUF" }
{ $subsections \ SBUF" }
"String buffers are documented in " { $link "sbufs" } "." ;
ARTICLE: "syntax-arrays" "Array syntax"
{ $subsections
postpone\ {
postpone\ }
\ {
\ }
}
"Arrays are documented in " { $link "arrays" } "." ;
ARTICLE: "syntax-vectors" "Vector syntax"
{ $subsections postpone\ V{ }
{ $subsections \ V{ }
"Vectors are documented in " { $link "vectors" } "." ;
ARTICLE: "syntax-hashtables" "Hashtable syntax"
{ $subsections postpone\ H{ }
{ $subsections \ H{ }
"Hashtables are documented in " { $link "hashtables" } "." ;
ARTICLE: "syntax-hash-sets" "Hash set syntax"
{ $subsections postpone\ HS{ }
{ $subsections \ HS{ }
"Hashtables are documented in " { $link "hash-sets" } "." ;
ARTICLE: "syntax-tuples" "Tuple syntax"
{ $subsections postpone\ T{ }
{ $subsections \ T{ }
"Tuples are documented in " { $link "tuples" } "." ;
ARTICLE: "syntax-quots" "Quotation syntax"
{ $subsections
postpone\ [
postpone\ ]
\ [
\ ]
}
"Quotations are documented in " { $link "quotations" } "." ;
ARTICLE: "syntax-byte-arrays" "Byte array syntax"
{ $subsections postpone\ B{ }
{ $subsections \ B{ }
"Byte arrays are documented in " { $link "byte-arrays" } "." ;
ARTICLE: "syntax-pathnames" "Pathname syntax"
{ $subsections postpone\ P" }
{ $subsections \ P" }
"Pathnames are documented in " { $link "io.pathnames" } "." ;
ARTICLE: "syntax-effects" "Stack effect syntax"
"Note that this is " { $emphasis "not" } " syntax to declare stack effects of words. This pushes an " { $link effect } " instance on the stack for reflection, for use with words such as " { $link define-declared } ", " { $link call-effect } " and " { $link execute-effect } "."
{ $subsections postpone\ ( }
{ $subsections \ ( }
{ $see-also "effects" "inference" "tools.inference" } ;
ARTICLE: "syntax-literals" "Literals"
@ -273,7 +273,7 @@ HELP: deprecated
HELP: \ SYNTAX:
{ $syntax "SYNTAX: foo ... ;" }
{ $description "Defines a parsing word." }
{ $examples "In the below example, the " { $snippet "world" } " word is never called, however its body references a parsing word which executes immediately:" { $example "use: io" "in: scratchpad" "<< SYNTAX: HELLO \"Hello parser!\" print ; >>\n: world ( -- ) HELLO ;" "Hello parser!" } } ;
{ $examples "In the below example, the " { $snippet "world" } " word is never called, however its body references a parsing word which executes immediately:" { $example "USE: io" "in: scratchpad" "<< SYNTAX: HELLO \"Hello parser!\" print ; >>\n: world ( -- ) HELLO ;" "Hello parser!" } } ;
HELP: inline
{ $syntax ": foo ... ; inline" }
@ -288,7 +288,7 @@ HELP: inline
HELP: recursive
{ $syntax ": foo ... ; recursive" }
{ $description "Declares the most recently defined word as a recursive word." }
{ $notes "This declaration is only required for " { $link postpone\ inline } " words which call themselves. See " { $link "inference-recursive-combinators" } "." } ;
{ $notes "This declaration is only required for " { $link \ inline } " words which call themselves. See " { $link "inference-recursive-combinators" } "." } ;
HELP: foldable
{ $syntax ": foo ... ; foldable" }
@ -349,31 +349,31 @@ $nl
HELP: \ {
{ $syntax "{ elements... }" }
{ $values { "elements" "a list of objects" } }
{ $description "Marks the beginning of a literal array. Literal arrays are terminated by " { $link postpone\ } } "." }
{ $description "Marks the beginning of a literal array. Literal arrays are terminated by " { $link \ } } "." }
{ $examples { $code "{ 1 2 3 }" } } ;
HELP: \ V{
{ $syntax "V{ elements... }" }
{ $values { "elements" "a list of objects" } }
{ $description "Marks the beginning of a literal vector. Literal vectors are terminated by " { $link postpone\ } } "." }
{ $description "Marks the beginning of a literal vector. Literal vectors are terminated by " { $link \ } } "." }
{ $examples { $code "V{ 1 2 3 }" } } ;
HELP: \ B{
{ $syntax "B{ elements... }" }
{ $values { "elements" "a list of integers" } }
{ $description "Marks the beginning of a literal byte array. Literal byte arrays are terminated by " { $link postpone\ } } "." }
{ $description "Marks the beginning of a literal byte array. Literal byte arrays are terminated by " { $link \ } } "." }
{ $examples { $code "B{ 1 2 3 }" } } ;
HELP: \ H{
{ $syntax "H{ { key value }... }" }
{ $values { "key" object } { "value" object } }
{ $description "Marks the beginning of a literal hashtable, given as a list of two-element arrays holding key/value pairs. Literal hashtables are terminated by " { $link postpone\ } } "." }
{ $description "Marks the beginning of a literal hashtable, given as a list of two-element arrays holding key/value pairs. Literal hashtables are terminated by " { $link \ } } "." }
{ $examples { $code "H{ { \"tuna\" \"fish\" } { \"jalapeno\" \"vegetable\" } }" } } ;
HELP: \ HS{
{ $syntax "HS{ members ... }" }
{ $values { "members" "a list of objects" } }
{ $description "Marks the beginning of a literal hash set, given as a list of its members. Literal hashtables are terminated by " { $link postpone\ } } "." }
{ $description "Marks the beginning of a literal hash set, given as a list of its members. Literal hashtables are terminated by " { $link \ } } "." }
{ $examples { $code "HS{ 3 \"foo\" }" } } ;
HELP: \ C{
@ -400,12 +400,12 @@ $nl
{ $code "T{ vector }" }
"A BOA-form tuple:"
{ $code
"use: colors"
"USE: colors"
"T{ rgba f 1.0 0.0 0.5 }"
}
"An assoc-form tuple equal to the above:"
{ $code
"use: colors"
"USE: colors"
"T{ rgba { red 1.0 } { green 0.0 } { blue 0.5 } }"
} } ;
@ -441,7 +441,7 @@ HELP: \ symbol:
{ $syntax "symbol: word" }
{ $values { "word" "a new word to define" } }
{ $description "Defines a new symbol word in the current vocabulary. Symbols push themselves on the stack when executed, and are used to identify variables (see " { $link "namespaces" } ") as well as for storing crufties in word properties (see " { $link "word-props" } ")." }
{ $examples { $example "use: prettyprint" "in: scratchpad" "symbol: foo\nfoo ." "foo" } } ;
{ $examples { $example "USE: prettyprint" "in: scratchpad" "symbol: foo\nfoo ." "foo" } } ;
{ define-symbol \ symbol: \ SYMBOLS: } related-words
@ -460,7 +460,7 @@ HELP: \ singleton:
"Defines a new singleton class. The class word itself is the sole instance of the singleton class."
}
{ $examples
{ $example "USING: classes.singleton kernel io ;" "in: singleton-demo" "use: prettyprint\nsingleton: foo\nGENERIC: bar ( obj -- ) ;\nM: foo bar drop \"a foo!\" print ;\nfoo bar" "a foo!" }
{ $example "USING: classes.singleton kernel io ;" "in: singleton-demo" "USE: prettyprint\nsingleton: foo\nGENERIC: bar ( obj -- ) ;\nM: foo bar drop \"a foo!\" print ;\nfoo bar" "a foo!" }
} ;
HELP: \ SINGLETONS:
@ -509,8 +509,8 @@ HELP: \ forget:
{ $values { "word" word } }
{ $description "Removes the word from its vocabulary, or does nothing if no such word exists. Existing definitions that reference forgotten words will continue to work, but new occurrences of the word will not parse." } ;
HELP: \ use:
{ $syntax "use: vocabulary" }
HELP: \ USE:
{ $syntax "USE: vocabulary" }
{ $values { "vocabulary" "a vocabulary name" } }
{ $description "Adds a new vocabulary to the search path, loading it first if necessary." }
{ $notes "If adding the vocabulary introduces ambiguity, referencing the ambiguous names will throw a " { $link ambiguous-use-error } "." }
@ -529,26 +529,26 @@ HELP: \ USING:
{ $notes "If adding the vocabularies introduces ambiguity, referencing the ambiguous names will throw a " { $link ambiguous-use-error } "." }
{ $errors "Throws an error if one of the vocabularies does not exist." } ;
HELP: \ qualified:
{ $syntax "qualified: vocab" }
HELP: \ QUALIFIED:
{ $syntax "QUALIFIED: vocab" }
{ $description "Adds the vocabulary's words, prefixed with the vocabulary name, to the search path." }
{ $notes "If adding the vocabulary introduces ambiguity, the vocabulary will take precedence when resolving any ambiguous names. This is a rare case; for example, suppose a vocabulary " { $snippet "fish" } " defines a word named " { $snippet "go:fishing" } ", and a vocabulary named " { $snippet "go" } " defines a word named " { $snippet "fishing" } ". Then, the following will call the latter word:"
{ $code
"use: fish"
"qualified: go"
"USE: fish"
"QUALIFIED: go"
"go:fishing"
}
}
{ $examples { $example
"USING: prettyprint ;"
"qualified: math"
"QUALIFIED: math"
"1 2 math:+ ."
"3"
} } ;
HELP: \ QUALIFIED-WITH:
{ $syntax "QUALIFIED-WITH: vocab word-prefix ;" }
{ $description "Like " { $link \ qualified: } " but uses " { $snippet "word-prefix" } " as prefix." }
{ $description "Like " { $link \ QUALIFIED: } " but uses " { $snippet "word-prefix" } " as prefix." }
{ $examples { $example
"USING: prettyprint ;"
"QUALIFIED-WITH: math m ;"
@ -584,10 +584,10 @@ HELP: \ RENAME:
"5"
} } ;
HELP: \ in:
{ $syntax "in: vocabulary" }
HELP: \ IN:
{ $syntax "IN: vocabulary" }
{ $values { "vocabulary" "a new vocabulary name" } }
{ $description "Sets the current vocabulary where new words will be defined, creating the vocabulary first if it does not exist. After the vocabulary has been created, it can be listed in " { $link \ use: } " and " { $link \ USING: } " declarations." } ;
{ $description "Sets the current vocabulary where new words will be defined, creating the vocabulary first if it does not exist. After the vocabulary has been created, it can be listed in " { $link \ USE: } " and " { $link \ USING: } " declarations." } ;
HELP: \ char:
{ $syntax "char: token" }
@ -609,11 +609,11 @@ HELP: \ "
{ $description "Reads from the input string until the next occurrence of " { $snippet "\"" } ", and appends the resulting string to the parse tree. String literals can span multiple lines. Various special characters can be read by inserting " { $link "escape" } "." }
{ $examples
"A string with an escaped newline in it:"
{ $example "use: io" "\"Hello\\nworld\" print" "Hello\nworld" }
{ $example "USE: io" "\"Hello\\nworld\" print" "Hello\nworld" }
"A string with an actual newline in it:"
{ $example "use: io" "\"Hello\nworld\" print" "Hello\nworld" }
{ $example "USE: io" "\"Hello\nworld\" print" "Hello\nworld" }
"A string with a named Unicode code point:"
{ $example "use: io" "\"\\u{greek-capital-letter-sigma}\" print" "\u{greek-capital-letter-sigma}" }
{ $example "USE: io" "\"\\u{greek-capital-letter-sigma}\" print" "\u{greek-capital-letter-sigma}" }
} ;
HELP: \ SBUF"
@ -636,7 +636,7 @@ HELP: \ (
{ $examples
{ $example
"USING: compiler.units kernel math prettyprint random words ;"
"in: scratchpad"
"IN: scratchpad"
""
"symbol: my-dynamic-word"
""
@ -658,7 +658,7 @@ HELP: \ nan:
{ $description "Adds a floating point Not-a-Number literal to the parse tree." }
{ $examples
{ $example
"use: prettyprint"
"USE: prettyprint"
"nan: 80000deadbeef ."
"nan: 80000deadbeef"
}
@ -691,8 +691,8 @@ HELP: \ HOOK:
{ $examples
{ $example
"USING: io namespaces ;"
"in: scratchpad"
"symbol: transport"
"IN: scratchpad"
"SYMBOL: transport"
"TUPLE: land-transport ;"
"TUPLE: air-transport ;"
"HOOK: deliver transport ( destination -- )"
@ -722,8 +722,8 @@ HELP: \ INTERSECTION:
{ $values { "class" "a new class word to define" } { "participants" "a list of class words separated by whitespace" } }
{ $description "Defines an intersection class. An object is an instance of an intersection class if it is an instance of all of its participants." } ;
HELP: \ mixin:
{ $syntax "mixin: class" }
HELP: \ MIXIN:
{ $syntax "MIXIN: class" }
{ $values { "class" "a new class word to define" } }
{ $description "Defines a mixin class. A mixin is similar to a union class, except it has no members initially, and new members can be added with the " { $link \ INSTANCE: } " word." }
{ $examples "The " { $link sequence } " and " { $link assoc } " mixin classes." } ;
@ -789,8 +789,8 @@ HELP: read-only
{ \ initial: \ read-only } related-words
HELP: \ slot:
{ $syntax "slot: name" }
HELP: \ SLOT:
{ $syntax "SLOT: name" }
{ $values { "name" "a slot name" } }
{ $description "Defines a protocol slot; that is, defines the accessor words for a slot named " { $snippet "slot" } " without associating it with any specific tuple." } ;

View File

@ -5,53 +5,53 @@ IN: vocabs.parser
ARTICLE: "word-search-errors" "Word lookup errors"
"If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies."
$nl
"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link postpone\ defer: } " was used."
"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link \ DEFER: } " was used."
$nl
"If " { $link auto-use? } " mode is on and only one vocabulary has a word with this name, the vocabulary is added to the search path and parsing continues."
$nl
"If any restarts were invoked, or if " { $link auto-use? } " is on, the parser will print the correct " { $link postpone\ USING: } " after parsing completes. This form can be copy and pasted back into the source file."
"If any restarts were invoked, or if " { $link auto-use? } " is on, the parser will print the correct " { $link \ USING: } " after parsing completes. This form can be copy and pasted back into the source file."
{ $subsections auto-use? } ;
ARTICLE: "word-search-syntax" "Syntax to control word lookup"
"Parsing words which make all words in a vocabulary available:"
{ $subsections
postpone\ use:
postpone\ USING:
postpone\ qualified:
postpone\ QUALIFIED-WITH:
\ USE:
\ USING:
\ QUALIFIED:
\ QUALIFIED-WITH:
}
"Parsing words which make a subset of all words in a vocabulary available:"
{ $subsections
postpone\ FROM:
postpone\ EXCLUDE:
postpone\ RENAME:
\ FROM:
\ EXCLUDE:
\ RENAME:
}
"Removing vocabularies from the search path:"
{ $subsections postpone\ unuse: }
"In the listener, the " { $vocab-link "scratchpad" } " is the default vocabulary for new word definitions. In source files, there is no default vocabulary. Defining words before declaring a vocabulary with " { $link postpone\ in: } " results in an error."
{ $subsections postpone\ in: } ;
{ $subsections \ unuse: }
"In the listener, the " { $vocab-link "scratchpad" } " is the default vocabulary for new word definitions. In source files, there is no default vocabulary. Defining words before declaring a vocabulary with " { $link \ in: } " results in an error."
{ $subsections \ in: } ;
ARTICLE: "word-search-semantics" "Resolution of ambiguous word names"
"There is a distinction between parsing words which perform “open” imports versus “closed” imports. An open import introduces all words from a vocabulary as identifiers, except possibly a finite set of exclusions. The " { $link postpone\ use: } ", " { $link postpone\ USING: } " and " { $link postpone\ EXCLUDE: } " words perform open imports. A closed import only adds a fixed set of identifiers. The " { $link postpone\ FROM: } ", " { $link postpone\ RENAME: } ", " { $link postpone\ qualified: } " and " { $link postpone\ QUALIFIED-WITH: } " words perform closed imports. Note that the latter two are considered as closed imports, due to the fact that all identifiers they introduce are unambiguously qualified with a prefix. The " { $link postpone\ in: } " parsing word also performs a closed import of the newly-created vocabulary."
"There is a distinction between parsing words which perform “open” imports versus “closed” imports. An open import introduces all words from a vocabulary as identifiers, except possibly a finite set of exclusions. The " { $link \ USE: } ", " { $link \ USING: } " and " { $link \ EXCLUDE: } " words perform open imports. A closed import only adds a fixed set of identifiers. The " { $link \ FROM: } ", " { $link \ RENAME: } ", " { $link \ QUALIFIED: } " and " { $link \ QUALIFIED-WITH: } " words perform closed imports. Note that the latter two are considered as closed imports, due to the fact that all identifiers they introduce are unambiguously qualified with a prefix. The " { $link \ in: } " parsing word also performs a closed import of the newly-created vocabulary."
$nl
"When the parser encounters a reference to a word, it first searches the closed imports, in order. Closed imports are searched from the most recent to least recent. If the word could not be found this way, it searches open imports. Unlike closed imports, with open imports, the order does not matter -- instead, if more than one vocabulary defines a word with this name, an error is thrown."
{ $subsections ambiguous-use-error }
"To resolve the error, add a closed import, using " { $link postpone\ FROM: } ", " { $link postpone\ qualified: } " or " { $link postpone\ QUALIFIED-WITH: } ". The closed import will then take precedence over the open imports, and the ambiguity will be resolved."
"To resolve the error, add a closed import, using " { $link \ FROM: } ", " { $link \ QUALIFIED: } " or " { $link \ QUALIFIED-WITH: } ". The closed import will then take precedence over the open imports, and the ambiguity will be resolved."
$nl
"The rationale for this behavior is as follows. Open imports are named such because they are open to future extension; if a future version of a vocabulary that you use adds new words, those new words will now be in scope in your source file, too. To avoid problems, any references to the new word have to be resolved since the parser cannot safely determine which vocabulary was meant. This problem can be avoided entirely by using only closed imports, but this leads to additional verbosity."
$nl
"In practice, a small set of guidelines helps avoid name clashes:"
{ $list
"Keep vocabularies small"
{ "Hide internal words using " { $link postpone\ PRIVATE< } }
{ "Make good use of " { $link postpone\ FROM: } ", " { $link postpone\ qualified: } " or " { $link postpone\ QUALIFIED-WITH: } }
{ "Hide internal words using " { $link \ PRIVATE< } }
{ "Make good use of " { $link \ FROM: } ", " { $link \ QUALIFIED: } " or " { $link \ QUALIFIED-WITH: } }
} ;
ARTICLE: "word-search-private" "Private words"
"Words which only serve as implementation detail should be defined in a private code block. Words in a private code blocks get defined in a vocabulary whose name is the name of the current vocabulary suffixed with " { $snippet ".private" } ". Privacy is not enforced by the system; private words can be called from other vocabularies, and from the listener. However, this should be avoided where possible."
{ $subsections
postpone\ PRIVATE<
postpone\ PRIVATE>
\ PRIVATE<
\ PRIVATE>
} ;
ARTICLE: "word-search" "Parse-time word lookup"
@ -79,7 +79,7 @@ $nl
add-words-from
add-words-excluding
}
"Words used to implement " { $link postpone\ in: } ":"
"Words used to implement " { $link \ in: } ":"
{ $subsections
current-vocab
set-current-vocab
@ -113,10 +113,10 @@ HELP: <no-word-error>
HELP: set-current-vocab
{ $values { "name" string } }
{ $description "Sets the current vocabulary where new words will be defined, creating the vocabulary first if it does not exist." }
{ $notes "This word is used to implement " { $link postpone\ in: } "." } ;
{ $notes "This word is used to implement " { $link \ in: } "." } ;
HELP: no-current-vocab
{ $error-description "Thrown when a new word is defined in a source file that does not have an " { $link postpone\ in: } " form." } ;
{ $error-description "Thrown when a new word is defined in a source file that does not have an " { $link \ in: } " form." } ;
HELP: current-vocab
{ $values { "vocab" vocab } }
@ -125,41 +125,41 @@ HELP: current-vocab
HELP: begin-private
{ $description "Begins a block of private word definitions. Private word definitions are placed in the current vocabulary name, suffixed with " { $snippet ".private" } "." }
{ $notes "This word is used to implement " { $link postpone\ PRIVATE< } "." } ;
{ $notes "This word is used to implement " { $link \ PRIVATE< } "." } ;
HELP: end-private
{ $description "Ends a block of private word definitions." }
{ $notes "This word is used to implement " { $link postpone\ PRIVATE> } "." } ;
{ $notes "This word is used to implement " { $link \ PRIVATE> } "." } ;
HELP: use-vocab
{ $values { "vocab" "a vocabulary specifier" } }
{ $description "Adds a vocabulary to the current manifest." }
{ $notes "This word is used to implement " { $link postpone\ use: } "." } ;
{ $notes "This word is used to implement " { $link \ USE: } "." } ;
HELP: unuse-vocab
{ $values { "vocab" "a vocabulary specifier" } }
{ $description "Removes a vocabulary from the current manifest." }
{ $notes "This word is used to implement " { $link postpone\ unuse: } "." } ;
{ $notes "This word is used to implement " { $link \ unuse: } "." } ;
HELP: add-qualified
{ $values { "vocab" "a vocabulary specifier" } { "prefix" string } }
{ $description "Adds the vocabulary's words, prefixed with the given string, to the current manifest." }
{ $notes "If adding the vocabulary introduces ambiguity, the vocabulary will take precedence when resolving any ambiguous names. See the example in " { $link postpone\ qualified: } " for further explanation." } ;
{ $notes "If adding the vocabulary introduces ambiguity, the vocabulary will take precedence when resolving any ambiguous names. See the example in " { $link \ QUALIFIED: } " for further explanation." } ;
HELP: add-words-from
{ $values { "vocab" "a vocabulary specifier" } { "words" { $sequence "word names" } } }
{ $description "Adds " { $snippet "words" } " from " { $snippet "vocab" } " to the current manifest." }
{ $notes "This word is used to implement " { $link postpone\ FROM: } "." } ;
{ $notes "This word is used to implement " { $link \ FROM: } "." } ;
HELP: add-words-excluding
{ $values { "vocab" "a vocabulary specifier" } { "words" { $sequence "word names" } } }
{ $description "Adds all words except for " { $snippet "words" } " from " { $snippet "vocab" } " to the manifest." }
{ $notes "This word is used to implement " { $link postpone\ EXCLUDE: } "." } ;
{ $notes "This word is used to implement " { $link \ EXCLUDE: } "." } ;
HELP: add-renamed-word
{ $values { "word" string } { "vocab" "a vocabulary specifier" } { "new-name" string } }
{ $description "Imports " { $snippet "word" } " from " { $snippet "vocab" } ", but renamed to " { $snippet "new-name" } "." }
{ $notes "This word is used to implement " { $link postpone\ RENAME: } "." } ;
{ $notes "This word is used to implement " { $link \ RENAME: } "." } ;
HELP: use-words
{ $values { "assoc" assoc } }
@ -170,7 +170,7 @@ HELP: unuse-words
{ $description "Removes an assoc mapping word names to words from the current manifest." } ;
HELP: ambiguous-use-error
{ $error-description "Thrown when a word name referenced in source file is available in more than one vocabulary in the manifest. Such cases must be explicitly disambiguated using " { $link postpone\ FROM: } ", " { $link postpone\ EXCLUDE: } ", " { $link postpone\ qualified: } ", or " { $link postpone\ QUALIFIED-WITH: } "." } ;
{ $error-description "Thrown when a word name referenced in source file is available in more than one vocabulary in the manifest. Such cases must be explicitly disambiguated using " { $link \ FROM: } ", " { $link \ EXCLUDE: } ", " { $link \ QUALIFIED: } ", or " { $link \ QUALIFIED-WITH: } "." } ;
HELP: search-manifest
{ $values { "name" string } { "manifest" manifest } { "word/f" { $maybe word } } }

View File

@ -4,15 +4,15 @@ USING: accessors alien.c-types alien.data alien.strings arrays
byte-arrays classes.struct combinators constructors
continuations destructors forestdb.ffi forestdb.paths fry
generalizations io.encodings.string io.encodings.utf8
io.pathnames kernel libc math multiline namespaces sequences
io.pathnames kernel libc math namespaces sequences
strings ;
qualified: sets
QUALIFIED: sets
IN: forestdb.lib
/*
![[
! Issues
! Get byseq ignores seqnum and uses key instead if key is set
*/
]]
ERROR: fdb-error error ;
@ -222,7 +222,7 @@ CONSTRUCTOR: <fdb-doc> fdb-doc ( seqnum keylen key metalen meta bodylen body del
TUPLE: fdb-info filename new-filename doc-count space-used file-size ;
CONSTRUCTOR: <info> fdb-info ( filename new-filename doc-count space-used file-size -- obj ) ;
/*
![[
! Example fdb_doc and converted doc
S{ fdb_doc
{ keylen 4 } { metalen 0 } { bodylen 4 } { size_ondisk 0 }
@ -235,7 +235,7 @@ T{ doc
{ metalen 0 } { bodylen 4 }
{ offset 4256 } { size-ondisk 0 }
}
*/
]]
: alien/length>string ( alien n -- string/f )
[ drop f ] [
@ -396,7 +396,7 @@ PRIVATE>
_ _ with-kvs-name
] with-forestdb-file-handle ; inline
/*
![[
! Do not try to commit here, as it will fail with FDB_RESULT_RONLY_VIOLATION
! fdb-current is weird, it gets replaced if you call fdb-rollback
! Therefore, only clean up fdb-current once, and clean it up at the end
@ -444,4 +444,4 @@ PRIVATE>
: with-forestdb-path ( path quot -- )
[ absolute-path fdb-open-default-config ] dip with-forestdb-handles-commit-wal ; inline
! [ absolute-path fdb-open-default-config ] dip with-forestdb-handle-commit-normal ; inline
*/
]]

View File

@ -1,7 +1,7 @@
USING: accessors arrays assocs continuations http.client kernel
literals math.ranges pcre pcre.ffi pcre.private random sequences
system tools.test ;
qualified: regexp
QUALIFIED: regexp
IN: pcre.tests
{ { "Bords" "words" "word" } } [

View File

@ -5,7 +5,7 @@ USING: accessors alien alien.accessors alien.c-types alien.data
alien.enums alien.strings arrays assocs combinators fry
io.encodings.string io.encodings.utf8 kernel literals math
math.bitwise pcre.ffi sequences splitting strings ;
qualified: regexp
QUALIFIED: regexp
IN: pcre
ERROR: bad-option what ;

View File

@ -3,7 +3,7 @@ hashtables init io.encodings.utf8 kernel namespaces
python.errors python.ffi python.objects sequences
specialized-arrays strings vectors ;
IN: python
qualified: math
QUALIFIED: math
ERROR: python-error type message traceback ;

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: alien.data alien.libraries alien.strings compiler.units
destructors fry io.encodings.utf8 kernel libc sequences words ;
qualified: readline.ffi
QUALIFIED: readline.ffi
IN: readline
: readline ( prompt -- str )

View File

@ -1,5 +1,5 @@
USING: accessors alien.c-types alien.syntax system vocabs ;
qualified: sequences
QUALIFIED: sequences
IN: unix.types
TYPEDEF: uchar u_int8_t ;

View File

@ -5,7 +5,7 @@ byte-arrays classes.struct combinators combinators.short-circuit
continuations fry grouping io.encodings.utf8 kernel math
math.parser namespaces sequences splitting strings system unix
unix.ffi vocabs ;
qualified: unix.ffi
QUALIFIED: unix.ffi
IN: unix.users
TUPLE: passwd user-name password uid gid gecos dir shell ;

View File

@ -6,8 +6,8 @@ USING: accessors alien.c-types alien.data arrays
combinators cpu.8080 cpu.8080.emulator io.pathnames kernel
locals math math.order openal openal.alut opengl.gl sequences
specialized-arrays ui ui.gadgets ui.gestures ui.render ;
qualified: threads
qualified: system
QUALIFIED: threads
QUALIFIED: system
SPECIALIZED-ARRAY: uchar
IN: space-invaders

View File

@ -4,7 +4,7 @@ USING: cpu.x86.assembler cpu.x86.assembler.operands kernel
layouts parser sequences ;
IN: bootstrap.x86
defer: stack-reg
DEFER: stack-reg
: stack-frame-size ( -- n ) 8 bootstrap-cells ;
: nv-regs ( -- seq ) { RBX RSI RDI R12 R13 R14 R15 } ;

View File

@ -4,7 +4,7 @@ USING: cpu.x86.assembler cpu.x86.assembler.operands kernel
layouts ;
IN: bootstrap.x86
defer: stack-reg
DEFER: stack-reg
: jit-save-tib ( -- ) ;
: jit-restore-tib ( -- ) ;

View File

@ -6,21 +6,21 @@ compiler.cfg.intrinsics.fixnum compiler.cfg.intrinsics.float
compiler.cfg.intrinsics.misc compiler.cfg.intrinsics.slots
compiler.cfg.intrinsics.strings compiler.cfg.stacks
cpu.architecture kernel words ;
qualified: alien
qualified: alien.accessors
qualified: alien.c-types
qualified: alien.data.private
qualified: arrays
qualified: byte-arrays
qualified: classes.tuple.private
qualified: kernel.private
qualified: math.bitwise.private
qualified: math.floats.private
qualified: math.integers.private
qualified: math.libm
qualified: math.private
qualified: slots.private
qualified: strings.private
QUALIFIED: alien
QUALIFIED: alien.accessors
QUALIFIED: alien.c-types
QUALIFIED: alien.data.private
QUALIFIED: arrays
QUALIFIED: byte-arrays
QUALIFIED: classes.tuple.private
QUALIFIED: kernel.private
QUALIFIED: math.bitwise.private
QUALIFIED: math.floats.private
QUALIFIED: math.integers.private
QUALIFIED: math.libm
QUALIFIED: math.private
QUALIFIED: slots.private
QUALIFIED: strings.private
IN: compiler.cfg.intrinsics
ERROR: inline-intrinsics-not-supported word quot ;

View File

@ -8,7 +8,7 @@ compiler.cfg.renaming.functor compiler.cfg.ssa.destruction.leaders
compiler.cfg.utilities fry heaps kernel make math namespaces sequences
;
IN: compiler.cfg.linear-scan.assignment
qualified: sets
QUALIFIED: sets
! This contains both active and inactive intervals; any interval
! such that start <= insn# <= end is in this set.

View File

@ -5,7 +5,7 @@ compiler.cfg.ssa.destruction.leaders compiler.cfg.utilities
cpu.architecture cpu.x86.assembler.operands kernel math namespaces
sequences system tools.test ;
IN: compiler.cfg.liveness.tests
qualified: sets
QUALIFIED: sets
! compute-edge-live-in
{ H{ } } [

View File

@ -3,7 +3,7 @@
USING: assocs compiler.cfg.instructions compiler.cfg.registers
compiler.cfg.ssa.destruction.leaders cpu.architecture deques
dlists fry kernel locals make namespaces sequences ;
qualified: sets
QUALIFIED: sets
IN: compiler.cfg.parallel-copy
PRIVATE<

View File

@ -1,7 +1,7 @@
USING: accessors arrays compiler.cfg compiler.cfg.debugger
compiler.cfg.ssa.construction.tdmsc compiler.cfg.utilities
kernel namespaces sequences tools.test ;
qualified: sets
QUALIFIED: sets
IN: compiler.cfg.ssa.construction.tdmsc.tests
: test-tdmsc ( -- )

View File

@ -3,7 +3,7 @@ compiler.cfg.registers compiler.cfg.ssa.destruction.coalescing
compiler.cfg.ssa.destruction.leaders compiler.cfg.ssa.interference
compiler.cfg.utilities cpu.architecture grouping kernel make
namespaces random sequences tools.test ;
qualified: sets
QUALIFIED: sets
IN: compiler.cfg.ssa.destruction.coalescing.tests
! eliminatable-copy?

View File

@ -3,7 +3,7 @@ compiler.cfg.stacks.height compiler.cfg.stacks.local
compiler.cfg.utilities compiler.test cpu.architecture kernel
kernel.private make math namespaces sequences.private slots.private
tools.test ;
qualified: sets
QUALIFIED: sets
IN: compiler.cfg.stacks.local.tests
! loc>vreg

View File

@ -250,7 +250,7 @@ HINTS: recursive-inline-hang array ;
[ t ] [ \ recursive-inline-hang-1 word-optimized? ] unit-test
defer: recursive-inline-hang-3
DEFER: recursive-inline-hang-3
: recursive-inline-hang-2 ( a -- a )
dup array? [ recursive-inline-hang-3 ] when ;
@ -344,7 +344,7 @@ TUPLE: some-tuple x ;
! Loop detection problem found by doublec
symbol: counter
defer: loop-bbb
DEFER: loop-bbb
: loop-aaa ( -- )
counter inc counter get 2 < [ loop-bbb ] when ; inline recursive

View File

@ -1,7 +1,7 @@
USING: compiler.units words tools.test math kernel ;
IN: compiler.tests.redefine15
defer: word-1
DEFER: word-1
: word-2 ( a -- b ) word-1 ;

View File

@ -121,7 +121,7 @@ IN: compiler.tests.simple
[ 5 ] [ after-if-test ] unit-test
defer: countdown-b
DEFER: countdown-b
: countdown-a ( n -- ) dup 0 eq? [ drop ] [ 1 fixnum- countdown-b ] if ;
: countdown-b ( n -- ) dup 0 eq? [ drop ] [ 1 fixnum- countdown-a ] if ;
@ -213,7 +213,7 @@ M: integer single-combination-test drop ;
[ 2 3 ] [ 2 3 4 single-combination-test ] unit-test
[ 2 f ] [ 2 3 f single-combination-test ] unit-test
defer: single-combination-test-2
DEFER: single-combination-test-2
: single-combination-test-4 ( obj -- obj )
dup [ single-combination-test-2 ] when ;

View File

@ -2,7 +2,7 @@ USING: multi-methods tools.test math sequences namespaces system
kernel strings words compiler.units quotations ;
IN: multi-methods.tests
defer: fake
DEFER: fake
\ fake H{ } clone "multi-methods" set-word-prop
COMPILE< ( -- ) \ fake set-stack-effect COMPILE>
@ -22,7 +22,7 @@ COMPILE< ( -- ) \ fake set-stack-effect COMPILE>
[ ] [ \ fake update-generic ] unit-test
defer: testing
DEFER: testing
[ ] [ \ testing ( -- ) define-generic ] unit-test

View File

@ -58,7 +58,7 @@ M: object simd-rep drop f ;
COMPILE<
PRIVATE<
defer: simd-construct-op
DEFER: simd-construct-op
! Unboxers for SIMD operations
: if-both-vectors ( a b rep t f -- )