"vocab:io/encodings/gb18030/gb-18030-2000.xml"
ascii <file-reader> 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 [
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 ;
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
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
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
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 ;
: parse-ducet ( file -- ducet )\r
data [ [ parse-keys ] [ parse-weight ] bi* ] H{ } assoc-map-as ;\r
\r
-"vocab:unicode/collation/allkeys.txt" parse-ducet to: ducet\r
+"vocab:unicode/collation/allkeys.txt" parse-ducet \ ducet set-value\r
\r
! Fix up table for long contractions\r
: help-one ( assoc key -- )\r
[ [ 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 ( -- )
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
VALUE: script-table
"vocab:unicode/script/Scripts.txt" load-interval-file
-to: script-table
+\ script-table set-value
PRIVATE>
{ $subsections\r
get-value\r
set-value\r
- POSTPONE: to:\r
change-value\r
} ;\r
\r
HELP: VALUE:\r
{ $syntax "VALUE: word" }\r
{ $values { "word" "a word to be created" } }\r
-{ $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: } "." }\r
+{ $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 } "." }\r
{ $examples\r
{ $example\r
"USING: values math prettyprint ;"\r
"IN: scratchpad"\r
"VALUE: x"\r
- "2 2 + to: x"\r
+ "2 2 + \ x set-value"\r
"x ."\r
"4"\r
}\r
{ $values { "value" "a new value" } { "word" "a value word" } }\r
{ $description "Sets a value word." } ;\r
\r
-HELP: to:\r
-{ $syntax "... to: value" }\r
-{ $values { "word" "a value word" } }\r
-{ $description "Sets a value word." }\r
-{ $notes\r
- "Note that"\r
- { $code "foo to: value" }\r
- "is just sugar for"\r
- { $code "foo \\ value set-value" }\r
-} ;\r
-\r
HELP: change-value\r
{ $values { "word" "a value word" } { "quot" { $quotation "( oldvalue -- newvalue )" } } }\r
{ $description "Changes the value using the given quotation." } ;\r
\r
VALUE: foo\r
[ f ] [ foo ] unit-test\r
-[ ] [ 3 to: foo ] unit-test\r
+[ ] [ 3 \ foo set-value ] unit-test\r
[ 3 ] [ foo ] unit-test\r
[ ] [ \ foo [ 1 + ] change-value ] unit-test\r
[ 4 ] [ foo ] unit-test\r
: set-value ( value word -- )
def>> first obj<< ;
-SYNTAX: to:
- scan-word literalize suffix!
- \ set-value suffix! ;
-
: get-value ( word -- value )
def>> first obj>> ;
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
VALUE: translation-step\r
VALUE: rotation-step\r
\r
-3 to: translation-step \r
-5 to: rotation-step\r
+3 \ translation-step set-value\r
+5 \ rotation-step set-value\r
\r
VAR: selected-file-model\r
VAR: observer3d \r
VALUE: ZERO-VALUE\r
VALUE: MAX-FACE-PER-CORNER\r
\r
-t to: remove-hidden-solids?\r
-0.0000001 to: VERY-SMALL-NUM\r
-0.0000001 to: ZERO-VALUE\r
-4 to: MAX-FACE-PER-CORNER\r
+t \ remove-hidden-solids? set-value\r
+0.0000001 \ VERY-SMALL-NUM set-value\r
+0.0000001 \ ZERO-VALUE set-value\r
+4 \ MAX-FACE-PER-CORNER set-value\r
! -------------------------------------------------------------\r
! sequence complement\r
\r