"BUILTIN:"
"SYMBOL:"
"SYMBOLS:"
- "INITIALIZE:"
+ "INITIALIZED-SYMBOL:"
"CONSTANT:"
"TUPLE:"
"final"
{ "map-integers" { "map-integers-as" "0.99" } }
{ "deep-subseq?" { "deep-subseq-of?" "0.99" } }
{ "overtomorrow" { "overmorrow" "0.99" } }
+ { "INITIALIZE:" { "INITIALIZED-SYMBOL:" "0.99" } }
}
: compute-assoc-fixups ( continuation name assoc -- seq )
{ $description "Creates a new symbol for every token until the " { $snippet ";" } "." }
{ $examples { $example "USING: prettyprint ;" "IN: scratchpad" "SYMBOLS: foo bar baz ;\nfoo . bar . baz ." "foo\nbar\nbaz" } } ;
-HELP: INITIALIZE:
-{ $syntax "INITIALIZE: word ... ;" }
-{ $description "If " { $snippet "word" } " does not have a value in the global namespace, calls the definition and assigns the result to " { $snippet "word" } " in the global namespace." }
+HELP: INITIALIZED-SYMBOL:
+{ $syntax "INITIALIZE-SYMBOL: word [ ... ]" }
+{ $description "Defines a new symbol " { $snippet "word" } " and sets the value in the global namespace." }
{ $examples
{ $unchecked-example
"USING: math namespaces prettyprint ;"
- "SYMBOL: foo"
- "INITIALIZE: foo 15 sq ;"
+ "INITIALIZED-SYMBOL: foo [ 15 sq ]"
"foo get-global ."
- "225" }
- { $unchecked-example
- "USING: math namespaces prettyprint ;"
- "SYMBOL: foo"
- "1234 foo set-global"
- "INITIALIZE: foo 15 sq ;"
- "foo get-global ."
- "1234" }
+ "225"
+ }
} ;
HELP: SINGLETON:
";" [ create-word-in [ reset-generic ] [ define-symbol ] bi ] each-token
] define-core-syntax
- "INITIALIZE:" [
- scan-word parse-definition [ initialize ] 2curry append!
+ "INITIALIZED-SYMBOL:" [
+ scan-new-word [ define-symbol ] [ scan-object [ initialize ] 2curry ] bi append!
] define-core-syntax
"SINGLETONS:" [
SynKeywordFactorWord factorWord_splitting | syn keyword factorWord_splitting contained ?head ?head-slice ?snip ?snip-slice ?tail ?tail-slice join-lines join-lines-as join-words join-words-as replace split split-indices split-lines split-slice split-subseq split-when split-when-slice split-words split1 split1-last split1-last-slice split1-slice split1-when split1-when-slice string-lines subseq-range
SynKeywordFactorWord factorWord_strings | syn keyword factorWord_strings contained 1string <string> >string resize-string string string?
SynKeywordFactorWord factorWord_strings_parser | syn keyword factorWord_strings_parser contained bad-escape bad-escape? escape name>char-hook parse-string unescape-string
-SynKeywordFactorWord factorWord_syntax | syn keyword factorWord_syntax contained " 'HS{ 'H{ '[ '{ ( : :: :> ; << <<<<<< <<<<<<< <PRIVATE ====== ======= >> >>>>>> >>>>>>> @ ALIAS: B B: BUILTIN: BV{ B{ C: CHAR: CONSTANT: CS{ C{ DEFER: ERROR: EXCLUDE: FORGET: FROM: GENERIC#: GENERIC: HOOK: HS{ H{ IDENTITY-MEMO: IDENTITY-MEMO:: IH{ IN: INITIALIZE: INSTANCE: INTERSECTION: M: M:: MACRO: MACRO:: MAIN: MATH: MEMO: MEMO:: MIXIN: M\ NAN: P" POSTPONE: PREDICATE: PRIMITIVE: PRIVATE> QUALIFIED-WITH: QUALIFIED: RENAME: REUSE: SBUF" SHUTDOWN-HOOK: SINGLETON: SINGLETONS: SLOT: STARTUP-HOOK: SYMBOL: SYMBOLS: SYNTAX: TUPLE: T{ UNION: UNUSE: USE: USING: V{ W{ [ [let [\| \ ] _ auto-use call( call-next-method delimiter deprecated execute( f final flushable foldable initial: inline intersection{ maybe{ not{ read-only recursive t t? union{ { }
+SynKeywordFactorWord factorWord_syntax | syn keyword factorWord_syntax contained " 'HS{ 'H{ '[ '{ ( : :: :> ; << <<<<<< <<<<<<< <PRIVATE ====== ======= >> >>>>>> >>>>>>> @ ALIAS: B B: BUILTIN: BV{ B{ C: CHAR: CONSTANT: CS{ C{ DEFER: ERROR: EXCLUDE: FORGET: FROM: GENERIC#: GENERIC: HOOK: HS{ H{ IDENTITY-MEMO: IDENTITY-MEMO:: IH{ IN: INITIALIZED-SYMBOL: INSTANCE: INTERSECTION: M: M:: MACRO: MACRO:: MAIN: MATH: MEMO: MEMO:: MIXIN: M\ NAN: P" POSTPONE: PREDICATE: PRIMITIVE: PRIVATE> QUALIFIED-WITH: QUALIFIED: RENAME: REUSE: SBUF" SHUTDOWN-HOOK: SINGLETON: SINGLETONS: SLOT: STARTUP-HOOK: SYMBOL: SYMBOLS: SYNTAX: TUPLE: T{ UNION: UNUSE: USE: USING: V{ W{ [ [let [\| \ ] _ auto-use call( call-next-method delimiter deprecated execute( f final flushable foldable initial: inline intersection{ maybe{ not{ read-only recursive t t? union{ { }
SynKeywordFactorWord factorWord_vectors | syn keyword factorWord_vectors contained 1vector <vector> >vector ?push vector vector?
delcommand HiLink