]> gitweb.factorcode.org Git - factor.git/commitdiff
syntax: redo INITIALIZE: as INITIALIZED-SYMBOL:
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 28 Jan 2023 00:22:14 +0000 (18:22 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 28 Jan 2023 04:41:03 +0000 (22:41 -0600)
INITIALIZE: doesn't make much sense to me, but `INITIALIZED-SYMBOL: foo [ 10 ]`
seems better

basis/bootstrap/syntax.factor
basis/fixups/fixups.factor
core/syntax/syntax-docs.factor
core/syntax/syntax.factor
misc/vim/syntax/factor/generated.vim

index 02af91f74e761762900f06a4f8b663df015b92d3..414edcd8305fa401b427a249cfacf16ca9dabaad 100644 (file)
@@ -44,7 +44,7 @@ IN: bootstrap.syntax
         "BUILTIN:"
         "SYMBOL:"
         "SYMBOLS:"
-        "INITIALIZE:"
+        "INITIALIZED-SYMBOL:"
         "CONSTANT:"
         "TUPLE:"
         "final"
index e475a154ddeb365938fb5b298c7adb9b64dfac1a..77a2019bb62fc5b0b37d9abd4defba9b6106a187 100644 (file)
@@ -50,6 +50,7 @@ CONSTANT: word-renames {
     { "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 )
index cd5b9f44c04e9395e815de024bd15d7cb06a0efa..22483d44923c1bb8cd3f5222cc13ba46ef1694a1 100644 (file)
@@ -504,23 +504,16 @@ HELP: SYMBOLS:
 { $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:
index dab509de5d31009f21046bde930cc0880b4be07d..d3bec9f3dd0164d37b3b4a98297d396cd6e5ed05 100644 (file)
@@ -135,8 +135,8 @@ IN: bootstrap.syntax
         ";" [ 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:" [
index 4cc721bd8608ed07829d3f42b01187ec3bbef78e..ffb992904784ba599ee043b250f808d2f689a773 100644 (file)
@@ -47,7 +47,7 @@ SynKeywordFactorWord factorWord_sorting | syn keyword factorWord_sorting contain
 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