From a85ae72783b4a070582d32250252cbae5deb4821 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 4 Jun 2017 16:00:02 -0500 Subject: [PATCH] factor: CHAR: -> char: --- basis/alien/c-types/c-types.factor | 2 +- .../alien/libraries/finder/linux/linux.factor | 2 +- basis/alien/parser/parser.factor | 2 +- basis/ascii/ascii-tests.factor | 14 +- basis/ascii/ascii.factor | 8 +- basis/base64/base64.factor | 8 +- basis/calendar/format/format.factor | 6 +- basis/calendar/parser/parser.factor | 14 +- .../checksums/adler-32/adler-32-tests.factor | 2 +- basis/checksums/bsd/bsd-tests.factor | 2 +- basis/checksums/crc16/crc16.factor | 2 +- basis/checksums/sha/sha-tests.factor | 2 +- basis/circular/circular-tests.factor | 12 +- basis/cocoa/messages/messages.factor | 8 +- basis/colors/constants/constants.factor | 2 +- .../cfg/linear-scan/debugger/debugger.factor | 4 +- basis/compiler/tests/intrinsics.factor | 12 +- basis/csv/csv-docs.factor | 2 +- basis/csv/csv-tests.factor | 2 +- basis/csv/csv.factor | 16 +- basis/db/postgresql/postgresql.factor | 2 +- basis/db/tester/tester.factor | 2 +- basis/db/tuples/tuples-tests.factor | 2 +- basis/environment/environment-tests.factor | 2 +- basis/farkup/farkup.factor | 46 +++--- basis/formatting/formatting-tests.factor | 2 +- basis/formatting/formatting.factor | 18 +-- basis/ftp/client/client.factor | 4 +- .../listing-parser/listing-parser.factor | 30 ++-- .../auth/providers/couchdb/couchdb.factor | 2 +- .../gobject-introspection/types/types.factor | 2 +- basis/help/html/html.factor | 28 ++-- basis/help/tutorial/tutorial.factor | 4 +- basis/html/streams/streams-tests.factor | 2 +- basis/html/streams/streams.factor | 2 +- basis/html/templates/chloe/chloe-tests.factor | 2 +- basis/html/templates/fhtml/fhtml.factor | 2 +- basis/http/parsers/parsers.factor | 2 +- basis/io/backend/unix/unix.factor | 2 +- basis/io/buffers/buffers-tests.factor | 6 +- basis/io/crlf/crlf.factor | 6 +- basis/io/encodings/8-bit/8-bit-tests.factor | 4 +- basis/io/encodings/euc/euc-tests.factor | 2 +- .../io/encodings/gb18030/gb18030-tests.factor | 8 +- .../io/encodings/iso2022/iso2022-tests.factor | 44 ++--- basis/io/encodings/iso2022/iso2022.factor | 24 +-- .../shift-jis/shift-jis-tests.factor | 20 +-- basis/io/encodings/utf32/utf32-tests.factor | 26 +-- basis/io/encodings/utf7/utf7.factor | 10 +- basis/io/files/info/unix/linux/linux.factor | 2 +- basis/io/files/info/unix/unix.factor | 30 ++-- basis/io/files/info/windows/windows.factor | 2 +- basis/io/files/unique/unique-tests.factor | 2 +- basis/io/files/windows/windows.factor | 2 +- basis/io/launcher/windows/windows.factor | 10 +- basis/io/mmap/mmap-tests.factor | 2 +- .../io/sockets/secure/openssl/openssl.factor | 2 +- basis/io/streams/limited/limited-tests.factor | 6 +- basis/io/streams/string/string-tests.factor | 8 +- basis/io/streams/string/string.factor | 4 +- .../io/streams/throwing/throwing-tests.factor | 2 +- basis/ip-parser/ip-parser.factor | 2 +- basis/json/prettyprint/prettyprint.factor | 2 +- basis/json/reader/reader.factor | 50 +++--- basis/json/writer/writer.factor | 36 ++--- basis/lcs/diff2html/diff2html.factor | 2 +- basis/lcs/lcs-tests.factor | 16 +- basis/locals/locals-tests.factor | 4 +- basis/logging/server/server.factor | 2 +- basis/mime/multipart/multipart-tests.factor | 2 +- basis/multiline/multiline.factor | 6 +- basis/pack/pack.factor | 86 +++++----- basis/peg/ebnf/ebnf-docs.factor | 2 +- basis/peg/ebnf/ebnf-tests.factor | 16 +- basis/peg/ebnf/ebnf.factor | 12 +- basis/peg/parsers/parsers-docs.factor | 2 +- basis/peg/parsers/parsers.factor | 10 +- basis/peg/peg-docs.factor | 4 +- basis/peg/peg-tests.factor | 26 +-- .../hashtables/hashtables-tests.factor | 2 +- basis/porter-stemmer/porter-stemmer.factor | 8 +- basis/prettyprint/backend/backend.factor | 24 +-- basis/prettyprint/prettyprint-tests.factor | 2 +- basis/prettyprint/sections/sections.factor | 2 +- .../quoted-printable/quoted-printable.factor | 14 +- basis/random/data/data.factor | 6 +- basis/regexp/classes/classes-tests.factor | 8 +- basis/regexp/classes/classes.factor | 14 +- basis/regexp/compiler/compiler.factor | 4 +- basis/regexp/minimize/minimize-tests.factor | 16 +- basis/regexp/negation/negation-tests.factor | 4 +- basis/regexp/nfa/nfa.factor | 4 +- basis/regexp/parser/parser.factor | 46 +++--- basis/regexp/regexp.factor | 4 +- .../generalizations-docs.factor | 2 +- basis/sequences/parser/parser-tests.factor | 2 +- basis/serialize/serialize.factor | 62 ++++---- basis/smtp/smtp.factor | 2 +- basis/strings/tables/tables.factor | 2 +- .../tools/completion/completion-tests.factor | 6 +- basis/tools/completion/completion.factor | 2 +- basis/tools/deploy/config/config-docs.factor | 4 +- basis/tools/disassembler/udis/udis.factor | 4 +- basis/tools/files/files.factor | 10 +- basis/tools/hexdump/hexdump.factor | 8 +- basis/tools/profiler/sampling/sampling.factor | 2 +- basis/tools/scaffold/scaffold.factor | 6 +- basis/tools/test/test.factor | 2 +- basis/tools/trace/trace.factor | 2 +- basis/ui/backend/windows/windows.factor | 2 +- basis/ui/backend/x11/x11.factor | 6 +- basis/ui/gadgets/grids/grids.factor | 2 +- basis/ui/gadgets/labels/labels.factor | 2 +- basis/ui/gadgets/panes/panes.factor | 2 +- basis/ui/text/pango/pango.factor | 2 +- .../listener/completion/completion.factor | 2 +- basis/ui/tools/listener/listener-docs.factor | 2 +- basis/ui/tools/listener/listener-tests.factor | 2 +- basis/ui/tools/listener/listener.factor | 4 +- basis/unicode/breaks/breaks.factor | 4 +- basis/unicode/case/case.factor | 18 +-- basis/unicode/collation/collation.factor | 2 +- basis/unicode/data/data.factor | 2 +- basis/unicode/script/script-tests.factor | 2 +- basis/unix/linux/proc/proc.factor | 8 +- basis/urls/encoding/encoding.factor | 4 +- basis/uuid/uuid.factor | 12 +- basis/validators/validators.factor | 2 +- basis/vocabs/hierarchy/hierarchy.factor | 2 +- basis/windows/ole32/ole32.factor | 22 +-- basis/windows/user32/user32.factor | 72 ++++----- basis/wrap/strings/strings.factor | 2 +- basis/xml/autoencoding/autoencoding.factor | 6 +- basis/xml/dtd/dtd.factor | 6 +- basis/xml/elements/elements.factor | 26 +-- basis/xml/entities/entities.factor | 24 +-- basis/xml/name/name.factor | 4 +- basis/xml/tests/state-parser-tests.factor | 2 +- basis/xml/tokenize/tokenize.factor | 20 +-- basis/xml/writer/writer.factor | 8 +- core/bootstrap/syntax.factor | 2 +- core/checksums/checksums.factor | 4 +- core/checksums/crc32/crc32.factor | 2 +- core/effects/effects.factor | 2 +- core/io/encodings/ascii/ascii-tests.factor | 4 +- core/io/encodings/encodings-tests.factor | 2 +- core/io/encodings/encodings.factor | 10 +- core/io/encodings/utf16/utf16-tests.factor | 26 +-- core/io/encodings/utf8/utf8-tests.factor | 22 +-- core/io/files/files-tests.factor | 8 +- core/io/io.factor | 4 +- core/io/pathnames/pathnames-docs.factor | 2 +- core/io/pathnames/pathnames.factor | 2 +- .../byte-array/byte-array-tests.factor | 4 +- core/io/streams/plain/plain.factor | 2 +- core/lexer/lexer.factor | 10 +- core/make/make-docs.factor | 2 +- core/math/parser/parser-tests.factor | 18 +-- core/math/parser/parser.factor | 84 +++++----- core/parser/parser-tests.factor | 6 +- core/sbufs/sbufs-tests.factor | 10 +- core/sequences/sequences-docs.factor | 6 +- core/sequences/sequences-tests.factor | 40 ++--- core/splitting/splitting.factor | 4 +- core/strings/parser/parser-docs.factor | 2 +- core/strings/parser/parser.factor | 40 ++--- core/strings/strings-tests.factor | 30 ++-- core/syntax/syntax-docs.factor | 16 +- core/syntax/syntax.factor | 2 +- core/system/system.factor | 4 +- core/vocabs/loader/loader.factor | 2 +- core/vocabs/vocabs.factor | 2 +- extra/alien/fortran/fortran.factor | 4 +- extra/benchmark/fannkuch/fannkuch.factor | 2 +- extra/benchmark/fasta/fasta.factor | 38 ++--- extra/benchmark/fib7/fib7.factor | 2 +- .../benchmark/knucleotide/knucleotide.factor | 2 +- extra/benchmark/make/make.factor | 2 +- extra/benchmark/regexp/regexp.factor | 2 +- extra/benchmark/sockets/sockets.factor | 8 +- extra/bencode/bencode.factor | 12 +- extra/c/lexer/lexer-tests.factor | 12 +- extra/c/lexer/lexer.factor | 20 +-- extra/c/preprocessor/preprocessor.factor | 8 +- extra/cgi/cgi.factor | 2 +- extra/codebook/codebook.factor | 6 +- extra/color-table/color-table.factor | 2 +- extra/colors/flex-hex/flex-hex.factor | 6 +- extra/couchdb/couchdb.factor | 4 +- extra/cpu/8080/emulator/emulator.factor | 44 ++--- extra/crypto/passwd-md5/passwd-md5.factor | 2 +- extra/ctags/ctags.factor | 4 +- extra/cuda/ptx/ptx.factor | 2 +- extra/cuesheet/cuesheet.factor | 4 +- extra/curses/curses.factor | 6 +- extra/curses/listener/listener.factor | 4 +- extra/decimals/decimals.factor | 4 +- extra/enigma/enigma.factor | 4 +- extra/fjsc/fjsc.factor | 10 +- extra/flip-text/flip-text.factor | 150 +++++++++--------- extra/forestdb/paths/paths.factor | 4 +- extra/fuel/pprint/pprint.factor | 2 +- extra/gopher/gopher.factor | 54 +++---- extra/gpu/demos/bunny/bunny.factor | 4 +- extra/hamurabi/hamurabi.factor | 2 +- extra/hashcash/hashcash.factor | 6 +- extra/html/entities/entities.factor | 10 +- extra/html/parser/parser.factor | 20 +-- extra/html/parser/utils/utils.factor | 2 +- extra/images/bitmap/bitmap.factor | 2 +- extra/images/pbm/pbm.factor | 6 +- extra/images/pgm/pgm.factor | 2 +- extra/images/ppm/ppm.factor | 2 +- extra/images/tiff/tiff.factor | 4 +- extra/imap/imap-tests.factor | 2 +- extra/infix/infix-tests.factor | 4 +- extra/infix/tokenizer/tokenizer-tests.factor | 14 +- extra/infix/tokenizer/tokenizer.factor | 8 +- extra/ini-file/ini-file.factor | 70 ++++---- extra/io/encodings/detect/detect.factor | 2 +- extra/io/streams/peek/peek-tests.factor | 8 +- .../client/participants/participants.factor | 6 +- extra/irc/messages/base/base.factor | 2 +- extra/lcd/lcd.factor | 2 +- extra/mason/platform/platform.factor | 2 +- extra/math/extras/extras-tests.factor | 2 +- .../math/floating-point/floating-point.factor | 4 +- extra/math/text/english/english.factor | 2 +- extra/math/text/french/french.factor | 4 +- extra/metar/metar.factor | 24 +-- extra/money/money.factor | 4 +- extra/morse/morse-tests.factor | 8 +- extra/morse/morse.factor | 122 +++++++------- extra/odbc/odbc.factor | 2 +- extra/parser-combinators/simple/simple.factor | 10 +- extra/path-finding/path-finding-tests.factor | 2 +- extra/pcre/pcre-tests.factor | 2 +- extra/pdf/layout/layout.factor | 4 +- extra/pdf/values/values.factor | 12 +- .../peg/javascript/tokenizer/tokenizer.factor | 20 +-- extra/poker/poker.factor | 16 +- extra/progress-bars/progress-bars.factor | 2 +- extra/project-euler/051/051.factor | 4 +- extra/project-euler/common/common.factor | 2 +- extra/project-euler/project-euler.factor | 2 +- .../response-parser/response-parser.factor | 10 +- .../align-columns/align-columns.factor | 8 +- .../balanced-brackets.factor | 4 +- .../multiplication-tables.factor | 6 +- .../number-reversal/number-reversal.factor | 2 +- .../one-d-cellular/one-d-cellular.factor | 2 +- extra/rot13/rot13.factor | 4 +- .../semantic-versioning.factor | 4 +- extra/sequences/extras/extras-docs.factor | 4 +- extra/sequences/extras/extras-tests.factor | 12 +- extra/smalltalk/parser/parser-tests.factor | 4 +- extra/smalltalk/parser/parser.factor | 10 +- extra/smalltalk/printer/printer.factor | 2 +- extra/smalltalk/selectors/selectors.factor | 4 +- extra/spelling/spelling.factor | 2 +- extra/successor/successor.factor | 4 +- extra/svg/svg.factor | 2 +- extra/tar/tar.factor | 42 ++--- extra/terminal/macosx/macosx.factor | 2 +- extra/text-analysis/text-analysis.factor | 4 +- extra/text-to-pdf/text-to-pdf.factor | 12 +- extra/tnetstrings/tnetstrings.factor | 14 +- extra/tools/cal/cal.factor | 6 +- extra/tools/wc/wc.factor | 4 +- extra/turing/turing.factor | 2 +- extra/txon/txon.factor | 8 +- extra/units/reduction/reduction.factor | 6 +- extra/uu/uu.factor | 10 +- extra/yaml/conversion/conversion.factor | 10 +- extra/yaml/yaml-tests.factor | 2 +- extra/zoneinfo/zoneinfo.factor | 2 +- misc/fuel/strange-syntax.factor | 8 +- 277 files changed, 1386 insertions(+), 1386 deletions(-) diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index bae6650e1d..65eeaf72ca 100644 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -503,7 +503,7 @@ M: double-2-rep rep-component-type drop double ; GENERIC: pointer-string ( pointer -- string/f ) M: object pointer-string drop f ; M: word pointer-string name>> ; -M: pointer pointer-string to>> pointer-string [ CHAR: * suffix ] [ f ] if* ; +M: pointer pointer-string to>> pointer-string [ char: * suffix ] [ f ] if* ; GENERIC: c-type-string ( c-type -- string ) diff --git a/basis/alien/libraries/finder/linux/linux.factor b/basis/alien/libraries/finder/linux/linux.factor index 055e7a8bc3..acb1eaf460 100644 --- a/basis/alien/libraries/finder/linux/linux.factor +++ b/basis/alien/libraries/finder/linux/linux.factor @@ -32,7 +32,7 @@ CONSTANT: mach-map { mach-map cpu of { "libc6" } or ; : name-matches? ( lib triple -- ? ) - first swap ?head [ ?first CHAR: . = ] [ drop f ] if ; + first swap ?head [ ?first char: . = ] [ drop f ] if ; : arch-matches? ( lib triple -- ? ) [ drop ldconfig-arch ] [ second swap subset? ] bi* ; diff --git a/basis/alien/parser/parser.factor b/basis/alien/parser/parser.factor index b15c6e5a1f..81d0012835 100755 --- a/basis/alien/parser/parser.factor +++ b/basis/alien/parser/parser.factor @@ -21,7 +21,7 @@ ERROR: bad-array-type ; : (parse-c-type) ( string -- type ) { { [ "*" ?tail ] [ (parse-c-type) ] } - { [ CHAR: ] over member? ] [ parse-array-type ] } + { [ char: ] over member? ] [ parse-array-type ] } { [ dup search ] [ parse-word ] } [ parse-word ] } cond ; diff --git a/basis/ascii/ascii-tests.factor b/basis/ascii/ascii-tests.factor index f5a141f34d..a4e7da915e 100644 --- a/basis/ascii/ascii-tests.factor +++ b/basis/ascii/ascii-tests.factor @@ -1,18 +1,18 @@ USING: ascii kernel math sequences strings tools.test ; -{ t } [ CHAR: a letter? ] unit-test -{ f } [ CHAR: A letter? ] unit-test -{ f } [ CHAR: a LETTER? ] unit-test -{ t } [ CHAR: A LETTER? ] unit-test -{ t } [ CHAR: 0 digit? ] unit-test -{ f } [ CHAR: x digit? ] unit-test +{ t } [ char: a letter? ] unit-test +{ f } [ char: A letter? ] unit-test +{ f } [ char: a LETTER? ] unit-test +{ t } [ char: A LETTER? ] unit-test +{ t } [ char: 0 digit? ] unit-test +{ f } [ char: x digit? ] unit-test { 4 } [ 0 "There are Four Upper Case characters" [ LETTER? [ 1 + ] when ] each ] unit-test -{ t f } [ CHAR: \s ascii? 400 ascii? ] unit-test +{ t f } [ char: \s ascii? 400 ascii? ] unit-test { "HELLO HOW ARE YOU?" } [ "hellO hOw arE YOU?" >upper ] unit-test { "i'm good thx bai" } [ "I'm Good THX bai" >lower ] unit-test diff --git a/basis/ascii/ascii.factor b/basis/ascii/ascii.factor index d2e12ac551..2f93350f8b 100644 --- a/basis/ascii/ascii.factor +++ b/basis/ascii/ascii.factor @@ -6,10 +6,10 @@ IN: ascii : ascii? ( ch -- ? ) 0 127 between? ; inline : blank? ( ch -- ? ) " \t\n\r" member? ; inline -: letter? ( ch -- ? ) CHAR: a CHAR: z between? ; inline -: LETTER? ( ch -- ? ) CHAR: A CHAR: Z between? ; inline -: digit? ( ch -- ? ) CHAR: 0 CHAR: 9 between? ; inline -: printable? ( ch -- ? ) CHAR: \s CHAR: ~ between? ; inline +: letter? ( ch -- ? ) char: a char: z between? ; inline +: LETTER? ( ch -- ? ) char: A char: Z between? ; inline +: digit? ( ch -- ? ) char: 0 char: 9 between? ; inline +: printable? ( ch -- ? ) char: \s char: ~ between? ; inline : control? ( ch -- ? ) { [ 0 0x1F between? ] [ 0x7F = ] } 1|| ; inline : quotable? ( ch -- ? ) { [ printable? ] [ "\"\\" member? not ] } 1&& ; inline : Letter? ( ch -- ? ) { [ letter? ] [ LETTER? ] } 1|| ; inline diff --git a/basis/base64/base64.factor b/basis/base64/base64.factor index 500784ef7f..83ca4d8fb4 100644 --- a/basis/base64/base64.factor +++ b/basis/base64/base64.factor @@ -23,13 +23,13 @@ CONSTANT: alphabet alphabet nth ; inline : base64>ch ( ch -- ch ) - $[ alphabet alphabet-inverse 0 CHAR: = pick set-nth ] nth + $[ alphabet alphabet-inverse 0 char: = pick set-nth ] nth [ malformed-base64 ] unless* ; inline : (write-lines) ( column byte-array -- column' ) output-stream get dup '[ _ stream-write1 1 + dup 76 = [ - drop B{ CHAR: \r CHAR: \n } _ stream-write 0 + drop B{ char: \r char: \n } _ stream-write 0 ] when ] each ; inline @@ -43,7 +43,7 @@ CONSTANT: alphabet : encode-pad ( seq n -- byte-array ) [ 3 0 pad-tail encode3 ] [ 1 + ] bi* head-slice - 4 CHAR: = pad-tail ; inline + 4 char: = pad-tail ; inline : (encode-base64) ( stream column -- ) 3 pick stream-read dup length { @@ -77,7 +77,7 @@ PRIVATE> : decode4 ( seq -- ) [ 0 [ base64>ch swap 6 shift bitor ] reduce 3 >be ] - [ [ CHAR: = = ] count ] bi + [ [ char: = = ] count ] bi [ write ] [ head-slice* write ] if-zero ; inline : (decode-base64) ( stream -- ) diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 1c4c685248..3807f3cb51 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -14,11 +14,11 @@ MACRO: formatted ( spec -- quot ) } cond ] map [ cleave ] curry ; -: pad-00 ( n -- str ) number>string 2 CHAR: 0 pad-head ; +: pad-00 ( n -- str ) number>string 2 char: 0 pad-head ; -: pad-0000 ( n -- str ) number>string 4 CHAR: 0 pad-head ; +: pad-0000 ( n -- str ) number>string 4 char: 0 pad-head ; -: pad-00000 ( n -- str ) number>string 5 CHAR: 0 pad-head ; +: pad-00000 ( n -- str ) number>string 5 char: 0 pad-head ; : write-00 ( n -- ) pad-00 write ; diff --git a/basis/calendar/parser/parser.factor b/basis/calendar/parser/parser.factor index eb0a732408..634f79ea0e 100644 --- a/basis/calendar/parser/parser.factor +++ b/basis/calendar/parser/parser.factor @@ -28,16 +28,16 @@ ERROR: invalid-timestamp-format ; : read-sp ( -- token ) " " read-token ; : signed-gmt-offset ( dt ch -- dt' ) - { { CHAR: + [ 1 ] } { CHAR: - [ -1 ] } } case time* ; + { { char: + [ 1 ] } { char: - [ -1 ] } } case time* ; : read-rfc3339-gmt-offset ( ch -- dt ) { { f [ instant ] } - { CHAR: Z [ instant ] } + { char: Z [ instant ] } [ [ read-00 hours - read1 { { CHAR: : [ read-00 ] } { f [ 0 ] } } case minutes + read1 { { char: : [ read-00 ] } { f [ 0 ] } } case minutes time+ ] dip signed-gmt-offset ] @@ -58,7 +58,7 @@ ERROR: invalid-timestamp-format ; read-ymd "Tt \t" expect read-hms - read1 { { CHAR: . [ read-rfc3339-seconds ] } [ ] } case + read1 { { char: . [ read-rfc3339-seconds ] } [ ] } case read-rfc3339-gmt-offset ; @@ -66,7 +66,7 @@ ERROR: invalid-timestamp-format ; [ (rfc3339>timestamp) ] with-string-reader ; : parse-rfc822-military-offset ( string -- dt ) - first CHAR: A - { + first char: A - { -1 -2 -3 -4 -5 -6 -7 -8 -9 f -10 -11 -12 1 2 3 4 5 6 7 8 9 10 11 12 0 } nth hours ; @@ -101,7 +101,7 @@ CONSTANT: rfc822-named-zones H{ : (rfc822>timestamp) ( -- timestamp ) "," read-token day-abbreviations3 member? check-timestamp drop - read1 CHAR: \s assert= + read1 char: \s assert= read-sp checked-number read-sp month-abbreviations index 1 + check-timestamp read-sp checked-number -rot swap @@ -117,7 +117,7 @@ CONSTANT: rfc822-named-zones H{ : (cookie-string>timestamp-1) ( -- timestamp ) "," read-token check-day-name - read1 CHAR: \s assert= + read1 char: \s assert= "-" read-token checked-number "-" read-token month-abbreviations index 1 + check-timestamp read-sp checked-number -rot swap diff --git a/basis/checksums/adler-32/adler-32-tests.factor b/basis/checksums/adler-32/adler-32-tests.factor index 0b300d5ed1..a496c5b28d 100644 --- a/basis/checksums/adler-32/adler-32-tests.factor +++ b/basis/checksums/adler-32/adler-32-tests.factor @@ -1,4 +1,4 @@ USING: checksums checksums.adler-32 strings tools.test ; { 300286872 } [ "Wikipedia" adler-32 checksum-bytes ] unit-test -{ 2679885283 } [ 10000 CHAR: a adler-32 checksum-bytes ] unit-test +{ 2679885283 } [ 10000 char: a adler-32 checksum-bytes ] unit-test diff --git a/basis/checksums/bsd/bsd-tests.factor b/basis/checksums/bsd/bsd-tests.factor index 9a61483b8e..47c03c0cf3 100644 --- a/basis/checksums/bsd/bsd-tests.factor +++ b/basis/checksums/bsd/bsd-tests.factor @@ -1,4 +1,4 @@ USING: checksums checksums.bsd strings tools.test ; { 15816 } [ "Wikipedia" bsd checksum-bytes ] unit-test -{ 47937 } [ 10000 CHAR: a bsd checksum-bytes ] unit-test +{ 47937 } [ 10000 char: a bsd checksum-bytes ] unit-test diff --git a/basis/checksums/crc16/crc16.factor b/basis/checksums/crc16/crc16.factor index 415a4090a4..8657e25574 100644 --- a/basis/checksums/crc16/crc16.factor +++ b/basis/checksums/crc16/crc16.factor @@ -36,5 +36,5 @@ M: crc16 checksum-bytes M: crc16 checksum-lines init-crc16 - [ [ (crc16) ] each CHAR: \n (crc16) ] each + [ [ (crc16) ] each char: \n (crc16) ] each finish-crc16 ; inline diff --git a/basis/checksums/sha/sha-tests.factor b/basis/checksums/sha/sha-tests.factor index 9aa5b89b0c..0978c6738b 100644 --- a/basis/checksums/sha/sha-tests.factor +++ b/basis/checksums/sha/sha-tests.factor @@ -8,7 +8,7 @@ IN: checksums.sha.tests { "a9993e364706816aba3e25717850c26c9cd0d89d" } [ "abc" sha1 checksum-bytes bytes>hex-string ] unit-test { "84983e441c3bd26ebaae4aa1f95129e5e54670f1" } [ "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" sha1 checksum-bytes bytes>hex-string ] unit-test -! [ "34aa973cd4c4daa4f61eeb2bdbad27316534016f" ] [ 1000000 CHAR: a fill string>sha1str ] unit-test ! takes a long time... +! [ "34aa973cd4c4daa4f61eeb2bdbad27316534016f" ] [ 1000000 char: a fill string>sha1str ] unit-test ! takes a long time... { "dea356a2cddd90c7a7ecedc5ebb563934f460452" } [ "0123456701234567012345670123456701234567012345670123456701234567" 10 swap concat sha1 checksum-bytes bytes>hex-string ] unit-test diff --git a/basis/circular/circular-tests.factor b/basis/circular/circular-tests.factor index a6c74d530e..7b1b39cb23 100644 --- a/basis/circular/circular-tests.factor +++ b/basis/circular/circular-tests.factor @@ -7,10 +7,10 @@ IN: circular.tests { 0 } [ { 0 1 2 3 4 } 0 swap virtual@ drop ] unit-test { 2 } [ { 0 1 2 3 4 } 2 swap virtual@ drop ] unit-test -{ CHAR: t } [ "test" 0 swap nth ] unit-test +{ char: t } [ "test" 0 swap nth ] unit-test { "test" } [ "test" >string ] unit-test -{ CHAR: e } [ "test" 5 swap nth-unsafe ] unit-test +{ char: e } [ "test" 5 swap nth-unsafe ] unit-test { [ 1 2 3 ] } [ { 1 2 3 } [ ] like ] unit-test { [ 2 3 1 ] } [ { 1 2 3 } [ rotate-circular ] keep [ ] like ] unit-test @@ -19,9 +19,9 @@ IN: circular.tests { [ 3 1 2 ] } [ { 1 2 3 } 1 over change-circular-start 1 over change-circular-start [ ] like ] unit-test { [ 3 1 2 ] } [ { 1 2 3 } -100 over change-circular-start [ ] like ] unit-test -{ "fob" } [ "foo" CHAR: b 2 pick set-nth >string ] unit-test -{ "boo" } [ "foo" CHAR: b 3 pick set-nth-unsafe >string ] unit-test -{ "ornact" } [ "factor" 4 over change-circular-start CHAR: n 2 pick set-nth >string ] unit-test +{ "fob" } [ "foo" char: b 2 pick set-nth >string ] unit-test +{ "boo" } [ "foo" char: b 3 pick set-nth-unsafe >string ] unit-test +{ "ornact" } [ "factor" 4 over change-circular-start char: n 2 pick set-nth >string ] unit-test { "bcd" } [ 3 "abcd" [ over circular-push ] each >string ] unit-test @@ -29,7 +29,7 @@ IN: circular.tests ! This no longer fails ! [ "test" 5 swap nth ] must-fail -! [ "foo" CHAR: b 3 rot set-nth ] must-fail +! [ "foo" char: b 3 rot set-nth ] must-fail { { } } [ 3 >array ] unit-test { { 1 2 } } [ diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 63cbe0224e..b0cbf43fe2 100644 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -197,7 +197,7 @@ cell { assoc-union alien>objc-types set-global : objc-struct-type ( i string -- ctype ) - [ CHAR: = ] 2keep index-from swap subseq + [ char: = ] 2keep index-from swap subseq objc>struct-types get at* [ drop void* ] unless ; ERROR: no-objc-type name ; @@ -209,9 +209,9 @@ ERROR: no-objc-type name ; : (parse-objc-type) ( i string -- ctype ) [ [ 1 + ] dip ] [ nth ] 2bi { { [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] } - { [ dup CHAR: ^ = ] [ 3drop void* ] } - { [ dup CHAR: { = ] [ drop objc-struct-type ] } - { [ dup CHAR: [ = ] [ 3drop void* ] } + { [ dup char: ^ = ] [ 3drop void* ] } + { [ dup char: { = ] [ drop objc-struct-type ] } + { [ dup char: [ = ] [ 3drop void* ] } [ 2nip decode-type ] } cond ; diff --git a/basis/colors/constants/constants.factor b/basis/colors/constants/constants.factor index 9be352ca47..f39ad10208 100644 --- a/basis/colors/constants/constants.factor +++ b/basis/colors/constants/constants.factor @@ -9,7 +9,7 @@ IN: colors.constants : parse-color ( line -- name color ) first4 [ [ string>number 255 /f ] tri@ 1.0 ] dip - [ blank? ] trim-head H{ { CHAR: \s CHAR: - } } substitute swap ; + [ blank? ] trim-head H{ { char: \s char: - } } substitute swap ; : parse-colors ( lines -- assoc ) [ "!" head? ] reject diff --git a/basis/compiler/cfg/linear-scan/debugger/debugger.factor b/basis/compiler/cfg/linear-scan/debugger/debugger.factor index 9e87559ac2..24116fa41b 100644 --- a/basis/compiler/cfg/linear-scan/debugger/debugger.factor +++ b/basis/compiler/cfg/linear-scan/debugger/debugger.factor @@ -14,8 +14,8 @@ IN: compiler.cfg.linear-scan.debugger allocate-registers drop ; : picture ( uses -- str ) - dup last 1 + CHAR: space - [ '[ CHAR: * swap _ set-nth ] each ] keep ; + dup last 1 + char: space + [ '[ char: * swap _ set-nth ] each ] keep ; : interval-picture ( interval -- str ) [ uses>> picture ] diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index 074155ca10..3016428a52 100644 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -42,12 +42,12 @@ IN: compiler.tests.intrinsics ! Write barrier hits on the wrong value were causing segfaults [ -3 ] [ -3 1 2 [ 2array [ 3 set-slot ] keep ] compile-call second ] unit-test -[ CHAR: a ] [ 0 "abc" [ string-nth ] compile-call ] unit-test -[ CHAR: a ] [ 0 [ "abc" string-nth ] compile-call ] unit-test -[ CHAR: a ] [ [ 0 "abc" string-nth ] compile-call ] unit-test -[ CHAR: b ] [ 1 "abc" [ string-nth ] compile-call ] unit-test -[ CHAR: b ] [ 1 [ "abc" string-nth ] compile-call ] unit-test -[ CHAR: b ] [ [ 1 "abc" string-nth ] compile-call ] unit-test +[ char: a ] [ 0 "abc" [ string-nth ] compile-call ] unit-test +[ char: a ] [ 0 [ "abc" string-nth ] compile-call ] unit-test +[ char: a ] [ [ 0 "abc" string-nth ] compile-call ] unit-test +[ char: b ] [ 1 "abc" [ string-nth ] compile-call ] unit-test +[ char: b ] [ 1 [ "abc" string-nth ] compile-call ] unit-test +[ char: b ] [ [ 1 "abc" string-nth ] compile-call ] unit-test [ 0x123456 ] [ 0 "\u123456bc" [ string-nth ] compile-call ] unit-test [ 0x123456 ] [ 0 [ "\u123456bc" string-nth ] compile-call ] unit-test diff --git a/basis/csv/csv-docs.factor b/basis/csv/csv-docs.factor index 1738c2bb59..9277fb9eca 100644 --- a/basis/csv/csv-docs.factor +++ b/basis/csv/csv-docs.factor @@ -46,7 +46,7 @@ HELP: write-csv { $description "Writes a sequence of sequences of comma-separated-values to the output stream, escaping where necessary." } ; HELP: with-delimiter -{ $values { "ch" "field delimiter (e.g. CHAR: \\t)" } +{ $values { "ch" "field delimiter (e.g. char: \\t)" } { "quot" quotation } } { $description "Sets the field delimiter for read-csv, read-row, write-csv, or write-row words." } ; diff --git a/basis/csv/csv-tests.factor b/basis/csv/csv-tests.factor index 533c6f00ec..560e6ba50d 100644 --- a/basis/csv/csv-tests.factor +++ b/basis/csv/csv-tests.factor @@ -61,7 +61,7 @@ IN: csv.tests "allows setting of delimiting character" [ { { "foo" "bah" "baz" } } ] -[ "foo\tbah\tbaz\n" CHAR: \t [ string>csv ] with-delimiter ] named-unit-test +[ "foo\tbah\tbaz\n" char: \t [ string>csv ] with-delimiter ] named-unit-test "Quoted field followed immediately by newline" [ { { "foo" "bar" } diff --git a/basis/csv/csv.factor b/basis/csv/csv.factor index fb34233c64..8d1d676627 100644 --- a/basis/csv/csv.factor +++ b/basis/csv/csv.factor @@ -7,7 +7,7 @@ IN: csv SYMBOL: delimiter -CHAR: , delimiter set-global +char: , delimiter set-global '[ dup "\n\"\r" member? [ drop t ] [ _ = ] if ] any? ; inline : escape-quotes ( cell stream -- ) - CHAR: \" over stream-write1 swap [ + char: \" over stream-write1 swap [ [ over stream-write1 ] - [ dup CHAR: \" = [ over stream-write1 ] [ drop ] if ] bi - ] each CHAR: \" swap stream-write1 ; + [ dup char: \" = [ over stream-write1 ] [ drop ] if ] bi + ] each char: \" swap stream-write1 ; : escape-if-required ( cell delimiter stream -- ) [ dupd needs-escaping? ] dip diff --git a/basis/db/postgresql/postgresql.factor b/basis/db/postgresql/postgresql.factor index 12bbd56dcf..20fcc51313 100644 --- a/basis/db/postgresql/postgresql.factor +++ b/basis/db/postgresql/postgresql.factor @@ -117,7 +117,7 @@ M: postgresql-db-connection ( sql in out -- statement ) dup prepare-statement ; : bind-name% ( -- ) - CHAR: $ 0, + char: $ 0, sql-counter [ inc ] [ get 0# ] bi ; M: postgresql-db-connection bind% ( spec -- ) diff --git a/basis/db/tester/tester.factor b/basis/db/tester/tester.factor index ea89166e51..a4381fd77e 100644 --- a/basis/db/tester/tester.factor +++ b/basis/db/tester/tester.factor @@ -8,7 +8,7 @@ IN: db.tester : postgresql-test-db-name ( -- string ) cpu name>> "-" "factor-test" 3append - H{ { CHAR: - CHAR: _ } { CHAR: . CHAR: _ } } substitute ; + H{ { char: - char: _ } { char: . char: _ } } substitute ; : postgresql-test-db ( -- postgresql-db ) \ postgresql-db get-global clone postgresql-test-db-name >>database ; diff --git a/basis/db/tuples/tuples-tests.factor b/basis/db/tuples/tuples-tests.factor index e3c72d9710..f6ebe4deb3 100644 --- a/basis/db/tuples/tuples-tests.factor +++ b/basis/db/tuples/tuples-tests.factor @@ -305,7 +305,7 @@ TUPLE: exam id name score ; : random-exam ( -- exam ) f - 6 [ CHAR: a CHAR: z [a,b] random ] replicate >string + 6 [ char: a char: z [a,b] random ] replicate >string 100 random exam boa ; diff --git a/basis/environment/environment-tests.factor b/basis/environment/environment-tests.factor index 51aedca9ad..c1e14d3e00 100644 --- a/basis/environment/environment-tests.factor +++ b/basis/environment/environment-tests.factor @@ -21,7 +21,7 @@ os unix? [ { f } [ "factor-test-key-1" os-env ] unit-test { } [ - 32766 CHAR: a "factor-test-key-long" set-os-env + 32766 char: a "factor-test-key-long" set-os-env ] unit-test { 32766 } [ "factor-test-key-long" os-env length ] unit-test { } [ "factor-test-key-long" unset-os-env ] unit-test diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index 4107bb7d16..3a54f6c6cc 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -63,11 +63,11 @@ DEFER: (parse-paragraph) : delimiter-class ( delimiter -- class ) H{ - { CHAR: * strong } - { CHAR: _ emphasis } - { CHAR: ^ superscript } - { CHAR: ~ subscript } - { CHAR: % inline-code } + { char: * strong } + { char: _ emphasis } + { char: ^ superscript } + { char: ~ subscript } + { char: % inline-code } } at ; : or-simple-title ( ... url title/f quot: ( ... title -- ... title' ) -- ... url title' ) @@ -82,9 +82,9 @@ DEFER: (parse-paragraph) ] dip [ (parse-paragraph) cons ] [ 1list ] if* ; : parse-big-link ( before after -- link rest ) - dup ?first CHAR: [ = + dup ?first char: [ = [ parse-link ] - [ [ CHAR: [ suffix ] [ (parse-paragraph) ] bi* ] + [ [ char: [ suffix ] [ (parse-paragraph) ] bi* ] if ; : escape ( before after -- before' after' ) @@ -94,8 +94,8 @@ DEFER: (parse-paragraph) [ nil ] [ [ "*_^~%[\\" member? ] find-cut [ { - { CHAR: [ [ parse-big-link ] } - { CHAR: \\ [ escape ] } + { char: [ [ parse-big-link ] } + { char: \\ [ escape ] } [ dup delimiter-class parse-delimiter ] } case cons ] [ drop "" like 1list ] if* @@ -124,10 +124,10 @@ DEFER: (parse-paragraph) V{ } clone (take-until) ; : count= ( string -- n ) - dup [ [ CHAR: = = not ] find drop 0 or ] bi@ min ; + dup [ [ char: = = not ] find drop 0 or ] bi@ min ; : trim= ( string -- string' ) - [ CHAR: = = ] trim ; + [ char: = = ] trim ; : make-heading ( string class -- heading ) [ trim= parse-paragraph ] dip boa ; inline @@ -149,14 +149,14 @@ DEFER: (parse-paragraph) : coalesce ( rows -- rows' ) V{ } clone [ '[ - _ dup ?last ?last CHAR: \\ = + _ dup ?last ?last char: \\ = [ [ pop "|" rot 3append ] keep ] when push ] each ] keep ; : parse-table ( state -- state' table ) - CHAR: | take-lines [ + char: | take-lines [ "|" split trim-row coalesce @@ -175,13 +175,13 @@ DEFER: (parse-paragraph) ] dip boa ; inline : parse-ul ( state -- state' ul ) - CHAR: - unordered-list parse-list ; + char: - unordered-list parse-list ; : parse-ol ( state -- state' ul ) - CHAR: # ordered-list parse-list ; + char: # ordered-list parse-list ; : parse-code ( state -- state' item ) - dup 1 look CHAR: [ = + dup 1 look char: [ = [ unclip-slice make-paragraph ] [ dup "{" take-until [ [ nip rest ] dip @@ -192,12 +192,12 @@ DEFER: (parse-paragraph) : parse-item ( state -- state' item ) dup 0 look { - { CHAR: = [ parse-heading ] } - { CHAR: | [ parse-table ] } - { CHAR: _ [ parse-line ] } - { CHAR: - [ parse-ul ] } - { CHAR: # [ parse-ol ] } - { CHAR: [ [ parse-code ] } + { char: = [ parse-heading ] } + { char: | [ parse-table ] } + { char: _ [ parse-line ] } + { char: - [ parse-ul ] } + { char: # [ parse-ol ] } + { char: [ [ parse-code ] } { f [ rest-slice f ] } [ drop unclip-slice make-paragraph ] } case ; @@ -212,7 +212,7 @@ CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');" { [ dup empty? ] [ drop invalid-url ] } { [ dup [ 127 > ] any? ] [ drop invalid-url ] } { [ dup first "/\\" member? ] [ drop invalid-url ] } - { [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] } + { [ char: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] } [ relative-link-prefix get prepend "" like url-encode ] } cond ; diff --git a/basis/formatting/formatting-tests.factor b/basis/formatting/formatting-tests.factor index 8433ac5fe7..94e393b832 100755 --- a/basis/formatting/formatting-tests.factor +++ b/basis/formatting/formatting-tests.factor @@ -47,7 +47,7 @@ IN: formatting.tests { "2008-09-10" } [ 2008 9 10 "%04d-%02d-%02d" sprintf ] unit-test { "Hello, World!" } [ "Hello, World!" "%s" sprintf ] unit-test { "printf test" } [ "printf test" sprintf ] unit-test -{ "char a = 'a'" } [ CHAR: a "char %c = 'a'" sprintf ] unit-test +{ "char a = 'a'" } [ char: a "char %c = 'a'" sprintf ] unit-test { "00" } [ 0x0 "%02x" sprintf ] unit-test { "ff" } [ 0xff "%02x" sprintf ] unit-test { "0 message(s)" } [ 0 "message" "%d %s(s)" sprintf ] unit-test diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index f98d1a04e3..7da90c8a8d 100644 --- a/basis/formatting/formatting.factor +++ b/basis/formatting/formatting.factor @@ -14,12 +14,12 @@ IN: formatting [ ] [ compose ] reduce ; inline : fix-sign ( string -- string ) - dup first CHAR: 0 = [ - dup [ [ CHAR: 0 = not ] [ digit? ] bi and ] find + dup first char: 0 = [ + dup [ [ char: 0 = not ] [ digit? ] bi and ] find [ 1 - swap 2dup nth { - { CHAR: - [ remove-nth "-" prepend ] } - { CHAR: + [ remove-nth "+" prepend ] } + { char: - [ remove-nth "-" prepend ] } + { char: + [ remove-nth "+" prepend ] } [ drop nip ] } case ] [ drop ] if @@ -39,15 +39,15 @@ ERROR: unknown-printf-directive ; EBNF: parse-printf -zero = "0" => [[ CHAR: 0 ]] +zero = "0" => [[ char: 0 ]] char = "'" (.) => [[ second ]] -pad-char = (zero|char)? => [[ CHAR: \s or ]] +pad-char = (zero|char)? => [[ char: \s or ]] pad-align = ("-")? => [[ \ pad-tail \ pad-head ? ]] pad-width = ([0-9])* => [[ >digits ]] pad = pad-align pad-char pad-width => [[ >quotation dup first 0 = [ drop [ ] ] when ]] -sign_ = [+ ] => [[ '[ dup CHAR: - swap index [ _ prefix ] unless ] ]] +sign_ = [+ ] => [[ '[ dup char: - swap index [ _ prefix ] unless ] ]] sign = (sign_)? => [[ [ ] or ]] width_ = "." ([0-9])* => [[ second >digits '[ _ short head ] ]] @@ -123,10 +123,10 @@ MACRO: sprintf ( format-string -- quot ) string 2 CHAR: 0 pad-head ; inline + number>string 2 char: 0 pad-head ; inline : pad-000 ( n -- string ) - number>string 3 CHAR: 0 pad-head ; inline + number>string 3 char: 0 pad-head ; inline : >time ( timestamp -- string ) [ hour>> ] [ minute>> ] [ second>> floor ] tri diff --git a/basis/ftp/client/client.factor b/basis/ftp/client/client.factor index c94d5a273a..9984669f9c 100644 --- a/basis/ftp/client/client.factor +++ b/basis/ftp/client/client.factor @@ -11,7 +11,7 @@ IN: ftp.client 3 head string>number ; : ftp-response-code ( string -- n/f ) - dup fourth CHAR: - = [ drop f ] [ (ftp-response-code) ] if ; + dup fourth char: - = [ drop f ] [ (ftp-response-code) ] if ; : read-response-loop ( ftp-response -- ftp-response ) readln @@ -22,7 +22,7 @@ IN: ftp.client readln [ (ftp-response-code) >>n ] [ add-response-line ] - [ fourth CHAR: - = ] tri + [ fourth char: - = ] tri [ read-response-loop ] when ; ERROR: ftp-error got expected ; diff --git a/basis/ftp/client/listing-parser/listing-parser.factor b/basis/ftp/client/listing-parser/listing-parser.factor index 6e2f9ebec4..138644b157 100644 --- a/basis/ftp/client/listing-parser/listing-parser.factor +++ b/basis/ftp/client/listing-parser/listing-parser.factor @@ -6,26 +6,26 @@ IN: ftp.client.listing-parser : ch>file-type ( ch -- type ) { - { CHAR: b [ +block-device+ ] } - { CHAR: c [ +character-device+ ] } - { CHAR: d [ +directory+ ] } - { CHAR: l [ +symbolic-link+ ] } - { CHAR: s [ +socket+ ] } - { CHAR: p [ +fifo+ ] } - { CHAR: - [ +regular-file+ ] } + { char: b [ +block-device+ ] } + { char: c [ +character-device+ ] } + { char: d [ +directory+ ] } + { char: l [ +symbolic-link+ ] } + { char: s [ +socket+ ] } + { char: p [ +fifo+ ] } + { char: - [ +regular-file+ ] } [ drop +unknown+ ] } case ; : file-type>ch ( type -- string ) { - { +block-device+ [ CHAR: b ] } - { +character-device+ [ CHAR: c ] } - { +directory+ [ CHAR: d ] } - { +symbolic-link+ [ CHAR: l ] } - { +socket+ [ CHAR: s ] } - { +fifo+ [ CHAR: p ] } - { +regular-file+ [ CHAR: - ] } - [ drop CHAR: - ] + { +block-device+ [ char: b ] } + { +character-device+ [ char: c ] } + { +directory+ [ char: d ] } + { +symbolic-link+ [ char: l ] } + { +socket+ [ char: s ] } + { +fifo+ [ char: p ] } + { +regular-file+ [ char: - ] } + [ drop char: - ] } case ; : parse-permissions ( remote-file str -- remote-file ) diff --git a/basis/furnace/auth/providers/couchdb/couchdb.factor b/basis/furnace/auth/providers/couchdb/couchdb.factor index a01c80baac..714e0310eb 100644 --- a/basis/furnace/auth/providers/couchdb/couchdb.factor +++ b/basis/furnace/auth/providers/couchdb/couchdb.factor @@ -111,7 +111,7 @@ TUPLE: couchdb-auth-provider url>user ; : strip-hash ( hash1 -- hash2 ) - [ drop first CHAR: _ = ] assoc-reject ; + [ drop first char: _ = ] assoc-reject ; : at-or-k ( key hash -- newkey ) dupd at [ nip ] when* ; diff --git a/basis/gobject-introspection/types/types.factor b/basis/gobject-introspection/types/types.factor index cd244cf9aa..6350f89d37 100644 --- a/basis/gobject-introspection/types/types.factor +++ b/basis/gobject-introspection/types/types.factor @@ -70,7 +70,7 @@ PREDICATE: fixed-size-array-type < c-array-type fixed-size>> >boolean ; : qualified-type-name ( data-type -- name ) [ name>> ] keep { - [ name>> CHAR: . swap member? ] + [ name>> char: . swap member? ] [ none-type? ] [ standard-type? ] } 1|| [ qualified-name ] unless ; diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index eaba3c55be..be004f3c60 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -15,19 +15,19 @@ IN: help.html : escape-char ( ch -- ) dup ascii? [ dup H{ - { CHAR: \" "__quo__" } - { CHAR: * "__star__" } - { CHAR: : "__colon__" } - { CHAR: < "__lt__" } - { CHAR: > "__gt__" } - { CHAR: ? "__que__" } - { CHAR: \\ "__back__" } - { CHAR: | "__pipe__" } - { CHAR: / "__slash__" } - { CHAR: , "__comma__" } - { CHAR: @ "__at__" } - { CHAR: # "__hash__" } - { CHAR: % "__percent__" } + { char: \" "__quo__" } + { char: * "__star__" } + { char: : "__colon__" } + { char: < "__lt__" } + { char: > "__gt__" } + { char: ? "__que__" } + { char: \\ "__back__" } + { char: | "__pipe__" } + { char: / "__slash__" } + { char: , "__comma__" } + { char: @ "__at__" } + { char: # "__hash__" } + { char: % "__percent__" } } at [ % ] [ , ] ?if ] [ number>string "__" "__" surround % ] if ; @@ -87,7 +87,7 @@ M: pathname url-of XML] ; : bijective-base26 ( n -- name ) - [ dup 0 > ] [ 1 - 26 /mod CHAR: a + ] "" produce-as nip reverse! ; + [ dup 0 > ] [ 1 - 26 /mod char: a + ] "" produce-as nip reverse! ; : css-class ( style classes -- name ) dup '[ drop _ assoc-size 1 + bijective-base26 ] cache ; diff --git a/basis/help/tutorial/tutorial.factor b/basis/help/tutorial/tutorial.factor index 86e7969ee3..541ca58e6d 100644 --- a/basis/help/tutorial/tutorial.factor +++ b/basis/help/tutorial/tutorial.factor @@ -142,7 +142,7 @@ $nl "We begin by writing a word which removes blanks and non-alphabetical characters from a string, and then converts the string to lower case. We call this word " { $snippet "normalize" } ". To figure out how to write this word, we begin with some interactive experimentation in the listener." $nl "Start by pushing a character on the stack; notice that characters are really just integers:" -{ $code "CHAR: a" } +{ $code "char: a" } $nl "Now, use the " { $link Letter? } " word to test if it is an alphabetical character, upper or lower case:" { $unchecked-example "Letter? ." "t" } @@ -151,7 +151,7 @@ $nl "This gives the expected result." $nl "Now try with a non-alphabetical character:" -{ $code "CHAR: #" } +{ $code "char: #" } { $unchecked-example "Letter? ." "f" } $nl "What we want to do is given a string, remove all characters which do not match the " { $link Letter? } " predicate. Let's push a string on the stack:" diff --git a/basis/html/streams/streams-tests.factor b/basis/html/streams/streams-tests.factor index 354a1c4079..6c95767939 100644 --- a/basis/html/streams/streams-tests.factor +++ b/basis/html/streams/streams-tests.factor @@ -14,7 +14,7 @@ IN: html.streams.tests ] unit-test { "a" } [ - [ CHAR: a write1 ] make-html-string + [ char: a write1 ] make-html-string ] unit-test { "<" } [ diff --git a/basis/html/streams/streams.factor b/basis/html/streams/streams.factor index cf413dde11..92a4b656d1 100644 --- a/basis/html/streams/streams.factor +++ b/basis/html/streams/streams.factor @@ -36,7 +36,7 @@ TUPLE: html-sub-stream < html-writer style parent ; : hex-color, ( color -- ) [ red>> ] [ green>> ] [ blue>> ] tri - [ 255 * >integer >hex 2 CHAR: 0 pad-head % ] tri@ ; + [ 255 * >integer >hex 2 char: 0 pad-head % ] tri@ ; : fg-css, ( color -- ) "color: #" % hex-color, "; " % ; diff --git a/basis/html/templates/chloe/chloe-tests.factor b/basis/html/templates/chloe/chloe-tests.factor index 9128eef6b7..b29dd6cfe6 100644 --- a/basis/html/templates/chloe/chloe-tests.factor +++ b/basis/html/templates/chloe/chloe-tests.factor @@ -10,7 +10,7 @@ IN: html.templates.chloe.tests : run-template ( quot -- string ) with-string-writer [ "\r\n\t" member? ] reject - [ CHAR: \s = ] trim ; inline + [ char: \s = ] trim ; inline : test-template ( name -- template ) "vocab:html/templates/chloe/test/" diff --git a/basis/html/templates/fhtml/fhtml.factor b/basis/html/templates/fhtml/fhtml.factor index 2ec80f2983..474b008530 100644 --- a/basis/html/templates/fhtml/fhtml.factor +++ b/basis/html/templates/fhtml/fhtml.factor @@ -16,7 +16,7 @@ TUPLE: template-lexer < lexer ; M: template-lexer skip-word [ { - { [ 2dup nth CHAR: \" = ] [ drop 1 + ] } + { [ 2dup nth char: \" = ] [ drop 1 + ] } { [ 2dup swap tail-slice "%>" head? ] [ drop 2 + ] } [ f skip ] } cond diff --git a/basis/http/parsers/parsers.factor b/basis/http/parsers/parsers.factor index df6ccbede9..03f1d82798 100644 --- a/basis/http/parsers/parsers.factor +++ b/basis/http/parsers/parsers.factor @@ -97,7 +97,7 @@ PEG: parse-response-line ( string -- triple ) [ " \t" member? ] satisfy repeat1 ; : qdtext-parser ( -- parser ) - { [ CHAR: \" = ] [ control? ] } except-these ; + { [ char: \" = ] [ control? ] } except-these ; : quoted-char-parser ( -- parser ) "\\" token hide any-char 2seq ; diff --git a/basis/io/backend/unix/unix.factor b/basis/io/backend/unix/unix.factor index 2468c53e58..0046a203fc 100755 --- a/basis/io/backend/unix/unix.factor +++ b/basis/io/backend/unix/unix.factor @@ -147,7 +147,7 @@ M: stdin dispose* ] with-destructors ; : wait-for-stdin ( stdin -- size ) - [ control>> CHAR: X over io:stream-write1 io:stream-flush ] + [ control>> char: X over io:stream-write1 io:stream-flush ] [ size>> ssize_t heap-size swap io:stream-read ssize_t deref ] bi ; diff --git a/basis/io/buffers/buffers-tests.factor b/basis/io/buffers/buffers-tests.factor index 3a834cd712..679b6afd78 100644 --- a/basis/io/buffers/buffers-tests.factor +++ b/basis/io/buffers/buffers-tests.factor @@ -44,7 +44,7 @@ io.buffers kernel libc namespaces sequences strings tools.test ; dup buffer-read-all >string swap dispose ] unit-test -{ CHAR: e } [ +{ char: e } [ "hello" string>buffer 1 over buffer-consume [ buffer-pop ] keep dispose ] unit-test @@ -58,11 +58,11 @@ io.buffers kernel libc namespaces sequences strings tools.test ; "b" get dispose "hello world" string>buffer "b" set -{ "hello" CHAR: \s } [ " " "b" get buffer-read-until [ >string ] dip ] unit-test +{ "hello" char: \s } [ " " "b" get buffer-read-until [ >string ] dip ] unit-test "b" get dispose "hello world" string>buffer "b" set -{ "hello worl" CHAR: d } [ "d" "b" get buffer-read-until [ >string ] dip ] unit-test +{ "hello worl" char: d } [ "d" "b" get buffer-read-until [ >string ] dip ] unit-test "b" get dispose "hello world" string>buffer "b" set diff --git a/basis/io/crlf/crlf.factor b/basis/io/crlf/crlf.factor index f68c763422..4fc4ef3c35 100644 --- a/basis/io/crlf/crlf.factor +++ b/basis/io/crlf/crlf.factor @@ -8,14 +8,14 @@ IN: io.crlf : read-crlf ( -- seq ) "\r" read-until - [ CHAR: \r assert= read1 CHAR: \n assert= ] [ f like ] if* ; + [ char: \r assert= read1 char: \n assert= ] [ f like ] if* ; : read-?crlf ( -- seq ) "\r\n" read-until - [ CHAR: \r = [ read1 CHAR: \n assert= ] when ] [ f like ] if* ; + [ char: \r = [ read1 char: \n assert= ] when ] [ f like ] if* ; : crlf>lf ( str -- str' ) - CHAR: \r swap remove ; + char: \r swap remove ; : lf>crlf ( str -- str' ) "\n" split "\r\n" join ; diff --git a/basis/io/encodings/8-bit/8-bit-tests.factor b/basis/io/encodings/8-bit/8-bit-tests.factor index 97823f30d9..e966a7a32b 100644 --- a/basis/io/encodings/8-bit/8-bit-tests.factor +++ b/basis/io/encodings/8-bit/8-bit-tests.factor @@ -3,12 +3,12 @@ io.encodings.8-bit.private tools.test strings arrays io.encodings.8-bit.latin1 io.encodings.8-bit.windows-1252 ; IN: io.encodings.8-bit.tests -{ B{ CHAR: f CHAR: o CHAR: o } } [ "foo" latin1 encode ] unit-test +{ B{ char: f char: o char: o } } [ "foo" latin1 encode ] unit-test [ { 256 } >string latin1 encode ] must-fail { B{ 255 } } [ { 255 } >string latin1 encode ] unit-test { "bar" } [ "bar" latin1 decode ] unit-test -{ { CHAR: b 233 CHAR: r } } [ B{ CHAR: b 233 CHAR: r } latin1 decode >array ] unit-test +{ { char: b 233 char: r } } [ B{ char: b 233 char: r } latin1 decode >array ] unit-test { { 0xfffd 0x20AC } } [ B{ 0x81 0x80 } windows-1252 decode >array ] unit-test { t } [ \ latin1 8-bit-encoding? ] unit-test diff --git a/basis/io/encodings/euc/euc-tests.factor b/basis/io/encodings/euc/euc-tests.factor index 669266a69d..808f85a017 100644 --- a/basis/io/encodings/euc/euc-tests.factor +++ b/basis/io/encodings/euc/euc-tests.factor @@ -47,4 +47,4 @@ IN: io.encodings.euc.tests { t } [ phrase-euc-kr 3 head* euc-kr decode phrase-unicode 2 head* = ] unit-test -{ t } [ phrase-euc-kr 2 head* euc-kr decode phrase-unicode 2 head* CHAR: replacement-character suffix = ] unit-test +{ t } [ phrase-euc-kr 2 head* euc-kr decode phrase-unicode 2 head* char: replacement-character suffix = ] unit-test diff --git a/basis/io/encodings/gb18030/gb18030-tests.factor b/basis/io/encodings/gb18030/gb18030-tests.factor index e46fd0e267..d63b54ff94 100644 --- a/basis/io/encodings/gb18030/gb18030-tests.factor +++ b/basis/io/encodings/gb18030/gb18030-tests.factor @@ -9,15 +9,15 @@ IN: io.encodings.gb18030.tests [ B{ 0xB7 0xB8 } >string gb18030 encode ] unit-test { { 0xB7 0xB8 } } [ B{ 0xA1 0xA4 0x81 0x30 0x86 0x30 } gb18030 decode >array ] unit-test -{ { 0xB7 CHAR: replacement-character } } +{ { 0xB7 char: replacement-character } } [ B{ 0xA1 0xA4 0x81 0x30 0x86 } gb18030 decode >array ] unit-test -{ { 0xB7 CHAR: replacement-character } } +{ { 0xB7 char: replacement-character } } [ B{ 0xA1 0xA4 0x81 0x30 } gb18030 decode >array ] unit-test -{ { 0xB7 CHAR: replacement-character } } +{ { 0xB7 char: replacement-character } } [ B{ 0xA1 0xA4 0x81 } gb18030 decode >array ] unit-test { { 0xB7 } } [ B{ 0xA1 0xA4 } gb18030 decode >array ] unit-test -{ { CHAR: replacement-character } } +{ { char: replacement-character } } [ B{ 0xA1 } >string gb18030 decode >array ] unit-test { { 0x44D7 0x464B } } [ B{ 0x82 0x33 0xA3 0x39 0x82 0x33 0xC9 0x31 } diff --git a/basis/io/encodings/iso2022/iso2022-tests.factor b/basis/io/encodings/iso2022/iso2022-tests.factor index c83c66f919..49d9f58595 100644 --- a/basis/io/encodings/iso2022/iso2022-tests.factor +++ b/basis/io/encodings/iso2022/iso2022-tests.factor @@ -7,30 +7,30 @@ IN: io.encodings.iso2022 { "hello" } [ "hello" >byte-array iso2022 decode ] unit-test { "hello" } [ "hello" iso2022 encode >string ] unit-test -{ "hi" } [ B{ CHAR: h $ ESC CHAR: ( CHAR: B CHAR: i } iso2022 decode ] unit-test -{ "hi" } [ B{ CHAR: h CHAR: i $ ESC CHAR: ( CHAR: B } iso2022 decode ] unit-test -{ "hi\u00fffd" } [ B{ CHAR: h CHAR: i $ ESC CHAR: ( } iso2022 decode ] unit-test -{ "hi\u00fffd" } [ B{ CHAR: h CHAR: i $ ESC } iso2022 decode ] unit-test +{ "hi" } [ B{ char: h $ ESC char: ( char: B char: i } iso2022 decode ] unit-test +{ "hi" } [ B{ char: h char: i $ ESC char: ( char: B } iso2022 decode ] unit-test +{ "hi\u00fffd" } [ B{ char: h char: i $ ESC char: ( } iso2022 decode ] unit-test +{ "hi\u00fffd" } [ B{ char: h char: i $ ESC } iso2022 decode ] unit-test -{ B{ CHAR: h $ ESC CHAR: ( CHAR: J 0xD8 } } [ "h\u00ff98" iso2022 encode ] unit-test -{ "h\u00ff98" } [ B{ CHAR: h $ ESC CHAR: ( CHAR: J 0xD8 } iso2022 decode ] unit-test -{ "hi" } [ B{ CHAR: h $ ESC CHAR: ( CHAR: J CHAR: i } iso2022 decode ] unit-test -{ "h" } [ B{ CHAR: h $ ESC CHAR: ( CHAR: J } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: ( CHAR: J 0x80 } iso2022 decode ] unit-test +{ B{ char: h $ ESC char: ( char: J 0xD8 } } [ "h\u00ff98" iso2022 encode ] unit-test +{ "h\u00ff98" } [ B{ char: h $ ESC char: ( char: J 0xD8 } iso2022 decode ] unit-test +{ "hi" } [ B{ char: h $ ESC char: ( char: J char: i } iso2022 decode ] unit-test +{ "h" } [ B{ char: h $ ESC char: ( char: J } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: ( char: J 0x80 } iso2022 decode ] unit-test -{ B{ CHAR: h $ ESC CHAR: $ CHAR: B 0x3E 0x47 } } [ "h\u007126" iso2022 encode ] unit-test -{ "h\u007126" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: B 0x3E 0x47 } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: B 0x3E } iso2022 decode ] unit-test -{ "h" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: B } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: B 0x80 0x80 } iso2022 decode ] unit-test +{ B{ char: h $ ESC char: $ char: B 0x3E 0x47 } } [ "h\u007126" iso2022 encode ] unit-test +{ "h\u007126" } [ B{ char: h $ ESC char: $ char: B 0x3E 0x47 } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ char: B 0x3E } iso2022 decode ] unit-test +{ "h" } [ B{ char: h $ ESC char: $ char: B } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ char: B 0x80 0x80 } iso2022 decode ] unit-test -{ B{ CHAR: h $ ESC CHAR: $ CHAR: ( CHAR: D 0x38 0x54 } } [ "h\u0058ce" iso2022 encode ] unit-test -{ "h\u0058ce" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: ( CHAR: D 0x38 0x54 } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: ( CHAR: D 0x38 } iso2022 decode ] unit-test -{ "h" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: ( CHAR: D } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: ( } iso2022 decode ] unit-test -{ "h\u00fffd" } [ B{ CHAR: h $ ESC CHAR: $ CHAR: ( CHAR: D 0x70 0x70 } iso2022 decode ] unit-test +{ B{ char: h $ ESC char: $ char: ( char: D 0x38 0x54 } } [ "h\u0058ce" iso2022 encode ] unit-test +{ "h\u0058ce" } [ B{ char: h $ ESC char: $ char: ( char: D 0x38 0x54 } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ char: ( char: D 0x38 } iso2022 decode ] unit-test +{ "h" } [ B{ char: h $ ESC char: $ char: ( char: D } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ char: ( } iso2022 decode ] unit-test +{ "h\u00fffd" } [ B{ char: h $ ESC char: $ char: ( char: D 0x70 0x70 } iso2022 decode ] unit-test [ "\u{syriac-music}" iso2022 encode ] must-fail diff --git a/basis/io/encodings/iso2022/iso2022.factor b/basis/io/encodings/iso2022/iso2022.factor index 9419293d16..336b1fd581 100644 --- a/basis/io/encodings/iso2022/iso2022.factor +++ b/basis/io/encodings/iso2022/iso2022.factor @@ -33,10 +33,10 @@ M: iso2022 CONSTANT: ESC 0x16 -CONSTANT: switch-ascii B{ $ ESC CHAR: ( CHAR: B } -CONSTANT: switch-jis201 B{ $ ESC CHAR: ( CHAR: J } -CONSTANT: switch-jis208 B{ $ ESC CHAR: $ CHAR: B } -CONSTANT: switch-jis212 B{ $ ESC CHAR: $ CHAR: ( CHAR: D } +CONSTANT: switch-ascii B{ $ ESC char: ( char: B } +CONSTANT: switch-jis201 B{ $ ESC char: ( char: J } +CONSTANT: switch-jis208 B{ $ ESC char: $ char: B } +CONSTANT: switch-jis212 B{ $ ESC char: $ char: ( char: D } : find-type ( char -- code type ) { @@ -62,19 +62,19 @@ M:: iso2022-state encode-char ( char stream encoding -- ) : read-escape ( stream -- type/f ) dup stream-read1 { - { CHAR: ( [ + { char: ( [ stream-read1 { - { CHAR: B [ ascii get-global ] } - { CHAR: J [ jis201 get-global ] } + { char: B [ ascii get-global ] } + { char: J [ jis201 get-global ] } [ drop f ] } case ] } - { CHAR: $ [ + { char: $ [ dup stream-read1 { - { CHAR: @ [ drop jis208 get-global ] } ! want: JIS X 0208-1978 - { CHAR: B [ drop jis208 get-global ] } - { CHAR: ( [ - stream-read1 CHAR: D = jis212 get-global f ? + { char: @ [ drop jis208 get-global ] } ! want: JIS X 0208-1978 + { char: B [ drop jis208 get-global ] } + { char: ( [ + stream-read1 char: D = jis212 get-global f ? ] } [ 2drop f ] } case diff --git a/basis/io/encodings/shift-jis/shift-jis-tests.factor b/basis/io/encodings/shift-jis/shift-jis-tests.factor index 91f8a93892..d82c407ebb 100644 --- a/basis/io/encodings/shift-jis/shift-jis-tests.factor +++ b/basis/io/encodings/shift-jis/shift-jis-tests.factor @@ -3,15 +3,15 @@ USING: io.encodings.shift-jis tools.test io.encodings.string arrays strings ; IN: io.encodings.shift-jis.tests -{ { CHAR: replacement-character } } [ { 141 } shift-jis decode >array ] unit-test +{ { char: replacement-character } } [ { 141 } shift-jis decode >array ] unit-test { "" } [ "" shift-jis decode >string ] unit-test { "" } [ "" shift-jis encode >string ] unit-test -[ { CHAR: replacement-character } shift-jis encode ] must-fail -{ "ab¥ィ" } [ { CHAR: a CHAR: b 0x5C 0xA8 } shift-jis decode ] unit-test -{ { CHAR: a CHAR: b 0x5C 0xA8 } } [ "ab¥ィ" shift-jis encode >array ] unit-test -{ "ab\\ィ" } [ { CHAR: a CHAR: b 0x5C 0xA8 } windows-31j decode ] unit-test -{ { CHAR: a CHAR: b 0x5C 0xA8 } } [ "ab\\ィ" windows-31j encode >array ] unit-test -{ "\u000081\u0000c8" } [ CHAR: logical-and 1string windows-31j encode >string ] unit-test -{ "\u000081\u0000c8" } [ CHAR: logical-and 1string shift-jis encode >string ] unit-test -{ { CHAR: logical-and } } [ "\u000081\u0000c8" windows-31j decode >array ] unit-test -{ { CHAR: logical-and } } [ "\u000081\u0000c8" shift-jis decode >array ] unit-test +[ { char: replacement-character } shift-jis encode ] must-fail +{ "ab¥ィ" } [ { char: a char: b 0x5C 0xA8 } shift-jis decode ] unit-test +{ { char: a char: b 0x5C 0xA8 } } [ "ab¥ィ" shift-jis encode >array ] unit-test +{ "ab\\ィ" } [ { char: a char: b 0x5C 0xA8 } windows-31j decode ] unit-test +{ { char: a char: b 0x5C 0xA8 } } [ "ab\\ィ" windows-31j encode >array ] unit-test +{ "\u000081\u0000c8" } [ char: logical-and 1string windows-31j encode >string ] unit-test +{ "\u000081\u0000c8" } [ char: logical-and 1string shift-jis encode >string ] unit-test +{ { char: logical-and } } [ "\u000081\u0000c8" windows-31j decode >array ] unit-test +{ { char: logical-and } } [ "\u000081\u0000c8" shift-jis decode >array ] unit-test diff --git a/basis/io/encodings/utf32/utf32-tests.factor b/basis/io/encodings/utf32/utf32-tests.factor index d1edee5417..b3eec78013 100644 --- a/basis/io/encodings/utf32/utf32-tests.factor +++ b/basis/io/encodings/utf32/utf32-tests.factor @@ -5,25 +5,25 @@ io.streams.byte-array sequences io.encodings io strings io.encodings.string alien.c-types alien.strings accessors classes ; IN: io.encodings.utf32.tests -{ { CHAR: x } } [ B{ 0 0 0 CHAR: x } utf32be decode >array ] unit-test +{ { char: x } } [ B{ 0 0 0 char: x } utf32be decode >array ] unit-test { { 0x1D11E } } [ B{ 0 1 0xD1 0x1E } utf32be decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0 1 0xD1 } utf32be decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0 1 } utf32be decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0 } utf32be decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0 1 0xD1 } utf32be decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0 1 } utf32be decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0 } utf32be decode >array ] unit-test { { } } [ { } utf32be decode >array ] unit-test -{ B{ 0 0 0 CHAR: x 0 1 0xD1 0x1E } } [ { CHAR: x 0x1d11e } >string utf32be encode ] unit-test +{ B{ 0 0 0 char: x 0 1 0xD1 0x1E } } [ { char: x 0x1d11e } >string utf32be encode ] unit-test -{ { CHAR: x } } [ B{ CHAR: x 0 0 0 } utf32le decode >array ] unit-test +{ { char: x } } [ B{ char: x 0 0 0 } utf32le decode >array ] unit-test { { 0x1d11e } } [ B{ 0x1e 0xd1 1 0 } utf32le decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0x1e 0xd1 1 } utf32le decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0x1e 0xd1 } utf32le decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0x1e } utf32le decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0x1e 0xd1 1 } utf32le decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0x1e 0xd1 } utf32le decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0x1e } utf32le decode >array ] unit-test { { } } [ { } utf32le decode >array ] unit-test -{ B{ 120 0 0 0 0x1e 0xd1 1 0 } } [ { CHAR: x 0x1d11e } >string utf32le encode ] unit-test +{ B{ 120 0 0 0 0x1e 0xd1 1 0 } } [ { char: x 0x1d11e } >string utf32le encode ] unit-test -{ { CHAR: x } } [ B{ 0xff 0xfe 0 0 CHAR: x 0 0 0 } utf32 decode >array ] unit-test -{ { CHAR: x } } [ B{ 0 0 0xfe 0xff 0 0 0 CHAR: x } utf32 decode >array ] unit-test +{ { char: x } } [ B{ 0xff 0xfe 0 0 char: x 0 0 0 } utf32 decode >array ] unit-test +{ { char: x } } [ B{ 0 0 0xfe 0xff 0 0 0 char: x } utf32 decode >array ] unit-test -{ B{ 0xff 0xfe 0 0 120 0 0 0 0x1e 0xd1 1 0 } } [ { CHAR: x 0x1d11e } >string utf32 encode ] unit-test +{ B{ 0xff 0xfe 0 0 120 0 0 0 0x1e 0xd1 1 0 } } [ { char: x 0x1d11e } >string utf32 encode ] unit-test diff --git a/basis/io/encodings/utf7/utf7.factor b/basis/io/encodings/utf7/utf7.factor index 40d4fe5490..56f9da0ee8 100644 --- a/basis/io/encodings/utf7/utf7.factor +++ b/basis/io/encodings/utf7/utf7.factor @@ -13,20 +13,20 @@ TUPLE: utf7codec dialect buffer ; : utf7 ( -- utf7codec ) { { { } { } } - { { CHAR: + } { CHAR: - } } + { { char: + } { char: - } } } V{ } utf7codec boa ; : utf7imap4 ( -- utf7codec ) { - { { CHAR: / } { CHAR: , } } - { { CHAR: & } { CHAR: - } } + { { char: / } { char: , } } + { { char: & } { char: - } } } V{ } utf7codec boa ; : >raw-base64 ( bytes -- bytes' ) - >string utf16be encode >base64 [ CHAR: = = ] trim-tail ; + >string utf16be encode >base64 [ char: = = ] trim-tail ; : raw-base64> ( str -- str' ) - dup length 4 / ceiling 4 * CHAR: = pad-tail base64> utf16be decode ; + dup length 4 / ceiling 4 * char: = pad-tail base64> utf16be decode ; : encode-chunk ( repl-pair surround-pair chunk ascii? -- bytes ) [ swap [ first ] [ concat ] bi replace nip ] diff --git a/basis/io/files/info/unix/linux/linux.factor b/basis/io/files/info/unix/linux/linux.factor index dd04aecf6d..56e722bf21 100644 --- a/basis/io/files/info/unix/linux/linux.factor +++ b/basis/io/files/info/unix/linux/linux.factor @@ -65,7 +65,7 @@ frequency pass-number ; } cleave ; : parse-mtab ( -- array ) - CHAR: \s [ "/etc/mtab" utf8 file>csv ] with-delimiter + char: \s [ "/etc/mtab" utf8 file>csv ] with-delimiter [ mtab-csv>mtab-entry ] map ; : mtab-entry>file-system-info ( mtab-entry -- file-system-info/f ) diff --git a/basis/io/files/info/unix/unix.factor b/basis/io/files/info/unix/unix.factor index a6e8a34561..3134954730 100644 --- a/basis/io/files/info/unix/unix.factor +++ b/basis/io/files/info/unix/unix.factor @@ -242,26 +242,26 @@ M: string set-file-group ( path string -- ) : ch>file-type ( ch -- type ) { - { CHAR: b [ +block-device+ ] } - { CHAR: c [ +character-device+ ] } - { CHAR: d [ +directory+ ] } - { CHAR: l [ +symbolic-link+ ] } - { CHAR: s [ +socket+ ] } - { CHAR: p [ +fifo+ ] } - { CHAR: - [ +regular-file+ ] } + { char: b [ +block-device+ ] } + { char: c [ +character-device+ ] } + { char: d [ +directory+ ] } + { char: l [ +symbolic-link+ ] } + { char: s [ +socket+ ] } + { char: p [ +fifo+ ] } + { char: - [ +regular-file+ ] } [ drop +unknown+ ] } case ; : file-type>ch ( type -- ch ) { - { +block-device+ [ CHAR: b ] } - { +character-device+ [ CHAR: c ] } - { +directory+ [ CHAR: d ] } - { +symbolic-link+ [ CHAR: l ] } - { +socket+ [ CHAR: s ] } - { +fifo+ [ CHAR: p ] } - { +regular-file+ [ CHAR: - ] } - [ drop CHAR: - ] + { +block-device+ [ char: b ] } + { +character-device+ [ char: c ] } + { +directory+ [ char: d ] } + { +symbolic-link+ [ char: l ] } + { +socket+ [ char: s ] } + { +fifo+ [ char: p ] } + { +regular-file+ [ char: - ] } + [ drop char: - ] } case ; = ] - [ second CHAR: : = ] + [ second char: : = ] [ first Letter? ] } 1&& [ 2 head "\\" append ] [ not-absolute-path ] if ; diff --git a/basis/io/files/unique/unique-tests.factor b/basis/io/files/unique/unique-tests.factor index a45137d703..b45bbe38b9 100644 --- a/basis/io/files/unique/unique-tests.factor +++ b/basis/io/files/unique/unique-tests.factor @@ -7,7 +7,7 @@ IN: io.files.unique.tests { 123 } [ [ "core" ".test" [ - [ [ 123 CHAR: a ] dip ascii set-file-contents ] + [ [ 123 char: a ] dip ascii set-file-contents ] [ file-info size>> ] bi ] cleanup-unique-file ] with-temp-directory diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 566f8c7a8c..2f8c6f032b 100755 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -320,7 +320,7 @@ M: windows root-directory? ( path -- ? ) { [ dup empty? ] [ drop f ] } { [ dup [ path-separator? ] all? ] [ drop t ] } { [ dup trim-tail-separators { [ length 2 = ] - [ second CHAR: : = ] } 1&& ] [ drop t ] } + [ second char: : = ] } 1&& ] [ drop t ] } { [ dup unicode-prefix head? ] [ trim-tail-separators length unicode-prefix length 2 + = ] } [ drop f ] diff --git a/basis/io/launcher/windows/windows.factor b/basis/io/launcher/windows/windows.factor index 89032eed79..5a49b486ac 100755 --- a/basis/io/launcher/windows/windows.factor +++ b/basis/io/launcher/windows/windows.factor @@ -57,17 +57,17 @@ TUPLE: CreateProcess-args : fix-trailing-backslashes ( str -- str' ) 0 count-trailing-backslashes - 2 * CHAR: \\ append ; + 2 * char: \\ append ; ! Find groups of \, groups of \ followed by ", or naked " : escape-double-quote ( str -- newstr ) [ - { [ drop CHAR: \ = ] [ nip "\\\"" member? ] } 2&& + { [ drop char: \ = ] [ nip "\\\"" member? ] } 2&& ] monotonic-split [ - dup last CHAR: \" = [ + dup last char: \" = [ dup length 1 > [ ! String of backslashes + double-quote - length 1 - 2 * CHAR: \\ "\\\"" append + length 1 - 2 * char: \\ "\\\"" append ] [ ! Single double-quote drop "\\\"" @@ -81,7 +81,7 @@ TUPLE: CreateProcess-args ! See http://msdn.microsoft.com/en-us/library/ms647232.aspx : escape-argument ( str -- newstr ) escape-double-quote - CHAR: \s over member? [ + char: \s over member? [ fix-trailing-backslashes "\"" dup surround ] when ; diff --git a/basis/io/mmap/mmap-tests.factor b/basis/io/mmap/mmap-tests.factor index 28cbb547ed..088f2459b5 100644 --- a/basis/io/mmap/mmap-tests.factor +++ b/basis/io/mmap/mmap-tests.factor @@ -7,7 +7,7 @@ SPECIALIZED-ARRAY: uint [| path | "12345" path ascii set-file-contents - { } [ path [ char CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test + { } [ path [ char char: 2 0 pick set-nth drop ] with-mapped-file ] unit-test { 5 } [ path [ char length ] with-mapped-file ] unit-test { 5 } [ path [ char length ] with-mapped-file-reader ] unit-test { "22345" } [ path ascii file-contents ] unit-test diff --git a/basis/io/sockets/secure/openssl/openssl.factor b/basis/io/sockets/secure/openssl/openssl.factor index 413d323aee..58cdb7ad4a 100644 --- a/basis/io/sockets/secure/openssl/openssl.factor +++ b/basis/io/sockets/secure/openssl/openssl.factor @@ -353,7 +353,7 @@ M: ssl-handle dispose* "*." ?head [ { [ tail? ] - [ [ [ CHAR: . = ] count ] bi@ - 1 <= ] + [ [ [ char: . = ] count ] bi@ - 1 <= ] } 2&& ] [ = diff --git a/basis/io/streams/limited/limited-tests.factor b/basis/io/streams/limited/limited-tests.factor index 092949c8df..a939fb998b 100644 --- a/basis/io/streams/limited/limited-tests.factor +++ b/basis/io/streams/limited/limited-tests.factor @@ -13,7 +13,7 @@ IN: io.streams.limited.tests { } [ "data" get 24 "limited" set ] unit-test -{ CHAR: h } [ "limited" get stream-read1 ] unit-test +{ char: h } [ "limited" get stream-read1 ] unit-test { } [ "limited" get ascii "decoded" set ] unit-test @@ -33,13 +33,13 @@ IN: io.streams.limited.tests { } [ "data" get 4 "limited" set ] unit-test -{ "abc" CHAR: \n } +{ "abc" char: \n } [ "\n" "limited" get stream-read-until [ >string ] dip ] unit-test { "" f } [ "\n" "limited" get stream-read-until [ >string ] dip ] unit-test -{ CHAR: a } +{ char: a } [ "a" 1 stream-read1 ] unit-test { "abc" } diff --git a/basis/io/streams/string/string-tests.factor b/basis/io/streams/string/string-tests.factor index 0385e89670..5e3d048b5c 100644 --- a/basis/io/streams/string/string-tests.factor +++ b/basis/io/streams/string/string-tests.factor @@ -4,7 +4,7 @@ IN: io.streams.string.tests { "" } [ "" [ contents ] with-string-reader ] unit-test -{ "line 1" CHAR: l } +{ "line 1" char: l } [ "line 1\nline 2\nline 3" [ readln read1 ] with-string-reader ] @@ -29,8 +29,8 @@ unit-test { "abc" f } [ "abc" [ 3 read read1 ] with-string-reader ] unit-test { - { "It seems " CHAR: J } - { "obs has lost h" CHAR: i } + { "It seems " char: J } + { "obs has lost h" char: i } { "s grasp on reality again.\n" f } } [ "It seems Jobs has lost his grasp on reality again.\n" [ @@ -40,7 +40,7 @@ unit-test ] with-string-reader ] unit-test -{ "" CHAR: \r } [ "\r\n" [ "\r" read-until ] with-string-reader ] unit-test +{ "" char: \r } [ "\r\n" [ "\r" read-until ] with-string-reader ] unit-test { f f } [ "" [ "\r" read-until ] with-string-reader ] unit-test { "hello" "hi" } [ diff --git a/basis/io/streams/string/string.factor b/basis/io/streams/string/string.factor index bb16e7ec81..721dcb2ca0 100644 --- a/basis/io/streams/string/string.factor +++ b/basis/io/streams/string/string.factor @@ -15,8 +15,8 @@ M: string-reader stream-read1 sequence-read1 ; M: string-reader stream-read-until sequence-read-until ; M: string-reader stream-readln dup >sequence-stream< bounds-check? [ - "\r\n" over sequence-read-until CHAR: \r eq? [ - over >sequence-stream< dupd ?nth CHAR: \n eq? + "\r\n" over sequence-read-until char: \r eq? [ + over >sequence-stream< dupd ?nth char: \n eq? [ 1 + pick i<< ] [ drop ] if ] when nip "" or ] [ drop f ] if ; diff --git a/basis/io/streams/throwing/throwing-tests.factor b/basis/io/streams/throwing/throwing-tests.factor index db203e7130..b942e182eb 100644 --- a/basis/io/streams/throwing/throwing-tests.factor +++ b/basis/io/streams/throwing/throwing-tests.factor @@ -52,7 +52,7 @@ IN: io.streams.throwing.tests ] with-byte-reader ] [ stream-exhausted? ] must-fail-with -{ "asd" CHAR: f } [ +{ "asd" char: f } [ "asdf" [ [ "f" read-until ] throw-on-eof ] with-string-reader ] unit-test diff --git a/basis/ip-parser/ip-parser.factor b/basis/ip-parser/ip-parser.factor index d08477d5f9..fb94b16244 100644 --- a/basis/ip-parser/ip-parser.factor +++ b/basis/ip-parser/ip-parser.factor @@ -62,7 +62,7 @@ ERROR: more-than-8-components ; dup hex> [ ] [ bad-ipv6-component ] ?if ; : split-ipv6 ( string -- seq ) - ":" split CHAR: . over last member? [ unclip-last ] [ f ] if + ":" split char: . over last member? [ unclip-last ] [ f ] if [ [ ipv6-component ] map ] [ [ parse-ipv4 append ] unless-empty ] bi* ; diff --git a/basis/json/prettyprint/prettyprint.factor b/basis/json/prettyprint/prettyprint.factor index 3947132afa..f746567d1e 100644 --- a/basis/json/prettyprint/prettyprint.factor +++ b/basis/json/prettyprint/prettyprint.factor @@ -14,7 +14,7 @@ GENERIC: pprint-json* ( obj -- ) : write-spaces ( -- ) indent-level get 0 > [ indent-level get nspaces * - CHAR: \s + char: \s write ] when ; diff --git a/basis/json/reader/reader.factor b/basis/json/reader/reader.factor index 39e932c102..8998c8589f 100644 --- a/basis/json/reader/reader.factor +++ b/basis/json/reader/reader.factor @@ -44,25 +44,25 @@ DEFER: (read-json-string) : (read-json-escape) ( stream accum -- accum ) { sbuf } declare over stream-read1 { - { CHAR: \" [ CHAR: \" ] } - { CHAR: \\ [ CHAR: \\ ] } - { CHAR: / [ CHAR: / ] } - { CHAR: b [ CHAR: \b ] } - { CHAR: f [ CHAR: \f ] } - { CHAR: n [ CHAR: \n ] } - { CHAR: r [ CHAR: \r ] } - { CHAR: t [ CHAR: \t ] } - { CHAR: u [ over read-json-escape-unicode ] } + { char: \" [ char: \" ] } + { char: \\ [ char: \\ ] } + { char: / [ char: / ] } + { char: b [ char: \b ] } + { char: f [ char: \f ] } + { char: n [ char: \n ] } + { char: r [ char: \r ] } + { char: t [ char: \t ] } + { char: u [ over read-json-escape-unicode ] } [ ] } case [ suffix! (read-json-string) ] [ json-error ] if* ; : (read-json-string) ( stream accum -- accum ) { sbuf } declare "\\\"" pick stream-read-until [ append! ] dip - CHAR: \" = [ nip ] [ (read-json-escape) ] if ; + char: \" = [ nip ] [ (read-json-escape) ] if ; : read-json-string ( stream -- str ) - "\\\"" over stream-read-until CHAR: \" = + "\\\"" over stream-read-until char: \" = [ nip ] [ >sbuf (read-json-escape) { sbuf } declare "" like ] if ; : second-last-unsafe ( seq -- second-last ) @@ -108,20 +108,20 @@ DEFER: (read-json-string) ! 2dup 1string swap . . ! Great for debug... { object vector object } declare { - { CHAR: \" [ over read-json-string suffix! ] } - { CHAR: [ [ json-open-array ] } - { CHAR: , [ v-over-push ] } - { CHAR: ] [ json-close-array ] } - { CHAR: { [ json-open-hash ] } - { CHAR: : [ v-pick-push ] } - { CHAR: } [ json-close-hash ] } - { CHAR: \s [ ] } - { CHAR: \t [ ] } - { CHAR: \r [ ] } - { CHAR: \n [ ] } - { CHAR: t [ "rue" pick json-expect t suffix! ] } - { CHAR: f [ "alse" pick json-expect f suffix! ] } - { CHAR: n [ "ull" pick json-expect json-null suffix! ] } + { char: \" [ over read-json-string suffix! ] } + { char: [ [ json-open-array ] } + { char: , [ v-over-push ] } + { char: ] [ json-close-array ] } + { char: { [ json-open-hash ] } + { char: : [ v-pick-push ] } + { char: } [ json-close-hash ] } + { char: \s [ ] } + { char: \t [ ] } + { char: \r [ ] } + { char: \n [ ] } + { char: t [ "rue" pick json-expect t suffix! ] } + { char: f [ "alse" pick json-expect f suffix! ] } + { char: n [ "ull" pick json-expect json-null suffix! ] } [ pick json-number [ suffix! ] dip [ scan ] when* ] } case ; diff --git a/basis/json/writer/writer.factor b/basis/json/writer/writer.factor index 4f91e7eb6a..88656a9c68 100644 --- a/basis/json/writer/writer.factor +++ b/basis/json/writer/writer.factor @@ -59,20 +59,20 @@ M: json-null stream-json-print PRIVATE> M: string stream-json-print - CHAR: \" over stream-write1 swap [ + char: \" over stream-write1 swap [ { - { CHAR: \" [ "\\\"" over stream-write ] } - { CHAR: \\ [ "\\\\" over stream-write ] } - { CHAR: / [ + { char: \" [ "\\\"" over stream-write ] } + { char: \\ [ "\\\\" over stream-write ] } + { char: / [ json-escape-slashes? get [ "\\/" over stream-write ] - [ CHAR: / over stream-write1 ] if + [ char: / over stream-write1 ] if ] } - { CHAR: \b [ "\\b" over stream-write ] } - { CHAR: \f [ "\\f" over stream-write ] } - { CHAR: \n [ "\\n" over stream-write ] } - { CHAR: \r [ "\\r" over stream-write ] } - { CHAR: \t [ "\\t" over stream-write ] } + { char: \b [ "\\b" over stream-write ] } + { char: \f [ "\\f" over stream-write ] } + { char: \n [ "\\n" over stream-write ] } + { char: \r [ "\\r" over stream-write ] } + { char: \t [ "\\t" over stream-write ] } { 0x2028 [ "\\u2028" over stream-write ] } { 0x2029 [ "\\u2029" over stream-write ] } [ @@ -87,7 +87,7 @@ M: string stream-json-print ] if ] } case - ] each CHAR: \" swap stream-write1 ; + ] each char: \" swap stream-write1 ; M: integer stream-json-print [ number>string ] [ stream-write ] bi* ; @@ -111,10 +111,10 @@ M: real stream-json-print [ >float number>string ] [ stream-write ] bi* ; M: sequence stream-json-print - CHAR: [ over stream-write1 swap - over '[ CHAR: , _ stream-write1 ] + char: [ over stream-write1 swap + over '[ char: , _ stream-write1 ] pick '[ _ stream-json-print ] interleave - CHAR: ] swap stream-write1 ; + char: ] swap stream-write1 ; json ; M: real json-coerce >float number>string ; :: json-print-assoc ( obj stream -- ) - CHAR: { stream stream-write1 obj >alist - [ CHAR: , stream stream-write1 ] + char: { stream stream-write1 obj >alist + [ char: , stream stream-write1 ] json-friendly-keys? get json-coerce-keys? get '[ first2 [ @@ -140,11 +140,11 @@ M: real json-coerce >float number>string ; [ _ [ json-coerce ] when ] if stream stream-json-print ] [ - CHAR: : stream stream-write1 + char: : stream stream-write1 stream stream-json-print ] bi* ] interleave - CHAR: } stream stream-write1 ; + char: } stream stream-write1 ; PRIVATE> diff --git a/basis/lcs/diff2html/diff2html.factor b/basis/lcs/diff2html/diff2html.factor index b244ddd45c..07c8d5269d 100644 --- a/basis/lcs/diff2html/diff2html.factor +++ b/basis/lcs/diff2html/diff2html.factor @@ -7,7 +7,7 @@ IN: lcs.diff2html GENERIC: diff-line ( obj -- xml ) : item-string ( item -- string ) - item>> [ CHAR: no-break-space 1string ] when-empty ; + item>> [ char: no-break-space 1string ] when-empty ; M: retain diff-line item-string diff --git a/basis/lcs/lcs-tests.factor b/basis/lcs/lcs-tests.factor index 914217ba68..749ea2ddc7 100644 --- a/basis/lcs/lcs-tests.factor +++ b/basis/lcs/lcs-tests.factor @@ -14,12 +14,12 @@ USING: tools.test lcs ; { "abd" } [ "faxbcd" "abdef" lcs ] unit-test { { - T{ delete f CHAR: f } - T{ retain f CHAR: a } - T{ delete f CHAR: x } - T{ retain f CHAR: b } - T{ delete f CHAR: c } - T{ retain f CHAR: d } - T{ insert f CHAR: e } - T{ insert f CHAR: f } + T{ delete f char: f } + T{ retain f char: a } + T{ delete f char: x } + T{ retain f char: b } + T{ delete f char: c } + T{ retain f char: d } + T{ insert f char: e } + T{ insert f char: f } } } [ "faxbcd" "abdef" lcs-diff ] unit-test diff --git a/basis/locals/locals-tests.factor b/basis/locals/locals-tests.factor index d9edb6bf0a..9d08c5c389 100644 --- a/basis/locals/locals-tests.factor +++ b/basis/locals/locals-tests.factor @@ -108,14 +108,14 @@ GENERIC#: lambda-generic-1 1 ( a b -- c ) M:: integer lambda-generic-1 ( a b -- c ) a b * ; M:: string lambda-generic-1 ( a b -- c ) - a b CHAR: x lambda-generic ; + a b char: x lambda-generic ; M:: integer lambda-generic ( a b -- c ) a b lambda-generic-1 ; GENERIC#: lambda-generic-2 1 ( a b -- c ) M:: integer lambda-generic-2 ( a b -- c ) - a CHAR: x b lambda-generic ; + a char: x b lambda-generic ; M:: string lambda-generic-2 ( a b -- c ) a b append ; diff --git a/basis/logging/server/server.factor b/basis/logging/server/server.factor index b9d8cf78f1..fcf5005bfa 100644 --- a/basis/logging/server/server.factor +++ b/basis/logging/server/server.factor @@ -38,7 +38,7 @@ SYMBOL: log-files : timestamp-header. ( -- ) "[" write now (timestamp>rfc3339) "] " write ; -: multiline-header ( -- str ) 20 CHAR: - ; foldable +: multiline-header ( -- str ) 20 char: - ; foldable : multiline-header. ( -- ) "[" write multiline-header write "] " write ; diff --git a/basis/mime/multipart/multipart-tests.factor b/basis/mime/multipart/multipart-tests.factor index febb21af11..3ac4e8d03a 100644 --- a/basis/mime/multipart/multipart-tests.factor +++ b/basis/mime/multipart/multipart-tests.factor @@ -71,7 +71,7 @@ SYMBOL: mime-test-server mime-test-server get insecure>> ; : a-stream ( n -- stream ) - CHAR: a ; + char: a ; { } [ [ diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index ce5abbeac5..5a631c0285 100644 --- a/basis/multiline/multiline.factor +++ b/basis/multiline/multiline.factor @@ -18,7 +18,7 @@ ERROR: bad-heredoc identifier ; dup next-line-text [ dup ";" = [ drop next-line ] - [ % CHAR: \n , (parse-here) ] if + [ % char: \n , (parse-here) ] if ] [ ";" throw-unexpected-eof ] if ; PRIVATE> @@ -45,7 +45,7 @@ SYNTAX: STRING: end text i subseq-start-from [| j | i j text subseq % j end length + ] [ - text i short tail % CHAR: \n , + text i short tail % char: \n , lexer next-line 0 end lexer (scan-multiline-string) ] if* @@ -66,7 +66,7 @@ SYNTAX: STRING: lexer line-text>> begin-text sequence= [ lexer begin-text advance-same-line ] [ - lexer line-text>> % CHAR: \n , + lexer line-text>> % char: \n , lexer next-line begin-text lexer (parse-til-line-begins) ] if diff --git a/basis/pack/pack.factor b/basis/pack/pack.factor index 80e54dfb6a..c07397d940 100644 --- a/basis/pack/pack.factor +++ b/basis/pack/pack.factor @@ -33,62 +33,62 @@ M: object >n-byte-array ( n string -- byte-array ) heap-size >n-byte-array ; : expand-pack-format ( str -- str' ) f swap [ dup digit? - [ [ 0 or 10 * ] [ CHAR: 0 - ] bi* + f ] + [ [ 0 or 10 * ] [ char: 0 - ] bi* + f ] [ [ 1 or ] [ ] bi* f swap ] if ] { } map-as "" concat-as nip ; foldable CONSTANT: pack-table H{ - { CHAR: c s8>byte-array } - { CHAR: C u8>byte-array } - { CHAR: s s16>byte-array } - { CHAR: S u16>byte-array } - { CHAR: t s24>byte-array } - { CHAR: T u24>byte-array } - { CHAR: i s32>byte-array } - { CHAR: I u32>byte-array } - { CHAR: q s64>byte-array } - { CHAR: Q u64>byte-array } - { CHAR: f write-float } - { CHAR: F write-float } - { CHAR: d write-double } - { CHAR: D write-double } + { char: c s8>byte-array } + { char: C u8>byte-array } + { char: s s16>byte-array } + { char: S u16>byte-array } + { char: t s24>byte-array } + { char: T u24>byte-array } + { char: i s32>byte-array } + { char: I u32>byte-array } + { char: q s64>byte-array } + { char: Q u64>byte-array } + { char: f write-float } + { char: F write-float } + { char: d write-double } + { char: D write-double } } CONSTANT: unpack-table H{ - { CHAR: c [ 8 signed-endian> ] } - { CHAR: C [ unsigned-endian> ] } - { CHAR: s [ 16 signed-endian> ] } - { CHAR: S [ unsigned-endian> ] } - { CHAR: t [ 24 signed-endian> ] } - { CHAR: T [ unsigned-endian> ] } - { CHAR: i [ 32 signed-endian> ] } - { CHAR: I [ unsigned-endian> ] } - { CHAR: q [ 64 signed-endian> ] } - { CHAR: Q [ unsigned-endian> ] } - { CHAR: f [ unsigned-endian> bits>float ] } - { CHAR: F [ unsigned-endian> bits>float ] } - { CHAR: d [ unsigned-endian> bits>double ] } - { CHAR: D [ unsigned-endian> bits>double ] } + { char: c [ 8 signed-endian> ] } + { char: C [ unsigned-endian> ] } + { char: s [ 16 signed-endian> ] } + { char: S [ unsigned-endian> ] } + { char: t [ 24 signed-endian> ] } + { char: T [ unsigned-endian> ] } + { char: i [ 32 signed-endian> ] } + { char: I [ unsigned-endian> ] } + { char: q [ 64 signed-endian> ] } + { char: Q [ unsigned-endian> ] } + { char: f [ unsigned-endian> bits>float ] } + { char: F [ unsigned-endian> bits>float ] } + { char: d [ unsigned-endian> bits>double ] } + { char: D [ unsigned-endian> bits>double ] } } CONSTANT: packed-length-table H{ - { CHAR: c 1 } - { CHAR: C 1 } - { CHAR: s 2 } - { CHAR: S 2 } - { CHAR: t 3 } - { CHAR: T 3 } - { CHAR: i 4 } - { CHAR: I 4 } - { CHAR: q 8 } - { CHAR: Q 8 } - { CHAR: f 4 } - { CHAR: F 4 } - { CHAR: d 8 } - { CHAR: D 8 } + { char: c 1 } + { char: C 1 } + { char: s 2 } + { char: S 2 } + { char: t 3 } + { char: T 3 } + { char: i 4 } + { char: I 4 } + { char: q 8 } + { char: Q 8 } + { char: f 4 } + { char: F 4 } + { char: d 8 } + { char: D 8 } } PRIVATE> diff --git a/basis/peg/ebnf/ebnf-docs.factor b/basis/peg/ebnf/ebnf-docs.factor index 50a8162e15..f18df8c824 100644 --- a/basis/peg/ebnf/ebnf-docs.factor +++ b/basis/peg/ebnf/ebnf-docs.factor @@ -371,7 +371,7 @@ ARTICLE: "peg.ebnf.tokenizers" "EBNF Tokenizers" } } "This parser when run with the string \"++--\" or the array " -"{ CHAR: + CHAR: + CHAR: - CHAR: - } will succeed with an AST of { \"++\" \"--\" }. " +"{ char: + char: + char: - char: - } will succeed with an AST of { \"++\" \"--\" }. " "If you want to add whitespace handling to the grammar you need to put it " "between the terminals:" { $examples diff --git a/basis/peg/ebnf/ebnf-tests.factor b/basis/peg/ebnf/ebnf-tests.factor index 84311bc24e..01899f1b61 100644 --- a/basis/peg/ebnf/ebnf-tests.factor +++ b/basis/peg/ebnf/ebnf-tests.factor @@ -156,11 +156,11 @@ IN: peg.ebnf.tests "ab" [EBNF foo=('a') [[ drop 1 ]] ('b') [[ drop 2 ]] EBNF] ] unit-test -{ CHAR: A } [ +{ char: A } [ "A" [EBNF foo=[A-Z] EBNF] ] unit-test -{ CHAR: Z } [ +{ char: Z } [ "Z" [EBNF foo=[A-Z] EBNF] ] unit-test @@ -168,7 +168,7 @@ IN: peg.ebnf.tests "0" [EBNF foo=[A-Z] EBNF] ] must-fail -{ CHAR: 0 } [ +{ char: 0 } [ "0" [EBNF foo=[^A-Z] EBNF] ] unit-test @@ -498,7 +498,7 @@ foo= 'd' "ac" parser3 ] unit-test -{ V{ CHAR: a "d" } } [ +{ V{ char: a "d" } } [ "ad" parser4 ] unit-test @@ -517,7 +517,7 @@ foo= 'd' ] unit-test ! Tokenizer tests -{ V{ "a" CHAR: b } } [ +{ V{ "a" char: b } } [ "ab" [EBNF tokenizer=default foo="a" . EBNF] ] unit-test @@ -541,7 +541,7 @@ Special = "(" | ")" | "{" | "}" | "[" | "]" | "," | " Tok = Spaces (Number | Special ) ;EBNF -{ V{ CHAR: 1 T{ ast-number f 23 } ";" CHAR: x } } [ +{ V{ char: 1 T{ ast-number f 23 } ";" char: x } } [ "123;x" [EBNF bar = . tokenizer = foo=. tokenizer=default baz=. @@ -549,7 +549,7 @@ Tok = Spaces (Number | Special ) EBNF] ] unit-test -{ V{ CHAR: 5 "+" CHAR: 2 } } [ +{ V{ char: 5 "+" char: 2 } } [ "5+2" [EBNF space=(" " | "\n") number=[0-9] @@ -560,7 +560,7 @@ Tok = Spaces (Number | Special ) EBNF] ] unit-test -{ V{ CHAR: 5 "+" CHAR: 2 } } [ +{ V{ char: 5 "+" char: 2 } } [ "5 + 2" [EBNF space=(" " | "\n") number=[0-9] diff --git a/basis/peg/ebnf/ebnf.factor b/basis/peg/ebnf/ebnf.factor index a93314702a..c84e126bcf 100644 --- a/basis/peg/ebnf/ebnf.factor +++ b/basis/peg/ebnf/ebnf.factor @@ -112,11 +112,11 @@ C: ebnf ! between the quotes. [ [ - [ CHAR: \ = ] satisfy + [ char: \ = ] satisfy [ "\"\\" member? ] satisfy 2seq , - [ CHAR: \" = not ] satisfy , + [ char: \" = not ] satisfy , ] choice* repeat1 "\"" "\"" surrounded-by , - [ CHAR: ' = not ] satisfy repeat1 "'" "'" surrounded-by , + [ char: ' = not ] satisfy repeat1 "'" "'" surrounded-by , ] choice* [ "" flatten-as unescape-string ] action ; : non-terminal-parser ( -- parser ) @@ -140,7 +140,7 @@ C: ebnf [ { [ blank? ] - [ CHAR: > = ] + [ char: > = ] } 1|| not ] satisfy repeat1 [ >string ] action ; @@ -155,13 +155,13 @@ C: ebnf : any-character-parser ( -- parser ) ! A parser to match the symbol for any character match. - [ CHAR: . = ] satisfy [ drop ] action ; + [ char: . = ] satisfy [ drop ] action ; : range-parser-parser ( -- parser ) ! Match the syntax for declaring character ranges [ [ "[" syntax , "[" token ensure-not , ] seq* hide , - [ CHAR: ] = not ] satisfy repeat1 , + [ char: ] = not ] satisfy repeat1 , "]" syntax , ] seq* [ first >string unescape-string ] action ; diff --git a/basis/peg/parsers/parsers-docs.factor b/basis/peg/parsers/parsers-docs.factor index af308399ec..eac0790688 100644 --- a/basis/peg/parsers/parsers-docs.factor +++ b/basis/peg/parsers/parsers-docs.factor @@ -11,7 +11,7 @@ HELP: 1token } { $description "Calls 1string on a character and returns a parser that matches that character." } { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"a\" CHAR: a 1token parse ." "\"a\"" } + { $example "USING: peg peg.parsers prettyprint ;" "\"a\" char: a 1token parse ." "\"a\"" } } { $see-also string-parser } ; HELP: (list-of) diff --git a/basis/peg/parsers/parsers.factor b/basis/peg/parsers/parsers.factor index adcc78a1da..c7d2048fe1 100644 --- a/basis/peg/parsers/parsers.factor +++ b/basis/peg/parsers/parsers.factor @@ -74,9 +74,9 @@ PRIVATE> : string-parser ( -- parser ) [ - [ CHAR: \" = ] satisfy hide , - [ CHAR: \" = not ] satisfy repeat0 , - [ CHAR: \" = ] satisfy hide , + [ char: \" = ] satisfy hide , + [ char: \" = not ] satisfy repeat0 , + [ char: \" = ] satisfy hide , ] seq* [ first >string ] action ; : (range-pattern) ( pattern -- string ) @@ -84,7 +84,7 @@ PRIVATE> ! all characters within that range. [ any-char , - [ CHAR: - = ] satisfy hide , + [ char: - = ] satisfy hide , any-char , ] seq* [ first2 [a,b] >string @@ -100,7 +100,7 @@ PRIVATE> ! characters separated with a dash (-) represents the ! range of characters from the first to the second, ! inclusive. - dup first CHAR: ^ = [ + dup first char: ^ = [ rest (range-pattern) [ member? not ] curry satisfy ] [ (range-pattern) [ member? ] curry satisfy diff --git a/basis/peg/peg-docs.factor b/basis/peg/peg-docs.factor index 6e387d329e..71e634adde 100644 --- a/basis/peg/peg-docs.factor +++ b/basis/peg/peg-docs.factor @@ -49,7 +49,7 @@ HELP: range } { $description "Returns a parser that matches a single character that lies within the range of characters given, inclusive." } -{ $examples { $code ": digit ( -- parser ) CHAR: 0 CHAR: 9 range ;" } } ; +{ $examples { $code ": digit ( -- parser ) char: 0 char: 9 range ;" } } ; HELP: seq { $values @@ -137,7 +137,7 @@ HELP: action "from that parse. The result of the quotation is then used as the final AST. This can be used " "for manipulating the parse tree to produce a AST better suited for the task at hand rather than " "the default AST. If the quotation returns " { $link fail } " then the parser fails." } -{ $code "CHAR: 0 CHAR: 9 range [ to-digit ] action" } ; +{ $code "char: 0 char: 9 range [ to-digit ] action" } ; HELP: sp { $values diff --git a/basis/peg/peg-tests.factor b/basis/peg/peg-tests.factor index 3b38a80751..f75fd3d990 100644 --- a/basis/peg/peg-tests.factor +++ b/basis/peg/peg-tests.factor @@ -18,19 +18,19 @@ IN: peg.tests ] unit-test [ - "" CHAR: a CHAR: z range parse + "" char: a char: z range parse ] must-fail [ - "1bcd" CHAR: a CHAR: z range parse + "1bcd" char: a char: z range parse ] must-fail -{ CHAR: a } [ - "abcd" CHAR: a CHAR: z range parse +{ char: a } [ + "abcd" char: a char: z range parse ] unit-test -{ CHAR: z } [ - "zbcd" CHAR: a CHAR: z range parse +{ char: z } [ + "zbcd" char: a char: z range parse ] unit-test [ @@ -93,12 +93,12 @@ IN: peg.tests "cb" "a" token optional "b" token 2array seq parse ] must-fail -{ V{ CHAR: a CHAR: b } } [ - "ab" "a" token ensure CHAR: a CHAR: z range dup 3array seq parse +{ V{ char: a char: b } } [ + "ab" "a" token ensure char: a char: z range dup 3array seq parse ] unit-test [ - "bb" "a" token ensure CHAR: a CHAR: z range 2array seq parse + "bb" "a" token ensure char: a char: z range 2array seq parse ] must-fail { t } [ @@ -138,11 +138,11 @@ IN: peg.tests ] must-fail [ - "b" [ CHAR: a = ] satisfy parse + "b" [ char: a = ] satisfy parse ] must-fail -{ CHAR: a } [ - "a" [ CHAR: a = ] satisfy parse +{ char: a } [ + "a" [ char: a = ] satisfy parse ] unit-test { "a" } [ @@ -191,7 +191,7 @@ IN: peg.tests "A" [ drop t ] satisfy [ 66 >= ] semantic parse ] must-fail -{ CHAR: B } [ +{ char: B } [ "B" [ drop t ] satisfy [ 66 >= ] semantic parse ] unit-test diff --git a/basis/persistent/hashtables/hashtables-tests.factor b/basis/persistent/hashtables/hashtables-tests.factor index 9fcd4de9b9..eaad1fbfc7 100644 --- a/basis/persistent/hashtables/hashtables-tests.factor +++ b/basis/persistent/hashtables/hashtables-tests.factor @@ -82,7 +82,7 @@ M: hash-0-b hashcode* 2drop 0 ; : random-string ( -- str ) 1000000 random ; - ! [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ; + ! [ char: a char: z [a,b] random ] "" replicate-as ; : random-assocs ( n -- hash phash ) [ random-string ] replicate diff --git a/basis/porter-stemmer/porter-stemmer.factor b/basis/porter-stemmer/porter-stemmer.factor index 4214e67cd0..465434d7d2 100644 --- a/basis/porter-stemmer/porter-stemmer.factor +++ b/basis/porter-stemmer/porter-stemmer.factor @@ -5,7 +5,7 @@ IN: porter-stemmer 2dup nth dup "aeiou" member? [ 3drop f ] [ - CHAR: y = [ + char: y = [ over zero? [ 2drop t ] [ [ 1 - ] dip consonant? not ] if ] [ @@ -67,7 +67,7 @@ IN: porter-stemmer pick consonant-seq 0 > [ nip ] [ drop ] if append ; : step1a ( str -- newstr ) - dup last CHAR: s = [ + dup last char: s = [ { { [ "sses" ?tail ] [ "ss" append ] } { [ "ies" ?tail ] [ "i" append ] } @@ -199,13 +199,13 @@ IN: porter-stemmer [ 1 = [ but-last-slice cvc? not ] [ drop f ] if ] if ; : remove-e ( str -- newstr ) - dup last CHAR: e = [ + dup last char: e = [ dup remove-e? [ but-last-slice ] when ] when ; : ll->l ( str -- newstr ) { - { [ dup last CHAR: l = not ] [ ] } + { [ dup last char: l = not ] [ ] } { [ dup length 1 - over double-consonant? not ] [ ] } { [ dup consonant-seq 1 > ] [ but-last-slice ] } [ ] diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index 2415bb6da9..b5d2896dcf 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -100,21 +100,21 @@ M: f pprint* drop \ f pprint-word ; ! Strings : ch>ascii-escape ( ch -- ch' ? ) H{ - { CHAR: \a CHAR: a } - { CHAR: \b CHAR: b } - { CHAR: \e CHAR: e } - { CHAR: \f CHAR: f } - { CHAR: \n CHAR: n } - { CHAR: \r CHAR: r } - { CHAR: \t CHAR: t } - { CHAR: \v CHAR: v } - { CHAR: \0 CHAR: 0 } - { CHAR: \\ CHAR: \\ } - { CHAR: \" CHAR: \" } + { char: \a char: a } + { char: \b char: b } + { char: \e char: e } + { char: \f char: f } + { char: \n char: n } + { char: \r char: r } + { char: \t char: t } + { char: \v char: v } + { char: \0 char: 0 } + { char: \\ char: \\ } + { char: \" char: \" } } ?at ; inline : unparse-ch ( ch -- ) - ch>ascii-escape [ CHAR: \\ , , ] [ + ch>ascii-escape [ char: \\ , , ] [ dup 32 < [ dup 16 < "\\x0" "\\x" ? % >hex % ] [ , ] if ] if ; diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index b98acc9374..f87cba36fb 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -468,7 +468,7 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ; : margin-test ( number-of-'a's -- str ) [ - [ CHAR: a text "b" text ] with-pprint + [ char: a text "b" text ] with-pprint ] with-string-writer ; { diff --git a/basis/prettyprint/sections/sections.factor b/basis/prettyprint/sections/sections.factor index 6ad8f49df0..cef6f74b6c 100644 --- a/basis/prettyprint/sections/sections.factor +++ b/basis/prettyprint/sections/sections.factor @@ -42,7 +42,7 @@ M: maybe vocabulary-name : line-limit? ( -- ? ) line-limit get dup [ pprinter get line-count>> <= ] when ; -: do-indent ( -- ) pprinter get indent>> CHAR: \s write ; +: do-indent ( -- ) pprinter get indent>> char: \s write ; : fresh-line ( n -- ) pprinter get 2dup last-newline>> = [ diff --git a/basis/quoted-printable/quoted-printable.factor b/basis/quoted-printable/quoted-printable.factor index bffe4f53d7..e79c696505 100644 --- a/basis/quoted-printable/quoted-printable.factor +++ b/basis/quoted-printable/quoted-printable.factor @@ -15,16 +15,16 @@ IN: quoted-printable : printable? ( ch -- ? ) { - [ CHAR: \s CHAR: < between? ] - [ CHAR: > CHAR: ~ between? ] - [ CHAR: \t = ] + [ char: \s char: < between? ] + [ char: > char: ~ between? ] + [ char: \t = ] } 1|| ; : char>quoted ( ch -- str ) dup printable? [ 1string ] [ assure-small >hex >upper - 2 CHAR: 0 pad-head - CHAR: = prefix + 2 char: 0 pad-head + char: = prefix ] if ; : take-some ( seqs -- seqs seq ) @@ -46,8 +46,8 @@ PRIVATE> ] if ] when ; diff --git a/basis/random/data/data.factor b/basis/random/data/data.factor index 60099ebcaf..e5301a93f4 100644 --- a/basis/random/data/data.factor +++ b/basis/random/data/data.factor @@ -10,11 +10,11 @@ CONSTANT: letters-count 26 >> : random-digit ( -- ch ) - digits-count random CHAR: 0 + ; + digits-count random char: 0 + ; -: random-LETTER ( -- ch ) letters-count random CHAR: A + ; +: random-LETTER ( -- ch ) letters-count random char: A + ; -: random-letter ( -- ch ) letters-count random CHAR: a + ; +: random-letter ( -- ch ) letters-count random char: a + ; : random-Letter ( -- ch ) { random-LETTER random-letter } execute-random ; diff --git a/basis/regexp/classes/classes-tests.factor b/basis/regexp/classes/classes-tests.factor index 2feed16f13..a4f9c5cb26 100644 --- a/basis/regexp/classes/classes-tests.factor +++ b/basis/regexp/classes/classes-tests.factor @@ -8,10 +8,10 @@ IN: regexp.classes.tests { f } [ { 1 2 } ] unit-test { T{ or-class f { 1 2 } } } [ { 1 2 } ] unit-test { 3 } [ { 1 2 } 3 2array ] unit-test -{ CHAR: A } [ CHAR: A LETTER-class 2array ] unit-test -{ CHAR: A } [ LETTER-class CHAR: A 2array ] unit-test -{ T{ primitive-class { class LETTER-class } } } [ CHAR: A LETTER-class 2array ] unit-test -{ T{ primitive-class { class LETTER-class } } } [ LETTER-class CHAR: A 2array ] unit-test +{ char: A } [ char: A LETTER-class 2array ] unit-test +{ char: A } [ LETTER-class char: A 2array ] unit-test +{ T{ primitive-class { class LETTER-class } } } [ char: A LETTER-class 2array ] unit-test +{ T{ primitive-class { class LETTER-class } } } [ LETTER-class char: A 2array ] unit-test { t } [ { t 1 } ] unit-test { t } [ { 1 t } ] unit-test { f } [ { f 1 } ] unit-test diff --git a/basis/regexp/classes/classes.factor b/basis/regexp/classes/classes.factor index 515747dbe6..e127f2d7e9 100644 --- a/basis/regexp/classes/classes.factor +++ b/basis/regexp/classes/classes.factor @@ -55,7 +55,7 @@ M: digit-class class-member? ( obj class -- ? ) drop digit? ; inline : c-identifier-char? ( ch -- ? ) - { [ alpha? ] [ CHAR: _ = ] } 1|| ; + { [ alpha? ] [ char: _ = ] } 1|| ; M: c-identifier-class class-member? ( obj class -- ? ) drop c-identifier-char? ; inline @@ -76,16 +76,16 @@ M: java-printable-class class-member? ( obj class -- ? ) drop java-printable? ; inline M: non-newline-blank-class class-member? ( obj class -- ? ) - drop { [ blank? ] [ CHAR: \n = not ] } 1&& ; inline + drop { [ blank? ] [ char: \n = not ] } 1&& ; inline M: control-character-class class-member? ( obj class -- ? ) drop control? ; inline : hex-digit? ( ch -- ? ) { - [ CHAR: A CHAR: F between? ] - [ CHAR: a CHAR: f between? ] - [ CHAR: 0 CHAR: 9 between? ] + [ char: A char: F between? ] + [ char: a char: f between? ] + [ char: 0 char: 9 between? ] } 1|| ; M: hex-digit-class class-member? ( obj class -- ? ) @@ -93,8 +93,8 @@ M: hex-digit-class class-member? ( obj class -- ? ) : java-blank? ( ch -- ? ) { - CHAR: \s CHAR: \t CHAR: \n - 0xb 0x7 CHAR: \r + char: \s char: \t char: \n + 0xb 0x7 char: \r } member? ; M: java-blank-class class-member? ( obj class -- ? ) diff --git a/basis/regexp/compiler/compiler.factor b/basis/regexp/compiler/compiler.factor index 274b9a5797..a62561ac10 100644 --- a/basis/regexp/compiler/compiler.factor +++ b/basis/regexp/compiler/compiler.factor @@ -37,10 +37,10 @@ M: ^ question>quot drop [ { [ drop zero? ] [ [ 1 - ] dip ?nth "\r\n" member? ] } 2|| ] ; M: $unix question>quot - drop [ { [ length = ] [ ?nth CHAR: \n = ] } 2|| ] ; + drop [ { [ length = ] [ ?nth char: \n = ] } 2|| ] ; M: ^unix question>quot - drop [ { [ drop zero? ] [ [ 1 - ] dip ?nth CHAR: \n = ] } 2|| ] ; + drop [ { [ drop zero? ] [ [ 1 - ] dip ?nth char: \n = ] } 2|| ] ; M: word-break question>quot drop [ word-break-at? ] ; diff --git a/basis/regexp/minimize/minimize-tests.factor b/basis/regexp/minimize/minimize-tests.factor index d87f8c8ae0..f9f2a52907 100644 --- a/basis/regexp/minimize/minimize-tests.factor +++ b/basis/regexp/minimize/minimize-tests.factor @@ -26,9 +26,9 @@ IN: regexp.minimize.tests { T{ transition-table { transitions H{ - { 0 H{ { CHAR: a 1 } { CHAR: b 1 } } } - { 1 H{ { CHAR: a 2 } { CHAR: b 2 } } } - { 2 H{ { CHAR: c 3 } } } + { 0 H{ { char: a 1 } { char: b 1 } } } + { 1 H{ { char: a 2 } { char: b 2 } } } + { 2 H{ { char: c 3 } } } { 3 H{ } } } } { start-state 0 } @@ -37,12 +37,12 @@ IN: regexp.minimize.tests } [ T{ transition-table { transitions H{ - { 0 H{ { CHAR: a 1 } { CHAR: b 4 } } } - { 1 H{ { CHAR: a 2 } { CHAR: b 5 } } } - { 2 H{ { CHAR: c 3 } } } + { 0 H{ { char: a 1 } { char: b 4 } } } + { 1 H{ { char: a 2 } { char: b 5 } } } + { 2 H{ { char: c 3 } } } { 3 H{ } } - { 4 H{ { CHAR: a 2 } { CHAR: b 5 } } } - { 5 H{ { CHAR: c 6 } } } + { 4 H{ { char: a 2 } { char: b 5 } } } + { 5 H{ { char: c 6 } } } { 6 H{ } } } } { start-state 0 } diff --git a/basis/regexp/negation/negation-tests.factor b/basis/regexp/negation/negation-tests.factor index 452026278c..fc548a110c 100644 --- a/basis/regexp/negation/negation-tests.factor +++ b/basis/regexp/negation/negation-tests.factor @@ -7,7 +7,7 @@ IN: regexp.negation.tests ! R/ |[^a]|.+/ T{ transition-table { transitions H{ - { 0 H{ { CHAR: a 1 } { T{ not-class f CHAR: a } -1 } } } + { 0 H{ { char: a 1 } { T{ not-class f char: a } -1 } } } { 1 H{ { t -1 } } } { -1 H{ { t -1 } } } } } @@ -18,7 +18,7 @@ IN: regexp.negation.tests ! R/ a/ T{ transition-table { transitions H{ - { 0 H{ { CHAR: a 1 } } } + { 0 H{ { char: a 1 } } } { 1 H{ } } } } { start-state 0 } diff --git a/basis/regexp/nfa/nfa.factor b/basis/regexp/nfa/nfa.factor index 5cac3c229d..d6feb793a3 100644 --- a/basis/regexp/nfa/nfa.factor +++ b/basis/regexp/nfa/nfa.factor @@ -116,10 +116,10 @@ M: not-class modify-class class>> modify-class ; MEMO: unix-dot ( -- class ) - CHAR: \n ; + char: \n ; MEMO: nonl-dot ( -- class ) - { CHAR: \n CHAR: \r } ; + { char: \n char: \r } ; M: dot modify-class drop dotall option? [ t ] [ diff --git a/basis/regexp/parser/parser.factor b/basis/regexp/parser/parser.factor index e919ff6d2d..80aab9f710 100644 --- a/basis/regexp/parser/parser.factor +++ b/basis/regexp/parser/parser.factor @@ -70,36 +70,36 @@ MEMO: simple-category-table ( -- table ) : lookup-escape ( char -- ast ) { - { CHAR: t [ CHAR: \t ] } - { CHAR: n [ CHAR: \n ] } - { CHAR: r [ CHAR: \r ] } - { CHAR: f [ 0xc ] } - { CHAR: a [ 0x7 ] } - { CHAR: e [ 0x1b ] } - { CHAR: \\ [ CHAR: \\ ] } + { char: t [ char: \t ] } + { char: n [ char: \n ] } + { char: r [ char: \r ] } + { char: f [ 0xc ] } + { char: a [ 0x7 ] } + { char: e [ 0x1b ] } + { char: \\ [ char: \\ ] } - { CHAR: w [ c-identifier-class ] } - { CHAR: W [ c-identifier-class ] } - { CHAR: s [ java-blank-class ] } - { CHAR: S [ java-blank-class ] } - { CHAR: d [ digit-class ] } - { CHAR: D [ digit-class ] } + { char: w [ c-identifier-class ] } + { char: W [ c-identifier-class ] } + { char: s [ java-blank-class ] } + { char: S [ java-blank-class ] } + { char: d [ digit-class ] } + { char: D [ digit-class ] } - { CHAR: z [ end-of-input ] } - { CHAR: Z [ end-of-file ] } - { CHAR: A [ beginning-of-input ] } - { CHAR: b [ word-break ] } - { CHAR: B [ word-break ] } + { char: z [ end-of-input ] } + { char: Z [ end-of-file ] } + { char: A [ beginning-of-input ] } + { char: b [ word-break ] } + { char: B [ word-break ] } [ ] } case ; : options-assoc ( -- assoc ) H{ - { CHAR: i case-insensitive } - { CHAR: d unix-lines } - { CHAR: m multiline } - { CHAR: r reversed-regexp } - { CHAR: s dotall } + { char: i case-insensitive } + { char: d unix-lines } + { char: m multiline } + { char: r reversed-regexp } + { char: s dotall } } ; ERROR: nonexistent-option name ; diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index ff383b272b..aa56543855 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -200,9 +200,9 @@ PRIVATE> : take-until ( lexer -- string ) dup skip-blank [ dupd [ - [ CHAR: / -rot index-from ] keep + [ char: / -rot index-from ] keep over [ "Unterminated regexp" throw ] unless - 2dup [ 1 - ] dip nth CHAR: \\ = + 2dup [ 1 - ] dip nth char: \\ = [ [ [ 1 + ] dip ] when ] keep ] loop over [ subseq ] dip 1 + ] change-lexer-column ; diff --git a/basis/sequences/generalizations/generalizations-docs.factor b/basis/sequences/generalizations/generalizations-docs.factor index 5ecebe44d4..0cdb85c6bc 100644 --- a/basis/sequences/generalizations/generalizations-docs.factor +++ b/basis/sequences/generalizations/generalizations-docs.factor @@ -10,7 +10,7 @@ HELP: nsequence "that constructs a sequence from the top " { $snippet "n" } " elements of the stack." } { $examples - { $example "USING: prettyprint sequences.generalizations ;" "CHAR: f CHAR: i CHAR: s CHAR: h 4 \"\" nsequence ." "\"fish\"" } + { $example "USING: prettyprint sequences.generalizations ;" "char: f char: i char: s char: h 4 \"\" nsequence ." "\"fish\"" } } ; HELP: narray diff --git a/basis/sequences/parser/parser-tests.factor b/basis/sequences/parser/parser-tests.factor index 50ae22b3dd..dded9e93bc 100644 --- a/basis/sequences/parser/parser-tests.factor +++ b/basis/sequences/parser/parser-tests.factor @@ -13,7 +13,7 @@ IN: sequences.parser.tests { "foo" ";bar" } [ "foo;bar" [ - [ CHAR: ; take-until-object ] [ take-rest ] bi + [ char: ; take-until-object ] [ take-rest ] bi ] parse-sequence ] unit-test diff --git a/basis/serialize/serialize.factor b/basis/serialize/serialize.factor index 0d0c34431a..1223d1d9f7 100644 --- a/basis/serialize/serialize.factor +++ b/basis/serialize/serialize.factor @@ -62,22 +62,22 @@ SYMBOL: serialized : serialize-shared ( obj quot -- ) [ dup object-id - [ CHAR: o write1 serialize-cell drop ] + [ char: o write1 serialize-cell drop ] ] dip if* ; inline M: f (serialize) ( obj -- ) - drop CHAR: n write1 ; + drop char: n write1 ; M: integer (serialize) ( obj -- ) [ - CHAR: z write1 + char: z write1 ] [ - dup 0 < [ neg CHAR: m ] [ CHAR: p ] if write1 + dup 0 < [ neg char: m ] [ char: p ] if write1 serialize-cell ] if-zero ; M: float (serialize) ( obj -- ) - CHAR: F write1 + char: F write1 double>bits serialize-cell ; : serialize-seq ( obj code -- ) @@ -90,7 +90,7 @@ M: float (serialize) ( obj -- ) M: tuple (serialize) ( obj -- ) [ - CHAR: T write1 + char: T write1 [ class-of (serialize) ] [ add-object ] [ tuple-slots (serialize) ] @@ -98,23 +98,23 @@ M: tuple (serialize) ( obj -- ) ] serialize-shared ; M: array (serialize) ( obj -- ) - CHAR: a serialize-seq ; + char: a serialize-seq ; M: quotation (serialize) ( obj -- ) [ - CHAR: q write1 + char: q write1 [ >array (serialize) ] [ add-object ] bi ] serialize-shared ; M: hashtable (serialize) ( obj -- ) [ - CHAR: h write1 + char: h write1 [ add-object ] [ >alist (serialize) ] bi ] serialize-shared ; M: byte-array (serialize) ( obj -- ) [ - CHAR: A write1 + char: A write1 [ add-object ] [ length serialize-cell ] [ write ] tri @@ -122,7 +122,7 @@ M: byte-array (serialize) ( obj -- ) M: string (serialize) ( obj -- ) [ - CHAR: s write1 + char: s write1 [ add-object ] [ utf8 encode @@ -132,11 +132,11 @@ M: string (serialize) ( obj -- ) ] serialize-shared ; : serialize-true ( word -- ) - drop CHAR: t write1 ; + drop char: t write1 ; : serialize-gensym ( word -- ) [ - CHAR: G write1 + char: G write1 [ add-object ] [ def>> (serialize) ] [ props>> (serialize) ] @@ -144,7 +144,7 @@ M: string (serialize) ( obj -- ) ] serialize-shared ; : serialize-word ( word -- ) - CHAR: w write1 + char: w write1 [ name>> (serialize) ] [ vocabulary>> (serialize) ] bi ; @@ -157,7 +157,7 @@ M: word (serialize) ( obj -- ) } cond ; M: wrapper (serialize) ( obj -- ) - CHAR: W write1 + char: W write1 wrapped>> (serialize) ; DEFER: (deserialize) @@ -246,22 +246,22 @@ SYMBOL: deserialized : deserialize* ( -- object ? ) read1 [ { - { CHAR: A [ deserialize-byte-array ] } - { CHAR: F [ deserialize-float ] } - { CHAR: T [ deserialize-tuple ] } - { CHAR: W [ deserialize-wrapper ] } - { CHAR: a [ deserialize-array ] } - { CHAR: h [ deserialize-hashtable ] } - { CHAR: m [ deserialize-negative-integer ] } - { CHAR: n [ deserialize-false ] } - { CHAR: t [ deserialize-true ] } - { CHAR: o [ deserialize-unknown ] } - { CHAR: p [ deserialize-positive-integer ] } - { CHAR: q [ deserialize-quotation ] } - { CHAR: s [ deserialize-string ] } - { CHAR: w [ deserialize-word ] } - { CHAR: G [ deserialize-word ] } - { CHAR: z [ deserialize-zero ] } + { char: A [ deserialize-byte-array ] } + { char: F [ deserialize-float ] } + { char: T [ deserialize-tuple ] } + { char: W [ deserialize-wrapper ] } + { char: a [ deserialize-array ] } + { char: h [ deserialize-hashtable ] } + { char: m [ deserialize-negative-integer ] } + { char: n [ deserialize-false ] } + { char: t [ deserialize-true ] } + { char: o [ deserialize-unknown ] } + { char: p [ deserialize-positive-integer ] } + { char: q [ deserialize-quotation ] } + { char: s [ deserialize-string ] } + { char: w [ deserialize-word ] } + { char: G [ deserialize-word ] } + { char: z [ deserialize-zero ] } } case t ] [ f f diff --git a/basis/smtp/smtp.factor b/basis/smtp/smtp.factor index 043d6d81dc..f74645875f 100644 --- a/basis/smtp/smtp.factor +++ b/basis/smtp/smtp.factor @@ -94,7 +94,7 @@ ERROR: bad-email-address email ; LOG: smtp-response DEBUG : multiline? ( response -- ? ) - 3 swap ?nth CHAR: - = ; + 3 swap ?nth char: - = ; : (receive-response) ( -- ) read-crlf diff --git a/basis/strings/tables/tables.factor b/basis/strings/tables/tables.factor index aa914885ef..e325d01290 100644 --- a/basis/strings/tables/tables.factor +++ b/basis/strings/tables/tables.factor @@ -9,7 +9,7 @@ IN: strings.tables dup longest length '[ _ "" pad-tail ] map! ; : format-column ( seq -- seq ) - dup longest length '[ _ CHAR: \s pad-tail ] map! ; + dup longest length '[ _ char: \s pad-tail ] map! ; PRIVATE> diff --git a/basis/tools/completion/completion-tests.factor b/basis/tools/completion/completion-tests.factor index 189679cb5e..1626d41433 100644 --- a/basis/tools/completion/completion-tests.factor +++ b/basis/tools/completion/completion-tests.factor @@ -28,6 +28,6 @@ IN: tools.completion { f } [ { "USING:" "A" "B" "C" ";" } complete-vocab? ] unit-test { t } [ { "X" ";" "USING:" "A" "B" "C" } complete-vocab? ] unit-test -{ f } [ { "CHAR:" } complete-char? ] unit-test -{ t } [ { "CHAR:" "" } complete-char? ] unit-test -{ t } [ { "CHAR:" "a" } complete-char? ] unit-test +{ f } [ { "char:" } complete-char? ] unit-test +{ t } [ { "char:" "" } complete-char? ] unit-test +{ t } [ { "char:" "a" } complete-char? ] unit-test diff --git a/basis/tools/completion/completion.factor b/basis/tools/completion/completion.factor index 0b53f0defd..399fc00f4a 100644 --- a/basis/tools/completion/completion.factor +++ b/basis/tools/completion/completion.factor @@ -148,7 +148,7 @@ PRIVATE> PRIVATE> -: complete-char? ( tokens -- ? ) "CHAR:" complete-token? ; +: complete-char? ( tokens -- ? ) "char:" complete-token? ; : complete-color? ( tokens -- ? ) "COLOR:" complete-token? ; diff --git a/basis/tools/deploy/config/config-docs.factor b/basis/tools/deploy/config/config-docs.factor index 7fa760089a..ff1480f6b0 100644 --- a/basis/tools/deploy/config/config-docs.factor +++ b/basis/tools/deploy/config/config-docs.factor @@ -82,9 +82,9 @@ $nl "Off by default. Programs wishing to use the UI must be deployed with this flag on." } ; HELP: deploy-unicode? -{ $description "Deploy flag. If set, full Unicode " { $link POSTPONE: CHAR: } " syntax is included." +{ $description "Deploy flag. If set, full Unicode " { $link POSTPONE: char: } " syntax is included." $nl -"Off by default. If your program needs to use " { $link POSTPONE: CHAR: } " with named characters, enable this flag." } ; +"Off by default. If your program needs to use " { $link POSTPONE: char: } " with named characters, enable this flag." } ; HELP: deploy-console? { $description "Deploy flag. If set, the deployed executable will be configured as a console application. On Windows, this means the application will be deployed in the console subsystem and will be attached to a console window. On Mac OS X, this means the application will be deployed as a Unix executable instead of a Mac application bundle. On other Unix platforms, the flag has no effect." diff --git a/basis/tools/disassembler/udis/udis.factor b/basis/tools/disassembler/udis/udis.factor index 9b091136a9..886238e91f 100644 --- a/basis/tools/disassembler/udis/udis.factor +++ b/basis/tools/disassembler/udis/udis.factor @@ -64,8 +64,8 @@ SINGLETON: udis-disassembler dup [ second length ] [ max ] map-reduce '[ [ - [ first >hex cell 2 * CHAR: 0 pad-head % ": " % ] - [ second _ CHAR: \s pad-tail % " " % ] + [ first >hex cell 2 * char: 0 pad-head % ": " % ] + [ second _ char: \s pad-tail % " " % ] [ third resolve-call % ] tri ] "" make diff --git a/basis/tools/files/files.factor b/basis/tools/files/files.factor index 574dc7d647..aac366e93f 100644 --- a/basis/tools/files/files.factor +++ b/basis/tools/files/files.factor @@ -9,22 +9,22 @@ IN: tools.files : dir-or-size ( file-info -- str ) dup directory? [ - drop "" 20 CHAR: \s pad-tail + drop "" 20 char: \s pad-tail ] [ - size>> number>string 20 CHAR: \s pad-head + size>> number>string 20 char: \s pad-head ] if ; : listing-time ( timestamp -- string ) [ hour>> ] [ minute>> ] bi - [ number>string 2 CHAR: 0 pad-head ] bi@ ":" glue ; + [ number>string 2 char: 0 pad-head ] bi@ ":" glue ; : listing-date ( timestamp -- string ) [ month>> month-abbreviation ] - [ day>> number>string 2 CHAR: \s pad-head ] + [ day>> number>string 2 char: \s pad-head ] [ dup year>> dup now year>> = [ drop listing-time ] [ nip number>string ] if - 5 CHAR: \s pad-head + 5 char: \s pad-head ] tri 3array " " join ; : read>string ( ? -- string ) "r" "-" ? ; inline diff --git a/basis/tools/hexdump/hexdump.factor b/basis/tools/hexdump/hexdump.factor index 2d94b71a26..1760733eaa 100644 --- a/basis/tools/hexdump/hexdump.factor +++ b/basis/tools/hexdump/hexdump.factor @@ -13,17 +13,17 @@ IN: tools.hexdump [ >hex write "h" write nl ] bi ; : write-offset ( lineno -- ) - 16 * >hex 8 CHAR: 0 pad-head write "h: " write ; + 16 * >hex 8 char: 0 pad-head write "h: " write ; : >hex-digit ( digit -- str ) - >hex 2 CHAR: 0 pad-head ; + >hex 2 char: 0 pad-head ; : >hex-digits ( bytes -- str ) [ >hex-digit " " append ] { } map-as concat - 48 CHAR: \s pad-tail ; + 48 char: \s pad-tail ; : >ascii ( bytes -- str ) - [ [ printable? ] keep CHAR: . ? ] "" map-as ; + [ [ printable? ] keep char: . ? ] "" map-as ; : write-hex-line ( bytes lineno -- ) write-offset [ >hex-digits write ] [ >ascii write ] bi nl ; diff --git a/basis/tools/profiler/sampling/sampling.factor b/basis/tools/profiler/sampling/sampling.factor index 4e02eea05e..fdac0a3f3e 100644 --- a/basis/tools/profiler/sampling/sampling.factor +++ b/basis/tools/profiler/sampling/sampling.factor @@ -212,7 +212,7 @@ DEFER: (profile.) :: times. ( node -- ) node { - [ depth>> number>string 4 CHAR: \s pad-head write bl ] + [ depth>> number>string 4 char: \s pad-head write bl ] [ total-time>> duration. bl ] [ [ gc-time>> ] [ total-time>> ] bi percentage. bl ] [ [ jit-time>> ] [ total-time>> ] bi percentage. bl ] diff --git a/basis/tools/scaffold/scaffold.factor b/basis/tools/scaffold/scaffold.factor index 003c90e14c..da5c9a9b9a 100644 --- a/basis/tools/scaffold/scaffold.factor +++ b/basis/tools/scaffold/scaffold.factor @@ -34,7 +34,7 @@ ERROR: not-a-vocab-root string ; [ check-root ] [ check-vocab-name ] bi* ; : replace-vocab-separators ( vocab -- path ) - path-separator first CHAR: . associate substitute ; inline + path-separator first char: . associate substitute ; inline : vocab-root/vocab>path ( vocab-root vocab -- path ) check-vocab-root/vocab @@ -108,7 +108,7 @@ ERROR: not-a-vocab-root string ; : lookup-type ( string -- object/string ? ) "/f" ?tail swap - "new" ?head drop [ { [ CHAR: ' = ] [ digit? ] } 1|| ] trim-tail + "new" ?head drop [ { [ char: ' = ] [ digit? ] } 1|| ] trim-tail H{ { "object" object } { "obj" object } @@ -327,7 +327,7 @@ SYMBOL: nested-examples : example-using ( using -- ) " " join "example-using" [ - nested-examples get 4 0 ? CHAR: \s "example-indent" [ + nested-examples get 4 0 ? char: \s "example-indent" [ "${example-indent}\"Example:\" ${example-indent}{ $example \"USING: ${example-using} ;\" ${example-indent} \"\" diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index e8c8a1a922..5873dd1b81 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -86,7 +86,7 @@ M: did-not-fail summary drop "Did not fail" ; : experiment-title ( word -- string ) "(" ?head drop ")" ?tail drop - H{ { CHAR: - CHAR: \s } } substitute >title ; + H{ { char: - char: \s } } substitute >title ; MACRO: ( word -- quot ) [ stack-effect in>> length dup ] diff --git a/basis/tools/trace/trace.factor b/basis/tools/trace/trace.factor index 21107fa042..50039ab407 100644 --- a/basis/tools/trace/trace.factor +++ b/basis/tools/trace/trace.factor @@ -64,7 +64,7 @@ M: trace-step-state summary : print-depth ( continuation -- ) call>> callstack-depth - [ CHAR: \s write ] + [ char: \s write ] [ number>string write ": " write ] bi ; : trace-into? ( continuation -- ? ) diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index 3f6d6d10a4..1c0030a8d4 100755 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -325,7 +325,7 @@ CONSTANT: exclude-keys-wm-char { { [ dup LETTER? ] - [ shift? caps-lock? xor [ CHAR: a + CHAR: A - ] unless 1string f ] + [ shift? caps-lock? xor [ char: a + char: A - ] unless 1string f ] } { [ dup digit? ] [ 1string f ] } [ wm-keydown-codes at t ] diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor index 4a85b42a42..a472dda492 100644 --- a/basis/ui/backend/x11/x11.factor +++ b/basis/ui/backend/x11/x11.factor @@ -101,9 +101,9 @@ M: x11-ui-backend (free-pixel-format) : valid-input? ( string gesture -- ? ) over empty? [ 2drop f ] [ mods>> { f { S+ } } member? [ - [ { [ 127 = not ] [ CHAR: \s >= ] } 1&& ] all? + [ { [ 127 = not ] [ char: \s >= ] } 1&& ] all? ] [ - [ { [ 127 = not ] [ CHAR: \s >= ] [ alpha? not ] } 1&& ] all? + [ { [ 127 = not ] [ char: \s >= ] [ alpha? not ] } 1&& ] all? ] if ] if ; @@ -327,7 +327,7 @@ M: x11-ui-backend beep ( -- ) > [ [ gadget-text ] map ] map format-table - [ CHAR: \n , ] [ % ] interleave ; + [ char: \n , ] [ % ] interleave ; PRIVATE> diff --git a/basis/ui/gadgets/labels/labels.factor b/basis/ui/gadgets/labels/labels.factor index 7ef8d62039..8a03ca75e8 100644 --- a/basis/ui/gadgets/labels/labels.factor +++ b/basis/ui/gadgets/labels/labels.factor @@ -21,7 +21,7 @@ PREDICATE: string-array < array [ string? ] all? ; PRIVATE> : ?string-lines ( string -- string/array ) - CHAR: \n over member-eq? [ string-lines ] when ; + char: \n over member-eq? [ string-lines ] when ; ERROR: not-a-string object ; diff --git a/basis/ui/gadgets/panes/panes.factor b/basis/ui/gadgets/panes/panes.factor index 72c0218a33..050c1dfe26 100644 --- a/basis/ui/gadgets/panes/panes.factor +++ b/basis/ui/gadgets/panes/panes.factor @@ -337,7 +337,7 @@ M: paragraph stream-write M: pack stream-write1 gadget-write1 ; M: paragraph stream-write1 - over CHAR: \s = + over char: \s = [ H{ } swap gadget-bl drop ] [ gadget-write1 ] if ; : empty-output? ( string style -- ? ) diff --git a/basis/ui/text/pango/pango.factor b/basis/ui/text/pango/pango.factor index d9331000bb..f088afde30 100644 --- a/basis/ui/text/pango/pango.factor +++ b/basis/ui/text/pango/pango.factor @@ -120,7 +120,7 @@ SYMBOL: dpi : escape-nulls ( str -- str' ) ! Replace nulls with something else since Pango uses null-terminated ! strings - H{ { 0 CHAR: zero-width-no-break-space } } substitute ; + H{ { 0 char: zero-width-no-break-space } } substitute ; : unpack-selection ( layout string/selection -- layout ) dup selection? [ diff --git a/basis/ui/tools/listener/completion/completion.factor b/basis/ui/tools/listener/completion/completion.factor index 8054ed75e5..0615613953 100644 --- a/basis/ui/tools/listener/completion/completion.factor +++ b/basis/ui/tools/listener/completion/completion.factor @@ -19,7 +19,7 @@ SLOT: history : history-list ( interactor -- alist ) history>> elements>> - [ dup string>> H{ { CHAR: \n CHAR: \s } } substitute ] { } map>assoc + [ dup string>> H{ { char: \n char: \s } } substitute ] { } map>assoc ; : history-completions ( short interactor -- seq ) diff --git a/basis/ui/tools/listener/listener-docs.factor b/basis/ui/tools/listener/listener-docs.factor index 5626e4fa69..7b1f971566 100644 --- a/basis/ui/tools/listener/listener-docs.factor +++ b/basis/ui/tools/listener/listener-docs.factor @@ -89,7 +89,7 @@ TIP: "When you mouse over certain objects, a black border will appear. Left-clic TIP: "The status bar displays stack effects of recognized words as they are being typed in." ; -TIP: "Press " { $command interactor "completion" code-completion-popup } " to complete word, vocabulary and Unicode character names. The latter two features become available if the cursor is after a " { $link POSTPONE: USE: } ", " { $link POSTPONE: USING: } " or " { $link POSTPONE: CHAR: } "." ; +TIP: "Press " { $command interactor "completion" code-completion-popup } " to complete word, vocabulary and Unicode character names. The latter two features become available if the cursor is after a " { $link POSTPONE: USE: } ", " { $link POSTPONE: USING: } " or " { $link POSTPONE: char: } "." ; TIP: "If a word's vocabulary is loaded, but not in the search path, you can use restarts to add the vocabulary to the search path. Auto-use mode (" { $command listener-gadget "toolbar" com-auto-use } ") invokes restarts automatically if there is only one restart." ; diff --git a/basis/ui/tools/listener/listener-tests.factor b/basis/ui/tools/listener/listener-tests.factor index ae060f0c63..83ff72d649 100644 --- a/basis/ui/tools/listener/listener-tests.factor +++ b/basis/ui/tools/listener/listener-tests.factor @@ -154,7 +154,7 @@ CONSTANT: text "Hello world.\nThis is a test." { } [ "interactor" get evaluate-input ] unit-test -{ CHAR: H } [ "promise" get 2 seconds ?promise-timeout ] unit-test +{ char: H } [ "promise" get 2 seconds ?promise-timeout ] unit-test { } [ [ ] with-grafted-gadget ] unit-test diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index ad0be948c6..65b27e784a 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -170,14 +170,14 @@ M: interactor stream-read1 dup interactor-read { { [ dup not ] [ 2drop f ] } { [ dup empty? ] [ drop stream-read1 ] } - { [ dup first empty? ] [ 2drop CHAR: \n ] } + { [ dup first empty? ] [ 2drop char: \n ] } [ nip first first ] } cond ; M: interactor stream-read-until ( seps stream -- seq sep/f ) swap '[ _ interactor-read [ - "\n" join CHAR: \n suffix + "\n" join char: \n suffix [ _ member? ] dupd find [ [ head ] when* ] dip dup not ] [ f f f ] if* diff --git a/basis/unicode/breaks/breaks.factor b/basis/unicode/breaks/breaks.factor index a032096b6f..625296d0e9 100644 --- a/basis/unicode/breaks/breaks.factor +++ b/basis/unicode/breaks/breaks.factor @@ -34,8 +34,8 @@ CONSTANT: graphemes 12 CATEGORY: grapheme-control Zl Zp Cc Cf ; : control-class ( ch -- class ) { - { CHAR: \r [ CR ] } - { CHAR: \n [ LF ] } + { char: \r [ CR ] } + { char: \n [ LF ] } { 0x200C [ Extend ] } { 0x200D [ Extend ] } [ drop Control ] diff --git a/basis/unicode/case/case.factor b/basis/unicode/case/case.factor index 1efeeced69..8279bea96a 100644 --- a/basis/unicode/case/case.factor +++ b/basis/unicode/case/case.factor @@ -28,8 +28,8 @@ SYMBOL: locale ! Just casing locale, or overall? [ [ { } ] [ [ dup first - { [ mark-above? ] [ CHAR: combining-ogonek = ] } 1|| - [ CHAR: combining-dot-above prefix ] when + { [ mark-above? ] [ char: combining-ogonek = ] } 1|| + [ char: combining-dot-above prefix ] when ] map ] if-empty ] with-rest ; inline @@ -46,24 +46,24 @@ SYMBOL: locale ! Just casing locale, or overall? : fix-sigma-end ( string -- string ) [ "" ] [ - dup last CHAR: greek-small-letter-sigma = - [ but-last CHAR: greek-small-letter-final-sigma suffix ] when + dup last char: greek-small-letter-sigma = + [ but-last char: greek-small-letter-final-sigma suffix ] when ] if-empty ; inline ! this duplicate unicode to prevent dependencies CATEGORY-NOT: (uncased) Lu Ll Lt Lm Mn Me ; : sigma-map ( string -- string ) - { CHAR: greek-capital-letter-sigma } split [ [ - [ { CHAR: greek-small-letter-sigma } ] [ + { char: greek-capital-letter-sigma } split [ [ + [ { char: greek-small-letter-sigma } ] [ dup first (uncased)? - CHAR: greek-small-letter-final-sigma - CHAR: greek-small-letter-sigma ? prefix + char: greek-small-letter-final-sigma + char: greek-small-letter-sigma ? prefix ] if-empty ] map ] with-rest concat fix-sigma-end ; inline : final-sigma ( string -- string ) - CHAR: greek-capital-letter-sigma + char: greek-capital-letter-sigma over member? [ sigma-map ] when "" like ; inline diff --git a/basis/unicode/collation/collation.factor b/basis/unicode/collation/collation.factor index 92f827d077..4d21fdd018 100644 --- a/basis/unicode/collation/collation.factor +++ b/basis/unicode/collation/collation.factor @@ -14,7 +14,7 @@ TUPLE: weight primary secondary tertiary ignorable? ; : parse-weight ( string -- weight ) "]" split but-last [ - weight new swap rest unclip CHAR: * = swapd >>ignorable? + weight new swap rest unclip char: * = swapd >>ignorable? swap "." split first3 [ hex> ] tri@ [ >>primary ] [ >>secondary ] [ >>tertiary ] tri* ] map ; diff --git a/basis/unicode/data/data.factor b/basis/unicode/data/data.factor index 397f483974..2247bc8dba 100644 --- a/basis/unicode/data/data.factor +++ b/basis/unicode/data/data.factor @@ -150,7 +150,7 @@ PRIVATE> : process-names ( data -- names-hash ) 1 swap (process-data) [ - >lower H{ { CHAR: \s CHAR: - } } substitute swap + >lower H{ { char: \s char: - } } substitute swap ] H{ } assoc-map-as ; : multihex ( hexstring -- string ) diff --git a/basis/unicode/script/script-tests.factor b/basis/unicode/script/script-tests.factor index 3963e3d42e..2cdff1178e 100644 --- a/basis/unicode/script/script-tests.factor +++ b/basis/unicode/script/script-tests.factor @@ -1,4 +1,4 @@ USING: unicode tools.test ; -{ "Latin" } [ CHAR: a script-of ] unit-test +{ "Latin" } [ char: a script-of ] unit-test { "Common" } [ 0 script-of ] unit-test diff --git a/basis/unix/linux/proc/proc.factor b/basis/unix/linux/proc/proc.factor index f952982601..fd444b1b03 100644 --- a/basis/unix/linux/proc/proc.factor +++ b/basis/unix/linux/proc/proc.factor @@ -55,16 +55,16 @@ ERROR: unknown-cpuinfo-line string ; : line>processor-info ( processor-info string -- processor-info ) ":" split first2 swap - [ CHAR: \t = ] trim-tail [ [ CHAR: \s = ] trim ] bi@ + [ char: \t = ] trim-tail [ [ char: \s = ] trim ] bi@ { { "address sizes" [ - "," split [ [ CHAR: \s = ] trim " " split first string>number ] map + "," split [ [ char: \s = ] trim " " split first string>number ] map >>address-sizes ] } { "apicid" [ string>number >>apicid ] } { "bogomips" [ string>number >>bogomips ] } { "cache size" [ - " " split first [ CHAR: \s = ] trim + " " split first [ char: \s = ] trim string>number 1024 * >>cache-size ] } { "cache_alignment" [ string>number >>cache-alignment ] } @@ -208,7 +208,7 @@ TUPLE: proc-cpu-stat name user nice system idle iowait irq softirq steal guest g : line>cpu ( string -- cpu ) " " split unclip-slice - [ [ [ CHAR: \s = ] trim string>number ] map ] dip prefix + [ [ [ char: \s = ] trim string>number ] map ] dip prefix [ proc-cpu-stat boa ] inputhex >upper 2 CHAR: 0 pad-head % ] each ; + [ char: % , >hex >upper 2 char: 0 pad-head % ] each ; : (url-encode) ( str quot: ( ch -- ? ) -- encoded ) '[ [ dup @ [ , ] [ push-utf8 ] if ] each ] "" make ; inline @@ -62,7 +62,7 @@ PRIVATE> 2dup length >= [ 2drop ] [ - 2dup nth dup CHAR: % = [ + 2dup nth dup char: % = [ drop 2dup url-decode-hex [ 3 + ] dip ] [ , [ 1 + ] dip diff --git a/basis/uuid/uuid.factor b/basis/uuid/uuid.factor index 21b60feffc..7ed996ab66 100644 --- a/basis/uuid/uuid.factor +++ b/basis/uuid/uuid.factor @@ -41,14 +41,14 @@ IN: uuid ] dip 76 shift bitor ; : uuid>string ( n -- string ) - >hex 32 CHAR: 0 pad-head - [ CHAR: - 20 ] dip insert-nth - [ CHAR: - 16 ] dip insert-nth - [ CHAR: - 12 ] dip insert-nth - [ CHAR: - 8 ] dip insert-nth ; + >hex 32 char: 0 pad-head + [ char: - 20 ] dip insert-nth + [ char: - 16 ] dip insert-nth + [ char: - 12 ] dip insert-nth + [ char: - 8 ] dip insert-nth ; : string>uuid ( string -- n ) - [ CHAR: - = ] reject hex> ; + [ char: - = ] reject hex> ; PRIVATE> diff --git a/basis/validators/validators.factor b/basis/validators/validators.factor index c3b800ae57..8f00203522 100644 --- a/basis/validators/validators.factor +++ b/basis/validators/validators.factor @@ -98,7 +98,7 @@ IN: validators : v-credit-card ( str -- n ) "- " without - dup CHAR: 0 CHAR: 9 [a,b] diff empty? [ + dup char: 0 char: 9 [a,b] diff empty? [ 13 v-min-length 16 v-max-length dup luhn? [ string>number ] [ diff --git a/basis/vocabs/hierarchy/hierarchy.factor b/basis/vocabs/hierarchy/hierarchy.factor index 3cc3e0fe66..ab3ee7659d 100644 --- a/basis/vocabs/hierarchy/hierarchy.factor +++ b/basis/vocabs/hierarchy/hierarchy.factor @@ -61,7 +61,7 @@ ERROR: vocab-root-required root ; : unrooted-disk-vocabs ( prefix -- seq ) [ loaded-vocab-names no-rooted ] dip - dup empty? [ CHAR: . suffix ] unless + dup empty? [ char: . suffix ] unless '[ vocab-name _ one-level-only? ] filter ; : unrooted-disk-vocabs-recursive ( prefix -- seq ) diff --git a/basis/windows/ole32/ole32.factor b/basis/windows/ole32/ole32.factor index 47c45c8d2f..11bb1c2a23 100644 --- a/basis/windows/ole32/ole32.factor +++ b/basis/windows/ole32/ole32.factor @@ -147,20 +147,20 @@ CONSTANT: GUID-STRING-LENGTH : guid>string ( guid -- string ) [ [ "{" ] dip { - [ Data1>> >hex 8 CHAR: 0 pad-head "-" ] - [ Data2>> >hex 4 CHAR: 0 pad-head "-" ] - [ Data3>> >hex 4 CHAR: 0 pad-head "-" ] + [ Data1>> >hex 8 char: 0 pad-head "-" ] + [ Data2>> >hex 4 char: 0 pad-head "-" ] + [ Data3>> >hex 4 char: 0 pad-head "-" ] [ Data4>> [ { - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head "-" ] - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head ] - [ >hex 2 CHAR: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head "-" ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] + [ >hex 2 char: 0 pad-head ] } spread ] input ] unless ; inline + dup string? [ char: \s ] unless ; inline PRIVATE> diff --git a/basis/xml/autoencoding/autoencoding.factor b/basis/xml/autoencoding/autoencoding.factor index 061369197e..73c6b11d04 100644 --- a/basis/xml/autoencoding/autoencoding.factor +++ b/basis/xml/autoencoding/autoencoding.factor @@ -52,8 +52,8 @@ IN: xml.autoencoding ! What if first letter of processing instruction is non-ASCII? get-next { { 0 [ next next start-utf16le ] } - { CHAR: ? [ go-utf8 instruct dup instruct-encoding ] } - { CHAR: ! [ go-utf8 direct ] } + { char: ? [ go-utf8 instruct dup instruct-encoding ] } + { char: ! [ go-utf8 direct ] } [ check start ; diff --git a/basis/xml/elements/elements.factor b/basis/xml/elements/elements.factor index 04aee4d69e..80d1b748bc 100644 --- a/basis/xml/elements/elements.factor +++ b/basis/xml/elements/elements.factor @@ -8,7 +8,7 @@ IN: xml.elements : take-interpolated ( quot -- interpolated ) interpolating? get [ - drop get-char CHAR: > eq? + drop get-char char: > eq? [ next f ] [ "->" take-string [ blank? ] trim ] if @@ -19,7 +19,7 @@ IN: xml.elements : start-tag ( -- name ? ) ! Outputs the name and whether this is a closing tag - get-char CHAR: / eq? dup [ next ] when + get-char char: / eq? dup [ next ] when parse-name swap ; : assure-no-duplicates ( attrs-alist -- attrs-alist ) @@ -29,7 +29,7 @@ IN: xml.elements : parse-attr ( -- array ) parse-name pass-blank "=" expect pass-blank - get-char CHAR: < eq? + get-char char: < eq? [ "<-" expect interpolate-quote ] [ t parse-quote* ] if 2array ; @@ -40,7 +40,7 @@ IN: xml.elements dup length 1 > [ assure-no-duplicates ] when ; : end-tag ( name attrs-alist -- tag ) - tag-ns pass-blank get-char CHAR: / eq? + tag-ns pass-blank get-char char: / eq? [ pop-ns next ">" expect ] [ depth inc close ] if ; @@ -109,9 +109,9 @@ DEFER: make-tag ! Is this unavoidable? : dtd-loop ( -- ) pass-blank get-char { - { CHAR: ] [ next ] } - { CHAR: % [ expand-pe ] } - { CHAR: < [ + { char: ] [ next ] } + { char: % [ expand-pe ] } + { char: < [ next make-tag dup dtd-acceptable? [ bad-doctype ] unless , dtd-loop ] } @@ -132,7 +132,7 @@ DEFER: make-tag ! Is this unavoidable? [ take-external-id ] [ f ] if ; : take-internal ( -- dtd/f ) - get-char CHAR: [ eq? + get-char char: [ eq? [ next take-internal-subset ] [ f ] if ; : take-doctype-decl ( -- doctype-decl ) @@ -151,8 +151,8 @@ DEFER: make-tag ! Is this unavoidable? : direct ( -- object ) get-char { - { CHAR: - [ take-comment ] } - { CHAR: [ [ take-cdata ] } + { char: - [ take-comment ] } + { char: [ [ take-cdata ] } [ drop take-directive ] } case ; @@ -166,8 +166,8 @@ DEFER: make-tag ! Is this unavoidable? : make-tag ( -- tag ) get-char { - { CHAR: ! [ next direct ] } - { CHAR: ? [ next instruct ] } - { CHAR: - [ next interpolate-tag ] } + { char: ! [ next direct ] } + { char: ? [ next instruct ] } + { char: - [ next interpolate-tag ] } [ drop normal-tag ] } case ; diff --git a/basis/xml/entities/entities.factor b/basis/xml/entities/entities.factor index d79b4eea79..5eb268ade1 100644 --- a/basis/xml/entities/entities.factor +++ b/basis/xml/entities/entities.factor @@ -6,17 +6,17 @@ IN: xml.entities CONSTANT: entities-out H{ - { CHAR: < "<" } - { CHAR: > ">" } - { CHAR: & "&" } + { char: < "<" } + { char: > ">" } + { char: & "&" } } CONSTANT: quoted-entities-out H{ - { CHAR: & "&" } - { CHAR: ' "'" } - { CHAR: \" """ } - { CHAR: < "<" } + { char: & "&" } + { char: ' "'" } + { char: \" """ } + { char: < "<" } } : escape-string-by ( str table -- escaped ) @@ -31,11 +31,11 @@ CONSTANT: quoted-entities-out CONSTANT: entities H{ - { "lt" CHAR: < } - { "gt" CHAR: > } - { "amp" CHAR: & } - { "apos" CHAR: ' } - { "quot" CHAR: \" } + { "lt" char: < } + { "gt" char: > } + { "amp" char: & } + { "apos" char: ' } + { "quot" char: \" } } : with-entities ( entities quot -- ) diff --git a/basis/xml/name/name.factor b/basis/xml/name/name.factor index 51b1dcf5ad..9712fe0cd1 100644 --- a/basis/xml/name/name.factor +++ b/basis/xml/name/name.factor @@ -65,8 +65,8 @@ SYMBOL: ns-stack } 2&& [ f ] [ 2drop f ] if ; : prefixed-name ( str -- name/f ) - CHAR: : over index [ - CHAR: : 2over 1 + swap index-from + char: : over index [ + char: : 2over 1 + swap index-from [ 2drop f ] [ [ head ] [ 1 + tail ] 2bi maybe-name ] if diff --git a/basis/xml/tests/state-parser-tests.factor b/basis/xml/tests/state-parser-tests.factor index 550378fea0..dfec370537 100644 --- a/basis/xml/tests/state-parser-tests.factor +++ b/basis/xml/tests/state-parser-tests.factor @@ -13,6 +13,6 @@ IN: xml.test.state [ "hello" ] [ "hello" [ take-rest ] string-parse ] unit-test [ 2 3 ] [ "12\n123" [ take-rest drop get-line get-column ] string-parse ] unit-test [ "hi" " how are you?" ] [ "hi how are you?" [ [ blank? ] take-until take-rest ] string-parse ] unit-test -[ "foo" ";bar" ] [ "foo;bar" [ CHAR: ; take-char take-rest ] string-parse ] unit-test +[ "foo" ";bar" ] [ "foo;bar" [ char: ; take-char take-rest ] string-parse ] unit-test [ "foo " " bar" ] [ "foo and bar" [ "and" take-string take-rest ] string-parse ] unit-test [ "baz" ] [ " \n\t baz" [ pass-blank take-rest ] string-parse ] unit-test diff --git a/basis/xml/tokenize/tokenize.factor b/basis/xml/tokenize/tokenize.factor index 0d04064022..d8f85cdcc7 100644 --- a/basis/xml/tokenize/tokenize.factor +++ b/basis/xml/tokenize/tokenize.factor @@ -24,7 +24,7 @@ HINTS: assure-good-char { spot fixnum } ; : record ( spot char -- spot ) over char>> [ - CHAR: \n eq? + char: \n eq? [ [ 1 + ] change-line -1 ] [ dup column>> 1 + ] if >>column ] [ drop ] if ; @@ -34,9 +34,9 @@ HINTS: record { spot fixnum } ; :: (next) ( spot -- spot char ) spot next>> :> old-next spot stream>> stream-read1 :> new-next - old-next CHAR: \r eq? [ - spot CHAR: \n >>char - new-next CHAR: \n eq? + old-next char: \r eq? [ + spot char: \n >>char + new-next char: \n eq? [ spot stream>> stream-read1 >>next ] [ new-next >>next ] if ] [ spot old-next >>char new-next >>next ] if @@ -134,11 +134,11 @@ HINTS: next* { spot } ; { { [ char not ] [ ] } { [ char quot call ] [ spot next* ] } - { [ char CHAR: & eq? ] [ + { [ char char: & eq? ] [ accum parse-entity quot accum spot (parse-char) ] } - { [ char CHAR: % eq? [ in-dtd? get ] [ f ] if ] [ + { [ char char: % eq? [ in-dtd? get ] [ f ] if ] [ accum parse-pe quot accum spot (parse-char) ] } @@ -161,23 +161,23 @@ HINTS: next* { spot } ; [| char | pos char assure-no-]]> pos! no-text [ - char blank? char CHAR: < eq? or [ + char blank? char char: < eq? or [ char 1string t pre/post-content ] unless ] when - char CHAR: < eq? + char char: < eq? ] parse-char ; : close ( -- ) pass-blank ">" expect ; : normalize-quote ( str -- str ) - [ dup "\t\r\n" member? [ drop CHAR: \s ] when ] map! ; + [ dup "\t\r\n" member? [ drop char: \s ] when ] map! ; : (parse-quote) ( <-disallowed? ch -- string ) swap '[ dup _ eq? [ drop t ] - [ CHAR: < eq? _ and [ attr-w/< ] [ f ] if ] if + [ char: < eq? _ and [ attr-w/< ] [ f ] if ] if ] parse-char normalize-quote get-char [ unclosed-quote ] unless ; inline diff --git a/basis/xml/writer/writer.factor b/basis/xml/writer/writer.factor index 1f42bf8a35..543fa2f5b4 100644 --- a/basis/xml/writer/writer.factor +++ b/basis/xml/writer/writer.factor @@ -48,7 +48,7 @@ PRIVATE> > print-attrs ; : write-start-tag ( tag -- ) @@ -84,7 +84,7 @@ M: contained-tag write-xml [ write-xml ] each unindent ; : write-end-tag ( tag -- ) - ?indent " write1 ; + ?indent " write1 ; M: open-tag write-xml xml-pprint? get [ @@ -148,7 +148,7 @@ M: doctype-decl write-xml ">" write ; M: directive write-xml - "> write CHAR: > write1 nl ; + "> write char: > write1 nl ; M: instruction write-xml "> write "?>" write ; diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index b5e2fcf8d4..9732378315 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -16,7 +16,7 @@ IN: bootstrap.syntax "B{" "BV{" "C:" - "CHAR:" + "char:" "DEFER:" "ERROR:" "FORGET:" diff --git a/core/checksums/checksums.factor b/core/checksums/checksums.factor index c5fc5f7058..d01a1518dc 100644 --- a/core/checksums/checksums.factor +++ b/core/checksums/checksums.factor @@ -18,7 +18,7 @@ M: checksum checksum-stream [ stream-contents ] dip checksum-bytes ; M: checksum checksum-lines - [ B{ CHAR: \n } join ] dip checksum-bytes ; + [ B{ char: \n } join ] dip checksum-bytes ; : checksum-file ( path checksum -- value ) [ binary ] dip checksum-stream ; @@ -45,7 +45,7 @@ GENERIC: get-checksum ( checksum-state -- value ) [ [ add-checksum-bytes ] each-block ] with-input-stream ; : add-checksum-lines ( checksum-state lines -- checksum-state ) - [ B{ CHAR: \n } add-checksum-bytes ] + [ B{ char: \n } add-checksum-bytes ] [ add-checksum-bytes ] interleave ; : add-checksum-file ( checksum-state path -- checksum-state ) diff --git a/core/checksums/crc32/crc32.factor b/core/checksums/crc32/crc32.factor index f6f6870041..32cff0ca12 100644 --- a/core/checksums/crc32/crc32.factor +++ b/core/checksums/crc32/crc32.factor @@ -36,5 +36,5 @@ M: crc32 checksum-bytes M: crc32 checksum-lines init-crc32 - [ [ (crc32) ] each CHAR: \n (crc32) ] each + [ [ (crc32) ] each char: \n (crc32) ] each finish-crc32 ; inline diff --git a/core/effects/effects.factor b/core/effects/effects.factor index 010d4d4d97..636c7125ad 100644 --- a/core/effects/effects.factor +++ b/core/effects/effects.factor @@ -62,7 +62,7 @@ M: pair effect>string ] if ; : stack-picture ( seq -- string ) - [ [ effect>string % CHAR: \s , ] each ] "" make ; + [ [ effect>string % char: \s , ] each ] "" make ; : var-picture ( var -- string ) [ ".." " " surround ] diff --git a/core/io/encodings/ascii/ascii-tests.factor b/core/io/encodings/ascii/ascii-tests.factor index d2818b0102..bcec0b1a8f 100644 --- a/core/io/encodings/ascii/ascii-tests.factor +++ b/core/io/encodings/ascii/ascii-tests.factor @@ -1,9 +1,9 @@ USING: arrays io.encodings.ascii io.encodings.string strings tools.test ; -{ B{ CHAR: f CHAR: o CHAR: o } } [ "foo" ascii encode ] unit-test +{ B{ char: f char: o char: o } } [ "foo" ascii encode ] unit-test [ { 128 } >string ascii encode ] must-fail { B{ 127 } } [ { 127 } >string ascii encode ] unit-test { "bar" } [ "bar" ascii decode ] unit-test -{ { CHAR: b 0xfffd CHAR: r } } [ B{ CHAR: b 233 CHAR: r } ascii decode >array ] unit-test +{ { char: b 0xfffd char: r } } [ B{ char: b 233 char: r } ascii decode >array ] unit-test diff --git a/core/io/encodings/encodings-tests.factor b/core/io/encodings/encodings-tests.factor index c0807d1bff..1dafc69975 100644 --- a/core/io/encodings/encodings-tests.factor +++ b/core/io/encodings/encodings-tests.factor @@ -52,7 +52,7 @@ unit-test ] unit-test { - CHAR: 1 + char: 1 } [ "Hello world\r\n1234" dup stream-readln drop diff --git a/core/io/encodings/encodings.factor b/core/io/encodings/encodings.factor index fc1d24375e..141792b491 100644 --- a/core/io/encodings/encodings.factor +++ b/core/io/encodings/encodings.factor @@ -106,7 +106,7 @@ M: decoder stream-element-type : fix-cr ( decoder c -- c' ) over cr>> [ - over cr- dup CHAR: \n eq? [ drop (read1) ] [ nip ] if + over cr- dup char: \n eq? [ drop (read1) ] [ nip ] if ] [ nip ] if ; inline M: decoder stream-read1 ( decoder -- ch ) @@ -155,8 +155,8 @@ M: decoder stream-contents* : handle-readln ( stream str ch -- str ) { { f [ line-ends/eof ] } - { CHAR: \r [ line-ends\r ] } - { CHAR: \n [ line-ends\n ] } + { char: \r [ line-ends\r ] } + { char: \n [ line-ends\n ] } } case ; inline M: decoder stream-read-until @@ -164,13 +164,13 @@ M: decoder stream-read-until dup cr- 2dup >decoder< decode-until over [ - dup CHAR: \n = [ + dup char: \n = [ 2drop stream-read-until ] [ [ 2drop ] 2dip ] if ] [ - first-unsafe CHAR: \n = [ [ rest ] dip ] when + first-unsafe char: \n = [ [ rest ] dip ] when [ 2drop ] 2dip ] if-empty ] [ diff --git a/core/io/encodings/utf16/utf16-tests.factor b/core/io/encodings/utf16/utf16-tests.factor index 0b704532d2..70b42ceddc 100644 --- a/core/io/encodings/utf16/utf16-tests.factor +++ b/core/io/encodings/utf16/utf16-tests.factor @@ -3,26 +3,26 @@ USING: arrays io.encodings.string io.encodings.utf16 strings tools.test ; -{ { CHAR: x } } [ B{ 0 CHAR: x } utf16be decode >array ] unit-test +{ { char: x } } [ B{ 0 char: x } utf16be decode >array ] unit-test { { 0x1D11E } } [ B{ 0xD8 0x34 0xDD 0x1E } utf16be decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0b11011111 CHAR: q } utf16be decode >array ] unit-test -{ { CHAR: replacement-character } } [ B{ 0b11011011 CHAR: x 0b11011011 CHAR: x } utf16be decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0b11011111 char: q } utf16be decode >array ] unit-test +{ { char: replacement-character } } [ B{ 0b11011011 char: x 0b11011011 char: x } utf16be decode >array ] unit-test -{ { 0 120 216 52 221 30 } } [ { CHAR: x 0x1d11e } >string utf16be encode >array ] unit-test +{ { 0 120 216 52 221 30 } } [ { char: x 0x1d11e } >string utf16be encode >array ] unit-test -{ { CHAR: x } } [ B{ CHAR: x 0 } utf16le decode >array ] unit-test +{ { char: x } } [ B{ char: x 0 } utf16le decode >array ] unit-test { { 119070 } } [ B{ 0x34 0xD8 0x1E 0xDD } >string utf16le decode >array ] unit-test -{ { CHAR: replacement-character } } [ { 0 0b11011111 } >string utf16le decode >array ] unit-test -{ { CHAR: replacement-character } } [ { 0 0b11011011 0 0 } >string utf16le decode >array ] unit-test +{ { char: replacement-character } } [ { 0 0b11011111 } >string utf16le decode >array ] unit-test +{ { char: replacement-character } } [ { 0 0b11011011 0 0 } >string utf16le decode >array ] unit-test -{ { 120 0 52 216 30 221 } } [ { CHAR: x 0x1d11e } >string utf16le encode >array ] unit-test +{ { 120 0 52 216 30 221 } } [ { char: x 0x1d11e } >string utf16le encode >array ] unit-test -{ { CHAR: x } } [ B{ 0xff 0xfe CHAR: x 0 } utf16 decode >array ] unit-test -{ { CHAR: x } } [ B{ 0xfe 0xff 0 CHAR: x } utf16 decode >array ] unit-test +{ { char: x } } [ B{ 0xff 0xfe char: x 0 } utf16 decode >array ] unit-test +{ { char: x } } [ B{ 0xfe 0xff 0 char: x } utf16 decode >array ] unit-test -{ { 0xff 0xfe 120 0 52 216 30 221 } } [ { CHAR: x 0x1d11e } >string utf16 encode >array ] unit-test +{ { 0xff 0xfe 120 0 52 216 30 221 } } [ { char: x 0x1d11e } >string utf16 encode >array ] unit-test ! test ascii encoding path -{ B{ CHAR: a 0 CHAR: b 0 CHAR: c 0 } } [ "abc" utf16le encode ] unit-test -{ B{ 0 CHAR: a 0 CHAR: b 0 CHAR: c } } [ "abc" utf16be encode ] unit-test +{ B{ char: a 0 char: b 0 char: c 0 } } [ "abc" utf16le encode ] unit-test +{ B{ 0 char: a 0 char: b 0 char: c } } [ "abc" utf16be encode ] unit-test diff --git a/core/io/encodings/utf8/utf8-tests.factor b/core/io/encodings/utf8/utf8-tests.factor index f6ee250173..d7a1551b7f 100644 --- a/core/io/encodings/utf8/utf8-tests.factor +++ b/core/io/encodings/utf8/utf8-tests.factor @@ -8,18 +8,18 @@ IN: io.encodings.utf8.tests : encode-utf8-w/stream ( array -- newarray ) >string utf8 encode >array ; -{ { CHAR: replacement-character } } [ { 0b11110,101 0b10,111111 0b10,000000 0b11111111 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b11110,101 0b10,111111 0b10,000000 0b11111111 } decode-utf8-w/stream ] unit-test { "x" } [ "x" decode-utf8-w/stream >string ] unit-test { { 0b11111000000 } } [ { 0b110,11111 0b10,000000 } decode-utf8-w/stream >array ] unit-test -{ { CHAR: replacement-character } } [ { 0b10000000 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b10000000 } decode-utf8-w/stream ] unit-test { { 0b1111000000111111 } } [ { 0b1110,1111 0b10,000000 0b10,111111 } decode-utf8-w/stream >array ] unit-test -{ { 0b11110,101 0b10,111111 0b10,000000 0b10,111111 0b1110,1111 0b10,000000 0b10,111111 0b110,11111 0b10,000000 CHAR: x } } -[ { 0b101111111000000111111 0b1111000000111111 0b11111000000 CHAR: x } encode-utf8-w/stream ] unit-test +{ { 0b11110,101 0b10,111111 0b10,000000 0b10,111111 0b1110,1111 0b10,000000 0b10,111111 0b110,11111 0b10,000000 char: x } } +[ { 0b101111111000000111111 0b1111000000111111 0b11111000000 char: x } encode-utf8-w/stream ] unit-test { 3 } [ 1 "日本語" >utf8-index ] unit-test { 3 } [ 9 "日本語" utf8-index> ] unit-test @@ -28,16 +28,16 @@ IN: io.encodings.utf8.tests { V{ } } [ 100000 [ [ code-point-length ] [ 1string utf8 encode length ] bi = ] reject ] unit-test -{ { CHAR: replacement-character } } [ { 0b110,00000 0b10,000000 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b110,00001 0b10,111111 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b110,00000 0b10,000000 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b110,00001 0b10,111111 } decode-utf8-w/stream ] unit-test { { 0x80 } } [ { 0b110,00010 0b10,000000 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b1110,0000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b1110,0000 0b10,011111 0b10,111111 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b1110,0000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b1110,0000 0b10,011111 0b10,111111 } decode-utf8-w/stream ] unit-test { { 0x800 } } [ { 0b1110,0000 0b10,100000 0b10,000000 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b11110,000 0b10,000000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b11110,000 0b10,001111 0b10,111111 0b10,111111 } decode-utf8-w/stream ] unit-test -{ { CHAR: replacement-character } } [ { 0b11110,100 0b10,010000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b11110,000 0b10,000000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b11110,000 0b10,001111 0b10,111111 0b10,111111 } decode-utf8-w/stream ] unit-test +{ { char: replacement-character } } [ { 0b11110,100 0b10,010000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test { { 0x10000 } } [ { 0b11110,000 0b10,010000 0b10,000000 0b10,000000 } decode-utf8-w/stream ] unit-test { { 0x10FFFF } } [ { 0b11110,100 0b10,001111 0b10,111111 0b10,111111 } decode-utf8-w/stream ] unit-test diff --git a/core/io/files/files-tests.factor b/core/io/files/files-tests.factor index 196dc815c3..c52273e88e 100644 --- a/core/io/files/files-tests.factor +++ b/core/io/files/files-tests.factor @@ -29,14 +29,14 @@ SPECIALIZED-ARRAY: int ] unit-test { - "This" CHAR: \s + "This" char: \s } [ "vocab:io/test/read-until-test.txt" ascii [ " " read-until ] with-file-reader ] unit-test { - "This" CHAR: \s + "This" char: \s } [ "vocab:io/test/read-until-test.txt" binary [ " " read-until [ ascii decode ] dip ] with-file-reader @@ -50,8 +50,8 @@ SPECIALIZED-ARRAY: int { { - { "It seems " CHAR: J } - { "obs has lost h" CHAR: i } + { "It seems " char: J } + { "obs has lost h" char: i } { "s grasp on reality again.\n" f } } } [ diff --git a/core/io/io.factor b/core/io/io.factor index fc804f0680..4ab6296161 100644 --- a/core/io/io.factor +++ b/core/io/io.factor @@ -99,7 +99,7 @@ SYMBOL: error-stream : print ( str -- ) output-stream get stream-print ; inline -: stream-bl ( stream -- ) CHAR: \s swap stream-write1 ; inline +: stream-bl ( stream -- ) char: \s swap stream-write1 ; inline : bl ( -- ) output-stream get stream-bl ; @@ -251,7 +251,7 @@ M: input-stream stream-length drop f ; inline M: output-stream stream-write [ stream-write1 ] curry each ; inline M: output-stream stream-flush drop ; inline -M: output-stream stream-nl CHAR: \n swap stream-write1 ; inline +M: output-stream stream-nl char: \n swap stream-write1 ; inline M: output-stream stream-seekable? drop f ; inline M: output-stream stream-length drop f ; inline diff --git a/core/io/pathnames/pathnames-docs.factor b/core/io/pathnames/pathnames-docs.factor index 8f94200d15..28181545c3 100644 --- a/core/io/pathnames/pathnames-docs.factor +++ b/core/io/pathnames/pathnames-docs.factor @@ -7,7 +7,7 @@ HELP: path-separator? { $description "Tests if the code point is a platform-specific path separator." } { $examples "On Unix:" - { $example "USING: io.pathnames prettyprint ;" "CHAR: / path-separator? ." "t" } + { $example "USING: io.pathnames prettyprint ;" "char: / path-separator? ." "t" } } ; HELP: parent-directory diff --git a/core/io/pathnames/pathnames.factor b/core/io/pathnames/pathnames.factor index 2d382e49d1..2edfbe08e4 100644 --- a/core/io/pathnames/pathnames.factor +++ b/core/io/pathnames/pathnames.factor @@ -65,7 +65,7 @@ ERROR: no-parent-directory path ; { { [ dup "\\\\?\\" head? ] [ t ] } { [ dup length 2 < ] [ f ] } - { [ dup second CHAR: : = ] [ t ] } + { [ dup second char: : = ] [ t ] } [ f ] } cond ; diff --git a/core/io/streams/byte-array/byte-array-tests.factor b/core/io/streams/byte-array/byte-array-tests.factor index 8f0bb63a75..abf2469806 100644 --- a/core/io/streams/byte-array/byte-array-tests.factor +++ b/core/io/streams/byte-array/byte-array-tests.factor @@ -19,8 +19,8 @@ SPECIALIZED-ARRAY: int { B{ 1 2 3 4 5 6 } } [ binary [ B{ 1 2 3 } write B{ 4 5 6 } write ] with-byte-writer ] unit-test { B{ 1 2 3 } } [ { 1 2 3 } binary [ 3 read ] with-byte-reader ] unit-test -{ B{ 0b11110101 0b10111111 0b10000000 0b10111111 0b11101111 0b10000000 0b10111111 0b11011111 0b10000000 CHAR: x } } -[ { 0b101111111000000111111 0b1111000000111111 0b11111000000 CHAR: x } >string utf8 [ write ] with-byte-writer ] unit-test +{ B{ 0b11110101 0b10111111 0b10000000 0b10111111 0b11101111 0b10000000 0b10111111 0b11011111 0b10000000 char: x } } +[ { 0b101111111000000111111 0b1111000000111111 0b11111000000 char: x } >string utf8 [ write ] with-byte-writer ] unit-test { { 0b1111111000000111111 } t } [ { 0b11110001 0b10111111 0b10000000 0b10111111 } utf8 stream-contents dup >array swap string? ] unit-test { B{ 121 120 } 0 } [ diff --git a/core/io/streams/plain/plain.factor b/core/io/streams/plain/plain.factor index 4ea1996f88..d2905b98e9 100644 --- a/core/io/streams/plain/plain.factor +++ b/core/io/streams/plain/plain.factor @@ -6,4 +6,4 @@ IN: io.streams.plain MIXIN: plain-writer M: plain-writer stream-nl - CHAR: \n swap stream-write1 ; + char: \n swap stream-write1 ; diff --git a/core/lexer/lexer.factor b/core/lexer/lexer.factor index 7dc514b189..74e438aace 100644 --- a/core/lexer/lexer.factor +++ b/core/lexer/lexer.factor @@ -50,11 +50,11 @@ ERROR: not-a-lexer object ; ERROR: unexpected want got ; : forbid-tab ( c -- c ) - [ CHAR: \t eq? [ "[space]" "[tab]" unexpected ] when ] keep ; inline + [ char: \t eq? [ "[space]" "[tab]" unexpected ] when ] keep ; inline : skip ( i seq ? -- n ) over length [ - [ swap forbid-tab CHAR: \s eq? xor ] curry find-from drop + [ swap forbid-tab char: \s eq? xor ] curry find-from drop ] dip or ; inline : change-lexer-column ( ..a lexer quot: ( ..a col line -- ..b newcol ) -- ..b ) @@ -85,7 +85,7 @@ GENERIC: skip-word ( lexer -- ) M: lexer skip-word [ - 2dup nth CHAR: \" eq? [ drop 1 + ] [ f skip ] if + 2dup nth char: \" eq? [ drop 1 + ] [ f skip ] if ] change-lexer-column ; : still-parsing? ( lexer -- ? ) @@ -163,14 +163,14 @@ M: lexer-error error-line [ error>> error-line ] [ line>> ] bi or ; [ line>> number>string ": " append ] [ line-text>> ] [ column>> ] tri - pick length + CHAR: \s + pick length + char: \s [ write ] [ print ] [ write "^" print ] tri* ; : (parsing-word-lexer-dump) ( error parsing-word -- ) [ line>> number>string over line>> number>string length - CHAR: \s pad-head + char: \s pad-head ": " append write ] [ line-text>> print ] bi simple-lexer-dump ; diff --git a/core/make/make-docs.factor b/core/make/make-docs.factor index f83f6e0143..67658a3f6b 100644 --- a/core/make/make-docs.factor +++ b/core/make/make-docs.factor @@ -56,7 +56,7 @@ $nl { $subsections building } { $example "USING: make math.parser ;" - "[ \"Language #\" % CHAR: \\s , 5 # ] \"\" make print" + "[ \"Language #\" % char: \\s , 5 # ] \"\" make print" "Language # 5" } { $subsections "make-philosophy" } ; diff --git a/core/math/parser/parser-tests.factor b/core/math/parser/parser-tests.factor index 24ccd1aab8..475d047767 100644 --- a/core/math/parser/parser-tests.factor +++ b/core/math/parser/parser-tests.factor @@ -426,12 +426,12 @@ unit-test { t } [ most-negative-fixnum number>string string>number fixnum? ] unit-test ! large/small numbers/exponents correctly cancel out -{ 1.0 } [ "1" 3000 [ CHAR: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test -{ 1.0 } [ "0x1" 1000 [ CHAR: 0 ] "" replicate-as append "p-4000" append string>number ] unit-test -{ 1.0 } [ "0." 3000 [ CHAR: 0 ] "" replicate-as append "1e3001" append string>number ] unit-test -{ 1.0 } [ "0x0." 1000 [ CHAR: 0 ] "" replicate-as append "1p4004" append string>number ] unit-test -{ 1.0 } [ "1" 3000 [ CHAR: 0 ] "" replicate-as append "." append - 3000 [ CHAR: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test +{ 1.0 } [ "1" 3000 [ char: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test +{ 1.0 } [ "0x1" 1000 [ char: 0 ] "" replicate-as append "p-4000" append string>number ] unit-test +{ 1.0 } [ "0." 3000 [ char: 0 ] "" replicate-as append "1e3001" append string>number ] unit-test +{ 1.0 } [ "0x0." 1000 [ char: 0 ] "" replicate-as append "1p4004" append string>number ] unit-test +{ 1.0 } [ "1" 3000 [ char: 0 ] "" replicate-as append "." append + 3000 [ char: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test ! We correctly parse the biggest/smallest float correctly ! (ie the 1/0. or 0/0. short-circuit optimization doesn't apply) @@ -451,9 +451,9 @@ unit-test { 1.79769313486231571e+308 } [ "1.797693134862315807e+308" string>number ] unit-test ! works with ratios -{ 0.25 } [ "1/4" 3000 [ CHAR: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test +{ 0.25 } [ "1/4" 3000 [ char: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test ! XXX: disable for right now, see #1362 or #1408 -! { 1.25 } [ "1+1/4" 3000 [ CHAR: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test +! { 1.25 } [ "1+1/4" 3000 [ char: 0 ] "" replicate-as append "e-3000" append string>number ] unit-test ! #1356 #1231 { 1/0. } [ "1e100000" string>number ] unit-test @@ -485,5 +485,5 @@ unit-test "1.55E+05" "1.550e+05" } [ - trouble CHAR: e 0 rot set-nth trouble drop + trouble char: e 0 rot set-nth trouble drop ] unit-test diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 5a683d921d..ef7eaa9483 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -10,16 +10,16 @@ PRIVATE> : digit> ( ch -- n ) { - { [ dup CHAR: 9 <= ] [ CHAR: 0 - dup 0 < [ drop 255 ] when ] } - { [ dup CHAR: a < ] [ CHAR: A 10 - - dup 10 < [ drop 255 ] when ] } - [ CHAR: a 10 - - dup 10 < [ drop 255 ] when ] + { [ dup char: 9 <= ] [ char: 0 - dup 0 < [ drop 255 ] when ] } + { [ dup char: a < ] [ char: A 10 - - dup 10 < [ drop 255 ] when ] } + [ char: a 10 - - dup 10 < [ drop 255 ] when ] } cond ; inline : string>digits ( str -- digits ) [ digit> ] B{ } map-as ; inline : >digit ( n -- ch ) - dup 10 < [ CHAR: 0 + ] [ 10 - CHAR: a + ] if ; inline + dup 10 < [ char: 0 + ] [ 10 - char: a + ] if ; inline ERROR: invalid-radix radix ; @@ -201,7 +201,7 @@ DEFER: @neg-digit : @exponent-digit-or-punc ( float-parse i number-parse n char -- float-parse n/f ) { - { CHAR: , [ [ @exponent-digit ] require-next-digit ] } + { char: , [ [ @exponent-digit ] require-next-digit ] } [ @exponent-digit ] } case ; inline @@ -211,8 +211,8 @@ DEFER: @neg-digit : @exponent-first-char ( float-parse i number-parse n char -- float-parse n/f ) { - { CHAR: - [ [ @exponent-digit ] require-next-digit ?neg ] } - { CHAR: + [ [ @exponent-digit ] require-next-digit ] } + { char: - [ [ @exponent-digit ] require-next-digit ?neg ] } + { char: + [ [ @exponent-digit ] require-next-digit ] } [ @exponent-digit ] } case ; inline @@ -233,7 +233,7 @@ DEFER: @neg-digit : @mantissa-digit-or-punc ( float-parse i number-parse n char -- float-parse n/f ) { - { CHAR: , [ [ @mantissa-digit ] require-next-digit ] } + { char: , [ [ @mantissa-digit ] require-next-digit ] } [ @mantissa-digit ] } case ; inline @@ -253,8 +253,8 @@ DEFER: @neg-digit : @denom-digit-or-punc ( i number-parse n char -- n/f ) { - { CHAR: , [ [ @denom-digit ] require-next-digit ] } - { CHAR: . [ ->mantissa ] } + { char: , [ [ @denom-digit ] require-next-digit ] } + { char: . [ ->mantissa ] } [ [ @denom-digit ] or-exponent ] } case ; inline @@ -264,7 +264,7 @@ DEFER: @neg-digit : @denom-first-digit ( i number-parse n char -- n/f ) { - { CHAR: . [ ->mantissa ] } + { char: . [ ->mantissa ] } [ @denom-digit ] } case ; inline @@ -274,8 +274,8 @@ DEFER: @neg-digit : @num-digit-or-punc ( i number-parse n char -- n/f ) { - { CHAR: , [ [ @num-digit ] require-next-digit ] } - { CHAR: / [ ->denominator ] } + { char: , [ [ @num-digit ] require-next-digit ] } + { char: / [ ->denominator ] } [ @num-digit ] } case ; inline @@ -289,10 +289,10 @@ DEFER: @neg-digit : @pos-digit-or-punc ( i number-parse n char -- n/f ) { - { CHAR: , [ [ @pos-digit ] require-next-digit ] } - { CHAR: + [ ->numerator ] } - { CHAR: / [ ->denominator ] } - { CHAR: . [ ->mantissa ] } + { char: , [ [ @pos-digit ] require-next-digit ] } + { char: + [ ->numerator ] } + { char: / [ ->denominator ] } + { char: . [ ->mantissa ] } [ [ @pos-digit ] or-exponent ] } case ; inline @@ -306,26 +306,26 @@ DEFER: @neg-digit : with-radix-char ( i number-parse n radix-quot nonradix-quot -- n/f ) [ rot { - { CHAR: b [ drop 2 ->radix require-next-digit ] } - { CHAR: o [ drop 8 ->radix require-next-digit ] } - { CHAR: x [ drop 16 ->radix require-next-digit ] } + { char: b [ drop 2 ->radix require-next-digit ] } + { char: o [ drop 8 ->radix require-next-digit ] } + { char: x [ drop 16 ->radix require-next-digit ] } [ [ drop ] 2dip swap call ] } case ] 2curry next-digit ; inline : @pos-first-digit ( i number-parse n char -- n/f ) { - { CHAR: . [ ->required-mantissa ] } - { CHAR: 0 [ [ @pos-digit ] [ @pos-digit-or-punc ] with-radix-char ] } + { char: . [ ->required-mantissa ] } + { char: 0 [ [ @pos-digit ] [ @pos-digit-or-punc ] with-radix-char ] } [ @pos-digit ] } case ; inline : @neg-digit-or-punc ( i number-parse n char -- n/f ) { - { CHAR: , [ [ @neg-digit ] require-next-digit ] } - { CHAR: - [ ->numerator ] } - { CHAR: / [ ->denominator ] } - { CHAR: . [ ->mantissa ] } + { char: , [ [ @neg-digit ] require-next-digit ] } + { char: - [ ->numerator ] } + { char: / [ ->denominator ] } + { char: . [ ->mantissa ] } [ [ @neg-digit ] or-exponent ] } case ; inline @@ -335,34 +335,34 @@ DEFER: @neg-digit : @neg-first-digit ( i number-parse n char -- n/f ) { - { CHAR: . [ ->required-mantissa ] } - { CHAR: 0 [ [ @neg-digit ] [ @neg-digit-or-punc ] with-radix-char ] } + { char: . [ ->required-mantissa ] } + { char: 0 [ [ @neg-digit ] [ @neg-digit-or-punc ] with-radix-char ] } [ @neg-digit ] } case ; inline : @first-char ( i number-parse n char -- n/f ) { - { CHAR: - [ [ @neg-first-digit ] require-next-digit ?neg ] } - { CHAR: + [ [ @pos-first-digit ] require-next-digit ] } + { char: - [ [ @neg-first-digit ] require-next-digit ?neg ] } + { char: + [ [ @pos-first-digit ] require-next-digit ] } [ @pos-first-digit ] } case ; inline : @neg-first-digit-no-radix ( i number-parse n char -- n/f ) { - { CHAR: . [ ->required-mantissa ] } + { char: . [ ->required-mantissa ] } [ @neg-digit ] } case ; inline : @pos-first-digit-no-radix ( i number-parse n char -- n/f ) { - { CHAR: . [ ->required-mantissa ] } + { char: . [ ->required-mantissa ] } [ @pos-digit ] } case ; inline : @first-char-no-radix ( i number-parse n char -- n/f ) { - { CHAR: - [ [ @neg-first-digit-no-radix ] require-next-digit ?neg ] } - { CHAR: + [ [ @pos-first-digit-no-radix ] require-next-digit ] } + { char: - [ [ @neg-first-digit-no-radix ] require-next-digit ?neg ] } + { char: + [ [ @pos-first-digit-no-radix ] require-next-digit ] } [ @pos-first-digit-no-radix ] } case ; inline @@ -403,7 +403,7 @@ CONSTANT: ONES B{ ] dip [ push ] keep [ push ] keep ; inline : (one-digit) ( num accum -- num' accum ) - [ 10 /mod CHAR: 0 + ] dip [ push ] keep ; inline + [ 10 /mod char: 0 + ] dip [ push ] keep ; inline : (bignum>dec) ( num accum -- num' accum ) [ over most-positive-fixnum > ] @@ -476,21 +476,21 @@ M: integer >base { { [ over 0 = ] [ 2drop "0" ] } { [ over 0 > ] [ positive>base ] } - [ [ neg ] dip positive>base CHAR: - prefix ] + [ [ neg ] dip positive>base char: - prefix ] } cond ; M: ratio >base [ >fraction [ /mod ] keep ] [ [ >base ] curry tri@ ] bi* "/" glue over first-unsafe { - { CHAR: 0 [ nip ] } - { CHAR: - [ append ] } + { char: 0 [ nip ] } + { char: - [ append ] } [ drop "+" glue ] } case ; base -0.0 double>bits bitand zero? "" "-" ? ; : bin-float-value ( str size -- str' ) - CHAR: 0 pad-head [ CHAR: 0 = ] trim-tail + char: 0 pad-head [ char: 0 = ] trim-tail [ "0" ] when-empty "1." prepend ; : float>hex-value ( mantissa -- str ) @@ -547,7 +547,7 @@ M: ratio >base [ format-string ] 4dip [ format-string ] bi@ (format-float) >string ] [ - "C" = [ [ "G" = ] [ "E" = ] bi or CHAR: E CHAR: e ? fix-float ] + "C" = [ [ "G" = ] [ "E" = ] bi or char: E char: e ? fix-float ] [ drop ] if ] 2bi ; inline @@ -583,7 +583,7 @@ M: float >base ] keep ; : bytes>hex-string ( bytes -- hex-string ) - dup length 2 * CHAR: 0 [ + dup length 2 * char: 0 [ [ [ 16 /mod [ >digit ] bi@ ] [ 2 * dup 1 + ] diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 58ea85917b..3bd648647b 100644 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -421,8 +421,8 @@ DEFER: foo [ ": foo ;" eval( -- ) ] [ error>> error>> no-current-vocab-error? ] must-fail-with -{ 92 } [ "CHAR: \\" eval( -- n ) ] unit-test -{ 92 } [ "CHAR: \\\\" eval( -- n ) ] unit-test +{ 92 } [ "char: \\" eval( -- n ) ] unit-test +{ 92 } [ "char: \\\\" eval( -- n ) ] unit-test { } [ { @@ -488,7 +488,7 @@ DEFER: blahy [ "IN: parser.tests USE: kernel TUPLE: blahy < tuple ; : blahy ( -- ) ; TUPLE: blahy < tuple ; : blahy ( -- ) ;" eval( -- ) ] [ error>> error>> def>> \ blahy eq? ] must-fail-with -[ "CHAR: \\u9999999999999" eval( -- n ) ] must-fail +[ "char: \\u9999999999999" eval( -- n ) ] must-fail SYMBOLS: a b c ; diff --git a/core/sbufs/sbufs-tests.factor b/core/sbufs/sbufs-tests.factor index c2ee4171f7..946ba60735 100644 --- a/core/sbufs/sbufs-tests.factor +++ b/core/sbufs/sbufs-tests.factor @@ -11,12 +11,12 @@ sequences.private strings tools.test ; "buf" get >string ] unit-test -{ CHAR: h } [ 0 SBUF" hello world" nth ] unit-test -{ CHAR: H } [ - CHAR: H 0 SBUF" hello world" [ set-nth ] keep first +{ char: h } [ 0 SBUF" hello world" nth ] unit-test +{ char: H } [ + char: H 0 SBUF" hello world" [ set-nth ] keep first ] unit-test -{ SBUF" x" } [ 1 CHAR: x >bignum suffix! ] unit-test +{ SBUF" x" } [ 1 char: x >bignum suffix! ] unit-test { fixnum } [ 1 >bignum SBUF" " new-sequence length class-of ] unit-test @@ -24,4 +24,4 @@ sequences.private strings tools.test ; [ 1.5 SBUF" " new-sequence ] must-fail -[ CHAR: A 0.5 0.5 SBUF" a" set-nth-unsafe ] must-fail +[ char: A 0.5 0.5 SBUF" a" set-nth-unsafe ] must-fail diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index c8bd6778c8..4fcc74ddb4 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -609,7 +609,7 @@ HELP: member? "Is a letter in a string:" { $example "USING: sequences prettyprint ;" - "CHAR: a \"abc\" member? ." + "char: a \"abc\" member? ." "t" } $nl "Is a number in a sequence:" @@ -795,12 +795,12 @@ HELP: padding HELP: pad-head { $values { "seq" sequence } { "n" "a non-negative integer" } { "elt" object } { "padded" "a new sequence" } } { $description "Outputs a new sequence consisting of " { $snippet "seq" } " padded on the left with enough repetitions of " { $snippet "elt" } " to have the result be of length " { $snippet "n" } "." } -{ $examples { $example "USING: io sequences ;" "{ \"ab\" \"quux\" } [ 5 CHAR: - pad-head print ] each" "---ab\n-quux" } } ; +{ $examples { $example "USING: io sequences ;" "{ \"ab\" \"quux\" } [ 5 char: - pad-head print ] each" "---ab\n-quux" } } ; HELP: pad-tail { $values { "seq" sequence } { "n" "a non-negative integer" } { "elt" object } { "padded" "a new sequence" } } { $description "Outputs a new sequence consisting of " { $snippet "seq" } " padded on the right with enough repetitions of " { $snippet "elt" } " to have the result be of length " { $snippet "n" } "." } -{ $examples { $example "USING: io sequences ;" "{ \"ab\" \"quux\" } [ 5 CHAR: - pad-tail print ] each" "ab---\nquux-" } } ; +{ $examples { $example "USING: io sequences ;" "{ \"ab\" \"quux\" } [ 5 char: - pad-tail print ] each" "ab---\nquux-" } } ; HELP: sequence= { $values { "seq1" sequence } { "seq2" sequence } { "?" boolean } } diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index 72a326aaab..d7e191c54a 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -51,20 +51,20 @@ IN: sequences.tests { 2 3 } [ [ 1 2 3 ] [ 2 > ] find ] unit-test { f f } [ [ 1 2 3 ] [ 10 > ] find ] unit-test -{ 1 CHAR: e } +{ 1 char: e } [ "hello world" "aeiou" [ member? ] curry find ] unit-test -{ 4 CHAR: o } +{ 4 char: o } [ 3 "hello world" "aeiou" [ member? ] curry find-from ] unit-test { f f } [ "abcd" [ 10 > nip ] find-index ] unit-test -{ f f } [ "abcd" [ drop CHAR: e = ] find-index ] unit-test -{ 3 CHAR: d } [ "abcdefg" [ 3 = nip ] find-index ] unit-test -{ 3 CHAR: d } [ "abcdefg" [ drop CHAR: d = ] find-index ] unit-test +{ f f } [ "abcd" [ drop char: e = ] find-index ] unit-test +{ 3 char: d } [ "abcdefg" [ 3 = nip ] find-index ] unit-test +{ 3 char: d } [ "abcdefg" [ drop char: d = ] find-index ] unit-test -{ 0 CHAR: a } [ 0 "abcdef" [ drop CHAR: a >= ] find-index-from ] unit-test -{ 1 CHAR: b } [ 0 "abcdef" [ drop CHAR: a > ] find-index-from ] unit-test -{ 2 CHAR: c } [ 1 "abcdef" [ drop CHAR: b > ] find-index-from ] unit-test +{ 0 char: a } [ 0 "abcdef" [ drop char: a >= ] find-index-from ] unit-test +{ 1 char: b } [ 0 "abcdef" [ drop char: a > ] find-index-from ] unit-test +{ 2 char: c } [ 1 "abcdef" [ drop char: b > ] find-index-from ] unit-test { f } [ 3 [ ] member? ] unit-test { f } [ 3 [ 1 2 ] member? ] unit-test @@ -74,11 +74,11 @@ IN: sequences.tests { t } [ [ "hello" "world" ] [ second ] keep member-eq? ] unit-test -{ 4 } [ CHAR: x "tuvwxyz" >vector index ] unit-test +{ 4 } [ char: x "tuvwxyz" >vector index ] unit-test -{ f } [ CHAR: x 5 "tuvwxyz" >vector index-from ] unit-test +{ f } [ char: x 5 "tuvwxyz" >vector index-from ] unit-test -{ f } [ CHAR: a 0 "tuvwxyz" >vector index-from ] unit-test +{ f } [ char: a 0 "tuvwxyz" >vector index-from ] unit-test { f } [ [ "Hello" { } 0.75 ] [ string? ] all? ] unit-test { t } [ [ ] [ ] all? ] unit-test @@ -163,7 +163,7 @@ IN: sequences.tests { { 1 3 2 4 } } [ { 1 2 3 4 } clone 1 2 pick exchange ] unit-test { { "" "a" "aa" "aaa" } } -[ 4 [ CHAR: a ] { } map-integers ] +[ 4 [ char: a ] { } map-integers ] unit-test { V{ 1 3 5 7 9 } } [ 10 >vector [ even? ] reject! ] unit-test @@ -279,14 +279,14 @@ unit-test { 9 } [ 10 ?last ] unit-test [ -1/0. 0 remove-nth! ] must-fail -{ "" } [ "" [ CHAR: \s = ] trim ] unit-test -{ "" } [ "" [ CHAR: \s = ] trim-head ] unit-test -{ "" } [ "" [ CHAR: \s = ] trim-tail ] unit-test -{ "" } [ " " [ CHAR: \s = ] trim-head ] unit-test -{ "" } [ " " [ CHAR: \s = ] trim-tail ] unit-test -{ "asdf" } [ " asdf " [ CHAR: \s = ] trim ] unit-test -{ "asdf " } [ " asdf " [ CHAR: \s = ] trim-head ] unit-test -{ " asdf" } [ " asdf " [ CHAR: \s = ] trim-tail ] unit-test +{ "" } [ "" [ char: \s = ] trim ] unit-test +{ "" } [ "" [ char: \s = ] trim-head ] unit-test +{ "" } [ "" [ char: \s = ] trim-tail ] unit-test +{ "" } [ " " [ char: \s = ] trim-head ] unit-test +{ "" } [ " " [ char: \s = ] trim-tail ] unit-test +{ "asdf" } [ " asdf " [ char: \s = ] trim ] unit-test +{ "asdf " } [ " asdf " [ char: \s = ] trim-head ] unit-test +{ " asdf" } [ " asdf " [ char: \s = ] trim-tail ] unit-test { 328350 } [ 100 [ sq ] map-sum ] unit-test diff --git a/core/splitting/splitting.factor b/core/splitting/splitting.factor index 841b0125b4..6730d40296 100644 --- a/core/splitting/splitting.factor +++ b/core/splitting/splitting.factor @@ -116,8 +116,8 @@ M: string string-lines 2dup [ "\r\n" member? ] find-from swapd [ over [ [ nip length ] keep ] unless [ "" subseq-as suffix! ] 2keep [ 1 + ] dip - ] dip CHAR: \r eq? [ - 2dup ?nth CHAR: \n eq? [ [ 1 + ] dip ] when + ] dip char: \r eq? [ + 2dup ?nth char: \n eq? [ [ 1 + ] dip ] when ] when ] while 2drop { } like ; diff --git a/core/strings/parser/parser-docs.factor b/core/strings/parser/parser-docs.factor index 3079f108e6..f05dd2ae9d 100644 --- a/core/strings/parser/parser-docs.factor +++ b/core/strings/parser/parser-docs.factor @@ -7,7 +7,7 @@ HELP: bad-escape HELP: escape { $values { "escape" "a single-character escape" } { "ch" "a character" } } { $description "Converts from a single-character escape code and the corresponding character." } -{ $examples { $example "USING: kernel prettyprint strings.parser ;" "CHAR: n escape CHAR: \\n = ." "t" } } ; +{ $examples { $example "USING: kernel prettyprint strings.parser ;" "char: n escape char: \\n = ." "t" } } ; HELP: parse-string { $values { "str" "a new " { $link string } } } diff --git a/core/strings/parser/parser.factor b/core/strings/parser/parser.factor index 056d6527c4..a2cf5749c4 100644 --- a/core/strings/parser/parser.factor +++ b/core/strings/parser/parser.factor @@ -9,19 +9,19 @@ ERROR: bad-escape char ; : escape ( escape -- ch ) H{ - { CHAR: a CHAR: \a } - { CHAR: b CHAR: \b } - { CHAR: e CHAR: \e } - { CHAR: f CHAR: \f } - { CHAR: n CHAR: \n } - { CHAR: r CHAR: \r } - { CHAR: t CHAR: \t } - { CHAR: s CHAR: \s } - { CHAR: v CHAR: \v } - { CHAR: \s CHAR: \s } - { CHAR: 0 CHAR: \0 } - { CHAR: \\ CHAR: \\ } - { CHAR: \" CHAR: \" } + { char: a char: \a } + { char: b char: \b } + { char: e char: \e } + { char: f char: \f } + { char: n char: \n } + { char: r char: \r } + { char: t char: \t } + { char: s char: \s } + { char: v char: \v } + { char: \s char: \s } + { char: 0 char: \0 } + { char: \\ char: \\ } + { char: \" char: \" } } ?at [ bad-escape ] unless ; SYMBOL: name>char-hook @@ -35,7 +35,7 @@ name>char-hook [ : unicode-escape ( str -- ch str' ) "{" ?head-slice [ - CHAR: } over index cut-slice [ + char: } over index cut-slice [ dup hex> [ nip ] [ @@ -48,8 +48,8 @@ name>char-hook [ : next-escape ( str -- ch str' ) unclip-slice { - { CHAR: u [ unicode-escape ] } - { CHAR: x [ hex-escape ] } + { char: u [ unicode-escape ] } + { char: x [ hex-escape ] } [ escape swap ] } case ; @@ -60,7 +60,7 @@ name>char-hook [ [ cut-slice [ append! ] dip rest-slice next-escape [ suffix! ] dip - CHAR: \\ over index (unescape-string) + char: \\ over index (unescape-string) ] [ append! ] if* ; @@ -68,7 +68,7 @@ name>char-hook [ PRIVATE> : unescape-string ( str -- str' ) - CHAR: \\ over index [ + char: \\ over index [ [ [ length ] keep ] dip (unescape-string) ] when* "" like ; @@ -113,7 +113,7 @@ DEFER: (parse-string) : parse-found-token ( accum lexer i elt -- ) { sbuf lexer fixnum fixnum } declare [ over lexer-subseq pick push-all ] dip - CHAR: \ = [ + char: \ = [ dup dup [ next-char ] bi@ [ [ pick push ] bi@ ] [ drop 2dup next-line% ] if* @@ -129,7 +129,7 @@ DEFER: (parse-string) parse-found-token ] [ drop 2dup next-line% - CHAR: \n pick push + char: \n pick push (parse-string) ] if* ] [ diff --git a/core/strings/strings-tests.factor b/core/strings/strings-tests.factor index 28feb10d15..9caf7d88dc 100644 --- a/core/strings/strings-tests.factor +++ b/core/strings/strings-tests.factor @@ -3,7 +3,7 @@ kernel.private literals make math math.order memory namespaces prettyprint sbufs sequences strings strings.private tools.test vectors ; -{ CHAR: b } [ 1 >bignum "abc" nth ] unit-test +{ char: b } [ 1 >bignum "abc" nth ] unit-test { } [ 10 [ [ -1000000 ] ignore-errors ] times ] unit-test @@ -23,7 +23,7 @@ vectors ; { "Beginning" } [ "Beginning and end" 9 head ] unit-test -{ f } [ CHAR: I "team" member? ] unit-test +{ f } [ char: I "team" member? ] unit-test { t } [ "ea" "team" subseq? ] unit-test { f } [ "actore" "Factor" subseq? ] unit-test @@ -39,12 +39,12 @@ vectors ; { "Replacing+spaces+with+plus" } [ "Replacing spaces with plus" - [ dup CHAR: \s = [ drop CHAR: + ] when ] map + [ dup char: \s = [ drop char: + ] when ] map ] unit-test -{ "05" } [ "5" 2 CHAR: 0 pad-head ] unit-test -{ "666" } [ "666" 2 CHAR: 0 pad-head ] unit-test +{ "05" } [ "5" 2 char: 0 pad-head ] unit-test +{ "666" } [ "666" 2 char: 0 pad-head ] unit-test [ 1 "" nth ] must-fail [ -6 "hello" nth ] must-fail @@ -75,17 +75,17 @@ unit-test { { - CHAR: h + char: h 0x1234 - CHAR: l + char: l 0x4321 - CHAR: o + char: o 0x654321 - CHAR: w - CHAR: o - CHAR: r - CHAR: l - CHAR: d + char: w + char: o + char: r + char: l + char: d } } [ "s" get >array @@ -100,7 +100,7 @@ unit-test ! Make sure aux vector is not shared { "\udeadbe" } [ "\udeadbe" clone - CHAR: \u123456 over clone set-first + char: \u123456 over clone set-first ] unit-test ! Regressions @@ -123,7 +123,7 @@ unit-test { t } [ 10000 [ drop - 300 100 CHAR: \u123456 + 300 100 char: \u123456 [ clone resize-string first ] keep = ] all-integers? ] unit-test diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index a61fd1c4d0..788e390381 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -174,7 +174,7 @@ 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: POSTPONE: " "escape" } @@ -589,17 +589,17 @@ HELP: IN: { $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 POSTPONE: USE: } " and " { $link POSTPONE: USING: } " declarations." } ; -HELP: CHAR: -{ $syntax "CHAR: token" } +HELP: char: +{ $syntax "char: token" } { $values { "token" "a literal character, escape code, or Unicode code point name" } } { $description "Adds a Unicode code point to the parse tree." } { $examples { $code - "CHAR: x" - "CHAR: \\u000032" - "CHAR: \\u{exclamation-mark}" - "CHAR: exclamation-mark" - "CHAR: ugaritic-letter-samka" + "char: x" + "char: \\u000032" + "char: \\u{exclamation-mark}" + "char: exclamation-mark" + "char: ugaritic-letter-samka" } } ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index 0e21d311a5..eeae1f13f2 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -80,7 +80,7 @@ IN: bootstrap.syntax "f" [ f suffix! ] define-core-syntax - "CHAR:" [ + "char:" [ lexer get parse-raw [ "token" throw-unexpected-eof ] unless* { { [ dup length 1 = ] [ first ] } { [ "\\" ?head ] [ next-escape >string "" assert= ] } diff --git a/core/system/system.factor b/core/system/system.factor index 99628b2b69..4cc2885c7b 100644 --- a/core/system/system.factor +++ b/core/system/system.factor @@ -27,10 +27,10 @@ UNION: unix macosx linux ; : vm-git-label ( -- string ) \ vm-git-label get-global ; : vm-git-ref ( -- string ) - vm-git-label CHAR: - over last-index head ; + vm-git-label char: - over last-index head ; : vm-git-id ( -- string ) - vm-git-label CHAR: - over last-index 1 + tail ; + vm-git-label char: - over last-index 1 + tail ; : vm-compiler ( -- string ) \ vm-compiler get-global ; diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index f77c32d57e..fef4f162b8 100644 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -40,7 +40,7 @@ M: string vocab-path ( string -- path/f ) PRIVATE> : vocab-dir ( vocab -- dir ) - vocab-name H{ { CHAR: . CHAR: / } } substitute ; + vocab-name H{ { char: . char: / } } substitute ; : append-vocab-dir ( vocab str/f -- path ) [ vocab-name "." split ] dip diff --git a/core/vocabs/vocabs.factor b/core/vocabs/vocabs.factor index be71fa0804..b2ea32504a 100644 --- a/core/vocabs/vocabs.factor +++ b/core/vocabs/vocabs.factor @@ -111,7 +111,7 @@ ERROR: no-vocab name ; swap [ drop t ] [ 2dup = [ 2drop t ] [ 2dup head? [ - length swap ?nth CHAR: . = + length swap ?nth char: . = ] [ 2drop f ] if ] if ] if-empty ; diff --git a/extra/alien/fortran/fortran.factor b/extra/alien/fortran/fortran.factor index 4f0633b5d0..c079968219 100755 --- a/extra/alien/fortran/fortran.factor +++ b/extra/alien/fortran/fortran.factor @@ -34,7 +34,7 @@ library-fortran-abis [ H{ } clone ] initialize : lowercase-name-with-underscore ( name -- name' ) >lower "_" append ; : lowercase-name-with-extra-underscore ( name -- name' ) - >lower CHAR: _ over member? + >lower char: _ over member? [ "__" append ] [ "_" append ] if ; HOOK: fortran-c-abi fortran-abi ( -- abi ) @@ -346,7 +346,7 @@ M: character-type () [ (fortran-result>) ] } cond ; -: letters ( -- seq ) CHAR: a CHAR: z [a,b] ; +: letters ( -- seq ) char: a char: z [a,b] ; : (shuffle-map) ( return parameters -- ret par ) [ diff --git a/extra/benchmark/fannkuch/fannkuch.factor b/extra/benchmark/fannkuch/fannkuch.factor index d07824e796..383657bed2 100644 --- a/extra/benchmark/fannkuch/fannkuch.factor +++ b/extra/benchmark/fannkuch/fannkuch.factor @@ -16,7 +16,7 @@ IN: benchmark.fannkuch ] count ; inline : write-permutation ( perm -- ) - [ CHAR: 0 + write1 ] each nl ; inline + [ char: 0 + write1 ] each nl ; inline : fannkuch-step ( counter max-flips perm -- counter max-flips ) pick 30 < [ [ 1 + ] [ ] [ dup write-permutation ] tri* ] when diff --git a/extra/benchmark/fasta/fasta.factor b/extra/benchmark/fasta/fasta.factor index f602db3b03..2f4e11e27a 100644 --- a/extra/benchmark/fasta/fasta.factor +++ b/extra/benchmark/fasta/fasta.factor @@ -19,30 +19,30 @@ CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACC CONSTANT: IUB { - { CHAR: a 0.27 } - { CHAR: c 0.12 } - { CHAR: g 0.12 } - { CHAR: t 0.27 } + { char: a 0.27 } + { char: c 0.12 } + { char: g 0.12 } + { char: t 0.27 } - { CHAR: B 0.02 } - { CHAR: D 0.02 } - { CHAR: H 0.02 } - { CHAR: K 0.02 } - { CHAR: M 0.02 } - { CHAR: N 0.02 } - { CHAR: R 0.02 } - { CHAR: S 0.02 } - { CHAR: V 0.02 } - { CHAR: W 0.02 } - { CHAR: Y 0.02 } + { char: B 0.02 } + { char: D 0.02 } + { char: H 0.02 } + { char: K 0.02 } + { char: M 0.02 } + { char: N 0.02 } + { char: R 0.02 } + { char: S 0.02 } + { char: V 0.02 } + { char: W 0.02 } + { char: Y 0.02 } } CONSTANT: homo-sapiens { - { CHAR: a 0.3029549426680 } - { CHAR: c 0.1979883004921 } - { CHAR: g 0.1975473066391 } - { CHAR: t 0.3015094502008 } + { char: a 0.3029549426680 } + { char: c 0.1979883004921 } + { char: g 0.1975473066391 } + { char: t 0.3015094502008 } } TYPED: make-cumulative ( freq -- chars: byte-array floats: double-array ) diff --git a/extra/benchmark/fib7/fib7.factor b/extra/benchmark/fib7/fib7.factor index 9e0dab0fd4..3c9febcd7c 100644 --- a/extra/benchmark/fib7/fib7.factor +++ b/extra/benchmark/fib7/fib7.factor @@ -3,7 +3,7 @@ IN: benchmark.fib7 :: matrix-fib ( m -- n ) m 0 >= [ m throw ] unless - m 2 >base [ CHAR: 1 = ] { } map-as :> bits + m 2 >base [ char: 1 = ] { } map-as :> bits 1 :> a! 0 :> b! 1 :> c! bits [ [ diff --git a/extra/benchmark/knucleotide/knucleotide.factor b/extra/benchmark/knucleotide/knucleotide.factor index 67f563849c..06147f9c28 100644 --- a/extra/benchmark/knucleotide/knucleotide.factor +++ b/extra/benchmark/knucleotide/knucleotide.factor @@ -15,7 +15,7 @@ CONSTANT: knucleotide-in "vocab:benchmark/knucleotide/knucleotide-input.txt" : read-input ( -- input ) discard-lines ">" read-until drop - CHAR: \n swap remove >upper ; + char: \n swap remove >upper ; : handle-table ( inputs n -- ) clump diff --git a/extra/benchmark/make/make.factor b/extra/benchmark/make/make.factor index b28c202c8b..dd69c777f9 100644 --- a/extra/benchmark/make/make.factor +++ b/extra/benchmark/make/make.factor @@ -6,7 +6,7 @@ USING: kernel make math sequences ; IN: benchmark.make : make-strings ( n -- seq ) - [ [ CHAR: a , ] times ] "" make ; + [ [ char: a , ] times ] "" make ; : make-arrays ( n -- seq ) [ % ] { } make ; diff --git a/extra/benchmark/regexp/regexp.factor b/extra/benchmark/regexp/regexp.factor index 823c4899b9..7aaf70d519 100644 --- a/extra/benchmark/regexp/regexp.factor +++ b/extra/benchmark/regexp/regexp.factor @@ -7,7 +7,7 @@ IN: benchmark.regexp : regexp-benchmark ( -- ) 200 20,000 [ number>string ] map - 200 [ 1 + CHAR: a ] map + 200 [ 1 + char: a ] map '[ _ R/ \d+/ [ matches? ] curry all? t assert= _ R/ [a]+/ [ matches? ] curry all? t assert= diff --git a/extra/benchmark/sockets/sockets.factor b/extra/benchmark/sockets/sockets.factor index b5497db6f6..ee9e74619f 100644 --- a/extra/benchmark/sockets/sockets.factor +++ b/extra/benchmark/sockets/sockets.factor @@ -19,7 +19,7 @@ CONSTANT: number-of-requests 1000 : server-loop ( server -- ) dup accept drop [ [ - read1 CHAR: x = [ + read1 char: x = [ server get dispose ] [ number-of-requests @@ -35,16 +35,16 @@ CONSTANT: number-of-requests 1000 : simple-client ( -- ) [ server-addr ascii [ - CHAR: b write1 flush + char: b write1 flush number-of-requests - [ CHAR: a dup write1 flush read1 assert= ] times + [ char: a dup write1 flush read1 assert= ] times ] with-client ] try counter get count-down ; : stop-server ( -- ) server-addr ascii [ - CHAR: x write1 + char: x write1 ] with-client ; : clients ( n -- ) diff --git a/extra/bencode/bencode.factor b/extra/bencode/bencode.factor index 2347595ae4..52ba8b0c04 100644 --- a/extra/bencode/bencode.factor +++ b/extra/bencode/bencode.factor @@ -23,7 +23,7 @@ M: assoc >bencode DEFER: read-bencode : read-integer ( -- obj ) - "e" read-until CHAR: e assert= string>number ; + "e" read-until char: e assert= string>number ; : read-list ( -- obj ) [ read-bencode dup ] [ ] produce nip ; @@ -34,15 +34,15 @@ DEFER: read-bencode ] [ ] produce nip >hashtable ; : read-string ( prefix -- obj ) - ":" read-until CHAR: : assert= swap prefix + ":" read-until char: : assert= swap prefix string>number read ascii decode ; : read-bencode ( -- obj ) read1 { - { CHAR: i [ read-integer ] } - { CHAR: l [ read-list ] } - { CHAR: d [ read-dictionary ] } - { CHAR: e [ f ] } + { char: i [ read-integer ] } + { char: l [ read-list ] } + { char: d [ read-dictionary ] } + { char: e [ f ] } [ read-string ] } case ; diff --git a/extra/c/lexer/lexer-tests.factor b/extra/c/lexer/lexer-tests.factor index 1927a72d44..296ea5ef71 100644 --- a/extra/c/lexer/lexer-tests.factor +++ b/extra/c/lexer/lexer-tests.factor @@ -51,32 +51,32 @@ IN: c.lexer.tests { f } [ "\"abc\" asdf" - [ CHAR: \ CHAR: \" take-quoted-string drop ] [ "asdf" take-sequence ] bi + [ char: \ char: \" take-quoted-string drop ] [ "asdf" take-sequence ] bi ] unit-test { "abc\\\"def" } [ "\"abc\\\"def\" asdf" - CHAR: \ CHAR: \" take-quoted-string + char: \ char: \" take-quoted-string ] unit-test { "asdf" } [ "\"abc\" asdf" - [ CHAR: \ CHAR: \" take-quoted-string drop ] + [ char: \ char: \" take-quoted-string drop ] [ skip-whitespace "asdf" take-sequence ] bi ] unit-test { f } [ "\"abc asdf" - CHAR: \ CHAR: \" take-quoted-string + char: \ char: \" take-quoted-string ] unit-test { "\"abc" } [ "\"abc asdf" - [ CHAR: \ CHAR: \" take-quoted-string drop ] + [ char: \ char: \" take-quoted-string drop ] [ "\"abc" take-sequence ] bi ] unit-test @@ -87,7 +87,7 @@ IN: c.lexer.tests [ "" take-token ] unit-test { "abcd e \\\"f g" } -[ "\"abcd e \\\"f g\"" CHAR: \ CHAR: \" take-token* ] unit-test +[ "\"abcd e \\\"f g\"" char: \ char: \" take-token* ] unit-test { "123" } [ "123jjj" take-c-integer ] unit-test diff --git a/extra/c/lexer/lexer.factor b/extra/c/lexer/lexer.factor index 1918d73de8..df544a9ac2 100644 --- a/extra/c/lexer/lexer.factor +++ b/extra/c/lexer/lexer.factor @@ -20,7 +20,7 @@ IN: c.lexer dup "//" take-sequence [ [ [ - { [ current CHAR: \n = ] [ sequence-parse-end? ] } 1|| + { [ current char: \n = ] [ sequence-parse-end? ] } 1|| ] take-until ] [ advance drop @@ -40,7 +40,7 @@ IN: c.lexer : take-define-identifier ( sequence-parser -- string ) skip-whitespace/comments - [ current { [ blank? ] [ CHAR: ( = ] } 1|| ] take-until ; + [ current { [ blank? ] [ char: ( = ] } 1|| ] take-until ; :: take-quoted-string ( sequence-parser escape-char quote-char -- string ) sequence-parser n>> :> start-n @@ -69,18 +69,18 @@ IN: c.lexer } case ; : take-token ( sequence-parser -- string/f ) - CHAR: \ CHAR: \" take-token* ; + char: \ char: \" take-token* ; : c-identifier-begin? ( ch -- ? ) - CHAR: a CHAR: z [a,b] - CHAR: A CHAR: Z [a,b] - { CHAR: _ } 3append member? ; + char: a char: z [a,b] + char: A char: Z [a,b] + { char: _ } 3append member? ; : c-identifier-ch? ( ch -- ? ) - CHAR: a CHAR: z [a,b] - CHAR: A CHAR: Z [a,b] - CHAR: 0 CHAR: 9 [a,b] - { CHAR: _ } 4 nappend member? ; + char: a char: z [a,b] + char: A char: Z [a,b] + char: 0 char: 9 [a,b] + { char: _ } 4 nappend member? ; : (take-c-identifier) ( sequence-parser -- string/f ) dup current c-identifier-begin? [ diff --git a/extra/c/preprocessor/preprocessor.factor b/extra/c/preprocessor/preprocessor.factor index 1a128c57b3..4d57c30103 100644 --- a/extra/c/preprocessor/preprocessor.factor +++ b/extra/c/preprocessor/preprocessor.factor @@ -73,8 +73,8 @@ ERROR: header-file-missing path ; : handle-include ( preprocessor-state sequence-parser -- ) skip-whitespace/comments advance dup previous { - { CHAR: < [ CHAR: > take-until-object read-standard-include ] } - { CHAR: \" [ CHAR: \" take-until-object read-local-include ] } + { char: < [ char: > take-until-object read-standard-include ] } + { char: \" [ char: \" take-until-object read-local-include ] } [ bad-include-line ] } case ; @@ -85,7 +85,7 @@ ERROR: header-file-missing path ; : take-define-identifier ( sequence-parser -- string ) skip-whitespace/comments - [ current { [ blank? ] [ CHAR: ( = ] } 1|| ] take-until ; + [ current { [ blank? ] [ char: ( = ] } 1|| ] take-until ; :: handle-define ( preprocessor-state sequence-parser -- ) sequence-parser take-define-identifier :> ident @@ -165,7 +165,7 @@ ERROR: header-file-missing path ; ] if ; : preprocess-line ( preprocessor-state sequence-parser -- ) - skip-whitespace/comments dup current CHAR: # = + skip-whitespace/comments dup current char: # = [ parse-directive-line ] [ swap processing-disabled?>> [ drop ] [ write-full nl ] if ] if ; diff --git a/extra/cgi/cgi.factor b/extra/cgi/cgi.factor index 5e93827579..9541d4d19b 100644 --- a/extra/cgi/cgi.factor +++ b/extra/cgi/cgi.factor @@ -11,7 +11,7 @@ IN: cgi : query-string ( string -- assoc ) query>assoc [ nip ] assoc-filter [ - [ [ CHAR: \s = ] trim ] + [ [ char: \s = ] trim ] [ dup string? [ 1array ] when ] bi* ] assoc-map ; diff --git a/extra/codebook/codebook.factor b/extra/codebook/codebook.factor index f0c48124e8..0e283f0d33 100644 --- a/extra/codebook/codebook.factor +++ b/extra/codebook/codebook.factor @@ -61,7 +61,7 @@ TUPLE: code-file { { [ dup alpha? ] [ 1string ] } { [ dup digit? ] [ 1string ] } - [ >hex 6 CHAR: 0 pad-head "_" "_" surround ] + [ >hex 6 char: 0 pad-head "_" "_" surround ] } cond ; : file-html-name ( name -- name ) @@ -75,7 +75,7 @@ TUPLE: code-file ! insert zero-width non-joiner between all characters so words can wrap anywhere : zwnj ( string -- s|t|r|i|n|g ) - [ CHAR: \u00200c "" 2sequence ] { } map-as concat ; + [ char: \u00200c "" 2sequence ] { } map-as concat ; ! We wrap every line in because Kindle tends to forget the font when ! moving back pages @@ -86,7 +86,7 @@ TUPLE: code-file "\n" 2array ; : line#>string ( i line#len -- i-string ) - [ number>string ] [ CHAR: \s pad-head ] bi* ; + [ number>string ] [ char: \s pad-head ] bi* ; :: code>html ( dir file -- page ) file name>> :> name diff --git a/extra/color-table/color-table.factor b/extra/color-table/color-table.factor index b6d419d2e6..fc6f07dac2 100644 --- a/extra/color-table/color-table.factor +++ b/extra/color-table/color-table.factor @@ -11,7 +11,7 @@ SINGLETON: color-renderer ] +CONSTANT: full-block-string $[ 10 char: full-block ] PRIVATE> diff --git a/extra/colors/flex-hex/flex-hex.factor b/extra/colors/flex-hex/flex-hex.factor index 57a6a210ef..6f5d756a1f 100644 --- a/extra/colors/flex-hex/flex-hex.factor +++ b/extra/colors/flex-hex/flex-hex.factor @@ -9,19 +9,19 @@ IN: colors.flex-hex diff --git a/extra/couchdb/couchdb.factor b/extra/couchdb/couchdb.factor index 15db1920e1..4ce2e56a44 100644 --- a/extra/couchdb/couchdb.factor +++ b/extra/couchdb/couchdb.factor @@ -74,7 +74,7 @@ CONSTANT: default-uuids-to-cache 100 default-couch-host default-couch-port ; : (server-url) ( server -- ) - "http://" % [ host>> % ] [ CHAR: : , port>> number>string % ] bi CHAR: / , ; inline + "http://" % [ host>> % ] [ char: : , port>> number>string % ] bi char: / , ; inline : server-url ( server -- url ) [ (server-url) ] "" make ; @@ -102,7 +102,7 @@ TUPLE: db { server server } { name string } ; C: db : (db-url) ( db -- ) - [ server>> server-url % ] [ name>> % ] bi CHAR: / , ; inline + [ server>> server-url % ] [ name>> % ] bi char: / , ; inline : db-url ( db -- url ) [ (db-url) ] "" make ; diff --git a/extra/cpu/8080/emulator/emulator.factor b/extra/cpu/8080/emulator/emulator.factor index 9aab8af27b..d13fd260cf 100644 --- a/extra/cpu/8080/emulator/emulator.factor +++ b/extra/cpu/8080/emulator/emulator.factor @@ -512,34 +512,34 @@ ERROR: undefined-8080-opcode n ; : cpu. ( cpu -- ) { - [ " PC: " write pc>> >hex 4 CHAR: \s pad-head write ] - [ " B: " write b>> >hex 2 CHAR: \s pad-head write ] - [ " C: " write c>> >hex 2 CHAR: \s pad-head write ] - [ " D: " write d>> >hex 2 CHAR: \s pad-head write ] - [ " E: " write e>> >hex 2 CHAR: \s pad-head write ] - [ " F: " write f>> >hex 2 CHAR: \s pad-head write ] - [ " H: " write h>> >hex 2 CHAR: \s pad-head write ] - [ " L: " write l>> >hex 2 CHAR: \s pad-head write ] - [ " A: " write a>> >hex 2 CHAR: \s pad-head write ] - [ " SP: " write sp>> >hex 4 CHAR: \s pad-head write ] - [ " cycles: " write cycles>> number>string 5 CHAR: \s pad-head write ] + [ " PC: " write pc>> >hex 4 char: \s pad-head write ] + [ " B: " write b>> >hex 2 char: \s pad-head write ] + [ " C: " write c>> >hex 2 char: \s pad-head write ] + [ " D: " write d>> >hex 2 char: \s pad-head write ] + [ " E: " write e>> >hex 2 char: \s pad-head write ] + [ " F: " write f>> >hex 2 char: \s pad-head write ] + [ " H: " write h>> >hex 2 char: \s pad-head write ] + [ " L: " write l>> >hex 2 char: \s pad-head write ] + [ " A: " write a>> >hex 2 char: \s pad-head write ] + [ " SP: " write sp>> >hex 4 char: \s pad-head write ] + [ " cycles: " write cycles>> number>string 5 char: \s pad-head write ] [ bl peek-instruction name>> write bl ] [ nl drop ] } cleave ; : cpu*. ( cpu -- ) { - [ " PC: " write pc>> >hex 4 CHAR: \s pad-head write ] - [ " B: " write b>> >hex 2 CHAR: \s pad-head write ] - [ " C: " write c>> >hex 2 CHAR: \s pad-head write ] - [ " D: " write d>> >hex 2 CHAR: \s pad-head write ] - [ " E: " write e>> >hex 2 CHAR: \s pad-head write ] - [ " F: " write f>> >hex 2 CHAR: \s pad-head write ] - [ " H: " write h>> >hex 2 CHAR: \s pad-head write ] - [ " L: " write l>> >hex 2 CHAR: \s pad-head write ] - [ " A: " write a>> >hex 2 CHAR: \s pad-head write ] - [ " SP: " write sp>> >hex 4 CHAR: \s pad-head write ] - [ " cycles: " write cycles>> number>string 5 CHAR: \s pad-head write ] + [ " PC: " write pc>> >hex 4 char: \s pad-head write ] + [ " B: " write b>> >hex 2 char: \s pad-head write ] + [ " C: " write c>> >hex 2 char: \s pad-head write ] + [ " D: " write d>> >hex 2 char: \s pad-head write ] + [ " E: " write e>> >hex 2 char: \s pad-head write ] + [ " F: " write f>> >hex 2 char: \s pad-head write ] + [ " H: " write h>> >hex 2 char: \s pad-head write ] + [ " L: " write l>> >hex 2 char: \s pad-head write ] + [ " A: " write a>> >hex 2 char: \s pad-head write ] + [ " SP: " write sp>> >hex 4 char: \s pad-head write ] + [ " cycles: " write cycles>> number>string 5 char: \s pad-head write ] [ nl drop ] } cleave ; diff --git a/extra/crypto/passwd-md5/passwd-md5.factor b/extra/crypto/passwd-md5/passwd-md5.factor index 0f17e8459c..778985b497 100644 --- a/extra/crypto/passwd-md5/passwd-md5.factor +++ b/extra/crypto/passwd-md5/passwd-md5.factor @@ -23,7 +23,7 @@ PRIVATE> [ 16 / ceiling swap concat ] keep head-slice append password [ length make-bits ] [ first ] bi - '[ CHAR: \0 _ ? ] "" map-as append + '[ char: \0 _ ? ] "" map-as append md5 checksum-bytes :> final! 1000 [ diff --git a/extra/ctags/ctags.factor b/extra/ctags/ctags.factor index cc83aa13d8..b3c903c3ca 100644 --- a/extra/ctags/ctags.factor +++ b/extra/ctags/ctags.factor @@ -15,8 +15,8 @@ IN: ctags : ctag ( word path lineno -- str ) [ - [ present % CHAR: \t , ] - [ normalize-path % CHAR: \t , ] + [ present % char: \t , ] + [ normalize-path % char: \t , ] [ number>string % ] tri* ] "" make ; diff --git a/extra/cuda/ptx/ptx.factor b/extra/cuda/ptx/ptx.factor index cd0969047b..84582d17a5 100644 --- a/extra/cuda/ptx/ptx.factor +++ b/extra/cuda/ptx/ptx.factor @@ -345,7 +345,7 @@ GENERIC: write-ptx-operand ( operand -- ) M: string write-ptx-operand write ; M: integer write-ptx-operand number>string write ; -M: float write-ptx-operand "0d" write double>bits >hex 16 CHAR: 0 pad-head write ; +M: float write-ptx-operand "0d" write double>bits >hex 16 char: 0 pad-head write ; M: ptx-negation write-ptx-operand "!" write var>> write ; M: ptx-vector write-ptx-operand "{" write diff --git a/extra/cuesheet/cuesheet.factor b/extra/cuesheet/cuesheet.factor index 8f5b86a599..f7c669e09c 100644 --- a/extra/cuesheet/cuesheet.factor +++ b/extra/cuesheet/cuesheet.factor @@ -55,10 +55,10 @@ ERROR: unknown-syntax syntax ; > last tracks>> last ; diff --git a/extra/curses/curses.factor b/extra/curses/curses.factor index a6629650ad..24e49ba4b4 100644 --- a/extra/curses/curses.factor +++ b/extra/curses/curses.factor @@ -328,18 +328,18 @@ PRIVATE> : waddch ( ch window -- ) ptr>> (waddch) ; : addch ( ch -- ) current-window get waddch ; -: wcnl ( window -- ) [ CHAR: \n ] dip waddch ; +: wcnl ( window -- ) [ char: \n ] dip waddch ; : cnl ( -- ) current-window get wcnl ; : wcwrite ( string window -- ) ptr>> (wcwrite) ; : cwrite ( string -- ) current-window get wcwrite ; : wcprint ( string window -- ) - ptr>> [ (wcwrite) ] [ CHAR: \n swap (waddch) ] bi ; + ptr>> [ (wcwrite) ] [ char: \n swap (waddch) ] bi ; : cprint ( string -- ) current-window get wcprint ; : wcprintf ( string window -- ) - ptr>> [ (wcwrite) ] [ CHAR: \n swap (waddch) ] + ptr>> [ (wcwrite) ] [ char: \n swap (waddch) ] [ (wcrefresh) ] tri ; : cprintf ( string -- ) current-window get wcprintf ; diff --git a/extra/curses/listener/listener.factor b/extra/curses/listener/listener.factor index bffe599a60..f6c7ecaeb6 100644 --- a/extra/curses/listener/listener.factor +++ b/extra/curses/listener/listener.factor @@ -16,7 +16,7 @@ IN: curses.listener ; : delchar ( y x -- ) - [ cmove CHAR: space addch ] [ cmove ] 2bi ; + [ cmove char: space addch ] [ cmove ] 2bi ; : move-left ( -- ) get-yx [ @@ -27,7 +27,7 @@ IN: curses.listener building get [ pop* move-left ] unless-empty ; : curses-stream-readln ( -- ) - getch dup CHAR: \n = [ addch ] [ + getch dup char: \n = [ addch ] [ { { KEY_MOUSE [ handle-mouse-click ] } { 127 [ handle-backspace ] } diff --git a/extra/decimals/decimals.factor b/extra/decimals/decimals.factor index db850a25aa..2c3887580b 100644 --- a/extra/decimals/decimals.factor +++ b/extra/decimals/decimals.factor @@ -13,8 +13,8 @@ C: decimal : string>decimal ( string -- decimal ) "." split1 - [ [ CHAR: 0 = ] trim-head [ "0" ] when-empty ] - [ [ CHAR: 0 = ] trim-tail [ "" ] when-empty ] bi* + [ [ char: 0 = ] trim-head [ "0" ] when-empty ] + [ [ char: 0 = ] trim-tail [ "" ] when-empty ] bi* [ append string>number ] [ nip length neg ] 2bi ; : parse-decimal ( -- decimal ) scan-token string>decimal ; diff --git a/extra/enigma/enigma.factor b/extra/enigma/enigma.factor index cc03fef19b..c0714909e6 100644 --- a/extra/enigma/enigma.factor +++ b/extra/enigma/enigma.factor @@ -36,10 +36,10 @@ TUPLE: enigma cogs prev-cogs reflector ; enigma cogs>> :> cogs enigma reflector>> :> reflector text >lower [ - CHAR: a mod dup special? [ + char: a mod dup special? [ ln 1 + ln! cogs [ nth ] each reflector nth - cogs reverse [ index ] each CHAR: a + + cogs reverse [ index ] each char: a + cogs length [ 6 * 1 + ln mod zero? ] filter cogs [ unclip prefix ] change-nths ] unless diff --git a/extra/fjsc/fjsc.factor b/extra/fjsc/fjsc.factor index 035adb9742..3bd24296de 100644 --- a/extra/fjsc/fjsc.factor +++ b/extra/fjsc/fjsc.factor @@ -32,8 +32,8 @@ TUPLE: ast-hashtable elements ; [ { [ blank? not ] - [ CHAR: \" = not ] - [ CHAR: ; = not ] + [ char: \" = not ] + [ char: ; = not ] [ LETTER? not ] [ letter? not ] [ identifier-middle? not ] @@ -59,8 +59,8 @@ DEFER: expression-parser [ { [ blank? not ] - [ CHAR: ) = not ] - [ CHAR: - = not ] + [ char: ) = not ] + [ char: - = not ] } 1&& ] satisfy repeat1 [ >string ] action ; @@ -115,7 +115,7 @@ DEFER: expression-parser [ "!" token hide , [ - dup CHAR: \n = swap CHAR: \r = or not + dup char: \n = swap char: \r = or not ] satisfy repeat0 , ] seq* [ drop ast-comment boa ] action ; diff --git a/extra/flip-text/flip-text.factor b/extra/flip-text/flip-text.factor index ee25928d6c..a1fabd4790 100644 --- a/extra/flip-text/flip-text.factor +++ b/extra/flip-text/flip-text.factor @@ -8,84 +8,84 @@ IN: flip-text } - { CHAR: _ 0x203E } + { char: A 0x2200 } + { char: B 0x10412 } + { char: C 0x03FD } + { char: D 0x15E1 } + { char: E 0x018E } + { char: F 0x2132 } + { char: G 0x2141 } + ! { char: H char: H } + ! { char: I char: I } + { char: J 0x148B } + { char: K 0x004B } + { char: L 0x2142 } + { char: M char: W } + ! { char: N char: N } + ! { char: O char: O } + { char: P 0x0500 } + { char: Q 0x038C } + { char: R 0x1D1A } + ! { char: S char: S } + { char: T 0x22A5 } + { char: U 0x0548 } + { char: V 0x039B } + { char: W char: M } + ! { char: X char: X } + { char: Y 0x2144 } + ! { char: Z char: Z } + { char: a 0x0250 } + { char: b char: q } + { char: c 0x0254 } + { char: d char: p } + { char: e 0x01DD } + { char: f 0x025F } + { char: g 0x1D77 } ! or 0183 + { char: h 0x0265 } + { char: i 0x1D09 } ! or 0131 + { char: j 0x027E } ! or 1E37 + { char: k 0x029E } + { char: l 0x0283 } ! or 237 + { char: m 0x026F } + { char: n char: u } + ! { char: o char: o } + { char: p char: d } + { char: q char: b } + { char: r 0x0279 } + ! { char: s char: s } + { char: t 0x0287 } + { char: u char: n } + { char: v 0x028C } + { char: w 0x028D } + { char: y 0x028E } + ! { char: z char: z } + ! { char: 0 char: 0 } + { char: 1 0x21C2 } + { char: 2 0x1105 } + { char: 3 0x0190 } ! or 1110 + { char: 4 0x152D } + ! { char: 5 char: 5 } + { char: 6 char: 9 } + { char: 7 0x2C62 } + ! { char: 8 char: 8 } + { char: 9 char: 6 } + { char: & 0x214B } + { char: ! 0x00A1 } + { char: \" 0x201E } + { char: . 0x02D9 } + { char: ; 0x061B } + { char: [ char: ] } + { char: ( char: ) } + { char: { char: } } + { char: ? 0x00BF } + { char: ! 0x00A1 } + { char: ' char: , } + { char: < char: > } + { char: _ 0x203E } { 0x203F 0x2040 } { 0x2045 0x2046 } { 0x2234 0x2235 } - { CHAR: \r CHAR: \n } + { char: \r char: \n } } CHARS [ CHARS set-at ] assoc-each diff --git a/extra/forestdb/paths/paths.factor b/extra/forestdb/paths/paths.factor index 5eb335290d..7acc535fc4 100644 --- a/extra/forestdb/paths/paths.factor +++ b/extra/forestdb/paths/paths.factor @@ -27,7 +27,7 @@ ERROR: not-a-string-number string ; : change-string-number ( string quot -- string' ) [ [ string>number ] dip call number>string ] 2keep drop - length CHAR: 0 pad-head ; inline + length char: 0 pad-head ; inline : next-vnode-name ( string -- string' ) [ @@ -37,7 +37,7 @@ ERROR: not-a-string-number string ; ] "" append-outputs-as ; : trim-head-zeros ( string -- string' ) - [ CHAR: 0 = ] trim-head 1 CHAR: 0 pad-head ; + [ char: 0 = ] trim-head 1 char: 0 pad-head ; : canonical-fdb-name ( string -- string' ) ensure-fdb-filename diff --git a/extra/fuel/pprint/pprint.factor b/extra/fuel/pprint/pprint.factor index a9bce92311..c5530a452a 100644 --- a/extra/fuel/pprint/pprint.factor +++ b/extra/fuel/pprint/pprint.factor @@ -12,7 +12,7 @@ GENERIC: fuel-pprint ( obj -- ) url present ; unclip swap "\t" split first4 gopher-link boa ; M: gopher-link >url - dup type>> CHAR: h = [ + dup type>> char: h = [ selector>> "URL:" ?head drop ] [ { @@ -78,7 +78,7 @@ M: gopher-link >url ] if >url ; : gopher-link. ( gopher-link -- ) - dup type>> CHAR: i = [ + dup type>> char: i = [ name>> print ] [ [ name>> ] keep [ diff --git a/extra/gpu/demos/bunny/bunny.factor b/extra/gpu/demos/bunny/bunny.factor index 88057edb89..a8b0f3c2da 100644 --- a/extra/gpu/demos/bunny/bunny.factor +++ b/extra/gpu/demos/bunny/bunny.factor @@ -93,8 +93,8 @@ UNIFORM-TUPLE: loading-uniforms [ [ pick push ] unless-empty ] [ { - { CHAR: \s [ (read-line-tokens) ] } - { CHAR: \n [ drop ] } + { char: \s [ (read-line-tokens) ] } + { char: \n [ drop ] } [ 2drop [ f ] when-empty ] } case ] bi* ; inline recursive diff --git a/extra/hamurabi/hamurabi.factor b/extra/hamurabi/hamurabi.factor index 3945cee0c4..f42abc0483 100644 --- a/extra/hamurabi/hamurabi.factor +++ b/extra/hamurabi/hamurabi.factor @@ -220,7 +220,7 @@ total-births total-deaths ; check-starvation ; : spaces ( n -- ) - CHAR: \s write ; + char: \s write ; : welcome ( -- ) 32 spaces "HAMURABI" print diff --git a/extra/hashcash/hashcash.factor b/extra/hashcash/hashcash.factor index 0342655172..ac4440b4b0 100644 --- a/extra/hashcash/hashcash.factor +++ b/extra/hashcash/hashcash.factor @@ -25,7 +25,7 @@ IN: hashcash ! Random salt is formed by ascii characters ! between 33 and 126 : available-chars ( -- seq ) - 33 126 [a,b] [ CHAR: : = ] reject ; + 33 126 [a,b] [ char: : = ] reject ; PRIVATE> @@ -54,14 +54,14 @@ M: hashcash string>> >hex >>suffix ; : get-bits ( bytes -- str ) - [ >bin 8 CHAR: 0 pad-head ] { } map-as concat ; + [ >bin 8 char: 0 pad-head ] { } map-as concat ; : checksummed-bits ( tuple -- relevant-bits ) dup string>> sha1-checksum swap bits>> 8 / ceiling head get-bits ; : all-char-zero? ( seq -- ? ) - [ CHAR: 0 = ] all? ; inline + [ char: 0 = ] all? ; inline : valid-guess? ( checksum tuple -- ? ) bits>> head all-char-zero? ; diff --git a/extra/html/entities/entities.factor b/extra/html/entities/entities.factor index 1baab98029..976b7f5ec2 100644 --- a/extra/html/entities/entities.factor +++ b/extra/html/entities/entities.factor @@ -10,11 +10,11 @@ IN: html.entities ">" } - { CHAR: \" """ } - { CHAR: ' "'" } + { char: & "&" } + { char: < "<" } + { char: > ">" } + { char: \" """ } + { char: ' "'" } } : next-escape ( seq -- i elt ) diff --git a/extra/html/parser/parser.factor b/extra/html/parser/parser.factor index f9bb72d434..00a295bdc1 100644 --- a/extra/html/parser/parser.factor +++ b/extra/html/parser/parser.factor @@ -20,7 +20,7 @@ SYMBOL: tagstack : closing-tag? ( string -- ? ) [ f ] - [ { [ first CHAR: / = ] [ last CHAR: / = ] } 1|| ] if-empty ; + [ { [ first char: / = ] [ last char: / = ] } 1|| ] if-empty ; : ( name attributes closing? -- tag ) tag new @@ -40,18 +40,18 @@ SYMBOL: tagstack '[ [ current _ = ] take-until ] [ advance drop ] bi ; : read-single-quote ( sequence-parser -- string ) - CHAR: ' (read-quote) ; + char: ' (read-quote) ; : read-double-quote ( sequence-parser -- string ) - CHAR: \" (read-quote) ; + char: \" (read-quote) ; : read-quote ( sequence-parser -- string ) - dup get+increment CHAR: ' = + dup get+increment char: ' = [ read-single-quote ] [ read-double-quote ] if ; : read-key ( sequence-parser -- string ) skip-whitespace - [ current { [ CHAR: = = ] [ blank? ] } 1|| ] take-until ; + [ current { [ char: = = ] [ blank? ] } 1|| ] take-until ; : read-token ( sequence-parser -- string ) [ current blank? ] take-until ; @@ -70,17 +70,17 @@ SYMBOL: tagstack [ advance drop ] bi ; : read-bang ( sequence-parser -- ) - advance dup { [ current CHAR: - = ] [ peek-next CHAR: - = ] } 1&& + advance dup { [ current char: - = ] [ peek-next char: - = ] } 1&& [ advance advance read-comment ] [ read-dtd ] if ; : read-tag ( sequence-parser -- string ) [ [ current "><" member? ] take-until - [ CHAR: / = ] trim-tail - ] [ dup current CHAR: < = [ advance ] unless drop ] bi ; + [ char: / = ] trim-tail + ] [ dup current char: < = [ advance ] unless drop ] bi ; : read-until-< ( sequence-parser -- string ) - [ current CHAR: < = ] take-until ; + [ current char: < = ] take-until ; : parse-text ( sequence-parser -- ) read-until-< [ text new-tag push-tag ] unless-empty ; @@ -108,7 +108,7 @@ SYMBOL: tagstack : read-< ( sequence-parser -- string/f ) advance dup current [ - CHAR: ! = [ read-bang f ] [ read-tag ] if + char: ! = [ read-bang f ] [ read-tag ] if ] [ drop f ] if* ; diff --git a/extra/html/parser/utils/utils.factor b/extra/html/parser/utils/utils.factor index 0b9474a7f1..ad7e7fd5d5 100644 --- a/extra/html/parser/utils/utils.factor +++ b/extra/html/parser/utils/utils.factor @@ -11,7 +11,7 @@ IN: html.parser.utils : double-quote ( str -- newstr ) "\"" dup surround ; : quote ( str -- newstr ) - CHAR: ' over member? + char: ' over member? [ double-quote ] [ single-quote ] if ; : ?quote ( str -- newstr ) dup quoted? [ quote ] unless ; diff --git a/extra/images/bitmap/bitmap.factor b/extra/images/bitmap/bitmap.factor index 2ac2326e32..5aeeb5b634 100644 --- a/extra/images/bitmap/bitmap.factor +++ b/extra/images/bitmap/bitmap.factor @@ -388,7 +388,7 @@ M: bmp-image stream>image* ( stream bmp-image -- bitmap ) ] bi ; : output-bmp ( image -- ) - B{ CHAR: B CHAR: M } write + B{ char: B char: M } write [ bitmap>> length 14 + 40 + write4 0 write4 diff --git a/extra/images/pbm/pbm.factor b/extra/images/pbm/pbm.factor index f0462df554..fdb6e7dfed 100644 --- a/extra/images/pbm/pbm.factor +++ b/extra/images/pbm/pbm.factor @@ -15,7 +15,7 @@ SINGLETON: pbm-image read1 dup blank? [ t ] [ - dup CHAR: # = + dup char: # = [ "\n" read-until 2drop t ] [ f ] if ] if @@ -28,8 +28,8 @@ SINGLETON: pbm-image : read-ascii-bits ( -- ) read1 { - { CHAR: 1 [ 0 , read-ascii-bits ] } - { CHAR: 0 [ 255 , read-ascii-bits ] } + { char: 1 [ 0 , read-ascii-bits ] } + { char: 0 [ 255 , read-ascii-bits ] } { f [ ] } [ drop read-ascii-bits ] } case ; diff --git a/extra/images/pgm/pgm.factor b/extra/images/pgm/pgm.factor index 730fc3ea81..f880a516cb 100644 --- a/extra/images/pgm/pgm.factor +++ b/extra/images/pgm/pgm.factor @@ -12,7 +12,7 @@ SINGLETON: pgm-image : read-token ( -- token ) [ read1 dup blank? [ t ] - [ dup CHAR: # = + [ dup char: # = [ "\n" read-until 2drop t ] [ f ] if ] if diff --git a/extra/images/ppm/ppm.factor b/extra/images/ppm/ppm.factor index 34d3a288b0..d6225216c6 100755 --- a/extra/images/ppm/ppm.factor +++ b/extra/images/ppm/ppm.factor @@ -11,7 +11,7 @@ SINGLETON: ppm-image : read-token ( -- token ) [ read1 dup blank? [ t ] - [ dup CHAR: # = + [ dup char: # = [ "\n" read-until 2drop t ] [ f ] if ] if diff --git a/extra/images/tiff/tiff.factor b/extra/images/tiff/tiff.factor index 2fab7c147c..1598f68e33 100755 --- a/extra/images/tiff/tiff.factor +++ b/extra/images/tiff/tiff.factor @@ -230,8 +230,8 @@ ERROR: bad-jpeg-proc n ; ERROR: bad-tiff-magic bytes ; : tiff-endianness ( byte-array -- ? ) { - { B{ CHAR: M CHAR: M } [ big-endian ] } - { B{ CHAR: I CHAR: I } [ little-endian ] } + { B{ char: M char: M } [ big-endian ] } + { B{ char: I char: I } [ little-endian ] } [ bad-tiff-magic ] } case ; diff --git a/extra/imap/imap-tests.factor b/extra/imap/imap-tests.factor index 37faf12614..dc8891a131 100644 --- a/extra/imap/imap-tests.factor +++ b/extra/imap/imap-tests.factor @@ -7,7 +7,7 @@ FROM: pcre => findall ; IN: imap.tests : random-ascii ( n -- str ) - [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ; + [ char: a char: z [a,b] random ] "" replicate-as ; : make-mail ( from -- mail ) now timestamp>rfc822 swap 10000 random diff --git a/extra/infix/infix-tests.factor b/extra/infix/infix-tests.factor index a6bbaa7dd5..ac95b8bfa6 100644 --- a/extra/infix/infix-tests.factor +++ b/extra/infix/infix-tests.factor @@ -34,8 +34,8 @@ IN: infix.tests { -1 } [ [let 1 :> a [infix -a infix] ] ] unit-test -{ CHAR: f } [ [let "foo" :> s [infix s[0] infix] ] ] unit-test -{ CHAR: r } [ [let "bar" :> s [infix s[-1] infix] ] ] unit-test +{ char: f } [ [let "foo" :> s [infix s[0] infix] ] ] unit-test +{ char: r } [ [let "bar" :> s [infix s[-1] infix] ] ] unit-test { "foo" } [ [let "foobar" :> s [infix s[0:3] infix] ] ] unit-test { "foo" } [ [let "foobar" :> s [infix s[:3] infix] ] ] unit-test { "bar" } [ [let "foobar" :> s [infix s[-3:] infix] ] ] unit-test diff --git a/extra/infix/tokenizer/tokenizer-tests.factor b/extra/infix/tokenizer/tokenizer-tests.factor index 4a5abff301..b50d1dfdba 100644 --- a/extra/infix/tokenizer/tokenizer-tests.factor +++ b/extra/infix/tokenizer/tokenizer-tests.factor @@ -4,18 +4,18 @@ USING: infix.ast infix.tokenizer tools.test ; IN: infix.tokenizer.tests { V{ T{ ast-value f 1 } } } [ "1" tokenize-infix ] unit-test -{ V{ T{ ast-value f 1.02 } CHAR: * T{ ast-value f 3 } } } [ "1.02*3" tokenize-infix ] unit-test -{ V{ T{ ast-value f 3 } CHAR: / CHAR: ( T{ ast-value f 3 } CHAR: + T{ ast-value f 4 } CHAR: ) } } +{ V{ T{ ast-value f 1.02 } char: * T{ ast-value f 3 } } } [ "1.02*3" tokenize-infix ] unit-test +{ V{ T{ ast-value f 3 } char: / char: ( T{ ast-value f 3 } char: + T{ ast-value f 4 } char: ) } } [ "3/(3+4)" tokenize-infix ] unit-test -{ V{ "foo" CHAR: ( "x" CHAR: , "y" CHAR: , "z" CHAR: ) } } [ "foo(x,y,z)" tokenize-infix ] unit-test -{ V{ "arr" CHAR: [ "x" CHAR: + T{ ast-value f 3 } CHAR: ] } } +{ V{ "foo" char: ( "x" char: , "y" char: , "z" char: ) } } [ "foo(x,y,z)" tokenize-infix ] unit-test +{ V{ "arr" char: [ "x" char: + T{ ast-value f 3 } char: ] } } [ "arr[x+3]" tokenize-infix ] unit-test [ "1.0.4" tokenize-infix ] must-fail -{ V{ CHAR: + CHAR: ] T{ ast-value f 3.4 } CHAR: , "bar" } } +{ V{ char: + char: ] T{ ast-value f 3.4 } char: , "bar" } } [ "+]3.4,bar" tokenize-infix ] unit-test { V{ "baz_34c" } } [ "baz_34c" tokenize-infix ] unit-test { V{ T{ ast-value f 34 } "c_baz" } } [ "34c_baz" tokenize-infix ] unit-test -{ V{ CHAR: ( T{ ast-value f 1 } CHAR: + T{ ast-value f 2 } CHAR: ) } } +{ V{ char: ( T{ ast-value f 1 } char: + T{ ast-value f 2 } char: ) } } [ "(1+2)" tokenize-infix ] unit-test -{ V{ T{ ast-value f 1 } CHAR: + T{ ast-value f 2 } CHAR: / T{ ast-value f 3 } } } +{ V{ T{ ast-value f 1 } char: + T{ ast-value f 2 } char: / T{ ast-value f 3 } } } [ "1\n+\r2\t/ 3" tokenize-infix ] unit-test diff --git a/extra/infix/tokenizer/tokenizer.factor b/extra/infix/tokenizer/tokenizer.factor index baff044056..a2369fc922 100644 --- a/extra/infix/tokenizer/tokenizer.factor +++ b/extra/infix/tokenizer/tokenizer.factor @@ -13,12 +13,12 @@ Number = Digits '.' Digits => [[ "" concat-as string>number ast-val String = '"' [^"]* '"' => [[ second >string ast-value boa ]] Space = [ \t\n\r] Spaces = Space* => [[ ignore ]] -NameFirst = Letter | "_" => [[ CHAR: _ ]] +NameFirst = Letter | "_" => [[ char: _ ]] NameRest = NameFirst | Digit Name = NameFirst NameRest* => [[ first2 swap prefix >string ]] -Special = [+*/%(),] | "-" => [[ CHAR: - ]] - | "[" => [[ CHAR: [ ]] | "]" => [[ CHAR: ] ]] - | ":" => [[ CHAR: : ]] +Special = [+*/%(),] | "-" => [[ char: - ]] + | "[" => [[ char: [ ]] | "]" => [[ char: ] ]] + | ":" => [[ char: : ]] Tok = Spaces (Name | Number | String | Special ) End = !(.) Toks = Tok* Spaces End diff --git a/extra/ini-file/ini-file.factor b/extra/ini-file/ini-file.factor index a31993cf69..e312c496ce 100644 --- a/extra/ini-file/ini-file.factor +++ b/extra/ini-file/ini-file.factor @@ -11,25 +11,25 @@ IN: ini-file : escape ( ch -- ch' ) H{ - { CHAR: a CHAR: \a } - { CHAR: b CHAR: \b } - { CHAR: f CHAR: \f } - { CHAR: n CHAR: \n } - { CHAR: r CHAR: \r } - { CHAR: t CHAR: \t } - { CHAR: v CHAR: \v } - { CHAR: ' CHAR: ' } - { CHAR: \" CHAR: \" } - { CHAR: \\ CHAR: \\ } - { CHAR: ? CHAR: ? } - { CHAR: ; CHAR: ; } - { CHAR: [ CHAR: [ } - { CHAR: ] CHAR: ] } - { CHAR: = CHAR: = } + { char: a char: \a } + { char: b char: \b } + { char: f char: \f } + { char: n char: \n } + { char: r char: \r } + { char: t char: \t } + { char: v char: \v } + { char: ' char: ' } + { char: \" char: \" } + { char: \\ char: \\ } + { char: ? char: ? } + { char: ; char: ; } + { char: [ char: [ } + { char: ] char: ] } + { char: = char: = } } ?at [ bad-escape ] unless ; : (unescape-string) ( str -- ) - CHAR: \\ over index [ + char: \\ over index [ cut-slice [ % ] dip rest-slice dup empty? [ "Missing escape code" throw ] when unclip-slice escape , (unescape-string) @@ -42,29 +42,29 @@ USE: xml.entities : escape-string ( str -- str' ) H{ - { CHAR: \a "\\a" } + { char: \a "\\a" } { 0x08 "\\b" } { 0x0c "\\f" } - { CHAR: \n "\\n" } - { CHAR: \r "\\r" } - { CHAR: \t "\\t" } + { char: \n "\\n" } + { char: \r "\\r" } + { char: \t "\\t" } { 0x0b "\\v" } - { CHAR: ' "\\'" } - { CHAR: \" "\\\"" } - { CHAR: \\ "\\\\" } - { CHAR: ? "\\?" } - { CHAR: ; "\\;" } - { CHAR: [ "\\[" } - { CHAR: ] "\\]" } - { CHAR: = "\\=" } + { char: ' "\\'" } + { char: \" "\\\"" } + { char: \\ "\\\\" } + { char: ? "\\?" } + { char: ; "\\;" } + { char: [ "\\[" } + { char: ] "\\]" } + { char: = "\\=" } } escape-string-by ; : space? ( ch -- ? ) { - [ CHAR: \s = ] - [ CHAR: \t = ] - [ CHAR: \n = ] - [ CHAR: \r = ] + [ char: \s = ] + [ char: \t = ] + [ char: \n = ] + [ char: \r = ] [ 0x0c = ] ! \f [ 0x0b = ] ! \v } 1|| ; @@ -87,12 +87,12 @@ SYMBOL: option : section? ( line -- index/f ) { [ length 1 > ] - [ first CHAR: [ = ] - [ CHAR: ] swap last-index ] + [ first char: [ = ] + [ char: ] swap last-index ] } 1&& ; : line-continues? ( line -- ? ) - { [ empty? not ] [ last CHAR: \ = ] } 1&& ; + { [ empty? not ] [ last char: \ = ] } 1&& ; : section, ( -- ) section get [ , ] when* ; diff --git a/extra/io/encodings/detect/detect.factor b/extra/io/encodings/detect/detect.factor index 12da3efd97..5285286ea5 100644 --- a/extra/io/encodings/detect/detect.factor +++ b/extra/io/encodings/detect/detect.factor @@ -13,7 +13,7 @@ default-8bit-encoding [ latin1 ] initialize over index [ 1 + head-slice ] when* >string ; + char: > over index [ 1 + head-slice ] when* >string ; : prolog-encoding ( string -- iana-encoding ) '[ diff --git a/extra/io/streams/peek/peek-tests.factor b/extra/io/streams/peek/peek-tests.factor index 0d6ab019c7..552142364d 100644 --- a/extra/io/streams/peek/peek-tests.factor +++ b/extra/io/streams/peek/peek-tests.factor @@ -6,16 +6,16 @@ io.streams.memory io.streams.peek io.streams.string kernel make namespaces sequences strings tools.test ; IN: io.streams.peek.tests -{ CHAR: a } +{ char: a } [ "abc" stream-read1 ] unit-test -{ CHAR: a } +{ char: a } [ "abc" stream-peek1 ] unit-test { f } [ "" stream-peek1 ] unit-test -{ CHAR: a } +{ char: a } [ "abc" stream-peek1 ] unit-test { "ab" 99 } @@ -24,7 +24,7 @@ IN: io.streams.peek.tests { "ab" f } [ "ab" "c" swap stream-read-until ] unit-test -{ CHAR: a } +{ char: a } [ "abc" [ stream-peek1 drop ] diff --git a/extra/irc/client/participants/participants.factor b/extra/irc/client/participants/participants.factor index f3440725bf..95c8e5fa75 100644 --- a/extra/irc/client/participants/participants.factor +++ b/extra/irc/client/participants/participants.factor @@ -37,13 +37,13 @@ M: irc-channel-chat has-participant? participants>> key? ; : apply-mode ( ? participant mode -- ) { - { CHAR: o [ operator<< ] } - { CHAR: v [ voice<< ] } + { char: o [ operator<< ] } + { char: v [ voice<< ] } [ 3drop ] } case ; : apply-modes ( mode-line participant -- ) - [ unclip CHAR: + = ] dip + [ unclip char: + = ] dip '[ [ _ _ ] dip apply-mode ] each ; : change-participant-mode ( mode channel nick -- ) diff --git a/extra/irc/messages/base/base.factor b/extra/irc/messages/base/base.factor index f5d3f50c6e..fe11f0b159 100644 --- a/extra/irc/messages/base/base.factor +++ b/extra/irc/messages/base/base.factor @@ -81,7 +81,7 @@ M: irc-message set-irc-command [ prefix>> ] [ command>> ] [ parameters>> " " join ] - [ trailing>> dup [ CHAR: : prefix ] when ] + [ trailing>> dup [ char: : prefix ] when ] } cleave 4array sift " " join ; > target-cpu get name>> (platform) diff --git a/extra/math/extras/extras-tests.factor b/extra/math/extras/extras-tests.factor index 8acda1801a..8361364dc8 100644 --- a/extra/math/extras/extras-tests.factor +++ b/extra/math/extras/extras-tests.factor @@ -96,7 +96,7 @@ IN: math.extras.test { f } [ { 1 1 2 2 } majority ] unit-test { 2 } [ { 1 1 2 2 2 } majority ] unit-test { 3 } [ { 1 2 3 1 2 3 1 2 3 3 } majority ] unit-test -{ CHAR: C } [ "AAACCBBCCCBCC" majority ] unit-test +{ char: C } [ "AAACCBBCCCBCC" majority ] unit-test { -5 } [ -4-3/5 round-to-even ] unit-test { -4 } [ -4-1/2 round-to-even ] unit-test diff --git a/extra/math/floating-point/floating-point.factor b/extra/math/floating-point/floating-point.factor index a3e6f2d124..22780ee236 100644 --- a/extra/math/floating-point/floating-point.factor +++ b/extra/math/floating-point/floating-point.factor @@ -32,9 +32,9 @@ IN: math.floating-point : double. ( double -- ) double>bits [ (double-sign) .b ] - [ (double-exponent-bits) >bin 11 CHAR: 0 pad-head bl print ] + [ (double-exponent-bits) >bin 11 char: 0 pad-head bl print ] [ - (double-mantissa-bits) >bin 52 CHAR: 0 pad-head + (double-mantissa-bits) >bin 52 char: 0 pad-head 11 [ bl ] times print ] tri ; diff --git a/extra/math/text/english/english.factor b/extra/math/text/english/english.factor index 5a4d7ae0f9..a790ada4e9 100644 --- a/extra/math/text/english/english.factor +++ b/extra/math/text/english/english.factor @@ -104,7 +104,7 @@ M: float number>text [ string>number number>text ] [ [ "negative " prepend ] when ] bi* ] [ - [ CHAR: 0 - small-numbers ] { } map-as " " join + [ char: 0 - small-numbers ] { } map-as " " join ] bi* " point " glue ; M: complex number>text diff --git a/extra/math/text/french/french.factor b/extra/math/text/french/french.factor index d93308e8a1..14616c6e9f 100644 --- a/extra/math/text/french/french.factor +++ b/extra/math/text/french/french.factor @@ -29,7 +29,7 @@ MEMO: units ( -- seq ) ! up to 10^99 ! The only plurals we have to remove are "quatre-vingts" and "cents", ! which are also the only strings ending with "ts". : unpluralize ( str -- newstr ) dup "ts" tail? [ but-last ] when ; -: pluralize ( str -- newstr ) dup "s" tail? [ CHAR: s suffix ] unless ; +: pluralize ( str -- newstr ) dup "s" tail? [ char: s suffix ] unless ; : space-append ( str1 str2 -- str ) " " glue ; @@ -91,7 +91,7 @@ MEMO: units ( -- seq ) ! up to 10^99 : ieme ( str -- str ) dup "ts" tail? [ but-last ] when dup "e" tail? [ but-last ] when - dup "q" tail? [ CHAR: u suffix ] when + dup "q" tail? [ char: u suffix ] when "ième" append ; : divisor ( n -- str ) diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index fc6df7b008..47273f11af 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -29,19 +29,19 @@ ERROR: bad-location str ; dup R/ \d+-\d+(-\d+(\.\d+)?)?[WE]/ matches? [ unclip-last [ parse-location ] - [ CHAR: W = [ neg ] when ] bi* + [ char: W = [ neg ] when ] bi* ] [ drop f ] if ; : string>latitude ( str -- lat/f ) dup R/ \d+-\d+(-\d+(\.\d+)?)?[NS]/ matches? [ unclip-last [ parse-location ] - [ CHAR: S = [ neg ] when ] bi* + [ char: S = [ neg ] when ] bi* ] [ drop f ] if ; : stations-data ( -- seq ) URL" http://tgftp.nws.noaa.gov/data/nsd_cccc.txt" - http-get nip CHAR: ; [ string>csv ] with-delimiter ; + http-get nip char: ; [ string>csv ] with-delimiter ; PRIVATE> @@ -197,11 +197,11 @@ CONSTANT: compass-directions H{ : parse-visibility ( str -- str' ) dup first { - { CHAR: M [ rest "less than " ] } - { CHAR: P [ rest "more than " ] } + { char: M [ rest "less than " ] } + { char: P [ rest "more than " ] } [ drop "" ] } case swap "SM" ?tail drop - CHAR: / over index [ 1 > [ 1 cut "+" glue ] when ] when* + char: / over index [ 1 > [ 1 cut "+" glue ] when ] when* string>number "%s%s statute miles" sprintf ; : parse-rvr ( str -- str' ) @@ -216,8 +216,8 @@ CONSTANT: compass-directions H{ : (parse-weather) ( str -- str' ) dup "+FC" = [ drop "tornadoes or waterspouts" ] [ dup first { - { CHAR: + [ rest "heavy " ] } - { CHAR: - [ rest "light " ] } + { char: + [ rest "heavy " ] } + { char: - [ rest "light " ] } [ drop f ] } case [ 2 group dup [ weather key? ] all? @@ -274,7 +274,7 @@ CONSTANT: sky H{ ] bi@ ; : parse-altimeter ( str -- str' ) - unclip [ string>number ] [ CHAR: A = ] bi* + unclip [ string>number ] [ char: A = ] bi* [ 100 /f "%.2f Hg" sprintf ] [ "%s hPa" sprintf ] if ; CONSTANT: re-timestamp R/ \d{6}Z/ @@ -420,14 +420,14 @@ CONSTANT: high-clouds H{ } : parse-cloud-cover ( str -- str' ) - "8/" ?head drop first3 [ CHAR: 0 - ] tri@ + "8/" ?head drop first3 [ char: 0 - ] tri@ [ [ f ] [ low-clouds at "low clouds are %s" sprintf ] if-zero ] [ [ f ] [ mid-clouds at "middle clouds are %s" sprintf ] if-zero ] [ [ f ] [ high-clouds at "high clouds are %s" sprintf ] if-zero ] tri* 3array " " join ; : parse-inches ( str -- str' ) - dup [ CHAR: / = ] all? [ drop "unknown" ] [ + dup [ char: / = ] all? [ drop "unknown" ] [ string>number [ "trace" ] [ 100 /f "%.2f inches" sprintf ] if-zero ] if ; @@ -466,7 +466,7 @@ CONSTANT: re-recent-weather R/ ((\w{2})?[BE]\d{2,4}((\w{2})?[BE]\d{2,4})?)+/ : parse-began/ended ( str -- str' ) unclip swap - [ CHAR: B = "began" "ended" ? ] + [ char: B = "began" "ended" ? ] [ parse-recent-time ] bi* "%s at %s" sprintf ; : split-recent-weather ( str -- seq ) diff --git a/extra/money/money.factor b/extra/money/money.factor index 571bd19e44..9516b385ad 100644 --- a/extra/money/money.factor +++ b/extra/money/money.factor @@ -5,7 +5,7 @@ namespaces sequences splitting ; IN: money SYMBOL: currency-token -CHAR: $ currency-token set-global +char: $ currency-token set-global : dollars/cents ( dollars -- dollars cents ) 100 * 100 /mod round >integer ; @@ -13,7 +13,7 @@ CHAR: $ currency-token set-global : format-money ( dollars cents -- string ) [ number>string ] bi@ [ 3 group "," join ] - [ 2 CHAR: 0 pad-head ] bi* "." glue ; + [ 2 char: 0 pad-head ] bi* "." glue ; : money>string ( number -- string ) dollars/cents format-money currency-token get prefix ; diff --git a/extra/morse/morse-tests.factor b/extra/morse/morse-tests.factor index 95b837a9eb..9efcee1c48 100644 --- a/extra/morse/morse-tests.factor +++ b/extra/morse/morse-tests.factor @@ -3,10 +3,10 @@ USING: arrays morse strings tools.test ; IN: morse.tests -{ "?" } [ CHAR: \\ ch>morse ] unit-test -{ "..." } [ CHAR: s ch>morse ] unit-test -{ CHAR: s } [ "..." morse>ch ] unit-test -{ CHAR: \s } [ "..--..--.." morse>ch ] unit-test +{ "?" } [ char: \\ ch>morse ] unit-test +{ "..." } [ char: s ch>morse ] unit-test +{ char: s } [ "..." morse>ch ] unit-test +{ char: \s } [ "..--..--.." morse>ch ] unit-test { "-- --- .-. ... . / -.-. --- -.. ." } [ "morse code" >morse ] unit-test { "morse code" } [ "-- --- .-. ... . / -.-. --- -.. ." morse> ] unit-test { "hello, world!" } [ "Hello, World!" >morse morse> ] unit-test diff --git a/extra/morse/morse.factor b/extra/morse/morse.factor index 23301ed3f8..07c0012424 100755 --- a/extra/morse/morse.factor +++ b/extra/morse/morse.factor @@ -10,71 +10,71 @@ ERROR: no-morse-ch ch ; CONSTANT: morse-code-table $[ H{ - { CHAR: a ".-" } - { CHAR: b "-..." } - { CHAR: c "-.-." } - { CHAR: d "-.." } - { CHAR: e "." } - { CHAR: f "..-." } - { CHAR: g "--." } - { CHAR: h "...." } - { CHAR: i ".." } - { CHAR: j ".---" } - { CHAR: k "-.-" } - { CHAR: l ".-.." } - { CHAR: m "--" } - { CHAR: n "-." } - { CHAR: o "---" } - { CHAR: p ".--." } - { CHAR: q "--.-" } - { CHAR: r ".-." } - { CHAR: s "..." } - { CHAR: t "-" } - { CHAR: u "..-" } - { CHAR: v "...-" } - { CHAR: w ".--" } - { CHAR: x "-..-" } - { CHAR: y "-.--" } - { CHAR: z "--.." } - { CHAR: 1 ".----" } - { CHAR: 2 "..---" } - { CHAR: 3 "...--" } - { CHAR: 4 "....-" } - { CHAR: 5 "....." } - { CHAR: 6 "-...." } - { CHAR: 7 "--..." } - { CHAR: 8 "---.." } - { CHAR: 9 "----." } - { CHAR: 0 "-----" } - { CHAR: . ".-.-.-" } - { CHAR: , "--..--" } - { CHAR: ? "..--.." } - { CHAR: ' ".----." } - { CHAR: ! "-.-.--" } - { CHAR: / "-..-." } - { CHAR: ( "-.--." } - { CHAR: ) "-.--.-" } - { CHAR: & ".-..." } - { CHAR: : "---..." } - { CHAR: ; "-.-.-." } - { CHAR: = "-...- " } - { CHAR: + ".-.-." } - { CHAR: - "-....-" } - { CHAR: _ "..--.-" } - { CHAR: \" ".-..-." } - { CHAR: $ "...-..-" } - { CHAR: @ ".--.-." } - { CHAR: \s "/" } + { char: a ".-" } + { char: b "-..." } + { char: c "-.-." } + { char: d "-.." } + { char: e "." } + { char: f "..-." } + { char: g "--." } + { char: h "...." } + { char: i ".." } + { char: j ".---" } + { char: k "-.-" } + { char: l ".-.." } + { char: m "--" } + { char: n "-." } + { char: o "---" } + { char: p ".--." } + { char: q "--.-" } + { char: r ".-." } + { char: s "..." } + { char: t "-" } + { char: u "..-" } + { char: v "...-" } + { char: w ".--" } + { char: x "-..-" } + { char: y "-.--" } + { char: z "--.." } + { char: 1 ".----" } + { char: 2 "..---" } + { char: 3 "...--" } + { char: 4 "....-" } + { char: 5 "....." } + { char: 6 "-...." } + { char: 7 "--..." } + { char: 8 "---.." } + { char: 9 "----." } + { char: 0 "-----" } + { char: . ".-.-.-" } + { char: , "--..--" } + { char: ? "..--.." } + { char: ' ".----." } + { char: ! "-.-.--" } + { char: / "-..-." } + { char: ( "-.--." } + { char: ) "-.--.-" } + { char: & ".-..." } + { char: : "---..." } + { char: ; "-.-.-." } + { char: = "-...- " } + { char: + ".-.-." } + { char: - "-....-" } + { char: _ "..--.-" } + { char: \" ".-..-." } + { char: $ "...-..-" } + { char: @ ".--.-." } + { char: \s "/" } } >biassoc ] @@ -102,7 +102,7 @@ CONSTANT: morse-code-table $[ "/" split [ trim-blanks morse>word ] map " " join ; : replace-underscores ( str -- str' ) - [ dup CHAR: _ = [ drop CHAR: - ] when ] map ; + [ dup char: _ = [ drop char: - ] when ] map ; PRIVATE> diff --git a/extra/odbc/odbc.factor b/extra/odbc/odbc.factor index ceb2e72b05..c530e18f4c 100644 --- a/extra/odbc/odbc.factor +++ b/extra/odbc/odbc.factor @@ -130,7 +130,7 @@ FUNCTION: SQLRETURN SQLGetData ( SQLHSTMT statementHandle, SQLUSMALLINT columnNu ascii string>alien ; + char: space ascii string>alien ; PRIVATE> diff --git a/extra/parser-combinators/simple/simple.factor b/extra/parser-combinators/simple/simple.factor index eba74dd8dd..746c4c775a 100644 --- a/extra/parser-combinators/simple/simple.factor +++ b/extra/parser-combinators/simple/simple.factor @@ -11,18 +11,18 @@ IN: parser-combinators.simple [ digit? ] satisfy <*> [ string>number ] <@ ; : string-parser ( -- parser ) - [ CHAR: \" = ] satisfy - [ CHAR: \" = not ] satisfy <*> &> - [ CHAR: \" = ] satisfy <& [ >string ] <@ ; + [ char: \" = ] satisfy + [ char: \" = not ] satisfy <*> &> + [ char: \" = ] satisfy <& [ >string ] <@ ; : bold-parser ( -- parser ) "*" token - [ CHAR: * = not ] satisfy <*> [ >string ] <@ &> + [ char: * = not ] satisfy <*> [ >string ] <@ &> "*" token <& ; : italic-parser ( -- parser ) "_" token - [ CHAR: _ = not ] satisfy <*> [ >string ] <@ &> + [ char: _ = not ] satisfy <*> [ >string ] <@ &> "_" token <& ; : comma-list ( element -- parser ) diff --git a/extra/path-finding/path-finding-tests.factor b/extra/path-finding/path-finding-tests.factor index 38d46f2b50..5c9f66eada 100644 --- a/extra/path-finding/path-finding-tests.factor +++ b/extra/path-finding/path-finding-tests.factor @@ -28,7 +28,7 @@ TUPLE: maze < astar ; 6 X X X X X X e X 7 X g X X 8 X X X X X X X X X X" - "\n" split ] nth nth CHAR: X = not ; + "\n" split ] nth nth char: X = not ; M: maze neighbours drop diff --git a/extra/pcre/pcre-tests.factor b/extra/pcre/pcre-tests.factor index 686d93e772..00686dc310 100644 --- a/extra/pcre/pcre-tests.factor +++ b/extra/pcre/pcre-tests.factor @@ -90,7 +90,7 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when ] unit-test : long-string ( -- x ) - 10000 [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ; + 10000 [ char: a char: z [a,b] random ] "" replicate-as ; ! Performance { 0 } [ long-string ".{0,15}foobar.{0,10}" findall length ] unit-test diff --git a/extra/pdf/layout/layout.factor b/extra/pdf/layout/layout.factor index cfb66648f4..217d7f08a3 100644 --- a/extra/pdf/layout/layout.factor +++ b/extra/pdf/layout/layout.factor @@ -86,8 +86,8 @@ M: div pdf-width : convert-string ( str -- str' ) { - { CHAR: “ "\"" } - { CHAR: ” "\"" } + { char: “ "\"" } + { char: ” "\"" } } escape-string-by [ 256 < ] filter ; PRIVATE> diff --git a/extra/pdf/values/values.factor b/extra/pdf/values/values.factor index c41e66d1fb..d033404035 100644 --- a/extra/pdf/values/values.factor +++ b/extra/pdf/values/values.factor @@ -14,12 +14,12 @@ IN: pdf.values H{ { 0x08 "\\b" } { 0x0c "\\f" } - { CHAR: \n "\\n" } - { CHAR: \r "\\r" } - { CHAR: \t "\\t" } - { CHAR: \\ "\\\\" } - { CHAR: ( "\\(" } - { CHAR: ) "\\)" } + { char: \n "\\n" } + { char: \r "\\r" } + { char: \t "\\t" } + { char: \\ "\\\\" } + { char: ( "\\(" } + { char: ) "\\)" } } escape-string-by ; PRIVATE> diff --git a/extra/peg/javascript/tokenizer/tokenizer.factor b/extra/peg/javascript/tokenizer/tokenizer.factor index 52d6e9807e..14af731aa9 100644 --- a/extra/peg/javascript/tokenizer/tokenizer.factor +++ b/extra/peg/javascript/tokenizer/tokenizer.factor @@ -16,7 +16,7 @@ SingleLineComment = "//" (!("\n") .)* "\n" => [[ ignore ]] MultiLineComment = "/*" (!("*/") .)* "*/" => [[ ignore ]] Space = [ \t\r\n] | SingleLineComment | MultiLineComment Spaces = Space* => [[ ignore ]] -NameFirst = Letter | "$" => [[ CHAR: $ ]] | "_" => [[ CHAR: _ ]] +NameFirst = Letter | "$" => [[ char: $ ]] | "_" => [[ char: _ ]] NameRest = NameFirst | Digit iName = NameFirst NameRest* => [[ first2 swap prefix >string ]] Keyword = ("break" @@ -48,15 +48,15 @@ Name = !(Keyword) iName => [[ ast-name boa ]] Number = Digits:ws '.' Digits:fs => [[ ws "." fs 3array "" concat-as string>number ast-number boa ]] | Digits => [[ >string string>number ast-number boa ]] -SingleEscape = "b" => [[ CHAR: \b ]] - | "f" => [[ CHAR: \f ]] - | "n" => [[ CHAR: \n ]] - | "r" => [[ CHAR: \r ]] - | "t" => [[ CHAR: \t ]] - | "v" => [[ CHAR: \v ]] - | "'" => [[ CHAR: ' ]] - | "\"" => [[ CHAR: \" ]] - | "\\" => [[ CHAR: \\ ]] +SingleEscape = "b" => [[ char: \b ]] + | "f" => [[ char: \f ]] + | "n" => [[ char: \n ]] + | "r" => [[ char: \r ]] + | "t" => [[ char: \t ]] + | "v" => [[ char: \v ]] + | "'" => [[ char: ' ]] + | "\"" => [[ char: \" ]] + | "\\" => [[ char: \\ ]] HexDigit = [0-9a-fA-F] HexEscape = "x" (HexDigit HexDigit):d => [[ d hex> ]] UnicodeEscape = "u" (HexDigit HexDigit HexDigit HexDigit):d => [[ d hex> ]] diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor index bc6edf5fd2..863adde899 100644 --- a/extra/poker/poker.factor +++ b/extra/poker/poker.factor @@ -206,14 +206,14 @@ ERROR: bad-suit-symbol ch ; : symbol>suit ( ch -- ch' ) ch>upper H{ - { CHAR: ♠ CHAR: S } - { CHAR: ♦ CHAR: D } - { CHAR: ♥ CHAR: H } - { CHAR: ♣ CHAR: C } - { CHAR: S CHAR: S } - { CHAR: D CHAR: D } - { CHAR: H CHAR: H } - { CHAR: C CHAR: C } + { char: ♠ char: S } + { char: ♦ char: D } + { char: ♥ char: H } + { char: ♣ char: C } + { char: S char: S } + { char: D char: D } + { char: H char: H } + { char: C char: C } } ?at [ bad-suit-symbol ] unless ; : card> ( string -- card ) diff --git a/extra/progress-bars/progress-bars.factor b/extra/progress-bars/progress-bars.factor index b397a0b287..c71c09b6a0 100644 --- a/extra/progress-bars/progress-bars.factor +++ b/extra/progress-bars/progress-bars.factor @@ -20,4 +20,4 @@ ERROR: invalid-length x ; : make-progress-bar ( percent length -- string ) [ check-percent ] [ check-length ] bi* - CHAR: = CHAR: - (make-progress-bar) ; + char: = char: - (make-progress-bar) ; diff --git a/extra/project-euler/051/051.factor b/extra/project-euler/051/051.factor index 7ade217789..6c74e25d58 100644 --- a/extra/project-euler/051/051.factor +++ b/extra/project-euler/051/051.factor @@ -41,7 +41,7 @@ SYMBOL: large-families H{ } clone [ '[ swap _ push-at ] each-index ] keep ; : *-if-index ( char combination index -- char ) - member? [ drop CHAR: * ] when ; + member? [ drop char: * ] when ; : replace-positions-with-* ( str positions -- str ) [ *-if-index ] curry map-index ; : all-positions-combinations ( seq -- combinations ) @@ -68,7 +68,7 @@ SYMBOL: large-families large-families get members ; : fill-*-with-ones ( str -- str ) - [ dup CHAR: * = [ drop CHAR: 1 ] when ] map ; + [ dup char: * = [ drop char: 1 ] when ] map ; ! recursively test all primes by length until we find an answer : (euler051) ( i -- answer ) diff --git a/extra/project-euler/common/common.factor b/extra/project-euler/common/common.factor index d3248a9dfc..318b3aac53 100644 --- a/extra/project-euler/common/common.factor +++ b/extra/project-euler/common/common.factor @@ -66,7 +66,7 @@ HINTS: count-digits fixnum ; PRIVATE> : alpha-value ( str -- n ) - >lower [ CHAR: a - 1 + ] map-sum ; + >lower [ char: a - 1 + ] map-sum ; : mediant ( a/c b/d -- (a+b)/(c+d) ) 2>fraction [ + ] 2bi@ / ; diff --git a/extra/project-euler/project-euler.factor b/extra/project-euler/project-euler.factor index 6b25f98bb3..d33264a435 100644 --- a/extra/project-euler/project-euler.factor +++ b/extra/project-euler/project-euler.factor @@ -36,7 +36,7 @@ IN: project-euler print readln string>number ; : number>euler ( n -- str ) - number>string 3 CHAR: 0 pad-head ; + number>string 3 char: 0 pad-head ; : solution-path ( n -- str/f ) number>euler "project-euler." prepend diff --git a/extra/redis/response-parser/response-parser.factor b/extra/redis/response-parser/response-parser.factor index 5b4f0b3283..7c8f55452d 100644 --- a/extra/redis/response-parser/response-parser.factor +++ b/extra/redis/response-parser/response-parser.factor @@ -30,11 +30,11 @@ PRIVATE> : read-response ( -- response ) readln unclip { - { CHAR: : [ string>number ] } - { CHAR: + [ handle-response ] } - { CHAR: $ [ string>number read-bulk ] } - { CHAR: * [ string>number read-multi-bulk ] } - { CHAR: - [ handle-error ] } + { char: : [ string>number ] } + { char: + [ handle-response ] } + { char: $ [ string>number read-bulk ] } + { char: * [ string>number read-multi-bulk ] } + { char: - [ handle-error ] } } case ; : check-response ( -- ) diff --git a/extra/rosetta-code/align-columns/align-columns.factor b/extra/rosetta-code/align-columns/align-columns.factor index 7c9817c2f6..4028a31823 100644 --- a/extra/rosetta-code/align-columns/align-columns.factor +++ b/extra/rosetta-code/align-columns/align-columns.factor @@ -55,14 +55,14 @@ SINGLETONS: +left+ +middle+ +right+ ; GENERIC: align-string ( str n alignment -- str' ) -M: +left+ align-string drop CHAR: space pad-tail ; -M: +right+ align-string drop CHAR: space pad-head ; +M: +left+ align-string drop char: space pad-tail ; +M: +right+ align-string drop char: space pad-head ; M: +middle+ align-string drop over length - 2 / - [ floor CHAR: space ] - [ ceiling CHAR: space ] bi surround ; + [ floor char: space ] + [ ceiling char: space ] bi surround ; : align-columns ( columns alignment -- columns' ) [ dup column-widths ] dip '[ diff --git a/extra/rosetta-code/balanced-brackets/balanced-brackets.factor b/extra/rosetta-code/balanced-brackets/balanced-brackets.factor index aa174fe148..959fd3487a 100644 --- a/extra/rosetta-code/balanced-brackets/balanced-brackets.factor +++ b/extra/rosetta-code/balanced-brackets/balanced-brackets.factor @@ -26,8 +26,8 @@ IN: rosetta-code.balanced-brackets t :> ok! str [ { - { CHAR: [ [ 1 ] } - { CHAR: ] [ -1 ] } + { char: [ [ 1 ] } + { char: ] [ -1 ] } [ drop 0 ] } case counter + counter! counter 0 < [ f ok! ] when diff --git a/extra/rosetta-code/multiplication-tables/multiplication-tables.factor b/extra/rosetta-code/multiplication-tables/multiplication-tables.factor index 6b8b563259..b4e6384914 100644 --- a/extra/rosetta-code/multiplication-tables/multiplication-tables.factor +++ b/extra/rosetta-code/multiplication-tables/multiplication-tables.factor @@ -11,16 +11,16 @@ IN: rosetta-code.multiplication-tables ! Only print the top half triangle of products. : print-row ( n -- ) - [ number>string 2 CHAR: space pad-head write " |" write ] + [ number>string 2 char: space pad-head write " |" write ] [ 1 - [ " " write ] times ] [ dup 12 [a,b] - [ * number>string 4 CHAR: space pad-head write ] with each + [ * number>string 4 char: space pad-head write ] with each ] tri nl ; : print-table ( -- ) " " write - 1 12 [a,b] [ number>string 4 CHAR: space pad-head write ] each nl + 1 12 [a,b] [ number>string 4 char: space pad-head write ] each nl " +" write 12 [ "----" write ] times nl 1 12 [a,b] [ print-row ] each ; diff --git a/extra/rosetta-code/number-reversal/number-reversal.factor b/extra/rosetta-code/number-reversal/number-reversal.factor index 2680601de0..1c968cbefc 100644 --- a/extra/rosetta-code/number-reversal/number-reversal.factor +++ b/extra/rosetta-code/number-reversal/number-reversal.factor @@ -17,7 +17,7 @@ IN: rosetta-code.number-reversal ! Note: Assume the players input does not need extra validation. : make-jumbled-array ( -- sorted jumbled ) - CHAR: 1 CHAR: 9 [a,b] [ 1string ] map dup clone randomize + char: 1 char: 9 [a,b] [ 1string ] map dup clone randomize [ 2dup = ] [ randomize ] while ; SYMBOL: trials diff --git a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor index ed61fb912c..3d4443c317 100644 --- a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor +++ b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor @@ -42,7 +42,7 @@ IN: rosetta-code.one-d-cellular dup count-neighbours [ life-law ] ?{ } 2map-as ; : print-cellular ( world -- ) - [ CHAR: # CHAR: _ ? ] "" map-as print ; + [ char: # char: _ ? ] "" map-as print ; : main-cellular ( -- ) ?{ f t t t f t t f t f t f t f t f f t f f } diff --git a/extra/rot13/rot13.factor b/extra/rot13/rot13.factor index c8f08bcf30..9bb08130b6 100644 --- a/extra/rot13/rot13.factor +++ b/extra/rot13/rot13.factor @@ -7,8 +7,8 @@ IN: rot13 : rot-letter ( ch -- ch ) { - { [ dup letter? ] [ CHAR: a rotate ] } - { [ dup LETTER? ] [ CHAR: A rotate ] } + { [ dup letter? ] [ char: a rotate ] } + { [ dup LETTER? ] [ char: A rotate ] } [ ] } cond ; diff --git a/extra/semantic-versioning/semantic-versioning.factor b/extra/semantic-versioning/semantic-versioning.factor index 8d6ad22410..b8898a88a4 100644 --- a/extra/semantic-versioning/semantic-versioning.factor +++ b/extra/semantic-versioning/semantic-versioning.factor @@ -17,8 +17,8 @@ PRIVATE> : split-version ( string -- array ) "+" split1 [ - dup [ [ digit? not ] [ CHAR: . = not ] bi and ] find [ - [ cut ] [ CHAR: - = [ rest [ f ] when-empty ] when ] bi* + dup [ [ digit? not ] [ char: . = not ] bi and ] find [ + [ cut ] [ char: - = [ rest [ f ] when-empty ] when ] bi* ] [ drop f ] if* [ "." split [ string>number 0 or ] map 3 0 pad-tail ] dip ] dip 3array ; diff --git a/extra/sequences/extras/extras-docs.factor b/extra/sequences/extras/extras-docs.factor index d52928eea3..13d84a3c09 100644 --- a/extra/sequences/extras/extras-docs.factor +++ b/extra/sequences/extras/extras-docs.factor @@ -55,7 +55,7 @@ HELP: collapse { $see-also compact } { $examples "Collapse multiple spaces in a string down to a single space" - { $example "USING: kernel prettyprint sequences.extras ;" "\" Hello, crazy world \" [ CHAR: \\s = ] \" \" collapse ." "\" Hello, crazy world \"" } } ; + { $example "USING: kernel prettyprint sequences.extras ;" "\" Hello, crazy world \" [ char: \\s = ] \" \" collapse ." "\" Hello, crazy world \"" } } ; HELP: compact { $values @@ -67,7 +67,7 @@ HELP: compact { $see-also collapse } { $examples "Collapse multiple spaces in a string down to a single space" - { $example "USING: kernel prettyprint sequences.extras ;" "\" Hello, crazy world \" [ CHAR: \\s = ] \" \" compact ." "\"Hello, crazy world\"" } } ; + { $example "USING: kernel prettyprint sequences.extras ;" "\" Hello, crazy world \" [ char: \\s = ] \" \" compact ." "\"Hello, crazy world\"" } } ; HELP: { $values { "seq" sequence } { "evens" evens } } diff --git a/extra/sequences/extras/extras-tests.factor b/extra/sequences/extras/extras-tests.factor index 3996c92176..583cec8068 100644 --- a/extra/sequences/extras/extras-tests.factor +++ b/extra/sequences/extras/extras-tests.factor @@ -17,11 +17,11 @@ IN: sequences.extras.tests { "foo" } [ "foo" "foobar" longest-subseq ] unit-test { "foo" } [ "foobar" "foo" longest-subseq ] unit-test -{ "" "" } [ "" "" CHAR: ? pad-longest ] unit-test -{ "abc" "def" } [ "abc" "def" CHAR: ? pad-longest ] unit-test -{ " " "abc" } [ "" "abc" CHAR: \s pad-longest ] unit-test -{ "abc" " " } [ "abc" "" CHAR: \s pad-longest ] unit-test -{ "abc..." "foobar" } [ "abc" "foobar" CHAR: . pad-longest ] unit-test +{ "" "" } [ "" "" char: ? pad-longest ] unit-test +{ "abc" "def" } [ "abc" "def" char: ? pad-longest ] unit-test +{ " " "abc" } [ "" "abc" char: \s pad-longest ] unit-test +{ "abc" " " } [ "abc" "" char: \s pad-longest ] unit-test +{ "abc..." "foobar" } [ "abc" "foobar" char: . pad-longest ] unit-test { { @@ -35,7 +35,7 @@ IN: sequences.extras.tests "--ABC--" } } [ - "ABC" 8 [ CHAR: - pad-center ] with map + "ABC" 8 [ char: - pad-center ] with map ] unit-test { { 0 1 0 1 } } [ diff --git a/extra/smalltalk/parser/parser-tests.factor b/extra/smalltalk/parser/parser-tests.factor index 7588dfba24..52de09a479 100644 --- a/extra/smalltalk/parser/parser-tests.factor +++ b/extra/smalltalk/parser/parser-tests.factor @@ -7,7 +7,7 @@ EBNF: test-Character test = ;EBNF -{ CHAR: a } [ "a" test-Character ] unit-test +{ char: a } [ "a" test-Character ] unit-test EBNF: test-Comment test = @@ -40,7 +40,7 @@ test = { 12.4e7 } [ "12.4e7" test-Literal ] unit-test { 12.4e-7 } [ "12.4e-7" test-Literal ] unit-test { -12.4e7 } [ "-12.4e7" test-Literal ] unit-test -{ CHAR: x } [ "$x" test-Literal ] unit-test +{ char: x } [ "$x" test-Literal ] unit-test { "Hello, world" } [ "'Hello, world'" test-Literal ] unit-test { "Hello, 'funny' world" } [ "'Hello, ''funny'' world'" test-Literal ] unit-test { T{ symbol f "foo" } } [ "#foo" test-Literal ] unit-test diff --git a/extra/smalltalk/parser/parser.factor b/extra/smalltalk/parser/parser.factor index 62e84fe173..96449b624d 100644 --- a/extra/smalltalk/parser/parser.factor +++ b/extra/smalltalk/parser/parser.factor @@ -20,7 +20,7 @@ WhitespaceCharacter = [ \t\n\r] DecimalDigit = [0-9] Letter = [A-Za-z] -CommentCharacter = [^"] | '""' => [[ CHAR: " ]] +CommentCharacter = [^"] | '""' => [[ char: " ]] Comment = '"' (CommentCharacter)*:s '"' => [[ s >string ast-comment boa ]] OptionalWhiteSpace = (WhitespaceCharacter | Comment)* @@ -48,7 +48,7 @@ BinarySelectorChar = "~" | "!" | "@" | "%" | "&" | "*" | "-" | "+" | "=" | "|" | "\\" | "<" | ">" | "," | "?" | "/" BinaryMessageSelector = BinarySelectorChar+ => [[ concat ]] -OptionalMinus = ("-" => [[ CHAR: - ]])? +OptionalMinus = ("-" => [[ char: - ]])? IntegerLiteral = (OptionalMinus:m UnsignedIntegerLiteral:i) => [[ i m [ neg ] when ]] UnsignedIntegerLiteral = Radix:r "r" BaseNIntegerLiteral:b => [[ b >string r base> ]] | DecimalIntegerLiteral => [[ check-number ]] @@ -57,13 +57,13 @@ Radix = DecimalIntegerLiteral => [[ check-number ]] BaseNIntegerLiteral = LetterOrDigit+ FloatingPointLiteral = (OptionalMinus DecimalIntegerLiteral - ("." => [[ CHAR: . ]] DecimalIntegerLiteral Exponent? | Exponent)) + ("." => [[ char: . ]] DecimalIntegerLiteral Exponent? | Exponent)) => [[ flatten check-number ]] -Exponent = "e" => [[ CHAR: e ]] (OptionalMinus DecimalIntegerLiteral)? +Exponent = "e" => [[ char: e ]] (OptionalMinus DecimalIntegerLiteral)? CharacterLiteral = "$" Character:c => [[ c ]] -StringLiteral = "'" (StringLiteralCharacter | "''" => [[ CHAR: ' ]])*:s "'" +StringLiteral = "'" (StringLiteralCharacter | "''" => [[ char: ' ]])*:s "'" => [[ s >string ]] StringLiteralCharacter = [^'] diff --git a/extra/smalltalk/printer/printer.factor b/extra/smalltalk/printer/printer.factor index cbf4baf74d..a6aad6cc8d 100644 --- a/extra/smalltalk/printer/printer.factor +++ b/extra/smalltalk/printer/printer.factor @@ -11,7 +11,7 @@ M: real smalltalk>string number>string ; M: string smalltalk>string [ "'" % - [ dup CHAR: ' = [ dup , , ] [ , ] if ] each + [ dup char: ' = [ dup , , ] [ , ] if ] each "'" % ] "" make ; diff --git a/extra/smalltalk/selectors/selectors.factor b/extra/smalltalk/selectors/selectors.factor index b4828bdbb4..fdc60b6289 100644 --- a/extra/smalltalk/selectors/selectors.factor +++ b/extra/smalltalk/selectors/selectors.factor @@ -9,7 +9,7 @@ SYMBOLS: unary binary keyword ; : selector-type ( selector -- type ) { { [ dup [ "~!@%&*-+=|\\<>,?/" member? ] all? ] [ binary ] } - { [ CHAR: : over member? ] [ keyword ] } + { [ char: : over member? ] [ keyword ] } [ unary ] } cond nip ; @@ -17,7 +17,7 @@ SYMBOLS: unary binary keyword ; dup selector-type { { unary [ drop { } ] } { binary [ drop { "x" } ] } - { keyword [ [ CHAR: : = ] count "x" ] } + { keyword [ [ char: : = ] count "x" ] } } case "receiver" suffix { "result" } ; : selector>generic ( selector -- generic ) diff --git a/extra/spelling/spelling.factor b/extra/spelling/spelling.factor index 78e5b20a31..20a8dcbac7 100644 --- a/extra/spelling/spelling.factor +++ b/extra/spelling/spelling.factor @@ -25,7 +25,7 @@ CONSTANT: ALPHABET "abcdefghijklmnopqrstuvwxyz" : inserts ( word -- edits ) [ length [0,b] ] keep '[ - CHAR: ? over _ insert-nth ALPHABET swap [ + char: ? over _ insert-nth ALPHABET swap [ swapd clone [ set-nth-unsafe ] keep ] curry with { } map-as ] map concat ; diff --git a/extra/successor/successor.factor b/extra/successor/successor.factor index 9f6f9f9c45..4c6867a8e7 100644 --- a/extra/successor/successor.factor +++ b/extra/successor/successor.factor @@ -12,10 +12,10 @@ IN: successor '[ _ > dup _ ] keep ? ; : next-digit ( ch -- ? ch' ) - 1 + CHAR: 9 CHAR: 0 carry ; + 1 + char: 9 char: 0 carry ; : next-letter ( ch -- ? ch' ) - [ ch>lower 1 + CHAR: z CHAR: a carry ] [ LETTER? ] bi + [ ch>lower 1 + char: z char: a carry ] [ LETTER? ] bi [ ch>upper ] when ; : next-char ( ch -- ? ch' ) diff --git a/extra/svg/svg.factor b/extra/svg/svg.factor index 51bf7a9668..cc54476dc2 100644 --- a/extra/svg/svg.factor +++ b/extra/svg/svg.factor @@ -13,7 +13,7 @@ XML-NS: sodipodi-name http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd XML-NS: inkscape-name http://www.inkscape.org/namespaces/inkscape : svg-string>number ( string -- number ) - H{ { CHAR: E CHAR: e } } substitute "e" split1 + H{ { char: E char: e } } substitute "e" split1 [ string>number ] [ [ string>number 10^ ] [ 1 ] if* ] bi* * >float ; diff --git a/extra/tar/tar.factor b/extra/tar/tar.factor index 4e9faf1ac5..a81019461b 100644 --- a/extra/tar/tar.factor +++ b/extra/tar/tar.factor @@ -178,27 +178,27 @@ C: symbolic-link dup typeflag>> { { 0 [ typeflag-0 ] } - { CHAR: 0 [ typeflag-0 ] } - ! { CHAR: 1 [ typeflag-1 ] } - { CHAR: 2 [ typeflag-2 ] } - ! { CHAR: 3 [ typeflag-3 ] } - ! { CHAR: 4 [ typeflag-4 ] } - { CHAR: 5 [ typeflag-5 ] } - ! { CHAR: 6 [ typeflag-6 ] } - ! { CHAR: 7 [ typeflag-7 ] } - { CHAR: g [ typeflag-g ] } - ! { CHAR: x [ typeflag-x ] } - ! { CHAR: A [ typeflag-A ] } - ! { CHAR: D [ typeflag-D ] } - ! { CHAR: E [ typeflag-E ] } - ! { CHAR: I [ typeflag-I ] } - ! { CHAR: K [ typeflag-K ] } - { CHAR: L [ typeflag-L ] } - ! { CHAR: M [ typeflag-M ] } - ! { CHAR: N [ typeflag-N ] } - ! { CHAR: S [ typeflag-S ] } - ! { CHAR: V [ typeflag-V ] } - ! { CHAR: X [ typeflag-X ] } + { char: 0 [ typeflag-0 ] } + ! { char: 1 [ typeflag-1 ] } + { char: 2 [ typeflag-2 ] } + ! { char: 3 [ typeflag-3 ] } + ! { char: 4 [ typeflag-4 ] } + { char: 5 [ typeflag-5 ] } + ! { char: 6 [ typeflag-6 ] } + ! { char: 7 [ typeflag-7 ] } + { char: g [ typeflag-g ] } + ! { char: x [ typeflag-x ] } + ! { char: A [ typeflag-A ] } + ! { char: D [ typeflag-D ] } + ! { char: E [ typeflag-E ] } + ! { char: I [ typeflag-I ] } + ! { char: K [ typeflag-K ] } + { char: L [ typeflag-L ] } + ! { char: M [ typeflag-M ] } + ! { char: N [ typeflag-N ] } + ! { char: S [ typeflag-S ] } + ! { char: V [ typeflag-V ] } + ! { char: X [ typeflag-X ] } { f [ drop ] } } case parse-tar ] [ diff --git a/extra/terminal/macosx/macosx.factor b/extra/terminal/macosx/macosx.factor index 0c58e03e83..ab781df878 100644 --- a/extra/terminal/macosx/macosx.factor +++ b/extra/terminal/macosx/macosx.factor @@ -31,7 +31,7 @@ STRUCT: winsize { ws_xpixel c:short } { ws_ypixel c:short } ; -MEMO: TIOCGWINSZ ( -- x ) CHAR: t 104 winsize heap-size _IOCR ; +MEMO: TIOCGWINSZ ( -- x ) char: t 104 winsize heap-size _IOCR ; PRIVATE> diff --git a/extra/text-analysis/text-analysis.factor b/extra/text-analysis/text-analysis.factor index 846ed9f707..bcef905537 100644 --- a/extra/text-analysis/text-analysis.factor +++ b/extra/text-analysis/text-analysis.factor @@ -57,7 +57,7 @@ CONSTANT: ABBREVIATIONS { $[ ABBREVIATIONS "|" join "(" ")\\.\x01" surround "i" - ] [ CHAR: . over index head ] re-replace-with + ] [ char: . over index head ] re-replace-with ! Split on EOS marker "\x01" split trimmed ; @@ -94,7 +94,7 @@ CONSTANT: add-syllable { : syllables ( str -- n ) dup length 1 = [ drop 1 ] [ - >lower CHAR: . swap remove + >lower char: . swap remove [ R/ [aeiouy]+/ count-matches ] [ sub-syllable [ matches? ] with count - ] [ add-syllable [ matches? ] with count + ] tri diff --git a/extra/text-to-pdf/text-to-pdf.factor b/extra/text-to-pdf/text-to-pdf.factor index d4f91b6ce6..2b826ce3c1 100644 --- a/extra/text-to-pdf/text-to-pdf.factor +++ b/extra/text-to-pdf/text-to-pdf.factor @@ -13,12 +13,12 @@ IN: text-to-pdf H{ { 0x08 "\\b" } { 0x0c "\\f" } - { CHAR: \n "\\n" } - { CHAR: \r "\\r" } - { CHAR: \t "\\t" } - { CHAR: \\ "\\\\" } - { CHAR: ( "\\(" } - { CHAR: ) "\\)" } + { char: \n "\\n" } + { char: \r "\\r" } + { char: \t "\\t" } + { char: \\ "\\\\" } + { char: ( "\\(" } + { char: ) "\\)" } } escape-string-by "(" ")" surround ; : pdf-object ( str n -- str' ) diff --git a/extra/tnetstrings/tnetstrings.factor b/extra/tnetstrings/tnetstrings.factor index f427901e8b..c8cf7ca114 100644 --- a/extra/tnetstrings/tnetstrings.factor +++ b/extra/tnetstrings/tnetstrings.factor @@ -43,13 +43,13 @@ DEFER: parse-tnetstring : parse-tnetstring ( data -- remain value ) parse-payload { - { CHAR: # [ string>number ] } - { CHAR: \" [ ] } - { CHAR: } [ parse-dict ] } - { CHAR: ] [ parse-list ] } - { CHAR: ! [ parse-bool ] } - { CHAR: ~ [ parse-null ] } - { CHAR: , [ ] } + { char: # [ string>number ] } + { char: \" [ ] } + { char: } [ parse-dict ] } + { char: ] [ parse-list ] } + { char: ! [ parse-bool ] } + { char: ~ [ parse-null ] } + { char: , [ ] } [ "Invalid payload type: %c" sprintf throw ] } case ; diff --git a/extra/tools/cal/cal.factor b/extra/tools/cal/cal.factor index 72619e1636..be2729796e 100644 --- a/extra/tools/cal/cal.factor +++ b/extra/tools/cal/cal.factor @@ -15,10 +15,10 @@ IN: tools.cal 42 " " pad-tail ; : month-header ( timestamp -- str ) - "%B %Y" strftime 20 CHAR: \s pad-center ; + "%B %Y" strftime 20 char: \s pad-center ; : year-header ( timestamp -- str ) - "%Y" strftime 64 CHAR: \s pad-center ; + "%Y" strftime 64 char: \s pad-center ; : month-rows ( timestamp -- rows ) days 7 group day-abbreviations2 prefix format-table ; @@ -31,7 +31,7 @@ PRIVATE> : year. ( timestamp -- ) dup year-header print nl 12 [1,b] [ >>month [ month-rows ] [ month-name ] bi - 20 CHAR: \s pad-center prefix + 20 char: \s pad-center prefix ] with map 3 group [ first3 [ "%s %s %s\n" printf ] 3each ] each ; diff --git a/extra/tools/wc/wc.factor b/extra/tools/wc/wc.factor index c0535df1bd..c254ddf75e 100644 --- a/extra/tools/wc/wc.factor +++ b/extra/tools/wc/wc.factor @@ -22,8 +22,8 @@ IN: tools.wc 0 [ aligned-slices [ uchar-16 cast-array swap - [ CHAR: \n uchar-16-with v= vcount + >fixnum ] reduce - ] [ [ CHAR: \n = ] count + >fixnum ] bi* + [ char: \n uchar-16-with v= vcount + >fixnum ] reduce + ] [ [ char: \n = ] count + >fixnum ] bi* ] each-block-slice ; inline : wc-stdin ( -- n ) diff --git a/extra/turing/turing.factor b/extra/turing/turing.factor index e4edf681b7..f1e2293dbb 100644 --- a/extra/turing/turing.factor +++ b/extra/turing/turing.factor @@ -63,7 +63,7 @@ SYMBOL: tape ! Print current turing machine state. state get . tape get . - 2 position get 2 * + CHAR: \s write "^" print ; + 2 position get 2 * + char: \s write "^" print ; : n ( -- ) ! Do one step and print new state. diff --git a/extra/txon/txon.factor b/extra/txon/txon.factor index e04c7c1a3d..6a559c91d0 100644 --- a/extra/txon/txon.factor +++ b/extra/txon/txon.factor @@ -13,13 +13,13 @@ IN: txon "\\`" "`" replace ; : `? ( ch1 ch2 -- ? ) - [ CHAR: \ = not ] [ CHAR: ` = ] bi* and ; + [ char: \ = not ] [ char: ` = ] bi* and ; : (find-`) ( string -- n/f ) 2 clump [ first2 `? ] find drop [ 1 + ] [ f ] if* ; : find-` ( string -- n/f ) - dup ?first CHAR: ` = [ drop 0 ] [ (find-`) ] if ; + dup ?first char: ` = [ drop 0 ] [ (find-`) ] if ; : parse-name ( string -- remain name ) ":`" split1 swap decode-value ; @@ -32,7 +32,7 @@ DEFER: name/values : parse-value ( string -- remain value ) dup find-` [ - dup 1 - pick ?nth CHAR: : = + dup 1 - pick ?nth char: : = [ drop name/values ] [ cut swap (parse-value) ] if [ rest [ blank? ] trim-head ] dip ] [ f swap ] if* ; @@ -45,7 +45,7 @@ DEFER: name/values ":`" over subseq? [ (name=value) ] [ f swap ] if ; : name/values ( string -- remain terms ) - [ dup { [ empty? not ] [ first CHAR: ` = not ] } 1&& ] + [ dup { [ empty? not ] [ first char: ` = not ] } 1&& ] [ name=value ] produce assoc-combine ; : parse-txon ( string -- objects ) diff --git a/extra/units/reduction/reduction.factor b/extra/units/reduction/reduction.factor index 3a75d359fc..e03073d757 100644 --- a/extra/units/reduction/reduction.factor +++ b/extra/units/reduction/reduction.factor @@ -7,9 +7,9 @@ IN: units.reduction CONSTANT: storage-suffixes { "B" "K" "M" "G" "T" "P" "E" "Z" "Y" } CONSTANT: unit-suffix-hash H{ - { CHAR: B 0 } { CHAR: K 1 } { CHAR: M 2 } { CHAR: G 3 } - { CHAR: T 4 } { CHAR: P 5 } { CHAR: E 6 } { CHAR: Z 7 } - { CHAR: Y 8 } + { char: B 0 } { char: K 1 } { char: M 2 } { char: G 3 } + { char: T 4 } { char: P 5 } { char: E 6 } { char: Z 7 } + { char: Y 8 } } : threshhold ( n multiplier base -- x ) diff --git a/extra/uu/uu.factor b/extra/uu/uu.factor index 6457289958..80de3f36a4 100644 --- a/extra/uu/uu.factor +++ b/extra/uu/uu.factor @@ -17,7 +17,7 @@ ERROR: bad-length seq ; 0 :> char! 0 :> bits! seq check-length [ - dup length CHAR: \s + , + dup length char: \s + , [ dup empty? bits zero? and ] [ @@ -30,7 +30,7 @@ ERROR: bad-length seq ; [ bits 6 >= ] [ bits 6 - - [ char swap neg shift 0x3f bitand CHAR: \s + , ] + [ char swap neg shift 0x3f bitand char: \s + , ] [ bits! ] bi ] while @@ -40,13 +40,13 @@ ERROR: bad-length seq ; ERROR: illegal-character ch ; : check-illegal-character ( ch -- ch ) - dup CHAR: \s dup 64 + between? [ illegal-character ] unless ; + dup char: \s dup 64 + between? [ illegal-character ] unless ; :: ascii>binary ( seq -- seq' ) 0 :> char! 0 :> bits! - seq unclip-slice CHAR: \s - :> len! + seq unclip-slice char: \s - :> len! [ [ dup empty? not len 0 > and ] [ @@ -55,7 +55,7 @@ ERROR: illegal-character ch ; drop 0 ] [ check-illegal-character - CHAR: \s - + char: \s - ] if char 6 shift bitor char! diff --git a/extra/yaml/conversion/conversion.factor b/extra/yaml/conversion/conversion.factor index 88d21c2ad2..d71be53ab4 100644 --- a/extra/yaml/conversion/conversion.factor +++ b/extra/yaml/conversion/conversion.factor @@ -92,7 +92,7 @@ CONSTANT: YAML_SET_TAG "tag:yaml.org,2002:set" : construct-int ( str -- n ) string>number ; : construct-infinity ( str -- -inf/+inf ) - first CHAR: - = -1/0. 1/0. ? ; + first char: - = -1/0. 1/0. ? ; : construct-float ( str -- x ) { @@ -107,11 +107,11 @@ CONSTANT: YAML_SET_TAG "tag:yaml.org,2002:set" ! - months, days and hours on 1 digit ! preprocess to fix this mess... : yaml>rfc3339 ( str -- str' ) - R/ -[0-9][^0-9]/ [ [ CHAR: 0 1 ] dip insert-nth ] re-replace-with - R/ -[0-9][^0-9]/ [ [ CHAR: 0 1 ] dip insert-nth ] re-replace-with - R/ [^0-9][0-9]:/ [ [ CHAR: 0 1 ] dip insert-nth ] re-replace-with + R/ -[0-9][^0-9]/ [ [ char: 0 1 ] dip insert-nth ] re-replace-with + R/ -[0-9][^0-9]/ [ [ char: 0 1 ] dip insert-nth ] re-replace-with + R/ [^0-9][0-9]:/ [ [ char: 0 1 ] dip insert-nth ] re-replace-with R/ [ \t]+/ " " re-replace - CHAR: : over index cut CHAR: space swap remove append ; + char: : over index cut char: space swap remove append ; : construct-timestamp ( obj -- obj' ) dup R/ [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ matches? diff --git a/extra/yaml/yaml-tests.factor b/extra/yaml/yaml-tests.factor index 93fb171e59..08dc1387c8 100644 --- a/extra/yaml/yaml-tests.factor +++ b/extra/yaml/yaml-tests.factor @@ -749,7 +749,7 @@ f value [ ! misc ! Don't use aliases/anchors for equal fixnums -{ f } [ CHAR: & { 0 0 } >yaml member? ] unit-test +{ f } [ char: & { 0 0 } >yaml member? ] unit-test ! !!!!!!!!!!!!!!! ! Config diff --git a/extra/zoneinfo/zoneinfo.factor b/extra/zoneinfo/zoneinfo.factor index 81b04e2b0b..65f6e14a8a 100644 --- a/extra/zoneinfo/zoneinfo.factor +++ b/extra/zoneinfo/zoneinfo.factor @@ -154,7 +154,7 @@ ERROR: zone-not-found name ; : on>value ( n -- n' ) ! "3", "Thu>=8" always >=, "lastFri" { - { [ dup 3 swap ?nth CHAR: > = ] [ + { [ dup 3 swap ?nth char: > = ] [ 3 cut 2 tail [ day-abbreviation3-predicate ] [ string>number ] bi* 2array ] } { [ dup "last" head? ] [ 4 tail day-abbreviation3-index ] } diff --git a/misc/fuel/strange-syntax.factor b/misc/fuel/strange-syntax.factor index 8712ea9024..ef72df7d0a 100644 --- a/misc/fuel/strange-syntax.factor +++ b/misc/fuel/strange-syntax.factor @@ -55,9 +55,9 @@ C-TYPE: cairo_snurface_t ! ! CHAR : stuff-with-chars ( -- K \n ) - CHAR: K - CHAR: \n - CHAR: \" ! <- \" should be highlighted + char: K + char: \n + char: \" ! <- \" should be highlighted drop ; ! ! MAIN @@ -96,7 +96,7 @@ FUNCTION: int futimes ( int id, FUNCTION: int booyah ( int x ) FUNCTION-ALIAS: test int bah ( int* ah, int[] eh ) -HEXCOLOR: ffffff COLOR: green NAN: 1234 CHAR: m alien: 93 +HEXCOLOR: ffffff COLOR: green NAN: 1234 char: m alien: 93 2drop 2drop drop PRIMITIVE: one ( a -- b )