From baac97876798288567e068229d0b49c51ddb6b8c Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 26 Sep 2011 11:08:26 -0700 Subject: [PATCH] Removing "to:" syntax from values. Squashed commit of the following: commit 18fef6bfa59f71dcb63b439f631c735848a9bbbb Author: John Benediktsson Date: Mon Sep 26 11:02:26 2011 -0700 vocabs.metadata: revert mistaken change. commit 496b103b54034ea953882a039c08847d0eda0bb4 Author: John Benediktsson Date: Sun Sep 25 19:03:54 2011 -0700 values: Removing "to:" syntax. --- basis/io/encodings/gb18030/gb18030.factor | 4 ++-- basis/io/encodings/iso2022/iso2022.factor | 8 ++++---- basis/io/encodings/shift-jis/shift-jis.factor | 4 ++-- basis/tools/deploy/test/6/6.factor | 4 ++-- basis/unicode/breaks/breaks.factor | 6 +++--- basis/unicode/collation/collation.factor | 2 +- basis/unicode/data/data.factor | 20 +++++++++---------- basis/unicode/script/script.factor | 2 +- basis/values/values-docs.factor | 16 ++------------- basis/values/values-tests.factor | 2 +- basis/values/values.factor | 4 ---- basis/xml/entities/html/html.factor | 2 +- unmaintained/4DNav/4DNav.factor | 4 ++-- unmaintained/adsoda/adsoda.factor | 8 ++++---- 14 files changed, 35 insertions(+), 51 deletions(-) diff --git a/basis/io/encodings/gb18030/gb18030.factor b/basis/io/encodings/gb18030/gb18030.factor index 512b52ef19..32b3e1787c 100644 --- a/basis/io/encodings/gb18030/gb18030.factor +++ b/basis/io/encodings/gb18030/gb18030.factor @@ -84,8 +84,8 @@ VALUE: mapping "vocab:io/encodings/gb18030/gb-18030-2000.xml" ascii xml>gb-data -[ ranges-u>gb to: u>gb ] [ ranges-gb>u to: gb>u ] bi ->biassoc to: mapping +[ ranges-u>gb \ u>gb set-value ] [ ranges-gb>u \ gb>u set-value ] bi +>biassoc \ mapping set-value : lookup-range ( char -- byte-array ) dup u>gb interval-at [ diff --git a/basis/io/encodings/iso2022/iso2022.factor b/basis/io/encodings/iso2022/iso2022.factor index 4f092d6282..874ee2378f 100644 --- a/basis/io/encodings/iso2022/iso2022.factor +++ b/basis/io/encodings/iso2022/iso2022.factor @@ -13,12 +13,12 @@ VALUE: jis201 VALUE: jis208 VALUE: jis212 -"vocab:io/encodings/iso2022/201.txt" flat-file>biassoc to: jis201 -"vocab:io/encodings/iso2022/208.txt" flat-file>biassoc to: jis208 -"vocab:io/encodings/iso2022/212.txt" flat-file>biassoc to: jis212 +"vocab:io/encodings/iso2022/201.txt" flat-file>biassoc \ jis201 set-value +"vocab:io/encodings/iso2022/208.txt" flat-file>biassoc \ jis208 set-value +"vocab:io/encodings/iso2022/212.txt" flat-file>biassoc \ jis212 set-value VALUE: ascii -128 iota unique >biassoc to: ascii +128 iota unique >biassoc \ ascii set-value TUPLE: iso2022-state type ; diff --git a/basis/io/encodings/shift-jis/shift-jis.factor b/basis/io/encodings/shift-jis/shift-jis.factor index 99cfa26d12..efb57d8286 100644 --- a/basis/io/encodings/shift-jis/shift-jis.factor +++ b/basis/io/encodings/shift-jis/shift-jis.factor @@ -36,10 +36,10 @@ TUPLE: jis assoc ; flat-file>biassoc [ nip ] assoc-filter jis boa ; "vocab:io/encodings/shift-jis/CP932.txt" -make-jis to: windows-31j-table +make-jis \ windows-31j-table set-value "vocab:io/encodings/shift-jis/sjis-0208-1997-std.txt" -make-jis to: shift-jis-table +make-jis \ shift-jis-table set-value : small? ( char -- ? ) ! ASCII range or single-byte halfwidth katakana diff --git a/basis/tools/deploy/test/6/6.factor b/basis/tools/deploy/test/6/6.factor index da64bb646c..7d5b4f4fba 100644 --- a/basis/tools/deploy/test/6/6.factor +++ b/basis/tools/deploy/test/6/6.factor @@ -6,8 +6,8 @@ VALUE: x VALUE: y : deploy-test-6 ( -- ) - 1 to: x - 2 to: y + 1 \ x set-value + 2 \ y set-value x y + 3 assert= ; MAIN: deploy-test-6 diff --git a/basis/unicode/breaks/breaks.factor b/basis/unicode/breaks/breaks.factor index b0943a7f98..5f31ca81fd 100644 --- a/basis/unicode/breaks/breaks.factor +++ b/basis/unicode/breaks/breaks.factor @@ -134,14 +134,14 @@ PRIVATE> graphemes init-table table [ make-grapheme-table finish-table ] with-variable -to: grapheme-table +\ grapheme-table set-value ! Word breaks VALUE: word-break-table "vocab:unicode/data/WordBreakProperty.txt" load-interval-file -to: word-break-table +\ word-break-table set-value CONSTANT: wOther 0 CONSTANT: wCR 1 @@ -198,7 +198,7 @@ VALUE: word-table words init-table table [ make-word-table finish-word-table ] with-variable -to: word-table +\ word-table set-value : word-table-nth ( class1 class2 -- ? ) word-table nth nth ; diff --git a/basis/unicode/collation/collation.factor b/basis/unicode/collation/collation.factor index 2c29de3f28..05338c8ea4 100644 --- a/basis/unicode/collation/collation.factor +++ b/basis/unicode/collation/collation.factor @@ -25,7 +25,7 @@ TUPLE: weight primary secondary tertiary ignorable? ; : parse-ducet ( file -- ducet ) data [ [ parse-keys ] [ parse-weight ] bi* ] H{ } assoc-map-as ; -"vocab:unicode/collation/allkeys.txt" parse-ducet to: ducet +"vocab:unicode/collation/allkeys.txt" parse-ducet \ ducet set-value ! Fix up table for long contractions : help-one ( assoc key -- ) diff --git a/basis/unicode/data/data.factor b/basis/unicode/data/data.factor index dc6c4bfd99..70250d9913 100644 --- a/basis/unicode/data/data.factor +++ b/basis/unicode/data/data.factor @@ -198,14 +198,14 @@ C: code-point [ [ set-code-point ] each ] H{ } make-assoc ; load-data { - [ process-names to: name-map ] - [ 13 swap process-data to: simple-lower ] - [ 12 swap process-data to: simple-upper ] - [ 14 swap process-data simple-upper assoc-union to: simple-title ] - [ process-combining to: class-map ] - [ process-canonical to: canonical-map to: combine-map ] - [ process-compatibility to: compatibility-map ] - [ process-category to: category-map ] + [ process-names \ name-map set-value ] + [ 13 swap process-data \ simple-lower set-value ] + [ 12 swap process-data \ simple-upper set-value ] + [ 14 swap process-data simple-upper assoc-union \ simple-title set-value ] + [ process-combining \ class-map set-value ] + [ process-canonical \ canonical-map set-value \ combine-map set-value ] + [ process-compatibility \ compatibility-map set-value ] + [ process-category \ category-map set-value ] } cleave : postprocess-class ( -- ) @@ -215,9 +215,9 @@ load-data { postprocess-class -load-special-casing to: special-casing +load-special-casing \ special-casing set-value -load-properties to: properties +load-properties \ properties set-value [ name>char [ "Invalid character" throw ] unless* ] name>char-hook set-global diff --git a/basis/unicode/script/script.factor b/basis/unicode/script/script.factor index 4243c81623..2cd3eade17 100644 --- a/basis/unicode/script/script.factor +++ b/basis/unicode/script/script.factor @@ -8,7 +8,7 @@ IN: unicode.script VALUE: script-table "vocab:unicode/script/Scripts.txt" load-interval-file -to: script-table +\ script-table set-value PRIVATE> diff --git a/basis/values/values-docs.factor b/basis/values/values-docs.factor index 880dcf3d8a..d3491af0d2 100644 --- a/basis/values/values-docs.factor +++ b/basis/values/values-docs.factor @@ -8,7 +8,6 @@ ARTICLE: "values" "Global values" { $subsections get-value set-value - POSTPONE: to: change-value } ; @@ -17,13 +16,13 @@ ABOUT: "values" HELP: VALUE: { $syntax "VALUE: word" } { $values { "word" "a word to be created" } } -{ $description "Creates a value on the given word, initializing it to hold " { $snippet "f" } ". To get the value, just run the word. To set it, use " { $link POSTPONE: to: } "." } +{ $description "Creates a value on the given word, initializing it to hold " { $snippet "f" } ". To get the value, just run the word. To set it, use " { $link set-value } "." } { $examples { $example "USING: values math prettyprint ;" "IN: scratchpad" "VALUE: x" - "2 2 + to: x" + "2 2 + \ x set-value" "x ." "4" } @@ -37,17 +36,6 @@ HELP: set-value { $values { "value" "a new value" } { "word" "a value word" } } { $description "Sets a value word." } ; -HELP: to: -{ $syntax "... to: value" } -{ $values { "word" "a value word" } } -{ $description "Sets a value word." } -{ $notes - "Note that" - { $code "foo to: value" } - "is just sugar for" - { $code "foo \\ value set-value" } -} ; - HELP: change-value { $values { "word" "a value word" } { "quot" { $quotation "( oldvalue -- newvalue )" } } } { $description "Changes the value using the given quotation." } ; diff --git a/basis/values/values-tests.factor b/basis/values/values-tests.factor index 74c63e3d8f..943b5f0098 100644 --- a/basis/values/values-tests.factor +++ b/basis/values/values-tests.factor @@ -3,7 +3,7 @@ IN: values.tests VALUE: foo [ f ] [ foo ] unit-test -[ ] [ 3 to: foo ] unit-test +[ ] [ 3 \ foo set-value ] unit-test [ 3 ] [ foo ] unit-test [ ] [ \ foo [ 1 + ] change-value ] unit-test [ 4 ] [ foo ] unit-test diff --git a/basis/values/values.factor b/basis/values/values.factor index 61217b1037..8154c7db59 100644 --- a/basis/values/values.factor +++ b/basis/values/values.factor @@ -43,10 +43,6 @@ M: value-word definition drop f ; : set-value ( value word -- ) def>> first obj<< ; -SYNTAX: to: - scan-word literalize suffix! - \ set-value suffix! ; - : get-value ( word -- value ) def>> first obj>> ; diff --git a/basis/xml/entities/html/html.factor b/basis/xml/entities/html/html.factor index fd8480307a..7b14daa7af 100644 --- a/basis/xml/entities/html/html.factor +++ b/basis/xml/entities/html/html.factor @@ -15,7 +15,7 @@ VALUE: html-entities read-entities-file ] map first3 assoc-union assoc-union ; -get-html to: html-entities +get-html \ html-entities set-value : with-html-entities ( quot -- ) html-entities swap with-entities ; inline diff --git a/unmaintained/4DNav/4DNav.factor b/unmaintained/4DNav/4DNav.factor index b9679ec26b..d0901c8d57 100644 --- a/unmaintained/4DNav/4DNav.factor +++ b/unmaintained/4DNav/4DNav.factor @@ -61,8 +61,8 @@ VALUE: selected-file VALUE: translation-step VALUE: rotation-step -3 to: translation-step -5 to: rotation-step +3 \ translation-step set-value +5 \ rotation-step set-value VAR: selected-file-model VAR: observer3d diff --git a/unmaintained/adsoda/adsoda.factor b/unmaintained/adsoda/adsoda.factor index cc09ad5281..a89c4880e1 100644 --- a/unmaintained/adsoda/adsoda.factor +++ b/unmaintained/adsoda/adsoda.factor @@ -48,10 +48,10 @@ VALUE: VERY-SMALL-NUM VALUE: ZERO-VALUE VALUE: MAX-FACE-PER-CORNER -t to: remove-hidden-solids? -0.0000001 to: VERY-SMALL-NUM -0.0000001 to: ZERO-VALUE -4 to: MAX-FACE-PER-CORNER +t \ remove-hidden-solids? set-value +0.0000001 \ VERY-SMALL-NUM set-value +0.0000001 \ ZERO-VALUE set-value +4 \ MAX-FACE-PER-CORNER set-value ! ------------------------------------------------------------- ! sequence complement -- 2.34.1