From 489ce262a1b5882ee65e65a2257d9113bd6d0882 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 11 Jan 2023 19:17:47 -0600 Subject: [PATCH] factor: fix some spacing with some regexps in vscode: /^ [^\s]./ /^ \[/ /^ \]/ /^ \{/ /^ \}/ and vary the number of spaces --- basis/alien/data/data-docs.factor | 4 +- basis/alien/enums/enums.factor | 2 +- .../libraries/finder/freebsd/freebsd.factor | 9 +- basis/alien/libraries/libraries-docs.factor | 4 +- basis/alien/prettyprint/prettyprint.factor | 2 +- basis/bootstrap/assembler/arm.64.factor | 2 +- basis/calendar/calendar-docs.factor | 16 +-- basis/calendar/calendar.factor | 2 +- basis/circular/circular-docs.factor | 18 +-- basis/cocoa/dialogs/dialogs.factor | 2 +- .../short-circuit/smart/smart-docs.factor | 8 +- .../build-stack-frame-tests.factor | 10 +- .../cfg/ssa/construction/tdmsc/tdmsc.factor | 2 +- basis/compiler/errors/errors.factor | 26 ++-- basis/compiler/tests/alien.factor | 2 +- basis/compiler/tests/codegen.factor | 16 +-- basis/compiler/tests/intrinsics.factor | 2 +- basis/compression/gzip/gzip-tests.factor | 4 +- basis/compression/gzip/gzip.factor | 12 +- basis/compression/huffman/huffman.factor | 18 +-- basis/compression/inflate/inflate.factor | 12 +- .../distributed/distributed.factor | 2 +- basis/constructors/constructors-tests.factor | 2 +- basis/core-text/core-text.factor | 2 +- basis/couchdb/couchdb.factor | 2 +- basis/csv/csv.factor | 2 +- basis/db/postgresql/ffi/ffi.factor | 12 +- basis/db/tester/tester.factor | 16 +-- basis/db/tuples/tuples-docs.factor | 78 ++++++------ basis/db/types/types-docs.factor | 28 ++--- basis/deques/deques-docs.factor | 18 +-- basis/editors/acme/acme-docs.factor | 7 +- basis/editors/acme/acme.factor | 6 +- basis/environment/environment-docs.factor | 5 +- basis/farkup/farkup-tests.factor | 2 +- basis/fonts/fonts-docs.factor | 8 +- basis/formatting/formatting.factor | 10 +- basis/furnace/actions/actions-docs.factor | 10 +- basis/furnace/auth/auth-docs.factor | 18 +-- basis/furnace/auth/login/login-docs.factor | 4 +- .../auth/providers/couchdb/couchdb.factor | 6 +- .../boilerplate/boilerplate-docs.factor | 4 +- .../conversations/conversations-docs.factor | 4 +- basis/furnace/db/db-docs.factor | 4 +- .../redirection/redirection-docs.factor | 12 +- basis/furnace/referrer/referrer-docs.factor | 4 +- basis/furnace/sessions/sessions-docs.factor | 4 +- .../syndication/syndication-docs.factor | 20 +-- basis/game/input/xinput/xinput.factor | 4 +- basis/help/html/html.factor | 4 +- basis/help/lint/checks/checks.factor | 4 +- basis/help/lint/lint.factor | 12 +- basis/help/markup/markup.factor | 2 +- basis/http/client/client-tests.factor | 10 +- basis/http/client/client.factor | 4 +- .../dispatchers/dispatchers-docs.factor | 2 +- basis/http/server/server-docs.factor | 12 +- basis/http/server/static/static-docs.factor | 6 +- basis/images/loader/cocoa/cocoa.factor | 2 +- basis/ini-file/ini-file-tests.factor | 2 +- basis/io/files/info/unix/unix-docs.factor | 114 +++++++++--------- basis/io/files/links/links-docs.factor | 12 +- basis/io/files/windows/windows.factor | 2 +- basis/io/streams/limited/limited-docs.factor | 8 +- basis/json/reader/reader-tests.factor | 2 +- basis/json/writer/writer-docs.factor | 10 +- basis/lists/lazy/lazy.factor | 2 +- basis/lists/lists-tests.factor | 2 +- basis/math/bitwise/bitwise-docs.factor | 82 ++++++------- basis/math/matrices/matrices-docs.factor | 20 +-- basis/math/matrices/matrices-tests.factor | 24 ++-- basis/mime/multipart/multipart-tests.factor | 6 +- basis/mime/types/types-docs.factor | 6 +- basis/peg/ebnf/ebnf-tests.factor | 34 +++--- basis/peg/ebnf/ebnf.factor | 6 +- basis/persistent/hashtables/hashtables.factor | 4 +- .../quoted-printable/quoted-printable.factor | 6 +- basis/random/random-docs.factor | 8 +- basis/random/sfmt/sfmt.factor | 8 +- basis/retries/retries-tests.factor | 2 +- .../generalizations-docs.factor | 8 +- basis/sorting/human/human-docs.factor | 12 +- basis/sorting/slots/slots-docs.factor | 4 +- .../prettyprint/prettyprint.factor | 6 +- .../splitting/monotonic/monotonic-docs.factor | 12 +- basis/suffix-arrays/suffix-arrays-docs.factor | 12 +- basis/system-info/freebsd/freebsd.factor | 6 +- basis/timers/timers-docs.factor | 8 +- .../tools/annotations/annotations-docs.factor | 4 +- basis/tools/deploy/deploy-docs.factor | 6 +- basis/tools/files/files-docs.factor | 2 +- basis/tools/test/test.factor | 10 +- basis/ui/backend/gtk/gtk-tests.factor | 88 +++++++------- basis/ui/backend/gtk/io/io.factor | 6 +- basis/ui/backend/windows/windows.factor | 16 +-- basis/ui/gadgets/panes/panes-tests.factor | 8 +- basis/ui/pens/tile/tile.factor | 4 +- basis/unicode/breaks/breaks.factor | 22 ++-- basis/unicode/unicode.factor | 2 +- basis/unix/groups/groups-docs.factor | 26 ++-- basis/unix/users/users-docs.factor | 22 ++-- basis/urls/urls-docs.factor | 6 +- basis/windows/com/com.factor | 2 +- basis/windows/uniscribe/uniscribe.factor | 8 +- basis/x11/x11.factor | 4 +- basis/xml/data/data.factor | 2 +- basis/xml/dtd/dtd.factor | 2 +- basis/xml/syntax/syntax.factor | 4 +- basis/xml/tokenize/tokenize.factor | 8 +- basis/xml/writer/writer-tests.factor | 4 +- basis/xmode/marker/marker-tests.factor | 4 +- core/assocs/assocs-docs.factor | 34 +++--- core/assocs/assocs.factor | 2 +- core/byte-arrays/byte-arrays-docs.factor | 16 +-- core/classes/classes-docs.factor | 8 +- core/combinators/combinators-tests.factor | 6 +- .../short-circuit/short-circuit-docs.factor | 8 +- core/continuations/continuations-docs.factor | 6 +- core/destructors/destructors-docs.factor | 2 +- .../generalizations-docs.factor | 4 +- core/graphs/graphs.factor | 8 +- core/hash-sets/hash-sets.factor | 2 +- core/hashtables/hashtables-docs.factor | 4 +- core/io/encodings/encodings-docs.factor | 16 +-- core/io/encodings/encodings-tests.factor | 18 +-- core/io/io-docs.factor | 25 ++-- core/io/io.factor | 4 +- core/kernel/kernel-docs.factor | 4 +- core/locals/locals-tests.factor | 2 +- core/math/math-docs.factor | 6 +- core/math/parser/parser.factor | 2 +- core/sequences/sequences-docs.factor | 8 +- core/sequences/sequences.factor | 2 +- core/sets/sets-docs.factor | 8 +- core/syntax/syntax-docs.factor | 4 +- extra/asn1/asn1.factor | 2 +- extra/asn1/ldap/ldap.factor | 2 +- extra/assocs/extras/extras.factor | 4 +- extra/bitcoin/client/client-docs.factor | 6 +- extra/boids/boids.factor | 2 +- extra/bson/bson-tests.factor | 24 ++-- extra/bson/constants/constants.factor | 2 +- extra/bson/reader/reader.factor | 10 +- extra/bson/writer/writer.factor | 8 +- extra/c/preprocessor/preprocessor.factor | 2 +- extra/cgi/cgi.factor | 8 +- extra/cli/git/git.factor | 2 +- extra/combinators/extras/extras-tests.factor | 6 +- extra/cpu/8080/emulator/emulator.factor | 2 +- extra/crypto/aes/aes-tests.factor | 35 +++--- extra/crypto/aes/aes.factor | 2 +- .../crypto/passwd-md5/passwd-md5-docs.factor | 12 +- extra/cuda/prettyprint/prettyprint.factor | 10 +- extra/ecdsa/ecdsa.factor | 4 +- extra/elevate/elevate-docs.factor | 2 +- extra/game/debug/debug.factor | 18 +-- extra/gamelib/ui/ui.factor | 4 +- extra/generators/generators.factor | 2 +- extra/gpu/render/render.factor | 6 +- extra/gpu/util/util.factor | 6 +- extra/html/parser/analyzer/analyzer.factor | 2 +- extra/html5/html5.factor | 4 +- extra/http2/hpack/hpack-tests.factor | 2 +- extra/id3/id3-tests.factor | 24 ++-- extra/images/gif/gif.factor | 10 +- extra/images/viewer/viewer-tests.factor | 6 +- extra/images/viewer/viewer.factor | 2 +- extra/infix/infix-tests.factor | 7 +- extra/io/files/acls/macosx/ffi/ffi.factor | 20 +-- extra/io/files/acls/macosx/macosx.factor | 4 +- extra/io/streams/256color/256color.factor | 2 +- extra/io/streams/ansi/ansi.factor | 2 +- extra/irc/client/chats/chats.factor | 12 +- .../client/internals/internals-tests.factor | 7 +- extra/irc/client/internals/internals.factor | 8 +- extra/irc/logbot/log-line/log-line.factor | 2 +- extra/irc/messages/messages-tests.factor | 82 ++++++------- extra/lint/vocabs/vocabs.factor | 2 +- extra/logic/examples/money/money.factor | 12 +- extra/logic/logic-tests.factor | 4 +- extra/logic/logic.factor | 8 +- extra/mason/mason.factor | 4 +- extra/mason/report/report-tests.factor | 6 +- .../affine-transforms.factor | 2 +- extra/math/dual/dual.factor | 8 +- extra/math/finance/finance-docs.factor | 24 ++-- extra/math/text/french/french.factor | 20 +-- extra/merger/merger.factor | 2 +- extra/metar/metar.factor | 2 +- extra/models/illusion/illusion.factor | 2 +- extra/modern/html/html.factor | 2 +- extra/modern/modern.factor | 2 +- extra/modern/paths/paths.factor | 2 +- extra/mongodb/benchmark/benchmark.factor | 42 ++++--- extra/mongodb/connection/connection.factor | 25 ++-- extra/mongodb/driver/driver.factor | 14 ++- extra/mongodb/operations/operations.factor | 12 +- .../tuple/collection/collection.factor | 14 +-- .../tuple/persistent/persistent.factor | 79 ++++++------ extra/mongodb/tuple/state/state.factor | 4 +- extra/mongodb/tuple/tuple.factor | 53 ++++---- extra/odbc/odbc.factor | 16 +-- extra/project-euler/009/009.factor | 2 +- extra/project-euler/047/047.factor | 4 +- extra/project-euler/051/051.factor | 2 +- extra/project-euler/070/070.factor | 4 +- extra/project-euler/099/099.factor | 2 +- extra/project-euler/116/116.factor | 2 +- extra/project-euler/151/151.factor | 2 +- extra/punycode/punycode-tests.factor | 16 +-- .../demo/mesh-picking/mesh-picking.factor | 2 +- extra/readline/readline.factor | 2 +- extra/rosetta-code/animation/animation.factor | 2 +- .../bulls-and-cows/bulls-and-cows.factor | 2 +- extra/rosetta-code/dice7/dice7.factor | 2 +- .../inverted-index/inverted-index.factor | 2 +- extra/rosetta-code/metronome/metronome.factor | 2 +- extra/rosetta-code/n-queens/n-queens.factor | 14 +-- .../y-combinator/y-combinator.factor | 6 +- extra/sequences/extras/extras-docs.factor | 4 +- extra/sequences/extras/extras.factor | 4 +- .../smalltalk/compiler/compiler-tests.factor | 98 ++++++++------- extra/smalltalk/parser/parser-tests.factor | 110 ++++++++--------- extra/sodium/ffi/ffi.factor | 2 +- extra/spider/spider-docs.factor | 6 +- extra/tools/wc/wc.factor | 10 +- extra/trees/trees-tests.factor | 2 +- extra/trees/trees.factor | 4 +- extra/webapps/blogs/blogs.factor | 8 +- extra/webapps/wiki/wiki.factor | 2 +- extra/wordlet/wordlet.factor | 2 +- extra/yaml/ffi/ffi.factor | 6 +- extra/yaml/yaml-tests.factor | 22 ++-- extra/yaml/yaml.factor | 4 +- extra/yenc/yenc.factor | 2 +- extra/zealot/factor/factor.factor | 4 +- extra/zoneinfo/zoneinfo-tests.factor | 10 +- 237 files changed, 1271 insertions(+), 1247 deletions(-) diff --git a/basis/alien/data/data-docs.factor b/basis/alien/data/data-docs.factor index 8e86520e73..f18dd3d4af 100644 --- a/basis/alien/data/data-docs.factor +++ b/basis/alien/data/data-docs.factor @@ -159,8 +159,8 @@ ARTICLE: "c-boxes" "C value boxes" "FUNCTION: int do_foo ( int* a )" } "and writes to the pointer 'a', then it can be called like this:" -{ $code - "1234 int [ do_foo ] keep int deref" +{ $code + "1234 int [ do_foo ] keep int deref" } "The stack will then contain the two integers emitted by the 'do_foo' function." ; diff --git a/basis/alien/enums/enums.factor b/basis/alien/enums/enums.factor index e9f9d44ec6..6f1b1306af 100644 --- a/basis/alien/enums/enums.factor +++ b/basis/alien/enums/enums.factor @@ -28,7 +28,7 @@ M: enum-c-type c-type-boxed-class drop object ; M: enum-c-type c-type-boxer-quot members>> enum-boxer ; M: enum-c-type c-type-unboxer-quot drop [ enum>number ] ; M: enum-c-type c-type-setter - [ enum>number ] swap base-type>> c-type-setter '[ _ 2dip @ ] ; + [ enum>number ] swap base-type>> c-type-setter '[ _ 2dip @ ] ; : define-enum-value ( class value -- ) enum>number "enum-value" set-word-prop ; diff --git a/basis/alien/libraries/finder/freebsd/freebsd.factor b/basis/alien/libraries/finder/freebsd/freebsd.factor index a47f16daab..8523717cb6 100644 --- a/basis/alien/libraries/finder/freebsd/freebsd.factor +++ b/basis/alien/libraries/finder/freebsd/freebsd.factor @@ -6,10 +6,11 @@ IN: alien.libraries.finder.freebsd " split1 [ [ unicode:blank? ] trim ] bi@ - 2array - ] map ; + [ + ":-" split1 [ drop ] dip + "=>" split1 [ [ unicode:blank? ] trim ] bi@ + 2array + ] map ; : load-ldconfig-cache ( -- seq ) "/sbin/ldconfig -r" utf8 [ read-lines ] with-process-reader diff --git a/basis/alien/libraries/libraries-docs.factor b/basis/alien/libraries/libraries-docs.factor index 582b607f32..e5231b0d1a 100644 --- a/basis/alien/libraries/libraries-docs.factor +++ b/basis/alien/libraries/libraries-docs.factor @@ -54,8 +54,8 @@ HELP: dlsym? HELP: make-library { $values - { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $link cdecl } " or " { $link stdcall } } - { "library" library } } + { "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $link cdecl } " or " { $link stdcall } } + { "library" library } } { $description "Opens a C library using the path and ABI parameters and outputs a library tuple." } { $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ; diff --git a/basis/alien/prettyprint/prettyprint.factor b/basis/alien/prettyprint/prettyprint.factor index 3417d6d1b8..548d892487 100644 --- a/basis/alien/prettyprint/prettyprint.factor +++ b/basis/alien/prettyprint/prettyprint.factor @@ -135,4 +135,4 @@ M: enum-c-type-word synopsis* [ lookup-c-type base-type>> dup int eq? [ drop ] [ "<" text pprint-word ] if ] } cleave ; M: enum-c-type-word definition - lookup-c-type members>> ; + lookup-c-type members>> ; diff --git a/basis/bootstrap/assembler/arm.64.factor b/basis/bootstrap/assembler/arm.64.factor index 6079c7a0c9..327278439d 100644 --- a/basis/bootstrap/assembler/arm.64.factor +++ b/basis/bootstrap/assembler/arm.64.factor @@ -324,7 +324,7 @@ big-endian off jit-call-quot vm-reg "end_callback" jit-call-1arg - ] } + ] } } define-sub-primitives diff --git a/basis/calendar/calendar-docs.factor b/basis/calendar/calendar-docs.factor index db29a9f29d..b577c77abb 100644 --- a/basis/calendar/calendar-docs.factor +++ b/basis/calendar/calendar-docs.factor @@ -351,9 +351,9 @@ HELP: hence { $description "Computes a time in the future that is the " { $snippet "duration" } " added to the result of " { $link now } "." } { $examples { $unchecked-example - "USING: calendar prettyprint ;" - "10 hours hence ." - "T{ timestamp f 2008 9 2 2 47 45+943/1000 T{ duration f 0 0 0 -5 0 0 } }" + "USING: calendar prettyprint ;" + "10 hours hence ." + "T{ timestamp f 2008 9 2 2 47 45+943/1000 T{ duration f 0 0 0 -5 0 0 } }" } } ; @@ -362,9 +362,9 @@ HELP: ago { $description "Computes a time in the past that is the " { $snippet "duration" } " subtracted from the result of " { $link now } "." } { $examples { $unchecked-example - "USING: calendar prettyprint ;" - "3 weeks ago ." - "T{ timestamp f 2008 8 11 16 49 52+99/500 T{ duration f 0 0 0 -5 0 0 } }" + "USING: calendar prettyprint ;" + "3 weeks ago ." + "T{ timestamp f 2008 8 11 16 49 52+99/500 T{ duration f 0 0 0 -5 0 0 } }" } } ; @@ -489,8 +489,8 @@ HELP: time-since-midnight HELP: since-1970 { $values - { "duration" duration } - { "timestamp" timestamp } } + { "duration" duration } + { "timestamp" timestamp } } { $description "Adds the duration to the beginning of Unix time and returns the result as a timestamp." } ; ARTICLE: "calendar" "Calendar" diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index f8afca050a..91f918ef2e 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -261,7 +261,7 @@ M: number +second [ day>> +day ] [ month>> +month ] [ year>> +year ] - } cleave ; inline + } cleave ; inline PRIVATE> diff --git a/basis/circular/circular-docs.factor b/basis/circular/circular-docs.factor index 259001ef0a..54a86e6147 100644 --- a/basis/circular/circular-docs.factor +++ b/basis/circular/circular-docs.factor @@ -5,25 +5,25 @@ IN: circular HELP: { $values - { "n" integer } - { "circular" circular } } + { "n" integer } + { "circular" circular } } { $description "Creates a new circular string object. A circular string is a string object that can be accessed out of bounds and the index will wrap around to the start of the string." } ; HELP: { $values - { "seq" sequence } - { "circular" circular } } + { "seq" sequence } + { "circular" circular } } { $description "Creates a new " { $link circular } " object that wraps an existing sequence. By default, the index is set to zero." } ; HELP: { $values - { "capacity" integer } - { "growing-circular" growing-circular } } + { "capacity" integer } + { "growing-circular" growing-circular } } { $description "Creates a new growing-circular object." } ; HELP: change-circular-start { $values - { "n" integer } { "circular" circular } } + { "n" integer } { "circular" circular } } { $description "Changes the start index of a circular object." } ; HELP: circular @@ -34,12 +34,12 @@ HELP: growing-circular HELP: circular-push { $values - { "elt" object } { "circular" circular } } + { "elt" object } { "circular" circular } } { $description "Pushes an element to a " { $link circular } " object." } ; HELP: growing-circular-push { $values - { "elt" object } { "circular" circular } } + { "elt" object } { "circular" circular } } { $description "Pushes an element onto a " { $link growing-circular } " object." } ; HELP: rotate-circular diff --git a/basis/cocoa/dialogs/dialogs.factor b/basis/cocoa/dialogs/dialogs.factor index 74387d63ef..4f07d89c96 100644 --- a/basis/cocoa/dialogs/dialogs.factor +++ b/basis/cocoa/dialogs/dialogs.factor @@ -12,7 +12,7 @@ IN: cocoa.dialogs dup 1 -> setAllowsMultipleSelection: ; : ( -- panel ) - dup 1 -> setCanChooseDirectories: ; + dup 1 -> setCanChooseDirectories: ; : ( -- panel ) NSSavePanel -> savePanel diff --git a/basis/combinators/short-circuit/smart/smart-docs.factor b/basis/combinators/short-circuit/smart/smart-docs.factor index 10695086a0..8b0a784613 100644 --- a/basis/combinators/short-circuit/smart/smart-docs.factor +++ b/basis/combinators/short-circuit/smart/smart-docs.factor @@ -5,8 +5,8 @@ IN: combinators.short-circuit.smart HELP: && { $values - { "quots" "a sequence of quotations" } - { "quot" quotation } } + { "quots" "a sequence of quotations" } + { "quot" quotation } } { $description "Infers the number of arguments that each quotation takes from the stack. Each quotation must take the same number of arguments. Returns true if every quotation yields true, and stops early if one yields false." } { $examples "Smart combinators will infer the two inputs:" { $example "USING: prettyprint kernel math combinators.short-circuit.smart ;" @@ -17,8 +17,8 @@ HELP: && HELP: || { $values - { "quots" "a sequence of quotations" } - { "quot" quotation } } + { "quots" "a sequence of quotations" } + { "quot" quotation } } { $description "Infers the number of arguments that each quotation takes from the stack. Each quotation must take the same number of arguments. Returns true if any quotation yields true, and stops early when one yields true." } { $examples "Smart combinators will infer the two inputs:" { $example "USING: prettyprint kernel math combinators.short-circuit.smart ;" diff --git a/basis/compiler/cfg/build-stack-frame/build-stack-frame-tests.factor b/basis/compiler/cfg/build-stack-frame/build-stack-frame-tests.factor index 9acd7215f0..212a352efc 100644 --- a/basis/compiler/cfg/build-stack-frame/build-stack-frame-tests.factor +++ b/basis/compiler/cfg/build-stack-frame/build-stack-frame-tests.factor @@ -13,11 +13,11 @@ IN: compiler.cfg.build-stack-frame.tests 144 } [ T{ stack-frame - { params 91 } - { allot-area-align 8 } - { allot-area-size 10 } - { spill-area-align 8 } - { spill-area-size 16 } + { params 91 } + { allot-area-align 8 } + { allot-area-size 10 } + { spill-area-align 8 } + { spill-area-size 16 } } finalize-stack-frame slots[ allot-area-base spill-area-base total-size ] ! Exclude any reserved stack space 32 bytes on win64, 0 bytes diff --git a/basis/compiler/cfg/ssa/construction/tdmsc/tdmsc.factor b/basis/compiler/cfg/ssa/construction/tdmsc/tdmsc.factor index 3d3aae705e..ef75ed4fb8 100644 --- a/basis/compiler/cfg/ssa/construction/tdmsc/tdmsc.factor +++ b/basis/compiler/cfg/ssa/construction/tdmsc/tdmsc.factor @@ -88,4 +88,4 @@ PRIVATE> } apply-passes ; : merge-set ( bbs -- bbs' ) - (merge-set) [ members ] dip nths ; + (merge-set) [ members ] dip nths ; diff --git a/basis/compiler/errors/errors.factor b/basis/compiler/errors/errors.factor index a0f5c8f013..752f8466e0 100644 --- a/basis/compiler/errors/errors.factor +++ b/basis/compiler/errors/errors.factor @@ -30,12 +30,12 @@ M: linkage-error error-type drop +linkage-error+ ; dup asset>> compiler-errors get-global set-at ; T{ error-type-holder - { type +compiler-error+ } - { word ":errors" } - { plural "compiler errors" } - { icon "vocab:ui/tools/error-list/icons/compiler-error.png" } - { quot [ compiler-errors get values ] } - { forget-quot [ compiler-errors get delete-at ] } + { type +compiler-error+ } + { word ":errors" } + { plural "compiler errors" } + { icon "vocab:ui/tools/error-list/icons/compiler-error.png" } + { quot [ compiler-errors get values ] } + { forget-quot [ compiler-errors get delete-at ] } } define-error-type : ( error word -- compiler-error ) @@ -48,13 +48,13 @@ T{ error-type-holder '[ _ boa ] dip dup asset>> linkage-errors get set-at ; inline T{ error-type-holder - { type +linkage-error+ } - { word ":linkage" } - { plural "linkage errors" } - { icon "vocab:ui/tools/error-list/icons/linkage-error.png" } - { quot [ linkage-errors get values ] } - { forget-quot [ linkage-errors get delete-at ] } - { fatal? f } + { type +linkage-error+ } + { word ":linkage" } + { plural "linkage errors" } + { icon "vocab:ui/tools/error-list/icons/linkage-error.png" } + { quot [ linkage-errors get values ] } + { forget-quot [ linkage-errors get delete-at ] } + { fatal? f } } define-error-type ERROR: no-such-library name message ; diff --git a/basis/compiler/tests/alien.factor b/basis/compiler/tests/alien.factor index bd476d31c4..8ba7772ab6 100644 --- a/basis/compiler/tests/alien.factor +++ b/basis/compiler/tests/alien.factor @@ -1036,7 +1036,7 @@ FUNCTION: ulong ffi_test_70 ( test_struct_68 a test_struct_68 b, test_struct_66 ] unit-test { 55 } [ - 1 2 3 S{ test_struct_66 f 4 5 } S{ test_struct_69 f 6.0 7 8 } S{ test_struct_66 f 9 10 } ffi_test_69 + 1 2 3 S{ test_struct_66 f 4 5 } S{ test_struct_69 f 6.0 7 8 } S{ test_struct_66 f 9 10 } ffi_test_69 ] unit-test : callback-17 ( -- callback ) diff --git a/basis/compiler/tests/codegen.factor b/basis/compiler/tests/codegen.factor index 294ea1be3e..434dc0c583 100644 --- a/basis/compiler/tests/codegen.factor +++ b/basis/compiler/tests/codegen.factor @@ -375,14 +375,14 @@ cell 4 = [ ! Reduction : coalescing-bug-4 ( a b c -- a b c ) - [ [ min ] keep ] dip vector? [ 1 ] [ 2 ] if ; - - [ 2 3 2 ] [ 2 3 "" coalescing-bug-4 ] unit-test - [ 3 3 2 ] [ 4 3 "" coalescing-bug-4 ] unit-test - [ 3 3 2 ] [ 4 3 "" coalescing-bug-4 ] unit-test - [ 2 3 1 ] [ 2 3 V{ } coalescing-bug-4 ] unit-test - [ 3 3 1 ] [ 4 3 V{ } coalescing-bug-4 ] unit-test - [ 3 3 1 ] [ 4 3 V{ } coalescing-bug-4 ] unit-test + [ [ min ] keep ] dip vector? [ 1 ] [ 2 ] if ; + +[ 2 3 2 ] [ 2 3 "" coalescing-bug-4 ] unit-test +[ 3 3 2 ] [ 4 3 "" coalescing-bug-4 ] unit-test +[ 3 3 2 ] [ 4 3 "" coalescing-bug-4 ] unit-test +[ 2 3 1 ] [ 2 3 V{ } coalescing-bug-4 ] unit-test +[ 3 3 1 ] [ 4 3 V{ } coalescing-bug-4 ] unit-test +[ 3 3 1 ] [ 4 3 V{ } coalescing-bug-4 ] unit-test ! Global stack analysis dataflow equations are wrong : some-word ( a -- b ) 2 + ; diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index 41366e05e2..1ca53213e3 100644 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -514,7 +514,7 @@ ERROR: bug-in-fixnum* x y a b ; ] unit-test [ B{ 0 1 2 3 4 } ] [ - 2 B{ 0 1 2 3 4 } + 2 B{ 0 1 2 3 4 } [ 1 swap ] compile-call underlying>> ] unit-test diff --git a/basis/compression/gzip/gzip-tests.factor b/basis/compression/gzip/gzip-tests.factor index ac0459e3d4..719c4bceb6 100644 --- a/basis/compression/gzip/gzip-tests.factor +++ b/basis/compression/gzip/gzip-tests.factor @@ -109,7 +109,7 @@ USING: compression.gzip compression.inflate tools.test ; 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 } - compress-dynamic gzip-inflate + compress-dynamic gzip-inflate ] unit-test { B{ @@ -221,5 +221,5 @@ USING: compression.gzip compression.inflate tools.test ; 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 255 255 255 0 } - compress-fixed gzip-inflate + compress-fixed gzip-inflate ] unit-test diff --git a/basis/compression/gzip/gzip.factor b/basis/compression/gzip/gzip.factor index 8c281375ac..4ac7518389 100644 --- a/basis/compression/gzip/gzip.factor +++ b/basis/compression/gzip/gzip.factor @@ -94,7 +94,7 @@ SYMBOL: lit-vec dup array? [ [ first 5 >bit-array reverse ] [ second ] bi 2array ] [ 5 >bit-array reverse ] if ; : lit-to-bits ( lit -- bits ) - dup array? [ [ first (lit-to-bits) ] [ second ] bi 2array ] [ (lit-to-bits) ] if ; + dup array? [ [ first (lit-to-bits) ] [ second ] bi 2array ] [ (lit-to-bits) ] if ; : pair-to-bits ( l,d -- bits ) [ first lit-to-bits ] [ second dist-to-bits ] bi 2array ; @@ -124,7 +124,7 @@ SYMBOL: lit-vec ! Use the given dictionary to replace the element with its code :: replace-one ( ele code-dict -- new-ele ) - ele array? [ ele first code-dict at ele second 2array ] [ ele code-dict at ] if ; + ele array? [ ele first code-dict at ele second 2array ] [ ele code-dict at ] if ; ! replace both elements of a length distance pair with their codes : replace-pair ( pair -- new-pair ) @@ -136,10 +136,10 @@ SYMBOL: lit-vec ! Dictionary encoding : lit-code-lens ( -- len-seq ) - 285 [0..b] [ lit-dict get at length ] map [ zero? ] trim-tail ; + 285 [0..b] [ lit-dict get at length ] map [ zero? ] trim-tail ; : dist-code-lens ( -- len-seq ) - 31 [0..b] [ dist-dict get at length ] map [ zero? ] trim-tail ; + 31 [0..b] [ dist-dict get at length ] map [ zero? ] trim-tail ; :: replace-0-single ( m len-seq -- new-len-seq ) m 11 < [ len-seq m 0 17 m 3 - 3 >bit-array 2array 1array replace ] @@ -162,7 +162,7 @@ SYMBOL: lit-vec range empty? [ len-seq ] [ range first range 1 tail len-seq replace-all-runs replace-runs ] if ; : run-free-lit ( -- len-seq ) - 0 285 [a..b] lit-code-lens replace-0 replace-all-runs ; + 0 285 [a..b] lit-code-lens replace-0 replace-all-runs ; : run-free-dist ( -- len-seq ) 0 31 [a..b] dist-code-lens replace-0 replace-all-runs ; @@ -204,7 +204,7 @@ TUPLE: deflate-block ! Compresses a block with dynamic huffman compression, outputting a nested array structure : (compress-dynamic) ( lit-seq -- bit-arr-seq ) - [ dup compress-lz77 vec-to-lits { 256 } append lit-vec set + [ dup compress-lz77 vec-to-lits { 256 } append lit-vec set lit-vec get build-dicts dist-dict set lit-dict set diff --git a/basis/compression/huffman/huffman.factor b/basis/compression/huffman/huffman.factor index 329e29a741..9a8e7e64d0 100644 --- a/basis/compression/huffman/huffman.factor +++ b/basis/compression/huffman/huffman.factor @@ -45,9 +45,9 @@ TUPLE: huffman-code [ nip '[ _ swap _ set-at ] each ] 3bi ; :: reverse-table ( tdesc n -- rtable ) - n f :> table - tdesc [ n table update-reverse-table ] huffman-each - table seq>> ; + n f :> table + tdesc [ n table update-reverse-table ] huffman-each + table seq>> ; TUPLE: huffman-tree { code maybe{ fixnum } } @@ -83,16 +83,16 @@ TUPLE: huffman-tree { [ dup leaf? ] [ code>> ?{ } swap H{ } clone ?set-at ] } { [ dup left>> not ] [ right>> (generate-codes) [ ?{ t } prepend ] assoc-map ] } { [ dup right>> not ] [ left>> (generate-codes) [ ?{ f } prepend ] assoc-map ] } - [ + [ [ left>> (generate-codes) [ ?{ f } prepend ] assoc-map ] [ right>> (generate-codes) [ ?{ t } prepend ] assoc-map ] bi assoc-union! - ] - } cond ; + ] + } cond ; : generate-codes ( lit-seq -- code-dict ) [ - [ H{ } clone ] - [ H{ } clone leaf-table set + [ H{ } clone ] + [ H{ } clone leaf-table set node-heap set build-tree heap-pop swap (generate-codes) nip ] if-empty @@ -113,7 +113,7 @@ TUPLE: huffman-tree >alist [ <==> ] sort ; : get-next-code ( code current -- next ) - [ reverse bit-array>integer 1 + ] [ length ] bi >bit-array reverse dup length pick length swap - [ f ] replicate append nip ; + [ reverse bit-array>integer 1 + ] [ length ] bi >bit-array reverse dup length pick length swap - [ f ] replicate append nip ; ! Does most of the work of converting a collection of codes to canonical ones. : (canonize-codes) ( current codes -- codes ) diff --git a/basis/compression/inflate/inflate.factor b/basis/compression/inflate/inflate.factor index 65e132eeac..94ad9e4027 100644 --- a/basis/compression/inflate/inflate.factor +++ b/basis/compression/inflate/inflate.factor @@ -26,14 +26,14 @@ ERROR: bad-zlib-header ; : read-until-terminated ( data -- data ) - [ dup 8 swap bs:read 0 = ] [ ] until ; + [ dup 8 swap bs:read 0 = ] [ ] until ; :: interpret-flag ( flg data -- ) - 27 data bs:seek - flg first 1 = [ 8 data bs:read data bs:seek ] when - flg second 1 = [ data read-until-terminated drop ] when - flg fourth 1 = [ data read-until-terminated drop ] when - flg second 1 = [ 1 data bs:read drop ] when ; + 27 data bs:seek + flg first 1 = [ 8 data bs:read data bs:seek ] when + flg second 1 = [ data read-until-terminated drop ] when + flg fourth 1 = [ data read-until-terminated drop ] when + flg second 1 = [ 1 data bs:read drop ] when ; :: check-gzip-header ( data -- ) 8 data bs:read 31 assert= ! ID 1 diff --git a/basis/concurrency/distributed/distributed.factor b/basis/concurrency/distributed/distributed.factor index 45afe537c1..ade25b60e3 100644 --- a/basis/concurrency/distributed/distributed.factor +++ b/basis/concurrency/distributed/distributed.factor @@ -10,7 +10,7 @@ IN: concurrency.distributed stock-spread ( stock spread -- stock-spread ) - now >>timestamp ; + now >>timestamp ; SYMBOL: AAPL diff --git a/basis/core-text/core-text.factor b/basis/core-text/core-text.factor index d50f69040b..01f400af91 100644 --- a/basis/core-text/core-text.factor +++ b/basis/core-text/core-text.factor @@ -85,7 +85,7 @@ render-loc render-dim render-ext ; : selection-rect ( dim line selection -- rect ) [let [ start>> ] [ end>> ] [ string>> ] tri :> ( start end string ) - start end [ 0 swap string subseq utf16n encode length 2 /i ] bi@ + start end [ 0 swap string subseq utf16n encode length 2 /i ] bi@ ] [ f CTLineGetOffsetForStringIndex ] bi-curry@ bi [ drop nip 0 ] [ swap - swap second ] 3bi ; diff --git a/basis/couchdb/couchdb.factor b/basis/couchdb/couchdb.factor index 29e6bb1c65..87999291ea 100644 --- a/basis/couchdb/couchdb.factor +++ b/basis/couchdb/couchdb.factor @@ -86,7 +86,7 @@ CONSTANT: default-uuids-to-cache 100 [ dup server-url % "_uuids?count=" % uuids-to-cache>> number>string % ] "" make ; : uuids-get ( server -- uuids ) - uuids-url couch-get "uuids" of >vector ; + uuids-url couch-get "uuids" of >vector ; : get-uuids ( server -- server ) dup uuids-get [ nip ] curry change-uuids ; diff --git a/basis/csv/csv.factor b/basis/csv/csv.factor index e615493a45..1eb9eab8e7 100644 --- a/basis/csv/csv.factor +++ b/basis/csv/csv.factor @@ -24,7 +24,7 @@ DEFER: quoted-field, { CHAR: \r [ ] } ! Error: lf inside string? [ [ , drop f maybe-escaped-quote ] when* ] } case - ] if ; inline recursive + ] if ; inline recursive : quoted-field, ( delimiter stream -- delimiter stream sep/f ) "\"" over stream-read-until drop % t maybe-escaped-quote ; diff --git a/basis/db/postgresql/ffi/ffi.factor b/basis/db/postgresql/ffi/ffi.factor index 0ad686c8ce..b1783a9458 100644 --- a/basis/db/postgresql/ffi/ffi.factor +++ b/basis/db/postgresql/ffi/ffi.factor @@ -242,12 +242,12 @@ FUNCTION: int PQflush ( PGconn* conn ) ! * use ! FUNCTION: PGresult* PQfn ( PGconn* conn, - int fnid, - int* result_buf, - int* result_len, - int result_is_int, - PQArgBlock* args, - int nargs ) + int fnid, + int* result_buf, + int* result_len, + int result_is_int, + PQArgBlock* args, + int nargs ) ! Accessor functions for PGresult objects FUNCTION: ExecStatusType PQresultStatus ( PGresult* res ) diff --git a/basis/db/tester/tester.factor b/basis/db/tester/tester.factor index 0029a0de1e..825c9e77fa 100644 --- a/basis/db/tester/tester.factor +++ b/basis/db/tester/tester.factor @@ -48,19 +48,19 @@ IN: db.tester TUPLE: test-1 id a b c ; test-1 "TEST1" { - { "id" "ID" INTEGER +db-assigned-id+ } - { "a" "A" { VARCHAR 256 } +not-null+ } - { "b" "B" { VARCHAR 256 } +not-null+ } - { "c" "C" { VARCHAR 256 } +not-null+ } + { "id" "ID" INTEGER +db-assigned-id+ } + { "a" "A" { VARCHAR 256 } +not-null+ } + { "b" "B" { VARCHAR 256 } +not-null+ } + { "c" "C" { VARCHAR 256 } +not-null+ } } define-persistent TUPLE: test-2 id x y z ; test-2 "TEST2" { - { "id" "ID" INTEGER +db-assigned-id+ } - { "x" "X" { VARCHAR 256 } +not-null+ } - { "y" "Y" { VARCHAR 256 } +not-null+ } - { "z" "Z" { VARCHAR 256 } +not-null+ } + { "id" "ID" INTEGER +db-assigned-id+ } + { "x" "X" { VARCHAR 256 } +not-null+ } + { "y" "Y" { VARCHAR 256 } +not-null+ } + { "z" "Z" { VARCHAR 256 } +not-null+ } } define-persistent : test-1-tuple ( -- tuple ) diff --git a/basis/db/tuples/tuples-docs.factor b/basis/db/tuples/tuples-docs.factor index dd4837adae..c574e241bd 100644 --- a/basis/db/tuples/tuples-docs.factor +++ b/basis/db/tuples/tuples-docs.factor @@ -10,61 +10,61 @@ HELP: random-id-generator HELP: create-sql-statement { $values - { "class" class } - { "object" object } } + { "class" class } + { "object" object } } { $description "Generates the SQL code for creating a table for a given class." } ; HELP: drop-sql-statement { $values - { "class" class } - { "object" object } } + { "class" class } + { "object" object } } { $description "Generates the SQL code for dropping a table for a given class." } ; HELP: insert-tuple-set-key { $values - { "tuple" tuple } { "statement" statement } } + { "tuple" tuple } { "statement" statement } } { $description "Inserts a tuple and sets its primary key in one word. This is necessary for some databases." } ; HELP: { $values - { "query" query } - { "statement" statement } } + { "query" query } + { "statement" statement } } { $description "A database-specific hook for generating the SQL for a count statement." } ; HELP: { $values - { "tuple" tuple } { "class" class } - { "object" object } } + { "tuple" tuple } { "class" class } + { "object" object } } { $description "A database-specific hook for generating the SQL for an delete statement." } ; HELP: { $values - { "class" class } - { "object" object } } + { "class" class } + { "object" object } } { $description "A database-specific hook for generating the SQL for an insert statement with a database-assigned primary key." } ; HELP: { $values - { "class" class } - { "object" object } } + { "class" class } + { "object" object } } { $description "A database-specific hook for generating the SQL for an insert statement with a user-assigned primary key." } ; HELP: { $values - { "tuple" tuple } { "class" class } - { "statement" tuple } } + { "tuple" tuple } { "class" class } + { "statement" tuple } } { $description "A database-specific hook for generating the SQL for a select statement." } ; HELP: { $values - { "class" class } - { "object" object } } + { "class" class } + { "object" object } } { $description "A database-specific hook for generating the SQL for an update statement." } ; HELP: define-persistent { $values - { "class" class } { "table" string } { "columns" "an array of slot specifiers" } } + { "class" class } { "table" string } { "columns" "an array of slot specifiers" } } { $description "Defines a relation from a Factor " { $snippet "tuple class" } " to an SQL database table name. The format for the slot specifiers is as follows:" { $list { "a slot name from the " { $snippet "tuple class" } } @@ -84,22 +84,22 @@ HELP: define-persistent HELP: create-table { $values - { "class" class } } + { "class" class } } { $description "Creates an SQL table from a mapping defined by " { $link define-persistent } ". If the table already exists, the database will likely throw an error." } ; HELP: ensure-table { $values - { "class" class } } + { "class" class } } { $description "Creates an SQL table from a mapping defined by " { $link define-persistent } ". If the table already exists, the error is silently ignored." } ; HELP: ensure-tables { $values - { "classes" "a sequence of classes" } } + { "classes" "a sequence of classes" } } { $description "Creates an SQL table from a mapping defined by " { $link define-persistent } ". If a table already exists, the error is silently ignored." } ; HELP: recreate-table { $values - { "class" class } } + { "class" class } } { $description "Drops an existing table and re-creates it from a mapping defined by " { $link define-persistent } ". If the table does not exist the error is silently ignored." } { $warning { $emphasis "THIS WORD WILL DELETE YOUR DATA." } $nl " Use " { $link ensure-table } " unless you want to delete the data in this table." } ; @@ -108,25 +108,25 @@ HELP: recreate-table HELP: drop-table { $values - { "class" class } } + { "class" class } } { $description "Drops an existing table which deletes all of the data. The database will probably throw an error if the table does not exist." } { $warning { $emphasis "THIS WORD WILL DELETE YOUR DATA." } } ; HELP: insert-tuple { $values - { "tuple" tuple } } + { "tuple" tuple } } { $description "Inserts a tuple into a database if a relation has been defined with " { $link define-persistent } ". If a mapping states that the database assigns a primary key to the tuple, this value will be set after this word runs." } { $notes "Objects should only be inserted into a database once per object. To store the object after the initial insert, call " { $link update-tuple } "." } ; HELP: update-tuple { $values - { "tuple" tuple } } + { "tuple" tuple } } { $description "Updates a tuple that has already been inserted into a database. The tuple must have a primary key that has been set by " { $link insert-tuple } " or that is user-defined." } ; HELP: update-tuples { $values - { "query/tuple" tuple } - { "quot" { $quotation ( tuple -- tuple'/f ) } } } + { "query/tuple" tuple } + { "quot" { $quotation ( tuple -- tuple'/f ) } } } { $description "An SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". The " { $snippet "quot" } " is applied to each tuple from the database that matches the query, and the changed tuple is stored back to the database. If the " { $snippet "quot" } " returns " { $link f } ", the tuple is dropped, and its data remains unmodified in the database." $nl "The word is equivalent to the following code:" @@ -135,14 +135,14 @@ $nl HELP: delete-tuples { $values - { "tuple" tuple } } + { "tuple" tuple } } { $description "Uses the " { $snippet "tuple" } " as an exemplar object and deletes any objects that have the same slots set. If a slot is not " { $link f } ", then it is used to generate an SQL statement that deletes tuples." } { $warning "This word will delete your data." } ; HELP: reject-tuples { $values - { "query/tuple" tuple } - { "quot" { $quotation ( tuple -- ? ) } } } + { "query/tuple" tuple } + { "quot" { $quotation ( tuple -- ? ) } } } { $description "An SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". The " { $snippet "quot" } " is applied to each tuple from the database that matches the query, and if it returns a true value, the row is deleted from the database." $nl "The word is equivalent to the following code:" @@ -154,26 +154,26 @@ $nl HELP: each-tuple { $values - { "query/tuple" tuple } - { "quot" { $quotation ( tuple -- ) } } } + { "query/tuple" tuple } + { "quot" { $quotation ( tuple -- ) } } } { $description "An SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". The " { $snippet "quot" } " is applied to each tuple from the database that matches the query constructed from the exemplar tuple." } ; HELP: select-tuple { $values - { "query/tuple" tuple } - { "tuple/f" { $maybe tuple } } } + { "query/tuple" tuple } + { "tuple/f" { $maybe tuple } } } { $description "An SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns a single tuple from the database if it matches the query constructed from the exemplar tuple." } ; HELP: select-tuples { $values - { "query/tuple" tuple } - { "tuples" "an array of tuples" } } + { "query/tuple" tuple } + { "tuples" "an array of tuples" } } { $description "An SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns an array of multiple tuples from the database that match the query constructed from the exemplar tuple." } ; HELP: count-tuples { $values - { "query/tuple" tuple } - { "n" integer } } + { "query/tuple" tuple } + { "n" integer } } { $description "Returns the number of items that would be returned if the query were a select query. Counting the tuples with this word is more efficient than calling " { $link length } " on the result of " { $link select-tuples } "." } ; { each-tuple select-tuple select-tuples count-tuples } related-words @@ -272,7 +272,7 @@ T{ book "Now we've created a book. Let's save it to the database." { $code "USING: db db.sqlite fry io.files.temp ; : with-book-tutorial ( quot -- ) - '[ \"book-tutorial.db\" temp-file _ with-db ] call ; inline + '[ \"book-tutorial.db\" temp-file _ with-db ] call ; inline [ book recreate-table diff --git a/basis/db/types/types-docs.factor b/basis/db/types/types-docs.factor index ba2aac8ce5..f2e4fe2aa3 100644 --- a/basis/db/types/types-docs.factor +++ b/basis/db/types/types-docs.factor @@ -91,53 +91,53 @@ HELP: VARCHAR HELP: user-assigned-id-spec? { $values - { "specs" "a sequence of SQL specs" } - { "?" boolean } } + { "specs" "a sequence of SQL specs" } + { "?" boolean } } { $description "Tests if any of the SQL specs has the type " { $link +user-assigned-id+ } "." } ; HELP: bind# { $values - { "spec" "an SQL spec" } { "obj" object } } + { "spec" "an SQL spec" } { "obj" object } } { $description "A generic word that lets a database construct a literal binding." } ; HELP: bind% { $values - { "spec" "an SQL spec" } } + { "spec" "an SQL spec" } } { $description "A generic word that lets a database output a binding." } ; HELP: db-assigned-id-spec? { $values - { "specs" "a sequence of SQL specs" } - { "?" boolean } } + { "specs" "a sequence of SQL specs" } + { "?" boolean } } { $description "Tests if any of the SQL specs has the type " { $link +db-assigned-id+ } "." } ; HELP: find-primary-key { $values - { "specs" "a sequence of SQL specs" } - { "seq" "a sequence of SQL specs" } } + { "specs" "a sequence of SQL specs" } + { "seq" "a sequence of SQL specs" } } { $description "Returns the rows from the SQL specs array that are part of the primary key. Composite primary keys are supported, so this word must return a sequence." } { $notes "This is a low-level word." } ; HELP: no-sql-type { $values - { "type" "an SQL type" } } + { "type" "an SQL type" } } { $description "Throws an error containing an SQL type that is unsupported or the result of a typo." } ; HELP: normalize-spec { $values - { "spec" "an SQL spec" } } + { "spec" "an SQL spec" } } { $description "Normalizes an SQL spec." } ; HELP: primary-key? { $values - { "spec" "an SQL spec" } - { "?" boolean } } + { "spec" "an SQL spec" } + { "?" boolean } } { $description "Returns true if an SQL spec is a primary key." } ; HELP: relation? { $values - { "spec" "an SQL spec" } - { "?" boolean } } + { "spec" "an SQL spec" } + { "?" boolean } } { $description "Returns true if an SQL spec is a relation." } ; HELP: unknown-modifier diff --git a/basis/deques/deques-docs.factor b/basis/deques/deques-docs.factor index cd90a357e7..a6adcf3c07 100644 --- a/basis/deques/deques-docs.factor +++ b/basis/deques/deques-docs.factor @@ -16,13 +16,13 @@ HELP: deque-empty? HELP: clear-deque { $values - { "deque" deque } } + { "deque" deque } } { $description "Removes all elements from a deque." } ; HELP: deque-member? { $values - { "value" object } { "deque" deque } - { "?" boolean } } + { "value" object } { "deque" deque } + { "?" boolean } } { $description "Returns true if the " { $snippet "value" } " is found in the deque." } ; HELP: push-front @@ -54,12 +54,12 @@ HELP: push-back* HELP: push-all-back { $values - { "seq" sequence } { "deque" deque } } + { "seq" sequence } { "deque" deque } } { $description "Pushes a sequence of elements onto the back of a deque." } ; HELP: push-all-front { $values - { "seq" sequence } { "deque" deque } } + { "seq" sequence } { "deque" deque } } { $description "Pushes a sequence of elements onto the front of a deque." } ; HELP: peek-front* @@ -110,7 +110,7 @@ HELP: pop-back* HELP: delete-node { $values - { "node" object } { "deque" deque } } + { "node" object } { "deque" deque } } { $contract "Deletes the node from the deque." } ; HELP: deque @@ -118,13 +118,13 @@ HELP: deque HELP: node-value { $values - { "node" object } - { "value" object } } + { "node" object } + { "value" object } } { $description "Accesses the value stored at a node." } ; HELP: slurp-deque { $values - { "deque" deque } { "quot" { $quotation ( ... obj -- ... ) } } } + { "deque" deque } { "quot" { $quotation ( ... obj -- ... ) } } } { $description "Pops off the back element of the deque and calls the quotation in a loop until the deque is empty." } { $examples { $example diff --git a/basis/editors/acme/acme-docs.factor b/basis/editors/acme/acme-docs.factor index be29f1cc93..3d27f4d154 100644 --- a/basis/editors/acme/acme-docs.factor +++ b/basis/editors/acme/acme-docs.factor @@ -20,10 +20,9 @@ HELP: plan9-path "The " { $link plan9-path } " word will try to locate your Plan9" " installation. In order of preference this word checks:" $nl -{ - $list - { "The " { $link plan9-path } " global" } - "The PLAN9 environment variable" +{ $list + { "The " { $link plan9-path } " global" } + "The PLAN9 environment variable" } $nl "Finally, if neither is available, falls back to " diff --git a/basis/editors/acme/acme.factor b/basis/editors/acme/acme.factor index 4f6580eae1..3c9de98ae5 100644 --- a/basis/editors/acme/acme.factor +++ b/basis/editors/acme/acme.factor @@ -25,10 +25,10 @@ editor-class [ acme ] initialize : (massage-pathname) ( file line -- str ) over file-info regular-file? - [ number>string 2array ":" join ] - [ drop ] if ; + [ number>string 2array ":" join ] + [ drop ] if ; PRIVATE> M: acme editor-command ( file line -- command ) - [ (plumb-path) , "-d" , "edit" , (massage-pathname) , ] { } make ; + [ (plumb-path) , "-d" , "edit" , (massage-pathname) , ] { } make ; diff --git a/basis/environment/environment-docs.factor b/basis/environment/environment-docs.factor index 823c9b35a4..98c8d7210f 100644 --- a/basis/environment/environment-docs.factor +++ b/basis/environment/environment-docs.factor @@ -6,14 +6,13 @@ IN: environment HELP: (os-envs) { $values - - { "seq" sequence } } + { "seq" sequence } } { $description "Returns a sequence of key/value pairs from the operating system." } { $notes "In most cases, use " { $link os-envs } " instead." } ; HELP: (set-os-envs) { $values - { "seq" sequence } } + { "seq" sequence } } { $description "Low-level word for replacing the current set of environment variables." } { $notes "In most cases, use " { $link set-os-envs } " instead." } ; diff --git a/basis/farkup/farkup-tests.factor b/basis/farkup/farkup-tests.factor index 34c1c59ab5..dd52aa18ed 100644 --- a/basis/farkup/farkup-tests.factor +++ b/basis/farkup/farkup-tests.factor @@ -135,7 +135,7 @@ link-no-follow? off { "

asdf

  • lol
  • haha
" } [ "asdf\n-lol\n-haha" convert-farkup ] unit-test { "

asdf

  • lol
  • haha
" } - [ "asdf\n\n-lol\n-haha" convert-farkup ] unit-test +[ "asdf\n\n-lol\n-haha" convert-farkup ] unit-test { "
" } [ "___" convert-farkup ] unit-test { "
" } [ "___\n" convert-farkup ] unit-test diff --git a/basis/fonts/fonts-docs.factor b/basis/fonts/fonts-docs.factor index 3b30713ef3..5d9b889b10 100644 --- a/basis/fonts/fonts-docs.factor +++ b/basis/fonts/fonts-docs.factor @@ -12,15 +12,15 @@ HELP: font HELP: font-with-background { $values - { "font" font } { "color" color } - { "font'" font } + { "font" font } { "color" color } + { "font'" font } } { $description "Creates a new font equal to the given font, except with a different " { $slot "background" } " slot." } ; HELP: font-with-foreground { $values - { "font" font } { "color" color } - { "font'" font } + { "font" font } { "color" color } + { "font'" font } } { $description "Creates a new font equal to the given font, except with a different " { $slot "foreground" } " slot." } ; diff --git a/basis/formatting/formatting.factor b/basis/formatting/formatting.factor index 1f5663c959..f02c16de64 100644 --- a/basis/formatting/formatting.factor +++ b/basis/formatting/formatting.factor @@ -195,11 +195,11 @@ MACRO: sprintf ( format-string -- quot ) : >datetime ( timestamp -- string ) [ { - [ day-of-week day-abbreviation3 ] - [ month>> month-abbreviation ] - [ day>> pad-00 ] - [ >time ] - [ year>> number>string ] + [ day-of-week day-abbreviation3 ] + [ month>> month-abbreviation ] + [ day>> pad-00 ] + [ >time ] + [ year>> number>string ] } cleave ] output>array join-words ; inline diff --git a/basis/furnace/actions/actions-docs.factor b/basis/furnace/actions/actions-docs.factor index 1a107d5c89..f97270ffe8 100644 --- a/basis/furnace/actions/actions-docs.factor +++ b/basis/furnace/actions/actions-docs.factor @@ -8,8 +8,8 @@ HELP: HELP: { $values - { "path" "a path" } - { "response" response } + { "path" "a path" } + { "response" response } } { $description "Creates an HTTP response which serves a Chloe template. See " { $link "html.templates.chloe" } "." } ; @@ -24,8 +24,8 @@ $nl HELP: new-action { $values - { "class" class } - { "action" action } + { "class" class } + { "action" action } } { $description "Constructs a subclass of " { $link action } "." } ; @@ -46,7 +46,7 @@ HELP: validate-integer-id HELP: validate-params { $values - { "validators" "an association list mapping parameter names to validator quotations" } + { "validators" "an association list mapping parameter names to validator quotations" } } { $description "Validates query or POST parameters, depending on the request type, and stores them in " { $link "html.forms.values" } ". The validator quotations can execute " { $link "validators" } "." } { $examples diff --git a/basis/furnace/auth/auth-docs.factor b/basis/furnace/auth/auth-docs.factor index 68125b3311..443186ab2e 100644 --- a/basis/furnace/auth/auth-docs.factor +++ b/basis/furnace/auth/auth-docs.factor @@ -5,8 +5,8 @@ IN: furnace.auth HELP: { $values - { "responder" "a responder" } - { "protected" "a new responder" } + { "responder" "a responder" } + { "protected" "a new responder" } } { $description "Wraps a responder in a protected responder. Access to the wrapped responder will be conditional upon the client authenticating with the current authentication realm." } ; @@ -27,15 +27,15 @@ HELP: define-capability HELP: encode-password { $values - { "string" string } { "salt" integer } - { "bytes" byte-array } + { "string" string } { "salt" integer } + { "bytes" byte-array } } { $description "Encodes a password with the current authentication realm's checksum." } ; HELP: have-capabilities? { $values - { "capabilities" "a sequence of capabilities" } - { "?" boolean } + { "capabilities" "a sequence of capabilities" } + { "?" boolean } } { $description "Tests if the currently logged-in user possesses the given capabilities." } ; @@ -44,14 +44,14 @@ HELP: logged-in-user HELP: login-required { $values - { "description" string } { "capabilities" "a sequence of capabilities" } + { "description" string } { "capabilities" "a sequence of capabilities" } } { $description "Redirects the client to a login page." } ; HELP: login-required* { $values - { "description" string } { "capabilities" "a sequence of capabilities" } { "realm" "an authenticaiton realm" } - { "response" response } + { "description" string } { "capabilities" "a sequence of capabilities" } { "realm" "an authenticaiton realm" } + { "response" response } } { $contract "Constructs an HTTP response for redirecting the client to a login page." } ; diff --git a/basis/furnace/auth/login/login-docs.factor b/basis/furnace/auth/login/login-docs.factor index fe9fef0f3f..efebdbb0ff 100644 --- a/basis/furnace/auth/login/login-docs.factor +++ b/basis/furnace/auth/login/login-docs.factor @@ -3,8 +3,8 @@ IN: furnace.auth.login HELP: { $values - { "responder" "a responder" } { "name" string } - { "realm" "a new responder" } + { "responder" "a responder" } { "name" string } + { "realm" "a new responder" } } { $description "Wraps a responder in a new login realm with the given name. The realm must be configured before use; see " { $link "furnace.auth.realm-config" } "." } ; diff --git a/basis/furnace/auth/providers/couchdb/couchdb.factor b/basis/furnace/auth/providers/couchdb/couchdb.factor index 79d272d15a..b4b737ef07 100644 --- a/basis/furnace/auth/providers/couchdb/couchdb.factor +++ b/basis/furnace/auth/providers/couchdb/couchdb.factor @@ -136,9 +136,9 @@ TUPLE: couchdb-auth-provider bi ; : user>user-hash ( user -- hash ) - hash-mirror - [ [ "password" ] dip [ >base64 >string ] change-at ] keep - couchdb-auth-provider get field-map>> map-fields-forward ; + hash-mirror + [ [ "password" ] dip [ >base64 >string ] change-at ] keep + couchdb-auth-provider get field-map>> map-fields-forward ; ! Used when the user is guaranteed to exist if the logic of the Factor ! code is correct (e.g. when update-user is called). diff --git a/basis/furnace/boilerplate/boilerplate-docs.factor b/basis/furnace/boilerplate/boilerplate-docs.factor index ea01cdd96a..3fb6c10ef6 100644 --- a/basis/furnace/boilerplate/boilerplate-docs.factor +++ b/basis/furnace/boilerplate/boilerplate-docs.factor @@ -3,8 +3,8 @@ IN: furnace.boilerplate HELP: { $values - { "responder" "a responder" } - { "boilerplate" "a new boilerplate responder" } + { "responder" "a responder" } + { "boilerplate" "a new boilerplate responder" } } { $description "Wraps a responder in a boilerplate responder. The boilerplate responder needs to be configured before use; see " { $link "furnace.boilerplate.config" } "." } ; diff --git a/basis/furnace/conversations/conversations-docs.factor b/basis/furnace/conversations/conversations-docs.factor index bb62c3104d..8feb52c09f 100644 --- a/basis/furnace/conversations/conversations-docs.factor +++ b/basis/furnace/conversations/conversations-docs.factor @@ -4,8 +4,8 @@ IN: furnace.conversations HELP: { $values - { "responder" "a responder" } - { "responder'" "a new responder" } + { "responder" "a responder" } + { "responder'" "a new responder" } } { $description "Creates a new " { $link conversations } " responder wrapping an existing responder." } ; diff --git a/basis/furnace/db/db-docs.factor b/basis/furnace/db/db-docs.factor index c40b9f9c15..89f7c7597d 100644 --- a/basis/furnace/db/db-docs.factor +++ b/basis/furnace/db/db-docs.factor @@ -3,8 +3,8 @@ IN: furnace.db HELP: { $values - { "responder" "a responder" } { "db" "a database descriptor" } - { "responder'" db-persistence } + { "responder" "a responder" } { "db" "a database descriptor" } + { "responder'" db-persistence } } { $description "Wraps a responder with database persistence support. The responder's " { $link call-responder* } " method will run in a " { $link with-db } " scope." } ; diff --git a/basis/furnace/redirection/redirection-docs.factor b/basis/furnace/redirection/redirection-docs.factor index e8f917f1f8..b7035d24aa 100644 --- a/basis/furnace/redirection/redirection-docs.factor +++ b/basis/furnace/redirection/redirection-docs.factor @@ -15,23 +15,23 @@ HELP: HELP: { $values - { "url" url } - { "response" response } + { "url" url } + { "response" response } } { $description "Creates a responder which unconditionally redirects the client to the given URL after setting its protocol to HTTPS." } { $notes "This word is intended to be used with a relative URL. The client is redirected to the relative URL, but with HTTPS instead of HTTP." } ; HELP: >secure-url { $values - { "url" url } - { "url'" url } + { "url" url } + { "url'" url } } { $description "Sets the protocol of a URL to HTTPS." } ; HELP: if-secure { $values - { "quot" quotation } - { "response" response } + { "quot" quotation } + { "response" response } } { $description "Runs a quotation if the current request was made over HTTPS, otherwise returns a redirect to have the client request the current page again via HTTPS." } ; diff --git a/basis/furnace/referrer/referrer-docs.factor b/basis/furnace/referrer/referrer-docs.factor index 01bcf88e34..53d1d77209 100644 --- a/basis/furnace/referrer/referrer-docs.factor +++ b/basis/furnace/referrer/referrer-docs.factor @@ -3,8 +3,8 @@ IN: furnace.referrer HELP: { $values - { "responder" "a responder" } - { "responder'" "a responder" } + { "responder" "a responder" } + { "responder'" "a responder" } } { $description "Wraps the responder in a filter responder which ensures that form submissions originate from a page on the same server. Any submissions which do not are sent back with a 403 error." } ; diff --git a/basis/furnace/sessions/sessions-docs.factor b/basis/furnace/sessions/sessions-docs.factor index 515954c30c..a3de063172 100644 --- a/basis/furnace/sessions/sessions-docs.factor +++ b/basis/furnace/sessions/sessions-docs.factor @@ -4,8 +4,8 @@ IN: furnace.sessions HELP: { $values - { "responder" "a responder" } - { "responder'" "a new responder" } + { "responder" "a responder" } + { "responder'" "a new responder" } } { $description "Wraps a responder in a session manager responder." } ; diff --git a/basis/furnace/syndication/syndication-docs.factor b/basis/furnace/syndication/syndication-docs.factor index 714b0cef0f..fc4797da7d 100644 --- a/basis/furnace/syndication/syndication-docs.factor +++ b/basis/furnace/syndication/syndication-docs.factor @@ -8,8 +8,8 @@ HELP: HELP: >entry { $values - { "object" object } - { "entry" entry } + { "object" object } + { "entry" entry } } { $contract "Converts an object into an Atom feed entry. The default implementation constructs an entry by calling " { $link feed-entry-title } ", " @@ -22,29 +22,29 @@ HELP: feed-action HELP: feed-entry-date { $values - { "object" object } - { "timestamp" timestamp } + { "object" object } + { "timestamp" timestamp } } { $contract "Outputs a feed entry timestmap." } ; HELP: feed-entry-description { $values - { "object" object } - { "description" string } + { "object" object } + { "description" string } } { $contract "Outputs a feed entry description." } ; HELP: feed-entry-title { $values - { "object" object } - { "string" string } + { "object" object } + { "string" string } } { $contract "Outputs a feed entry title." } ; HELP: feed-entry-url { $values - { "object" object } - { "url" url } + { "object" object } + { "url" url } } { $contract "Outputs a feed entry URL." } ; diff --git a/basis/game/input/xinput/xinput.factor b/basis/game/input/xinput/xinput.factor index 0959df79f5..879e490626 100644 --- a/basis/game/input/xinput/xinput.factor +++ b/basis/game/input/xinput/xinput.factor @@ -34,7 +34,7 @@ MACRO: map-index-compose ( seq quot -- quot' ) map-index-compose 2cleave ; : >pov ( byte -- symbol ) - { + { pov-neutral pov-up pov-down @@ -51,7 +51,7 @@ MACRO: map-index-compose ( seq quot -- quot' ) pov-neutral pov-neutral pov-neutral - } nth ; + } nth ; : fill-controller-state ( XINPUT_STATE -- controller-state ) Gamepad>> controller-state new dup rot diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index c9cd833b69..9e9fb9b16b 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -108,7 +108,7 @@ M: pathname url-of } }); - XML] ; + XML] ; : help-header ( stylesheet -- xml ) help-stylesheet help-meta swap help-script 3append ; @@ -127,7 +127,7 @@ M: pathname url-of Handbook >Glossary - XML] ; + XML] ; : help-footer ( -- xml ) version-info "\n" split1 drop diff --git a/basis/help/lint/checks/checks.factor b/basis/help/lint/checks/checks.factor index cbaff6550b..de62d72ad9 100644 --- a/basis/help/lint/checks/checks.factor +++ b/basis/help/lint/checks/checks.factor @@ -47,8 +47,8 @@ SYMBOL: vocab-articles ] vocabs-quot get call( quot -- ) ] leaks members no-ui-disposables dup length 0 > [ - dup [ class-of ] histogram-by - [ "Leaked resources: " write ... ] with-string-writer simple-lint-error + dup [ class-of ] histogram-by + [ "Leaked resources: " write ... ] with-string-writer simple-lint-error ] [ drop ] if ; diff --git a/basis/help/lint/lint.factor b/basis/help/lint/lint.factor index 1162ec7657..26fb942889 100644 --- a/basis/help/lint/lint.factor +++ b/basis/help/lint/lint.factor @@ -15,12 +15,12 @@ TUPLE: help-lint-error < source-file-error ; SYMBOL: +help-lint-failure+ T{ error-type-holder - { type +help-lint-failure+ } - { word ":lint-failures" } - { plural "help lint failures" } - { icon "vocab:ui/tools/error-list/icons/help-lint-error.png" } - { quot [ lint-failures get values ] } - { forget-quot [ lint-failures get delete-at ] } + { type +help-lint-failure+ } + { word ":lint-failures" } + { plural "help lint failures" } + { icon "vocab:ui/tools/error-list/icons/help-lint-error.png" } + { quot [ lint-failures get values ] } + { forget-quot [ lint-failures get delete-at ] } } define-error-type M: help-lint-error error-type drop +help-lint-failure+ ; diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index a92c2d64b8..c1be84b1ea 100644 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -376,7 +376,7 @@ M: f ($instance) ($link) ; print-element $snippet ; : ($instances) ( element -- ) - dup word? [ ($link) "s" print-element ] [ print-element ] if ; + dup word? [ ($link) "s" print-element ] [ print-element ] if ; : $sequence ( element -- ) { "a " { $link sequence } " of " } print-element diff --git a/basis/http/client/client-tests.factor b/basis/http/client/client-tests.factor index 49b897180e..6ccf080b06 100644 --- a/basis/http/client/client-tests.factor +++ b/basis/http/client/client-tests.factor @@ -99,7 +99,7 @@ IN: http.client.tests "https://www.apple.com/index.html" "CONNECT" f >>proxy-url - request-uri + request-uri ] unit-test { f } [ @@ -229,10 +229,10 @@ CONSTANT: classic-proxy-settings H{ ! This url is misparsed bu request-url can fix it { T{ url - { protocol "http" } - { host "www.google.com" } - { path "/" } - { port 80 } + { protocol "http" } + { host "www.google.com" } + { path "/" } + { port 80 } } } [ "www.google.com" request-url ] unit-test ! This one is not fixable, leave it as it is diff --git a/basis/http/client/client.factor b/basis/http/client/client.factor index 236a203bc8..a41146a6a4 100644 --- a/basis/http/client/client.factor +++ b/basis/http/client/client.factor @@ -177,8 +177,8 @@ SYMBOL: redirects : no-proxy? ( request -- ? ) get-no-proxy-list [ - [ url>> host>> "." split ] dip "," split - [ "." split no-proxy-match? ] with any? + [ url>> host>> "." split ] dip "," split + [ "." split no-proxy-match? ] with any? ] [ drop f ] if* ; : (check-proxy) ( proxy -- ? ) diff --git a/basis/http/server/dispatchers/dispatchers-docs.factor b/basis/http/server/dispatchers/dispatchers-docs.factor index 583edee8ee..c2d67d219c 100644 --- a/basis/http/server/dispatchers/dispatchers-docs.factor +++ b/basis/http/server/dispatchers/dispatchers-docs.factor @@ -23,7 +23,7 @@ HELP: HELP: add-responder { $values - { "dispatcher" dispatcher } { "responder" "a responder" } { "path" "a pathname string or hostname" } } + { "dispatcher" dispatcher } { "responder" "a responder" } { "path" "a pathname string or hostname" } } { $description "Adds a responder to a dispatcher." } { $notes "The " { $snippet "path" } " parameter is interpreted differently depending on the dispatcher type." } { $side-effects "dispatcher" } ; diff --git a/basis/http/server/server-docs.factor b/basis/http/server/server-docs.factor index be09e235a6..a3a24c462f 100644 --- a/basis/http/server/server-docs.factor +++ b/basis/http/server/server-docs.factor @@ -15,14 +15,14 @@ HELP: benchmark? HELP: call-responder { $values - { "path" "a sequence of strings" } { "responder" "a responder" } - { "response" response } } + { "path" "a sequence of strings" } { "responder" "a responder" } + { "response" response } } { $description "Calls a responder." } ; HELP: call-responder* { $values - { "path" "a sequence of strings" } { "responder" "a responder" } - { "response" response } } + { "path" "a sequence of strings" } { "responder" "a responder" } + { "response" response } } { $contract "Processes an HTTP request and returns a response." } { $notes "When this word is called, various dynamic variables are set; see " { $link "http.server.requests" } "." } ; @@ -64,8 +64,8 @@ HELP: request-params HELP: param { $values - { "name" string } - { "value" string } + { "name" string } + { "value" string } } { $description "Outputs the value of a query parameter (if the current request is a GET or HEAD request) or a POST parameter (if the current request is a POST request)." } { $notes "Instead of using this word, it is better to use " { $vocab-link "furnace.actions" } " and the associated validation machinery, which allows you to access values using " { $link "html.forms.values" } " words." } ; diff --git a/basis/http/server/static/static-docs.factor b/basis/http/server/static/static-docs.factor index df8827795b..a882a0e261 100644 --- a/basis/http/server/static/static-docs.factor +++ b/basis/http/server/static/static-docs.factor @@ -9,9 +9,9 @@ HELP: HELP: { $values - { "root" "a pathname string" } - { "responder" file-responder } } - { $description "Creates a file responder which serves content from " { $snippet "path" } "." } ; + { "root" "a pathname string" } + { "responder" file-responder } } +{ $description "Creates a file responder which serves content from " { $snippet "path" } "." } ; HELP: enable-fhtml { $values { "responder" file-responder } } diff --git a/basis/images/loader/cocoa/cocoa.factor b/basis/images/loader/cocoa/cocoa.factor index 4307248f84..e0cce98505 100644 --- a/basis/images/loader/cocoa/cocoa.factor +++ b/basis/images/loader/cocoa/cocoa.factor @@ -33,7 +33,7 @@ os macosx? [ { "png" "tif" "tiff" "gif" "jpg" "jpeg" "bmp" "ico" "webp" } ] [ supported-ns-image-extensions - ] if [ ns-image register-image-class ] each + ] if [ ns-image register-image-class ] each ] when : ( byte-array -- image-rep ) diff --git a/basis/ini-file/ini-file-tests.factor b/basis/ini-file/ini-file-tests.factor index 7f9108e775..1434d64b51 100644 --- a/basis/ini-file/ini-file-tests.factor +++ b/basis/ini-file/ini-file-tests.factor @@ -86,7 +86,7 @@ USING: ini-file tools.test ; { H{ { "owner" H{ { "name" "John Doe" } { "organization" "Acme Widgets Inc." } } } - { "database" H{ { "server" "192.0.2.62" } + { "database" H{ { "server" "192.0.2.62" } { "port" "143" } { "file" "payroll.dat" } } } } } [ diff --git a/basis/io/files/info/unix/unix-docs.factor b/basis/io/files/info/unix/unix-docs.factor index dc87f0e2a2..db8bd10448 100644 --- a/basis/io/files/info/unix/unix-docs.factor +++ b/basis/io/files/info/unix/unix-docs.factor @@ -6,100 +6,100 @@ IN: io.files.info.unix HELP: add-file-permissions { $values - { "path" "a pathname string" } - { "n" integer } } + { "path" "a pathname string" } + { "n" integer } } { $description "Ensures that the bits from " { $snippet "n" } " are set in the Unix file permissions for a given file." } ; HELP: remove-file-permissions { $values - { "path" "a pathname string" } - { "n" integer } } + { "path" "a pathname string" } + { "n" integer } } { $description "Ensures that the bits from " { $snippet "n" } " are cleared in the Unix file permissions for a given file." } ; HELP: file-group-id { $values - { "path" "a pathname string" } - { "gid" integer } } + { "path" "a pathname string" } + { "gid" integer } } { $description "Returns the group id for a given file." } ; HELP: file-group-name { $values - { "path" "a pathname string" } - { "string" string } } + { "path" "a pathname string" } + { "string" string } } { $description "Returns the group name for a given file." } ; HELP: file-permissions { $values - { "path" "a pathname string" } - { "n" integer } } + { "path" "a pathname string" } + { "n" integer } } { $description "Returns the Unix file permissions for a given file." } ; HELP: file-user-name { $values - { "path" "a pathname string" } - { "string" string } } + { "path" "a pathname string" } + { "string" string } } { $description "Returns the user-name for a given file." } ; HELP: file-user-id { $values - { "path" "a pathname string" } - { "uid" integer } } + { "path" "a pathname string" } + { "uid" integer } } { $description "Returns the user id for a given file." } ; HELP: group-execute? { $values - { "obj" "a pathname string or an integer" } - { "?" boolean } } + { "obj" "a pathname string or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "group execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: group-read? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "group read" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: group-write? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "group write" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: other-execute? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "other execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: other-read? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "other read" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: other-write? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "other write" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: set-file-access-time { $values - { "path" "a pathname string" } { "timestamp" timestamp } } + { "path" "a pathname string" } { "timestamp" timestamp } } { $description "Sets a file's last access timestamp." } ; HELP: set-file-group { $values - { "path" "a pathname string" } { "string/id" "a string or a group id" } } + { "path" "a pathname string" } { "string/id" "a string or a group id" } } { $description "Sets a file's group id from the given group id or group name." } ; HELP: set-file-ids { $values - { "path" "a pathname string" } { "uid" integer } { "gid" integer } } + { "path" "a pathname string" } { "uid" integer } { "gid" integer } } { $description "Sets the user id and group id of a file with a single library call." } ; HELP: set-file-permissions { $values - { "path" "a pathname string" } { "n" "an integer, interepreted as a string of bits" } } + { "path" "a pathname string" } { "n" "an integer, interepreted as a string of bits" } } { $description "Sets the file permissions for a given file with the supplied Unix permissions integer." } { $examples "Using the traditional octal value:" { $code "USING: io.files.info.unix kernel ;" @@ -115,113 +115,113 @@ HELP: set-file-permissions HELP: set-file-times { $values - { "path" "a pathname string" } { "timestamps" "an array of two timestamps" } } + { "path" "a pathname string" } { "timestamps" "an array of two timestamps" } } { $description "Sets the access and write timestamps for a file as provided in the input array. A value of " { $link f } " provided for either of the timestamps will not change that timestamp." } ; HELP: set-file-user { $values - { "path" "a pathname string" } { "string/id" "a string or a user id" } } + { "path" "a pathname string" } { "string/id" "a string or a user id" } } { $description "Sets a file's user id from the given user id or user-name." } ; HELP: set-file-modified-time { $values - { "path" "a pathname string" } { "timestamp" timestamp } } + { "path" "a pathname string" } { "timestamp" timestamp } } { $description "Sets a file's last modified timestamp, or write timestamp." } ; HELP: set-gid { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "gid" } " bit of a file to true or false." } ; HELP: gid? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "gid" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: set-group-execute { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "group execute" } " bit of a file to true or false." } ; HELP: set-group-read { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "group read" } " bit of a file to true or false." } ; HELP: set-group-write { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "group write" } " bit of a file to true or false." } ; HELP: set-other-execute { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "other execute" } " bit of a file to true or false." } ; HELP: set-other-read { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "other read" } " bit of a file to true or false." } ; HELP: set-other-write { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "other execute" } " bit of a file to true or false." } ; HELP: set-sticky { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "sticky" } " bit of a file to true or false." } ; HELP: sticky? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "sticky" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: set-uid { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "uid" } " bit of a file to true or false." } ; HELP: uid? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "uid" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: set-user-execute { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "user execute" } " bit of a file to true or false." } ; HELP: set-user-read { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "user read" } " bit of a file to true or false." } ; HELP: set-user-write { $values - { "path" "a pathname string" } { "?" boolean } } + { "path" "a pathname string" } { "?" boolean } } { $description "Sets the " { $snippet "user write" } " bit of a file to true or false." } ; HELP: user-execute? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "user execute" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: user-read? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "user read" } " bit is set on a file, " { $link file-info } ", or an integer." } ; HELP: user-write? { $values - { "obj" "a pathname string, file-info object, or an integer" } - { "?" boolean } } + { "obj" "a pathname string, file-info object, or an integer" } + { "?" boolean } } { $description "Tests whether the " { $snippet "user write" } " bit is set on a file, " { $link file-info } ", or an integer." } ; ARTICLE: "unix-file-permissions" "Unix file permissions" diff --git a/basis/io/files/links/links-docs.factor b/basis/io/files/links/links-docs.factor index 4590fe5c35..57c18a5cd9 100644 --- a/basis/io/files/links/links-docs.factor +++ b/basis/io/files/links/links-docs.factor @@ -19,15 +19,15 @@ HELP: copy-link HELP: follow-link { $values - { "path" "a pathname string" } - { "path'" "a pathname string" } + { "path" "a pathname string" } + { "path'" "a pathname string" } } { $description "Returns an absolute path from " { $link read-link } "." } ; HELP: follow-links { $values - { "path" "a pathname string" } - { "path'" "a pathname string" } + { "path" "a pathname string" } + { "path'" "a pathname string" } } { $description "Follows a chain of symlinks up to " { $link symlink-depth } "." } ; @@ -35,13 +35,13 @@ HELP: follow-links HELP: symlink-depth { $values - { "value" integer } + { "value" integer } } { $description "The number of redirections " { $link follow-links } " will follow." } ; HELP: too-many-symlinks { $values - { "path" "a pathname string" } { "n" integer } + { "path" "a pathname string" } { "n" integer } } { $description "An error thrown when the number of redirections in a chain of symlinks surpasses the value in the " { $link symlink-depth } " variable." } ; diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index a708dfee81..a2148da194 100644 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -53,7 +53,7 @@ TUPLE: io-callback port thread ; C: io-callback : ( handle existing -- handle ) - f 1 CreateIoCompletionPort dup win32-error=0/f ; + f 1 CreateIoCompletionPort dup win32-error=0/f ; : ( -- handle ) INVALID_HANDLE_VALUE f ; diff --git a/basis/io/streams/limited/limited-docs.factor b/basis/io/streams/limited/limited-docs.factor index ff55eb991d..6cc6ba8fb7 100644 --- a/basis/io/streams/limited/limited-docs.factor +++ b/basis/io/streams/limited/limited-docs.factor @@ -5,15 +5,15 @@ IN: io.streams.limited HELP: { $values - { "stream" "an input stream" } { "limit" integer } - { "stream'" "an input stream" } + { "stream" "an input stream" } { "limit" integer } + { "stream'" "an input stream" } } { $description "Constructs a new " { $link limited-stream } " from an existing stream. User code should use " { $link limit-stream } " or " { $link limited-input } "." } ; HELP: limit-stream { $values - { "stream" "an input stream" } { "limit" integer } - { "stream'" "a stream" } + { "stream" "an input stream" } { "limit" integer } + { "stream'" "a stream" } } { $description "Changes a decoder's stream to be a limited stream, or wraps " { $snippet "stream" } " in a " { $link limited-stream } "." } { $examples diff --git a/basis/json/reader/reader-tests.factor b/basis/json/reader/reader-tests.factor index 642c76674e..b2054ab26b 100644 --- a/basis/json/reader/reader-tests.factor +++ b/basis/json/reader/reader-tests.factor @@ -85,7 +85,7 @@ ${ { 0xabcd } >string } [ " \"\\uaBCd\" " json> ] unit-test [ not-a-json-number? ] must-fail-with ! unclosed objects and mismatched brackets are not allowed - [ "[\"a\", +[ "[\"a\", 4 ,1," json> ] must-fail diff --git a/basis/json/writer/writer-docs.factor b/basis/json/writer/writer-docs.factor index 9c8d0d5b93..37d55a4d3f 100644 --- a/basis/json/writer/writer-docs.factor +++ b/basis/json/writer/writer-docs.factor @@ -14,11 +14,11 @@ HELP: json-print $nl "Some options can control the formatting of the result:" { $table - { { $link json-allow-fp-special? } "Allow special floating-points: NaN, Infinity, -Infinity" } - { { $link json-friendly-keys? } "Convert - to _ in tuple slots and hashtable keys" } - { { $link json-coerce-keys? } "Coerce hashtable keys into strings" } - { { $link json-escape-slashes? } "Escape forward slashes inside strings" } - { { $link json-escape-unicode? } "Escape unicode values inside strings" } + { { $link json-allow-fp-special? } "Allow special floating-points: NaN, Infinity, -Infinity" } + { { $link json-friendly-keys? } "Convert - to _ in tuple slots and hashtable keys" } + { { $link json-coerce-keys? } "Coerce hashtable keys into strings" } + { { $link json-escape-slashes? } "Escape forward slashes inside strings" } + { { $link json-escape-unicode? } "Escape unicode values inside strings" } } } { $see-also >json } ; diff --git a/basis/lists/lazy/lazy.factor b/basis/lists/lazy/lazy.factor index 3209ab6575..bbb194302f 100644 --- a/basis/lists/lazy/lazy.factor +++ b/basis/lists/lazy/lazy.factor @@ -176,7 +176,7 @@ M: lazy-append cdr [ list1>> cdr ] [ list2>> ] bi lappend-lazy ; M: lazy-append nil? - drop f ; + drop f ; TUPLE: lazy-from-by n quot ; diff --git a/basis/lists/lists-tests.factor b/basis/lists/lists-tests.factor index f6f6a04975..b46c6de2ac 100644 --- a/basis/lists/lists-tests.factor +++ b/basis/lists/lists-tests.factor @@ -31,7 +31,7 @@ USING: tools.test lists math kernel ; ] unit-test { 15 } [ - { 1 2 3 4 5 } sequence>list 0 [ + ] foldr + { 1 2 3 4 5 } sequence>list 0 [ + ] foldr ] unit-test { { 5 4 3 2 1 } } [ diff --git a/basis/math/bitwise/bitwise-docs.factor b/basis/math/bitwise/bitwise-docs.factor index cc3c33a49b..0ec2f69b02 100644 --- a/basis/math/bitwise/bitwise-docs.factor +++ b/basis/math/bitwise/bitwise-docs.factor @@ -131,8 +131,8 @@ HELP: bitroll HELP: bit-count { $values - { "obj" object } - { "n" integer } + { "obj" object } + { "n" integer } } { $description "Returns the number of set bits as an object. This word only works on non-negative integers or objects that can be represented as a byte-array." } { $examples @@ -152,8 +152,8 @@ HELP: bit-count HELP: bitroll-32 { $values - { "m" integer } { "s" integer } - { "n" integer } + { "m" integer } { "s" integer } + { "n" integer } } { $description "Rolls the number " { $snippet "m" } " by " { $snippet "s" } " bits to the left, wrapping around after 32 bits." } { $examples @@ -169,8 +169,8 @@ HELP: bitroll-32 HELP: bitroll-64 { $values - { "m" integer } { "s" "a shift integer" } - { "n" integer } + { "m" integer } { "s" "a shift integer" } + { "n" integer } } { $description "Rolls the number " { $snippet "m" } " by " { $snippet "s" } " bits to the left, wrapping around after 64 bits." } { $examples @@ -188,8 +188,8 @@ HELP: bitroll-64 HELP: clear-bit { $values - { "x" integer } { "n" integer } - { "y" integer } + { "x" integer } { "n" integer } + { "y" integer } } { $description "Sets the " { $snippet "n" } "th bit of " { $snippet "x" } " to zero." } { $examples @@ -265,8 +265,8 @@ HELP: >signed HELP: mask { $values - { "x" integer } { "n" integer } - { "y" integer } + { "x" integer } { "n" integer } + { "y" integer } } { $description "After the operation, only the bits that were set in both the mask and the original number are set." } { $examples @@ -278,8 +278,8 @@ HELP: mask HELP: mask-bit { $values - { "m" integer } { "n" integer } - { "m'" integer } + { "m" integer } { "n" integer } + { "m'" integer } } { $description "Turns off all bits besides the " { $snippet "n" } "th bit." } { $examples @@ -291,8 +291,8 @@ HELP: mask-bit HELP: mask? { $values - { "x" integer } { "n" integer } - { "?" boolean } + { "x" integer } { "n" integer } + { "?" boolean } } { $description "Returns true if all of the bits in the mask " { $snippet "n" } " are set in the integer input " { $snippet "x" } "." } { $examples @@ -323,8 +323,8 @@ HELP: odd-parity? HELP: on-bits { $values - { "m" integer } - { "n" integer } + { "m" integer } + { "n" integer } } { $description "Returns an integer with " { $snippet "m" } " bits set." } { $examples @@ -340,9 +340,9 @@ HELP: on-bits HELP: toggle-bit { $values - { "m" integer } - { "n" integer } - { "m'" integer } + { "m" integer } + { "n" integer } + { "m'" integer } } { $description "Toggles the " { $snippet "n" } "th bit of an integer." } { $examples @@ -358,8 +358,8 @@ HELP: toggle-bit HELP: set-bit { $values - { "x" integer } { "n" integer } - { "y" integer } + { "x" integer } { "n" integer } + { "y" integer } } { $description "Sets the " { $snippet "n" } "th bit of " { $snippet "x" } "." } { $examples @@ -371,15 +371,15 @@ HELP: set-bit HELP: shift-mod { $values - { "m" integer } { "s" integer } { "w" integer } - { "n" integer } + { "m" integer } { "s" integer } { "w" integer } + { "n" integer } } { $description "Calls " { $link shift } " on " { $snippet "n" } " and " { $snippet "s" } ", wrapping the result to " { $snippet "w" } " bits." } ; HELP: unmask { $values - { "x" integer } { "n" integer } - { "y" integer } + { "x" integer } { "n" integer } + { "y" integer } } { $description "Clears the bits in " { $snippet "x" } " if they are set in the mask " { $snippet "n" } "." } { $examples @@ -391,8 +391,8 @@ HELP: unmask HELP: unmask? { $values - { "x" integer } { "n" integer } - { "?" boolean } + { "x" integer } { "n" integer } + { "?" boolean } } { $description "Tests whether unmasking the bits in " { $snippet "x" } " would return an integer greater than zero." } { $examples @@ -404,8 +404,8 @@ HELP: unmask? HELP: w* { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Multiplies two integers and wraps the result to a 32-bit unsigned integer." } { $examples @@ -417,8 +417,8 @@ HELP: w* HELP: w+ { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Adds two integers and wraps the result to a 32-bit unsigned integer." } { $examples @@ -430,8 +430,8 @@ HELP: w+ HELP: w- { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Subtracts two integers and wraps the result to a 32-bit unsigned integer." } { $examples @@ -443,8 +443,8 @@ HELP: w- HELP: W* { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Multiplies two integers and wraps the result to a 64-bit unsigned integer." } { $examples @@ -456,8 +456,8 @@ HELP: W* HELP: W+ { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Adds two integers and wraps the result to 64-bit unsigned integer." } { $examples @@ -469,8 +469,8 @@ HELP: W+ HELP: W- { $values - { "x" integer } { "y" integer } - { "z" integer } + { "x" integer } { "y" integer } + { "z" integer } } { $description "Subtracts two integers and wraps the result to a 64-bit unsigned integer." } { $examples @@ -482,8 +482,8 @@ HELP: W- HELP: wrap { $values - { "m" integer } { "n" integer } - { "m'" integer } + { "m" integer } { "n" integer } + { "m'" integer } } { $description "Wraps an integer " { $snippet "m" } " by modding it by " { $snippet "n" } ". This word is uses bitwise arithmetic and does not actually call the modulus word, and as such can only mod by powers of two." } { $examples "Equivalent to modding by 8:" diff --git a/basis/math/matrices/matrices-docs.factor b/basis/math/matrices/matrices-docs.factor index 7cd9494bf2..c941de5fcd 100644 --- a/basis/math/matrices/matrices-docs.factor +++ b/basis/math/matrices/matrices-docs.factor @@ -1038,11 +1038,11 @@ HELP: matrix-p-norm-entrywise { $description "Find the entry-wise norm of a matrix, in 𝑙ₚ (" { $snippet "L^p" } ") vector space." } { $notes "This word is not an induced or Schatten norm, and it is distinct from all of " { $links matrix-l1-norm matrix-l2-norm matrix-l-infinity-norm } "." } { $examples - { $example + { $example "USING: math.matrices prettyprint ;" "4 4 1 2 matrix-p-norm-entrywise ." "4.0" - } + } } ; HELP: matrix-p-norm @@ -1056,17 +1056,17 @@ HELP: matrix-p-norm } { $examples "Calls " { $link l1-norm } ":" - { $example + { $example "USING: math.matrices prettyprint ;" "4 4 1 1 matrix-p-norm ." "4" - } + } "Falls back to " { $link matrix-p-norm-entrywise } ":" - { $example + { $example "USING: math.functions math.matrices prettyprint ;" "2 2 3 1.5 matrix-p-norm 7.559 10e-4 ~ ." "t" - } + } } ; { matrix-p-norm matrix-p-norm-entrywise } related-words @@ -1076,15 +1076,15 @@ HELP: matrix-normalize { $values { "m" "a matrix with at least 1 non-zero number" } { "m'" matrix } } { $description "Normalize a matrix containing at least 1 non-zero element. Each element from the input matrix is computed as a fraction of the maximum element. The maximum element becomes " { $snippet "1/1" } "." } { $notelist - $2d-only-note - { $matrix-scalar-note max abs / } + $2d-only-note + { $matrix-scalar-note max abs / } } { $examples - { $example + { $example "USING: math.matrices prettyprint ;" "{ { 5 9 } { 15 17 } } matrix-normalize ." "{ { 5/17 9/17 } { 15/17 1 } }" - } + } } ; HELP: main-diagonal diff --git a/basis/math/matrices/matrices-tests.factor b/basis/math/matrices/matrices-tests.factor index 6a015b8b4d..0d7c116ebe 100644 --- a/basis/math/matrices/matrices-tests.factor +++ b/basis/math/matrices/matrices-tests.factor @@ -374,13 +374,13 @@ PRIVATE> { { 4 3 2 1 } } [ { 1 2 3 4 } transpose anti-diagonal ] unit-test { { - { 1 4 7 } - { 2 5 8 } - { 3 6 9 } + { 1 4 7 } + { 2 5 8 } + { 3 6 9 } } } [ { - { 1 2 3 } - { 4 5 6 } - { 7 8 9 } + { 1 2 3 } + { 4 5 6 } + { 7 8 9 } } transpose ] unit-test ! anti transposition @@ -389,13 +389,13 @@ PRIVATE> { { 4 3 2 1 } } [ { 1 2 3 4 } anti-transpose main-diagonal ] unit-test { { - { 9 6 3 } - { 8 5 2 } - { 7 4 1 } + { 9 6 3 } + { 8 5 2 } + { 7 4 1 } } } [ { - { 1 2 3 } - { 4 5 6 } - { 7 8 9 } + { 1 2 3 } + { 4 5 6 } + { 7 8 9 } } anti-transpose ] unit-test ] 2bi ; + upload1 + [ "mime" "test" unique-file ] with-temp-directory + ascii [ set-file-contents ] [ ] 2bi ; { } [ mime-test-stream [ ] with-input-stream ] unit-test diff --git a/basis/mime/types/types-docs.factor b/basis/mime/types/types-docs.factor index 96987829cf..e60a3ed405 100644 --- a/basis/mime/types/types-docs.factor +++ b/basis/mime/types/types-docs.factor @@ -6,7 +6,7 @@ IN: mime.types HELP: mime-db { $values - { "seq" sequence } } + { "seq" sequence } } { $description "Outputs an array where the first element is a MIME type and the rest of the array is file extensions that have that MIME type." } ; HELP: mime-type @@ -18,13 +18,13 @@ HELP: mime-type HELP: mime-types { $values - { "assoc" assoc } } + { "assoc" assoc } } { $description "Outputs an " { $snippet "assoc" } " made from the data in the " { $link mime-db } " word where the keys are file extensions and the values are the corresponding MIME types." } ; HELP: nonstandard-mime-types { $values - { "assoc" assoc } } + { "assoc" assoc } } { $description "A list of Factor-specific MIME types that are added to the MIME database loaded from disk." } ; ARTICLE: "mime.types" "MIME types" diff --git a/basis/peg/ebnf/ebnf-tests.factor b/basis/peg/ebnf/ebnf-tests.factor index 7aaaba47c4..9f7e4df3ef 100644 --- a/basis/peg/ebnf/ebnf-tests.factor +++ b/basis/peg/ebnf/ebnf-tests.factor @@ -16,10 +16,10 @@ IN: peg.ebnf.tests { T{ ebnf-rule f - "digit" - T{ ebnf-choice f + "digit" + T{ ebnf-choice f V{ T{ ebnf-terminal f "1" } T{ ebnf-terminal f "2" } } - } + } } } [ "digit = '1' | '2'" rule-parser parse @@ -27,10 +27,10 @@ IN: peg.ebnf.tests { T{ ebnf-rule f - "digit" - T{ ebnf-sequence f - V{ T{ ebnf-terminal f "1" } T{ ebnf-terminal f "2" } } - } + "digit" + T{ ebnf-sequence f + V{ T{ ebnf-terminal f "1" } T{ ebnf-terminal f "2" } } + } } } [ "digit = '1' '2'" rule-parser parse @@ -38,12 +38,12 @@ IN: peg.ebnf.tests { T{ ebnf-choice f - V{ - T{ ebnf-sequence f - V{ T{ ebnf-non-terminal f "one" } T{ ebnf-non-terminal f "two" } } - } - T{ ebnf-non-terminal f "three" } - } + V{ + T{ ebnf-sequence f + V{ T{ ebnf-non-terminal f "one" } T{ ebnf-non-terminal f "two" } } + } + T{ ebnf-non-terminal f "three" } + } } } [ "one two | three" choice-parser parse @@ -51,7 +51,7 @@ IN: peg.ebnf.tests { T{ ebnf-sequence f - V{ + V{ T{ ebnf-non-terminal f "one" } T{ ebnf-whitespace f T{ ebnf-choice f @@ -66,7 +66,7 @@ IN: peg.ebnf.tests { T{ ebnf-sequence f - V{ + V{ T{ ebnf-non-terminal f "one" } T{ ebnf-repeat0 f T{ ebnf-sequence f @@ -86,7 +86,7 @@ IN: peg.ebnf.tests { T{ ebnf-sequence f - V{ + V{ T{ ebnf-non-terminal f "one" } T{ ebnf-ignore f T{ ebnf-sequence f @@ -106,7 +106,7 @@ IN: peg.ebnf.tests { T{ ebnf-sequence f - V{ + V{ T{ ebnf-non-terminal f "one" } T{ ebnf-optional f T{ ebnf-non-terminal f "two" } } T{ ebnf-non-terminal f "three" } diff --git a/basis/peg/ebnf/ebnf.factor b/basis/peg/ebnf/ebnf.factor index e7ed0ed1ed..311fb19dea 100644 --- a/basis/peg/ebnf/ebnf.factor +++ b/basis/peg/ebnf/ebnf.factor @@ -300,10 +300,10 @@ DEFER: choice-parser ] choice* ; : action-parser ( -- parser ) - "[[" factor-code-parser "]]" syntax-pack ; + "[[" factor-code-parser "]]" syntax-pack ; : semantic-parser ( -- parser ) - "?[" factor-code-parser "]?" syntax-pack ; + "?[" factor-code-parser "]?" syntax-pack ; : sequence-parser ( -- parser ) ! A sequence of terminals and non-terminals, including @@ -457,7 +457,7 @@ M: ebnf-sequence build-locals " " % % " nip ]" % - ] "" make + ] "" make ] if ] if ; diff --git a/basis/persistent/hashtables/hashtables.factor b/basis/persistent/hashtables/hashtables.factor index 4d474caa79..28d2d37e09 100644 --- a/basis/persistent/hashtables/hashtables.factor +++ b/basis/persistent/hashtables/hashtables.factor @@ -13,8 +13,8 @@ TUPLE: persistent-hash M: persistent-hash assoc-size count>> ; M: persistent-hash at* - [ dup hashcode >fixnum ] [ root>> ] bi* (entry-at) - dup [ value>> t ] [ f ] if ; + [ dup hashcode >fixnum ] [ root>> ] bi* (entry-at) + dup [ value>> t ] [ f ] if ; M: persistent-hash new-at [ diff --git a/basis/quoted-printable/quoted-printable.factor b/basis/quoted-printable/quoted-printable.factor index bffe4f53d7..0453fe7f60 100644 --- a/basis/quoted-printable/quoted-printable.factor +++ b/basis/quoted-printable/quoted-printable.factor @@ -47,9 +47,9 @@ PRIVATE> : read-char ( byte -- ch ) dup CHAR: = = [ - drop read1 dup CHAR: \n = - [ drop read1 read-char ] - [ read1 2array hex> ] if + drop read1 dup CHAR: \n = + [ drop read1 read-char ] + [ read1 2array hex> ] if ] when ; : read-quoted ( -- bytes ) diff --git a/basis/random/random-docs.factor b/basis/random/random-docs.factor index 974e0bd40f..99c489febd 100644 --- a/basis/random/random-docs.factor +++ b/basis/random/random-docs.factor @@ -102,8 +102,8 @@ HELP: with-system-random HELP: randomize { $values - { "seq" sequence } - { "randomized" sequence } + { "seq" sequence } + { "randomized" sequence } } { $description "Randomizes a sequence in-place with the Fisher-Yates algorithm and returns the sequence." } ; @@ -122,8 +122,8 @@ HELP: sample HELP: delete-random { $values - { "seq" sequence } - { "elt" object } } + { "seq" sequence } + { "elt" object } } { $description "Deletes a random number from a sequence using " { $link remove-nth! } " and returns the deleted object." } ; ARTICLE: "random-protocol" "Random protocol" diff --git a/basis/random/sfmt/sfmt.factor b/basis/random/sfmt/sfmt.factor index d6668c1622..ac86936a08 100644 --- a/basis/random/sfmt/sfmt.factor +++ b/basis/random/sfmt/sfmt.factor @@ -39,16 +39,16 @@ TUPLE: sfmt [ endian-shuffle ] dip hrshift endian-shuffle ; inline : wA ( w -- wA ) - dup 1 hlshift* vbitxor ; inline + dup 1 hlshift* vbitxor ; inline : wB ( w mask -- wB ) - [ 11 vrshift ] dip vbitand ; inline + [ 11 vrshift ] dip vbitand ; inline : wC ( w -- wC ) - 1 hrshift* ; inline + 1 hrshift* ; inline : wD ( w -- wD ) - 18 vlshift ; inline + 18 vlshift ; inline : formula ( a b mask c d -- r ) [ wC ] dip wD vbitxor diff --git a/basis/retries/retries-tests.factor b/basis/retries/retries-tests.factor index 0e96a1f0f1..a9123e2d12 100644 --- a/basis/retries/retries-tests.factor +++ b/basis/retries/retries-tests.factor @@ -67,6 +67,6 @@ IN: retries.tests { } [ [ 2 = [ "not 2!" throw ] unless ] - 1.1 100 3 retries + 1.1 100 3 retries ] unit-test diff --git a/basis/sequences/generalizations/generalizations-docs.factor b/basis/sequences/generalizations/generalizations-docs.factor index b82a8a9a9b..853b988de1 100644 --- a/basis/sequences/generalizations/generalizations-docs.factor +++ b/basis/sequences/generalizations/generalizations-docs.factor @@ -65,8 +65,8 @@ HELP: set-firstn HELP: nappend { $values - { "n" integer } - { "seq" sequence } + { "n" integer } + { "seq" sequence } } { $description "Outputs a new sequence consisting of the elements of the top " { $snippet "n" } " sequences from the datastack in turn." } { $errors "Throws an error if any of the sequences contain elements that are not permitted in the sequence type of the first sequence." } @@ -79,8 +79,8 @@ HELP: nappend HELP: nappend-as { $values - { "n" integer } { "exemplar" sequence } - { "seq" sequence } + { "n" integer } { "exemplar" sequence } + { "seq" sequence } } { $description "Outputs a new sequence of type " { $snippet "exemplar" } " consisting of the elements of the top " { $snippet "n" } " sequences from the datastack in turn." } { $errors "Throws an error if any of the sequences contain elements that are not permitted in the sequence type of the first sequence." } diff --git a/basis/sorting/human/human-docs.factor b/basis/sorting/human/human-docs.factor index 0c9dac3a09..04066020ca 100644 --- a/basis/sorting/human/human-docs.factor +++ b/basis/sorting/human/human-docs.factor @@ -5,22 +5,22 @@ IN: sorting.human HELP: find-numbers { $values - { "sequence" sequence } - { "sequence'" sequence } + { "sequence" sequence } + { "sequence'" sequence } } { $description "Splits a string on numbers and returns a sequence of sequences and integers." } ; HELP: human<=> { $values - { "obj1" object } { "obj2" object } - { "<=>" "an ordering specifier" } + { "obj1" object } { "obj2" object } + { "<=>" "an ordering specifier" } } { $description "Compares two objects after converting numbers in the string into integers." } ; HELP: human>=< { $values - { "obj1" object } { "obj2" object } - { ">=<" "an ordering specifier" } + { "obj1" object } { "obj2" object } + { ">=<" "an ordering specifier" } } { $description "Compares two objects using the " { $link human<=> } " word and inverts the result." } ; diff --git a/basis/sorting/slots/slots-docs.factor b/basis/sorting/slots/slots-docs.factor index 7c9288631c..3fc15909bd 100644 --- a/basis/sorting/slots/slots-docs.factor +++ b/basis/sorting/slots/slots-docs.factor @@ -15,8 +15,8 @@ HELP: compare-slots HELP: sort-by { $values - { "seq" sequence } { "sort-specs" "a sequence of accessors ending with a comparator" } - { "seq'" sequence } + { "seq" sequence } { "sort-specs" "a sequence of accessors ending with a comparator" } + { "seq'" sequence } } { $description "Sorts a sequence of tuples by the sort-specs in " { $snippet "sort-spec" } ". A sort-spec is a sequence of slot accessors ending in a comparator." } { $examples diff --git a/basis/specialized-arrays/prettyprint/prettyprint.factor b/basis/specialized-arrays/prettyprint/prettyprint.factor index ac7c705c8a..f0b46b651b 100644 --- a/basis/specialized-arrays/prettyprint/prettyprint.factor +++ b/basis/specialized-arrays/prettyprint/prettyprint.factor @@ -7,9 +7,9 @@ IN: specialized-arrays.prettyprint : pprint-direct-array ( direct-array -- ) \ c-array@ [ - [ underlying-type ] [ underlying>> ] [ length>> ] tri - [ pprint* ] tri@ - ] pprint-prefix ; + [ underlying-type ] [ underlying>> ] [ length>> ] tri + [ pprint* ] tri@ + ] pprint-prefix ; M: specialized-array pprint* [ pprint-object ] [ pprint-direct-array ] pprint-c-object ; diff --git a/basis/splitting/monotonic/monotonic-docs.factor b/basis/splitting/monotonic/monotonic-docs.factor index 5837c4cc31..63b43f4a46 100644 --- a/basis/splitting/monotonic/monotonic-docs.factor +++ b/basis/splitting/monotonic/monotonic-docs.factor @@ -5,8 +5,8 @@ IN: splitting.monotonic HELP: monotonic-split-slice { $values - { "seq" sequence } { "quot" { $quotation ( obj1 obj2 -- ? ) } } - { "pieces" "a sequence of slices" } + { "seq" sequence } { "quot" { $quotation ( obj1 obj2 -- ? ) } } + { "pieces" "a sequence of slices" } } { $description "Monotonically splits a sequence into slices." } { $examples @@ -22,8 +22,8 @@ HELP: monotonic-split-slice HELP: monotonic-split { $values - { "seq" sequence } { "quot" quotation } - { "pieces" "a sequence of sequences" } + { "seq" sequence } { "quot" quotation } + { "pieces" "a sequence of sequences" } } { $description "Splits a sequence into subsequences, in which for all consecutive pairs of elements the quotation returns true." } { $examples @@ -43,8 +43,8 @@ HELP: monotonic-split HELP: downward-slices { $values - { "seq" sequence } - { "slices" "a sequence of downward-slices" } + { "seq" sequence } + { "slices" "a sequence of downward-slices" } } { $description "Returns an array of monotonically decreasing slices of type " { $link downward-slice } ". Slices of one element are discarded." } ; diff --git a/basis/suffix-arrays/suffix-arrays-docs.factor b/basis/suffix-arrays/suffix-arrays-docs.factor index 455756bd7d..dee423128c 100644 --- a/basis/suffix-arrays/suffix-arrays-docs.factor +++ b/basis/suffix-arrays/suffix-arrays-docs.factor @@ -6,8 +6,8 @@ IN: suffix-arrays HELP: >suffix-array { $values - { "seq" sequence } - { "suffix-array" array } } + { "seq" sequence } + { "suffix-array" array } } { $description "Creates a suffix array from the input sequence. Suffix arrays are arrays of slices." } ; HELP: SA{ @@ -15,14 +15,14 @@ HELP: SA{ HELP: suffixes { $values - { "string" string } - { "suffixes-seq" "a sequence of slices" } } + { "string" string } + { "suffixes-seq" "a sequence of slices" } } { $description "Returns a sequence of tail slices of the input string." } ; HELP: query { $values - { "begin" sequence } { "suffix-array" "a suffix-array" } - { "matches" array } } + { "begin" sequence } { "suffix-array" "a suffix-array" } + { "matches" array } } { $description "Returns a sequence of sequences from the suffix-array that contain the input sequence. An empty array is returned when there are no matches." } ; ARTICLE: "suffix-arrays" "Suffix arrays" diff --git a/basis/system-info/freebsd/freebsd.factor b/basis/system-info/freebsd/freebsd.factor index 0a434acbd7..e43fd2895c 100644 --- a/basis/system-info/freebsd/freebsd.factor +++ b/basis/system-info/freebsd/freebsd.factor @@ -24,9 +24,9 @@ FUNCTION-ALIAS: (xuname) PRIVATE> : uname ( -- seq ) - SYS_NMLN [ (uname) ] [ group ] bi - dup length utsname-items assert= - [ >string [ zero? ] trim-tail ] map ; + SYS_NMLN [ (uname) ] [ group ] bi + dup length utsname-items assert= + [ >string [ zero? ] trim-tail ] map ; : sysname ( -- string ) 0 uname nth ; : nodename ( -- string ) 1 uname nth ; diff --git a/basis/timers/timers-docs.factor b/basis/timers/timers-docs.factor index 49905afdc9..cc1d8e28c7 100644 --- a/basis/timers/timers-docs.factor +++ b/basis/timers/timers-docs.factor @@ -18,8 +18,8 @@ HELP: stop-timer HELP: every { $values - { "quot" quotation } { "interval-duration" duration } - { "timer" timer } } + { "quot" quotation } { "interval-duration" duration } + { "timer" timer } } { $description "Creates a timer that calls the quotation repeatedly, using " { $snippet "duration" } " as the frequency. The first call of " { $snippet "quot" } " will happen immediately. If the quotation throws an exception, the timer will stop." } { $examples { $code @@ -40,8 +40,8 @@ HELP: later HELP: delayed-every { $values - { "quot" quotation } { "duration" duration } - { "timer" timer } } + { "quot" quotation } { "duration" duration } + { "timer" timer } } { $description "Creates a timer that calls " { $snippet "quot" } " repeatedly, waiting " { $snippet "duration" } " before calling " { $snippet "quot" } " the first time and then waiting " { $snippet "duration" } " between further calls. If the quotation throws an exception, the timer will stop." } { $examples { $code diff --git a/basis/tools/annotations/annotations-docs.factor b/basis/tools/annotations/annotations-docs.factor index 885a359094..5c6e53edb4 100644 --- a/basis/tools/annotations/annotations-docs.factor +++ b/basis/tools/annotations/annotations-docs.factor @@ -36,13 +36,13 @@ HELP: watch HELP: reset { $values - { "word" word } } + { "word" word } } { $description "Resets any annotations on a word." } { $notes "This word will remove a " { $link watch } "." } ; HELP: watch-vars { $values - { "word" word } { "vars" "a sequence of symbols" } } + { "word" word } { "vars" "a sequence of symbols" } } { $description "Annotates a word definition to print the " { $snippet "vars" } " upon entering the word. This word is useful for debugging." } ; HELP: add-timing diff --git a/basis/tools/deploy/deploy-docs.factor b/basis/tools/deploy/deploy-docs.factor index 892436cd11..81e3cd21e1 100644 --- a/basis/tools/deploy/deploy-docs.factor +++ b/basis/tools/deploy/deploy-docs.factor @@ -21,9 +21,9 @@ ARTICLE: "tools.deploy.usage" "Deploy tool usage" "For example, you can deploy the " { $vocab-link "hello-ui" } " demo which comes with Factor. Note that this demo already has a deployment configuration, so nothing needs to be configured:" { $code "\"hello-ui\" deploy" } { $list - { "On Mac OS X, this yields a program named " { $snippet "Hello world.app" } "." } - { "On Windows, it yields a directory named " { $snippet "Hello world" } " containing a program named " { $snippet "hello-ui.exe" } "." } - { "On Unix-like systems (Linux, BSD, Solaris, etc), it yields a directory named " { $snippet "Hello world" } " containing a program named " { $snippet "hello-ui" } "." } + { "On Mac OS X, this yields a program named " { $snippet "Hello world.app" } "." } + { "On Windows, it yields a directory named " { $snippet "Hello world" } " containing a program named " { $snippet "hello-ui.exe" } "." } + { "On Unix-like systems (Linux, BSD, Solaris, etc), it yields a directory named " { $snippet "Hello world" } " containing a program named " { $snippet "hello-ui" } "." } } "On all platforms, running the program will display a window with a message." ; diff --git a/basis/tools/files/files-docs.factor b/basis/tools/files/files-docs.factor index d95ea3bcd3..04881e7e59 100644 --- a/basis/tools/files/files-docs.factor +++ b/basis/tools/files/files-docs.factor @@ -5,7 +5,7 @@ IN: tools.files HELP: directory. { $values - { "path" "a pathname string" } + { "path" "a pathname string" } } { $description "Prints information about all files in a directory to the output stream in a cross-platform way similar to the Unix " { $snippet "ls" } " command." } ; diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index ddcfc03476..59a55a22dc 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -22,11 +22,11 @@ SYMBOL: test-failures test-failures [ V{ } clone ] initialize T{ error-type-holder - { type +test-failure+ } - { word ":test-failures" } - { plural "unit test failures" } - { icon "vocab:ui/tools/error-list/icons/unit-test-error.png" } - { quot [ test-failures get ] } + { type +test-failure+ } + { word ":test-failures" } + { plural "unit test failures" } + { icon "vocab:ui/tools/error-list/icons/unit-test-error.png" } + { quot [ test-failures get ] } } define-error-type SYMBOL: silent-tests? diff --git a/basis/ui/backend/gtk/gtk-tests.factor b/basis/ui/backend/gtk/gtk-tests.factor index 921f70fb2a..f37c54748a 100644 --- a/basis/ui/backend/gtk/gtk-tests.factor +++ b/basis/ui/backend/gtk/gtk-tests.factor @@ -4,62 +4,62 @@ IN: ui.backend.gtk.tests : gdk-key-release-event ( -- event ) S{ GdkEventKey - { type 9 } - { window ALIEN: 1672900 } - { send_event 0 } - { time 1332590199 } - { state 17 } - { keyval 72 } - { length 1 } - { string ALIEN: 1b25c80 } - { hardware_keycode 43 } - { group 0 } - { is_modifier 0 } + { type 9 } + { window ALIEN: 1672900 } + { send_event 0 } + { time 1332590199 } + { state 17 } + { keyval 72 } + { length 1 } + { string ALIEN: 1b25c80 } + { hardware_keycode 43 } + { group 0 } + { is_modifier 0 } } ; : gdk-key-press-event ( -- event ) S{ GdkEventKey - { type 8 } - { window ALIEN: 16727e0 } - { send_event 0 } - { time 1332864912 } - { state 16 } - { keyval 65471 } - { length 0 } - { string ALIEN: 19c9700 } - { hardware_keycode 68 } - { group 0 } - { is_modifier 0 } + { type 8 } + { window ALIEN: 16727e0 } + { send_event 0 } + { time 1332864912 } + { state 16 } + { keyval 65471 } + { length 0 } + { string ALIEN: 19c9700 } + { hardware_keycode 68 } + { group 0 } + { is_modifier 0 } } ; : gdk-space-key-press-event ( -- event ) S{ GdkEventKey - { type 8 } - { window ALIEN: 1b66360 } - { send_event 0 } - { time 28246628 } - { state 0 } - { keyval 32 } - { length 0 } - { string ALIEN: 20233b0 } - { hardware_keycode 64 } - { group 0 } - { is_modifier 1 } + { type 8 } + { window ALIEN: 1b66360 } + { send_event 0 } + { time 28246628 } + { state 0 } + { keyval 32 } + { length 0 } + { string ALIEN: 20233b0 } + { hardware_keycode 64 } + { group 0 } + { is_modifier 1 } } ; : gdk-windows-key-release-event ( -- event ) S{ GdkEventKey - { type 9 } - { window ALIEN: 1a71d80 } - { send_event 0 } - { time 47998769 } - { state 67108928 } - { keyval 119 } - { length 1 } - { string ALIEN: 2017640 } - { hardware_keycode 25 } - { group 0 } - { is_modifier 0 } + { type 9 } + { window ALIEN: 1a71d80 } + { send_event 0 } + { time 47998769 } + { state 67108928 } + { keyval 119 } + { length 1 } + { string ALIEN: 2017640 } + { hardware_keycode 25 } + { group 0 } + { is_modifier 0 } } ; diff --git a/basis/ui/backend/gtk/io/io.factor b/basis/ui/backend/gtk/io/io.factor index 4e661c6a91..6df57923a9 100644 --- a/basis/ui/backend/gtk/io/io.factor +++ b/basis/ui/backend/gtk/io/io.factor @@ -13,9 +13,9 @@ IN: ui.backend.gtk.io revents>> 0 = not ; : dispatch ( source callback user-data -- ? ) - 3drop - 0 mx get-global wait-for-events - yield t ; + 3drop + 0 mx get-global wait-for-events + yield t ; : ( -- funcs ) GSourceFuncs malloc-struct diff --git a/basis/ui/backend/windows/windows.factor b/basis/ui/backend/windows/windows.factor index 4281dd8394..dde75997ed 100644 --- a/basis/ui/backend/windows/windows.factor +++ b/basis/ui/backend/windows/windows.factor @@ -357,15 +357,15 @@ SYMBOL: upper-surrogate-wm-char ctrl? alt? xor [ ! enable AltGr combination inputs wParam { { [ dup upper-surrogate? ] [ - upper-surrogate-wm-char set-global ] - } + upper-surrogate-wm-char set-global + ] } { [ dup under-surrogate? ] [ - drop - upper-surrogate-wm-char get-global [ - wParam "" 2sequence - utf16n encode utf16n decode hWnd window user-input - ] when* ] - } + drop + upper-surrogate-wm-char get-global [ + wParam "" 2sequence + utf16n encode utf16n decode hWnd window user-input + ] when* + ] } [ 1string hWnd window user-input f upper-surrogate-wm-char set-global ] } cond diff --git a/basis/ui/gadgets/panes/panes-tests.factor b/basis/ui/gadgets/panes/panes-tests.factor index 98d4d11a5a..a05c0aad89 100644 --- a/basis/ui/gadgets/panes/panes-tests.factor +++ b/basis/ui/gadgets/panes/panes-tests.factor @@ -130,10 +130,10 @@ ARTICLE: "test-article-2" "This is a test article" ${ "" T{ font - { name $[ default-sans-serif-font-name ] } - { size $[ default-font-size ] } - { foreground $[ text-color ] } - { background $[ content-background ] } + { name $[ default-sans-serif-font-name ] } + { size $[ default-font-size ] } + { foreground $[ text-color ] } + { background $[ content-background ] } } } [ dup current>> smash-line [ text>> ] [ font>> ] bi diff --git a/basis/ui/pens/tile/tile.factor b/basis/ui/pens/tile/tile.factor index c6a1997c04..bbd2cd1a04 100644 --- a/basis/ui/pens/tile/tile.factor +++ b/basis/ui/pens/tile/tile.factor @@ -34,8 +34,8 @@ M: tile-pen pen-pref-dim : render-tile ( tile x width gadget -- ) [ orientation>> '[ _ v* ] dip ] keep '[ - _ _ [ dim>> swap ] [ orientation>> ] bi set-axis - swap draw-scaled-image + _ _ [ dim>> swap ] [ orientation>> ] bi set-axis + swap draw-scaled-image ] with-translation ; M: tile-pen draw-interior diff --git a/basis/unicode/breaks/breaks.factor b/basis/unicode/breaks/breaks.factor index f69b0945fe..60421a4ba1 100644 --- a/basis/unicode/breaks/breaks.factor +++ b/basis/unicode/breaks/breaks.factor @@ -95,17 +95,17 @@ CATEGORY: spacing Mc ; { [ dup jamo? ] [ jamo-class ] } { [ dup hangul? ] [ hangul-class ] } { [ dup grapheme-control? ] [ - control-class dup ZWJ = [ - drop - str unclip-last-slice drop dup [ - [ extend? ] - [ control-class Extend = ] - [ modifier? ] - tri or or not - ] find-last drop [ swap ?nth ] [ last ] if* - extended-pictographic-table interval-key? [ - (Extended_Pictographic-Extend*-)ZWJ - ] [ ZWJ ] if + control-class dup ZWJ = [ + drop + str unclip-last-slice drop dup [ + [ extend? ] + [ control-class Extend = ] + [ modifier? ] + tri or or not + ] find-last drop [ swap ?nth ] [ last ] if* + extended-pictographic-table interval-key? [ + (Extended_Pictographic-Extend*-)ZWJ + ] [ ZWJ ] if ] when ] } { [ dup extend? ] [ drop Extend ] } diff --git a/basis/unicode/unicode.factor b/basis/unicode/unicode.factor index e67b3a5366..9988f9606e 100644 --- a/basis/unicode/unicode.factor +++ b/basis/unicode/unicode.factor @@ -67,7 +67,7 @@ CATEGORY: math Sm | "Other_Math" property? ; ] if ; : last-grapheme-from ( end str -- i ) - swap head-slice last-grapheme ; + swap head-slice last-grapheme ; new-passwd { $values - { "passwd" "a passwd struct" } - { "new-passwd" "a passwd tuple" } } + { "passwd" "a passwd struct" } + { "new-passwd" "a passwd tuple" } } { $description "A platform-specific conversion routine from a passwd structure to a passwd tuple." } ; HELP: real-user-name @@ -49,35 +49,35 @@ HELP: set-real-user HELP: user-passwd { $values - { "obj" object } - { "passwd/f" "passwd or f" } } + { "obj" object } + { "passwd/f" "passwd or f" } } { $description "Returns the passwd tuple given a user-name string or user id." } ; HELP: user-name { $values - { "id" integer } - { "string" string } } + { "id" integer } + { "string" string } } { $description "Returns the user-name associated with the user id." } ; HELP: user-id { $values - { "string" string } - { "id/f" "an integer or f" } } + { "string" string } + { "id/f" "an integer or f" } } { $description "Returns the user id associated with the user-name." } ; HELP: with-effective-user { $values - { "string/id/f" "a string, a uid, or f" } { "quot" quotation } } + { "string/id/f" "a string, a uid, or f" } { "quot" quotation } } { $description "Sets the effective user-name and calls the quotation. Restores the current user-name on success or on error after the call. If the first parameter is " { $link f } ", the quotation is called as the current user." } ; HELP: with-user-cache { $values - { "quot" quotation } } + { "quot" quotation } } { $description "Iterates over the password file using library calls and creates a cache in the " { $link user-cache } " symbol. The cache is a hashtable indexed by user id. When looking up many users, this approach is much faster than calling system calls." } ; HELP: with-real-user { $values - { "string/id/f" "a string, a uid, or f" } { "quot" quotation } } + { "string/id/f" "a string, a uid, or f" } { "quot" quotation } } { $description "Sets the real user-name and calls the quotation. Restores the current user-name on success or on error after the call. If the first parameter is " { $link f } ", the quotation is called as the current user." } ; { diff --git a/basis/urls/urls-docs.factor b/basis/urls/urls-docs.factor index 39a50b1425..6819fb9ffa 100644 --- a/basis/urls/urls-docs.factor +++ b/basis/urls/urls-docs.factor @@ -89,7 +89,7 @@ HELP: parse-host HELP: query-param { $values - { "url" url } { "key" string } + { "url" url } { "key" string } { "value" { $maybe string } } } { $description "Outputs the URL-decoded value of a URL query parameter." } { $examples @@ -132,8 +132,8 @@ HELP: relative-url HELP: relative-url? { $values - { "url" url } - { "?" boolean } } + { "url" url } + { "?" boolean } } { $description "Tests whether a URL is relative." } ; HELP: redacted-url diff --git a/basis/windows/com/com.factor b/basis/windows/com/com.factor index 674bae2b14..2e9d2380ae 100644 --- a/basis/windows/com/com.factor +++ b/basis/windows/com/com.factor @@ -130,7 +130,7 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) with-out-parameters ; : com-add-ref ( interface -- interface ) - [ IUnknown::AddRef drop ] keep ; inline + [ IUnknown::AddRef drop ] keep ; inline ERROR: null-com-release ; : com-release ( interface -- ) diff --git a/basis/windows/uniscribe/uniscribe.factor b/basis/windows/uniscribe/uniscribe.factor index 299ef2f481..1c9e2d0ed3 100644 --- a/basis/windows/uniscribe/uniscribe.factor +++ b/basis/windows/uniscribe/uniscribe.factor @@ -89,10 +89,10 @@ PRIVATE> [ [ { 0 0 } ] dip ] [ [let :> str str selection-start/end - [ - str string>> dup selection? [ string>> ] when - swap >utf16-index - ] bi@ + [ + str string>> dup selection? [ string>> ] when + swap >utf16-index + ] bi@ ] ] tri* ! iMinSel diff --git a/basis/x11/x11.factor b/basis/x11/x11.factor index fc749012ab..4340fa1a7a 100644 --- a/basis/x11/x11.factor +++ b/basis/x11/x11.factor @@ -10,8 +10,8 @@ SYMBOL: scr SYMBOL: root : init-locale ( -- ) - LC_ALL "" setlocale [ "setlocale() failed" print flush ] unless - XSupportsLocale c-bool> [ "XSupportsLocale() failed" print flush ] unless ; + LC_ALL "" setlocale [ "setlocale() failed" print flush ] unless + XSupportsLocale c-bool> [ "XSupportsLocale() failed" print flush ] unless ; : flush-dpy ( -- ) dpy get XFlush drop ; diff --git a/basis/xml/data/data.factor b/basis/xml/data/data.factor index bb948e159b..f4c3e5c5e7 100644 --- a/basis/xml/data/data.factor +++ b/basis/xml/data/data.factor @@ -205,7 +205,7 @@ CONSULT: name xml body>> ; PRIVATE> M: xml clone - xml clone-slots ; + xml clone-slots ; M: xml like swap dup xml? [ nip ] [ diff --git a/basis/xml/dtd/dtd.factor b/basis/xml/dtd/dtd.factor index 29ab7e482c..a407b73566 100644 --- a/basis/xml/dtd/dtd.factor +++ b/basis/xml/dtd/dtd.factor @@ -26,7 +26,7 @@ UNION: dtd-acceptable { CHAR: \" [ parse-quote ] } [ drop take-external-id close ] } case - ] dip '[ swap _ [ ?set-at ] change ] 2keep ; + ] dip '[ swap _ [ ?set-at ] change ] 2keep ; : take-entity-decl ( -- entity-decl ) pass-blank get-char { diff --git a/basis/xml/syntax/syntax.factor b/basis/xml/syntax/syntax.factor index aeebe98bbe..6d52b18953 100644 --- a/basis/xml/syntax/syntax.factor +++ b/basis/xml/syntax/syntax.factor @@ -44,13 +44,13 @@ SYNTAX: XML-NS: [ values [ interpolated? ] filter ] dip each ; inline : (each-interpolated) ( ... item quot: ( ... interpolated -- ... ) -- ... ) - { + { { [ over interpolated? ] [ call ] } { [ over tag? ] [ [ attrs>> ] dip each-attrs ] } { [ over attrs? ] [ each-attrs ] } { [ over xml? ] [ [ body>> ] dip (each-interpolated) ] } [ 2drop ] - } cond ; inline recursive + } cond ; inline recursive : each-interpolated ( xml quot -- ) '[ _ (each-interpolated) ] deep-each ; inline diff --git a/basis/xml/tokenize/tokenize.factor b/basis/xml/tokenize/tokenize.factor index 77f5f8d917..78d739eece 100644 --- a/basis/xml/tokenize/tokenize.factor +++ b/basis/xml/tokenize/tokenize.factor @@ -75,9 +75,9 @@ HINTS: next* { spot } ; ! Take the substring of a string starting at spot ! from code until the quotation given is true and ! advance spot to after the substring. - 10 [ - '[ _ keep over [ drop ] [ _ push ] if ] skip-until - ] keep "" like ; inline + 10 [ + '[ _ keep over [ drop ] [ _ push ] if ] skip-until + ] keep "" like ; inline : take-to ( seq -- string ) '[ _ member? ] take-until ; inline @@ -186,4 +186,4 @@ HINTS: next* { spot } ; [ next (parse-quote) ] [ quoteless-attr ] if ; inline : parse-quote ( -- seq ) - f parse-quote* ; + f parse-quote* ; diff --git a/basis/xml/writer/writer-tests.factor b/basis/xml/writer/writer-tests.factor index d12e530ee7..0bf7024ec6 100644 --- a/basis/xml/writer/writer-tests.factor +++ b/basis/xml/writer/writer-tests.factor @@ -13,10 +13,10 @@ IN: xml.writer.tests { "ns:foo" } [ T{ name { space "ns" } { main "foo" } } name>string ] unit-test : reprints-as ( to from -- ) - [ ] [ string>xml xml>string ] bi-curry* unit-test ; + [ ] [ string>xml xml>string ] bi-curry* unit-test ; : pprint-reprints-as ( to from -- ) - [ ] [ string>xml pprint-xml>string ] bi-curry* unit-test ; + [ ] [ string>xml pprint-xml>string ] bi-curry* unit-test ; : reprints-same ( string -- ) dup reprints-as ; diff --git a/basis/xmode/marker/marker-tests.factor b/basis/xmode/marker/marker-tests.factor index 6989e7fca5..f9f7a9e1d9 100644 --- a/basis/xmode/marker/marker-tests.factor +++ b/basis/xmode/marker/marker-tests.factor @@ -82,7 +82,7 @@ xmode.marker tools.test kernel ; T{ token f ">" KEYWORD2 } } } [ - f "" "xml" load-mode tokenize-line nip + f "" "xml" load-mode tokenize-line nip ] unit-test { @@ -97,7 +97,7 @@ xmode.marker tools.test kernel ; T{ token f ">" KEYWORD2 } } } [ - f "" "xml" load-mode tokenize-line nip + f "" "xml" load-mode tokenize-line nip ] unit-test { diff --git a/core/assocs/assocs-docs.factor b/core/assocs/assocs-docs.factor index 66cea3395a..5636c60fe0 100644 --- a/core/assocs/assocs-docs.factor +++ b/core/assocs/assocs-docs.factor @@ -514,29 +514,29 @@ HELP: >alist HELP: assoc-clone-like { $values - { "assoc" assoc } { "exemplar" assoc } - { "newassoc" assoc } } + { "assoc" assoc } { "exemplar" assoc } + { "newassoc" assoc } } { $description "Outputs a newly-allocated assoc with the same elements as " { $snippet "assoc" } "." } { $examples { $example "USING: prettyprint assocs hashtables ;" "H{ { 1 2 } { 3 4 } } { } assoc-clone-like ." "{ { 1 2 } { 3 4 } }" } } ; HELP: assoc-union-all { $values - { "seq" "a sequence of assocs" } - { "union" assoc } } + { "seq" "a sequence of assocs" } + { "union" assoc } } { $description "Takes the union of all of the " { $snippet "assocs" } " in " { $snippet "seq" } "." } { $examples { $example "USING: prettyprint assocs ;" "{ H{ { 1 2 } } H{ { 3 4 } } } assoc-union-all ." "H{ { 1 2 } { 3 4 } }" } } ; HELP: assoc-map-as { $values - { "assoc" assoc } { "quot" { $quotation ( ... key value -- ... newkey newvalue ) } } { "exemplar" assoc } - { "newassoc" assoc } } + { "assoc" assoc } { "quot" { $quotation ( ... key value -- ... newkey newvalue ) } } { "exemplar" assoc } + { "newassoc" assoc } } { $description "Applies the quotation to each entry in the input assoc and collects the results in a new assoc of the same type as the exemplar." } { $examples { $example "USING: prettyprint assocs hashtables math ;" " H{ { 1 2 } { 3 4 } } [ sq ] { } assoc-map-as ." "{ { 1 4 } { 3 16 } }" } } ; HELP: extract-keys { $values - { "seq" sequence } { "assoc" assoc } - { "subassoc" assoc } } + { "seq" sequence } { "assoc" assoc } + { "subassoc" assoc } } { $description "Outputs an new " { $snippet "assoc" } " with key/value pairs whose keys match the elements in the input " { $snippet "seq" } "." } { $examples { $example "USING: prettyprint assocs ;" @@ -547,7 +547,7 @@ HELP: extract-keys HELP: push-at { $values - { "value" object } { "key" object } { "assoc" assoc } } + { "value" object } { "key" object } { "assoc" assoc } } { $description "Pushes the " { $snippet "value" } " onto a " { $snippet "vector" } " stored at the " { $snippet "key" } " in the " { $snippet "assoc" } ". If the " { $snippet "key" } " does not yet exist, creates a new " { $snippet "vector" } " at that " { $snippet "key" } " and pushes the " { $snippet "value" } "." } { $examples { $example "USING: prettyprint assocs kernel ;" "H{ { \"cats\" V{ \"Mittens\" } } } \"Mew\" \"cats\" pick push-at ." @@ -556,8 +556,8 @@ HELP: push-at HELP: search-alist { $values - { "key" object } { "alist" "an array of key/value pairs" } - { "pair/f" "a key/value pair" } { "i/f" integer } } + { "key" object } { "alist" "an array of key/value pairs" } + { "pair/f" "a key/value pair" } { "i/f" integer } } { $description "Iterates over " { $snippet "alist" } " and stops when the key is matched or the end of the " { $snippet "alist" } " has been reached. If there is no match, both outputs are " { $link f } "." } { $notes "This word is used to implement " { $link at* } " and " { $link set-at } " on sequences, and should not be called directly." } { $examples { $example "USING: prettyprint assocs.private kernel ;" @@ -571,8 +571,8 @@ HELP: search-alist HELP: unzip { $values - { "assoc" assoc } - { "keys" sequence } { "values" sequence } } + { "assoc" assoc } + { "keys" sequence } { "values" sequence } } { $description "Outputs an array of keys and an array of values of the input " { $snippet "assoc" } "." } { $examples { $example "USING: prettyprint assocs kernel ;" @@ -583,8 +583,8 @@ HELP: unzip HELP: zip { $values - { "keys" sequence } { "values" sequence } - { "alist" "an array of key/value pairs" } } + { "keys" sequence } { "values" sequence } + { "alist" "an array of key/value pairs" } } { $description "Combines two sequences pairwise into a single sequence of key/value pairs." } { $examples { $example "USING: prettyprint assocs ;" @@ -595,8 +595,8 @@ HELP: zip HELP: zip-as { $values - { "keys" sequence } { "values" sequence } { "exemplar" sequence } - { "assoc" "a sequence of key/value pairs of type " { $snippet "exemplar" } } } + { "keys" sequence } { "values" sequence } { "exemplar" sequence } + { "assoc" "a sequence of key/value pairs of type " { $snippet "exemplar" } } } { $description "Combines two sequences pairwise into a single sequence of key/value pairs of type " { $snippet "exemplar" } "." } { $notes "Exemplar must be a sequence type; hashtables will not work yet." } { $examples diff --git a/core/assocs/assocs.factor b/core/assocs/assocs.factor index fdfacb8fcc..f4ddb7371b 100644 --- a/core/assocs/assocs.factor +++ b/core/assocs/assocs.factor @@ -238,7 +238,7 @@ M: assoc value-at* swap [ = nip ] curry assoc-find nip ; ] if ; inline : zip ( keys values -- alist ) - { } zip-as ; inline + { } zip-as ; inline : zip-index-as ( values exemplar -- assoc ) [ dup length ] dip zip-as ; inline diff --git a/core/byte-arrays/byte-arrays-docs.factor b/core/byte-arrays/byte-arrays-docs.factor index 6a62122eb1..6946b88663 100644 --- a/core/byte-arrays/byte-arrays-docs.factor +++ b/core/byte-arrays/byte-arrays-docs.factor @@ -49,26 +49,26 @@ HELP: >byte-array HELP: 1byte-array { $values - { "x" object } - { "byte-array" byte-array } } + { "x" object } + { "byte-array" byte-array } } { $description "Creates a new byte-array with one element." } ; HELP: 2byte-array { $values - { "x" object } { "y" object } - { "byte-array" byte-array } } + { "x" object } { "y" object } + { "byte-array" byte-array } } { $description "Creates a new byte-array with two elements." } ; HELP: 3byte-array { $values - { "x" object } { "y" object } { "z" object } - { "byte-array" byte-array } } + { "x" object } { "y" object } { "z" object } + { "byte-array" byte-array } } { $description "Creates a new byte-array with three element." } ; HELP: 4byte-array { $values - { "w" object } { "x" object } { "y" object } { "z" object } - { "byte-array" byte-array } } + { "w" object } { "x" object } { "y" object } { "z" object } + { "byte-array" byte-array } } { $description "Creates a new byte-array with four elements." } ; { 1byte-array 2byte-array 3byte-array 4byte-array } related-words diff --git a/core/classes/classes-docs.factor b/core/classes/classes-docs.factor index 7581a900c5..c60a4362ae 100644 --- a/core/classes/classes-docs.factor +++ b/core/classes/classes-docs.factor @@ -130,8 +130,8 @@ HELP: superclass-of HELP: superclasses-of { $values - { "class" class } - { "supers" sequence } } + { "class" class } + { "supers" sequence } } { $description "Outputs a sequence of superclasses of a class along with the class itself." } { $examples { $example "USING: classes prettyprint ;" @@ -175,8 +175,8 @@ HELP: implementors HELP: instance? { $values - { "object" object } { "class" class } - { "?" boolean } } + { "object" object } { "class" class } + { "?" boolean } } { $description "Tests whether the input object is a member of the class." } ; HELP: reset-class diff --git a/core/combinators/combinators-tests.factor b/core/combinators/combinators-tests.factor index f428666a0d..b1d6b78e68 100644 --- a/core/combinators/combinators-tests.factor +++ b/core/combinators/combinators-tests.factor @@ -120,9 +120,9 @@ IN: combinators.tests : cond-test-6 ( a -- b ) { - [ drop "really early" ] - { [ dup 2 mod 1 = ] [ drop "odd" ] } - { [ dup 2 mod 0 = ] [ drop "even" ] } + [ drop "really early" ] + { [ dup 2 mod 1 = ] [ drop "odd" ] } + { [ dup 2 mod 0 = ] [ drop "even" ] } } cond ; { "really early" } [ 2 cond-test-6 ] unit-test diff --git a/core/combinators/short-circuit/short-circuit-docs.factor b/core/combinators/short-circuit/short-circuit-docs.factor index 80183e7dbc..d32c066dd3 100644 --- a/core/combinators/short-circuit/short-circuit-docs.factor +++ b/core/combinators/short-circuit/short-circuit-docs.factor @@ -37,14 +37,14 @@ HELP: 3|| HELP: n&& { $values - { "quots" "a sequence of quotations" } { "n" integer } - { "quot" quotation } } + { "quots" "a sequence of quotations" } { "n" integer } + { "quot" quotation } } { $description "A macro that rewrites the code to pass " { $snippet "n" } " parameters from the stack to each quotation, evaluating the result in the same manner as " { $link 0&& } "." } ; HELP: n|| { $values - { "quots" "a sequence of quotations" } { "n" integer } - { "quot" quotation } } + { "quots" "a sequence of quotations" } { "n" integer } + { "quot" quotation } } { $description "A macro that rewrites the code to pass " { $snippet "n" } " parameters from the stack to each OR quotation." } ; ARTICLE: "combinators.short-circuit" "Short-circuit combinators" diff --git a/core/continuations/continuations-docs.factor b/core/continuations/continuations-docs.factor index 148180d7df..6299d04bcd 100644 --- a/core/continuations/continuations-docs.factor +++ b/core/continuations/continuations-docs.factor @@ -254,8 +254,8 @@ HELP: with-datastack HELP: attempt-all { $values - { "seq" sequence } { "quot" quotation } - { "obj" object } } + { "seq" sequence } { "quot" quotation } + { "obj" object } } { $description "Applies the quotation to elements in a sequence and returns the value from the first quotation that does not throw an error. If all quotations throw an error, returns the last error thrown." } { $examples "The first two numbers throw, the last one doesn't:" { $example @@ -275,7 +275,7 @@ HELP: return HELP: with-return { $values - { "quot" quotation } } + { "quot" quotation } } { $description "Captures a continuation that can be reified by calling the " { $link return } " word. If so, it will resume execution immediately after the " { $link with-return } " word. If " { $link return } " is not called, then execution proceeds as if this word were simply " { $link call } "." } { $examples "Only \"Hi\" will print:" diff --git a/core/destructors/destructors-docs.factor b/core/destructors/destructors-docs.factor index 8271fcbd20..5eed17e184 100644 --- a/core/destructors/destructors-docs.factor +++ b/core/destructors/destructors-docs.factor @@ -63,7 +63,7 @@ HELP: |dispose HELP: dispose-each { $values - { "seq" sequence } } + { "seq" sequence } } { $description "Attempts to dispose of each element of a sequence and collects all of the errors into a sequence. If any errors are thrown during disposal, the last error is rethrown after all objects have been disposed." } ; HELP: disposables diff --git a/core/generalizations/generalizations-docs.factor b/core/generalizations/generalizations-docs.factor index 1b1c7f5cc5..d144dfdee4 100644 --- a/core/generalizations/generalizations-docs.factor +++ b/core/generalizations/generalizations-docs.factor @@ -260,8 +260,8 @@ HELP: nweave HELP: n*quot { $values - { "n" integer } { "quot" quotation } - { "quotquot" quotation } + { "n" integer } { "quot" quotation } + { "quotquot" quotation } } { $examples { $example "USING: generalizations prettyprint math ;" diff --git a/core/graphs/graphs.factor b/core/graphs/graphs.factor index de64c6b606..3b305a34a9 100644 --- a/core/graphs/graphs.factor +++ b/core/graphs/graphs.factor @@ -19,12 +19,12 @@ PRIVATE> diff --git a/core/hash-sets/hash-sets.factor b/core/hash-sets/hash-sets.factor index f9ed7fdfab..8cd3729361 100644 --- a/core/hash-sets/hash-sets.factor +++ b/core/hash-sets/hash-sets.factor @@ -99,7 +99,7 @@ PRIVATE> [ 0 0 ] dip hash-set boa ; inline M: hash-set in? - key@ 2nip ; + key@ 2nip ; M: hash-set clear-set [ init-hash ] [ array>> [ drop +empty+ ] map! drop ] bi ; diff --git a/core/hashtables/hashtables-docs.factor b/core/hashtables/hashtables-docs.factor index 7fb99af93a..972a659971 100644 --- a/core/hashtables/hashtables-docs.factor +++ b/core/hashtables/hashtables-docs.factor @@ -118,8 +118,8 @@ HELP: associate HELP: ?set-at { $values - { "value" object } { "key" object } { "assoc/f" "an assoc or " { $link f } } - { "assoc" assoc } } + { "value" object } { "key" object } { "assoc/f" "an assoc or " { $link f } } + { "assoc" assoc } } { $description "If the third input is an assoc, stores the key/value pair into that assoc, or else creates a new hashtable with the key/value pair as its only entry." } ; HELP: >hashtable diff --git a/core/io/encodings/encodings-docs.factor b/core/io/encodings/encodings-docs.factor index 95cb73e8ad..3ff1311239 100644 --- a/core/io/encodings/encodings-docs.factor +++ b/core/io/encodings/encodings-docs.factor @@ -42,27 +42,27 @@ $low-level-note ; HELP: decode-input { $values - { "encoding" "an encoding descriptor" } + { "encoding" "an encoding descriptor" } } { $description "Changes the encoding of the current input stream stored in the " { $link input-stream } " variable." } ; HELP: encode-output { $values - { "encoding" "an encoding descriptor" } + { "encoding" "an encoding descriptor" } } { $description "Changes the encoding of the current output stream stored in the " { $link output-stream } " variable." } ; HELP: re-decode { $values - { "stream" "a stream" } { "encoding" "an encoding descriptor" } - { "newstream" "a new stream" } + { "stream" "a stream" } { "encoding" "an encoding descriptor" } + { "newstream" "a new stream" } } { $description "Creates a new decoding stream with the supplied encoding descriptor from an existing stream by calling the " { $link } " word." } ; HELP: re-encode { $values - { "stream" "a stream" } { "encoding" "an encoding descriptor" } - { "newstream" "a new stream" } + { "stream" "a stream" } { "encoding" "an encoding descriptor" } + { "newstream" "a new stream" } } { $description "Creates a new encoding stream with the supplied encoding descriptor from an existing stream by calling the " { $link } " word." } ; @@ -70,13 +70,13 @@ HELP: re-encode HELP: with-decoded-input { $values - { "encoding" "an encoding descriptor" } { "quot" quotation } + { "encoding" "an encoding descriptor" } { "quot" quotation } } { $description "Creates a new decoding stream with the given encoding descriptor and calls the quotation with this stream set to the " { $link input-stream } " variable. The original decoder stream is restored after the quotation returns and the stream is kept open for future input operations." } ; HELP: with-encoded-output { $values - { "encoding" "an encoding descriptor" } { "quot" quotation } + { "encoding" "an encoding descriptor" } { "quot" quotation } } { $description "Creates a new encoder with the given encoding descriptor and calls the quotation using this encoder. The original encoder object is restored after the quotation returns and the stream is kept open for future output operations." } ; diff --git a/core/io/encodings/encodings-tests.factor b/core/io/encodings/encodings-tests.factor index c0807d1bff..f3601ee0a3 100644 --- a/core/io/encodings/encodings-tests.factor +++ b/core/io/encodings/encodings-tests.factor @@ -38,25 +38,25 @@ unit-test { "1234" } [ - "Hello world\r\n1234" - dup stream-readln drop - 4 swap stream-read + "Hello world\r\n1234" + dup stream-readln drop + 4 swap stream-read ] unit-test { "1234" } [ - "Hello world\r\n1234" - dup stream-readln drop - 4 swap stream-read-partial + "Hello world\r\n1234" + dup stream-readln drop + 4 swap stream-read-partial ] unit-test { CHAR: 1 } [ - "Hello world\r\n1234" - dup stream-readln drop - stream-read1 + "Hello world\r\n1234" + dup stream-readln drop + stream-read1 ] unit-test { utf8 ascii } [ diff --git a/core/io/io-docs.factor b/core/io/io-docs.factor index 3a15419455..5993419f89 100644 --- a/core/io/io-docs.factor +++ b/core/io/io-docs.factor @@ -68,8 +68,8 @@ $io-error ; HELP: stream-read-partial { $values - { "n" "a non-negative integer" } { "stream" "an input stream" } - { "seq/f" { $or byte-array string f } } } + { "n" "a non-negative integer" } { "stream" "an input stream" } + { "seq/f" { $or byte-array string f } } } { $description "Reads at most " { $snippet "n" } " elements from a stream and returns up to that many characters without blocking. If no characters are available, blocks until some are and returns them." } ; HELP: stream-read-partial-unsafe @@ -132,14 +132,14 @@ $io-error ; HELP: stream-tell { $values - { "stream" "a stream" } { "n" integer } + { "stream" "a stream" } { "n" integer } } { $description "Returns the index of the stream pointer if the stream is seekable." } { $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ; HELP: stream-seek { $values - { "n" integer } { "seek-type" "a seek singleton" } { "stream" "a stream" } + { "n" integer } { "seek-type" "a seek singleton" } { "stream" "a stream" } } { $description "Moves the pointer associated with a stream's handle to an offset " { $snippet "n" } " bytes from the seek type so that further reading or writing happens at the new location. For output streams, the buffer is flushed before seeking. Seeking past the end of an output stream will pad the difference with zeros once the stream is written to again." $nl "Three methods of seeking are supported:" @@ -149,36 +149,33 @@ HELP: stream-seek HELP: stream-seekable? { $values - { "stream" "a stream" } { "?" boolean } + { "stream" "a stream" } { "?" boolean } } { $description "Returns true if " { $snippet "stream" } " is a seekable stream." } { $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ; HELP: stream-length { $values - { "stream" "a stream" } { "n/f" { $maybe integer } } + { "stream" "a stream" } { "n/f" { $maybe integer } } } { $description "Returns the length of the data supplied by " { $snippet "stream" } ", or " { $link f } " if the stream is not seekable or has unknown length." } { $notes "Stream seeking is not supported on streams that do not have a known length, e.g. TCP/IP streams." } ; HELP: seek-absolute { $values - - { "value" "a seek singleton" } + { "value" "a seek singleton" } } { $description "Seeks to an offset from the beginning of the stream." } ; HELP: seek-end { $values - - { "value" "a seek singleton" } + { "value" "a seek singleton" } } { $description "Seeks to an offset from the end of the stream. If the offset puts the stream pointer past the end of the data on an output stream, writing to it will pad the difference with zeros." } ; HELP: seek-relative { $values - - { "value" "a seek singleton" } + { "value" "a seek singleton" } } { $description "Seeks to an offset from the current position of the stream pointer." } ; @@ -187,13 +184,13 @@ HELP: seek-relative HELP: seek-input { $values - { "n" integer } { "seek-type" "a seek singleton" } + { "n" integer } { "seek-type" "a seek singleton" } } { $description "Calls " { $link stream-seek } " on the stream stored in " { $link input-stream } "." } ; HELP: seek-output { $values - { "n" integer } { "seek-type" "a seek singleton" } + { "n" integer } { "seek-type" "a seek singleton" } } { $description "Calls " { $link stream-seek } " on the stream stored in " { $link output-stream } "." } ; diff --git a/core/io/io.factor b/core/io/io.factor index 36ea5e009d..677b437a93 100644 --- a/core/io/io.factor +++ b/core/io/io.factor @@ -223,12 +223,12 @@ CONSTANT: each-block-size 65536 >radix 0 ; inline : ( i number-parse n -- float-parse i number-parse n ) - [ drop nip [ radix>> ] [ magnitude>> ] bi [ 0 f ] dip float-parse boa ] 3keep ; inline + [ drop nip [ radix>> ] [ magnitude>> ] bi [ 0 f ] dip float-parse boa ] 3keep ; inline : if-skip ( char true false -- ) pick ",_" member-eq? [ drop nip call ] [ nip call ] if ; inline diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 0d95ae06a7..8cebd36ec3 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1491,8 +1491,8 @@ HELP: sift { $values { "seq" sequence } { "newseq" sequence } } - { $description "Outputs a new sequence with all instances of " { $link f } " removed." } - { $examples +{ $description "Outputs a new sequence with all instances of " { $link f } " removed." } +{ $examples { $example "USING: prettyprint sequences ;" "{ \"a\" 3 { } f } sift ." "{ \"a\" 3 { } }" @@ -1575,7 +1575,7 @@ HELP: replicate-as { $values { "len" integer } { "quot" { $quotation ( ... -- ... newelt ) } } { "exemplar" sequence } { "newseq" sequence } } - { $description "Calls the quotation " { $snippet "len" } " times, collecting results into a new sequence of the same type as the exemplar sequence." } +{ $description "Calls the quotation " { $snippet "len" } " times, collecting results into a new sequence of the same type as the exemplar sequence." } { $examples { $unchecked-example "USING: prettyprint kernel sequences ;" "5 [ 100 random ] B{ } replicate-as ." @@ -1613,7 +1613,7 @@ HELP: 2map-reduce { $values { "seq1" sequence } { "seq2" sequence } { "map-quot" { $quotation ( ..a elt1 elt2 -- ..a intermediate ) } } { "reduce-quot" { $quotation ( ..a prev intermediate -- ..a next ) } } { "result" object } } - { $description "Calls " { $snippet "map-quot" } " on each pair of elements from " { $snippet "seq1" } " and " { $snippet "seq2" } " and combines the results using " { $snippet "reduce-quot" } " in the same manner as " { $link reduce } ", except that there is no identity element, and the sequence must have a length of at least 1." } +{ $description "Calls " { $snippet "map-quot" } " on each pair of elements from " { $snippet "seq1" } " and " { $snippet "seq2" } " and combines the results using " { $snippet "reduce-quot" } " in the same manner as " { $link reduce } ", except that there is no identity element, and the sequence must have a length of at least 1." } { $errors "Throws an error if the sequence is empty." } { $examples { $example "USING: sequences prettyprint math ;" "{ 10 30 50 } { 200 400 600 } [ + ] [ + ] 2map-reduce ." diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index c10d4dbe66..55ac4221ff 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -909,7 +909,7 @@ PRIVATE> ] keep ; : reverse ( seq -- newseq ) - [ + [ dup [ length ] keep new-sequence [ 0 swap copy-unsafe ] keep reverse! ] keep like ; diff --git a/core/sets/sets-docs.factor b/core/sets/sets-docs.factor index 3fecbd4b60..54d82d5de9 100644 --- a/core/sets/sets-docs.factor +++ b/core/sets/sets-docs.factor @@ -59,8 +59,8 @@ ARTICLE: "set-operations" "Operations on sets" } "Utilities for sets and sequences:" { $subsections - within - without + within + without } ; ARTICLE: "set-implementations" "Set implementations" @@ -199,8 +199,8 @@ HELP: set= HELP: gather { $values - { "seq" sequence } { "quot" { $quotation ( ... elt -- ... elts ) } } - { "newseq" sequence } } + { "seq" sequence } { "quot" { $quotation ( ... elt -- ... elts ) } } + { "newseq" sequence } } { $description "Maps a quotation over a sequence, concatenates the results of the mapping, and removes duplicates." } ; HELP: set-like diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 6639784a83..3128f4cc0d 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -120,8 +120,8 @@ ARTICLE: "syntax-floats" "Float syntax" { $subsections POSTPONE: NAN: } "To see the 64 bit value of " { $snippet "0/0." } " on your platform, execute the following code :" { $code - "USING: io math math.parser ;" - "\"NAN: \" write 0/0. double>bits >hex print" + "USING: io math math.parser ;" + "\"NAN: \" write 0/0. double>bits >hex print" } "Hexadecimal, octal and binary float literals are also supported. These consist of a hexadecimal, octal or binary literal with a decimal point and a mandatory base-two exponent expressed as a decimal number after " { $snippet "p" } " or " { $snippet "P" } ":" { $example diff --git a/extra/asn1/asn1.factor b/extra/asn1/asn1.factor index 2ea0de5e86..b4873b1ad0 100644 --- a/extra/asn1/asn1.factor +++ b/extra/asn1/asn1.factor @@ -60,7 +60,7 @@ PRIVATE> } } } - } ; + } ; SYMBOL: elements diff --git a/extra/asn1/ldap/ldap.factor b/extra/asn1/ldap/ldap.factor index 8115e10165..0da784fe26 100644 --- a/extra/asn1/ldap/ldap.factor +++ b/extra/asn1/ldap/ldap.factor @@ -65,4 +65,4 @@ CONSTANT: SearchScope_WholeSubtree 2 } } } - } ; + } ; diff --git a/extra/assocs/extras/extras.factor b/extra/assocs/extras/extras.factor index ddbe6a4de1..4340087837 100644 --- a/extra/assocs/extras/extras.factor +++ b/extra/assocs/extras/extras.factor @@ -79,8 +79,8 @@ IN: assocs.extras ! Modifies assoc1 : assoc-merge! ( assoc1 assoc2 quot: ( value1 value2 -- new-value ) -- assoc1' ) [| key2 val2 quot | val2 key2 pick - at* [ swap quot call ] [ drop ] if - key2 pick set-at ] curry assoc-each ; inline + at* [ swap quot call ] [ drop ] if + key2 pick set-at ] curry assoc-each ; inline ! Same as above, non-destructive : assoc-merge ( assoc1 assoc2 quot: ( value1 value2 -- new-value ) -- new-assoc ) diff --git a/extra/bitcoin/client/client-docs.factor b/extra/bitcoin/client/client-docs.factor index 5ebd601548..12abacd741 100644 --- a/extra/bitcoin/client/client-docs.factor +++ b/extra/bitcoin/client/client-docs.factor @@ -113,9 +113,9 @@ HELP: set-generate } { $description "If 'gen' is true, the server starts generating bitcoins. If 'gen' is " - "'false' then the server stops generating bitcoins. 'n' is the number " - "of CPU's to use while generating. A value of '-1' means use all the " - "CPU's available." + "'false' then the server stops generating bitcoins. 'n' is the number " + "of CPU's to use while generating. A value of '-1' means use all the " + "CPU's available." } ; HELP: get-info diff --git a/extra/boids/boids.factor b/extra/boids/boids.factor index fbe6db5040..4520a11403 100644 --- a/extra/boids/boids.factor +++ b/extra/boids/boids.factor @@ -45,7 +45,7 @@ M: boids-gadget ungraft* -6.0 4.0 glVertex2f -6.0 -4.0 glVertex2f 8.0 0.0 glVertex2f - ] do-state + ] do-state ] with-translation ; : draw-boids ( boids -- ) diff --git a/extra/bson/bson-tests.factor b/extra/bson/bson-tests.factor index b0052e3d71..24809f7297 100644 --- a/extra/bson/bson-tests.factor +++ b/extra/bson/bson-tests.factor @@ -36,12 +36,18 @@ IN: bson.tests { gmt-offset T{ duration { hour 2 } } } } } } turnaround ] unit-test -{ H{ { "nested" H{ { "a" "a string" } { "b" H{ { "a" "a string" } } } } } - { "ref" T{ dbref f "a" "b" "c" } } - { "array" H{ { "a list" { 1 2.234 "hello world" } } } } - { "quot" [ 1 2 + ] } } -} -[ H{ { "nested" H{ { "a" "a string" } { "b" H{ { "a" "a string" } } } } } - { "ref" T{ dbref f "a" "b" "c" } } - { "array" H{ { "a list" { 1 2.234 "hello world" } } } } - { "quot" [ 1 2 + ] } } turnaround ] unit-test +{ + H{ + { "nested" H{ { "a" "a string" } { "b" H{ { "a" "a string" } } } } } + { "ref" T{ dbref f "a" "b" "c" } } + { "array" H{ { "a list" { 1 2.234 "hello world" } } } } + { "quot" [ 1 2 + ] } + } +} [ + H{ + { "nested" H{ { "a" "a string" } { "b" H{ { "a" "a string" } } } } } + { "ref" T{ dbref f "a" "b" "c" } } + { "array" H{ { "a list" { 1 2.234 "hello world" } } } } + { "quot" [ 1 2 + ] } + } turnaround +] unit-test diff --git a/extra/bson/constants/constants.factor b/extra/bson/constants/constants.factor index 2282aabff1..2b075a6172 100644 --- a/extra/bson/constants/constants.factor +++ b/extra/bson/constants/constants.factor @@ -51,7 +51,7 @@ CONSTRUCTOR: dbref ( ref id -- dbref ) ; TUPLE: mdbregexp { regexp string } { options string } ; : ( string -- mdbregexp ) - [ mdbregexp new ] dip >>regexp ; + [ mdbregexp new ] dip >>regexp ; CONSTANT: MDB_OID_FIELD "_id" diff --git a/extra/bson/reader/reader.factor b/extra/bson/reader/reader.factor index f08d896c4c..f630057344 100644 --- a/extra/bson/reader/reader.factor +++ b/extra/bson/reader/reader.factor @@ -51,8 +51,8 @@ DEFER: read-elements read-int32 [ f ] [ drop read-elements t ] if-zero ; inline recursive : bson-binary-read ( -- binary ) - read-int32 read-byte - { + read-int32 read-byte + { { T_Binary_Default [ read ] } { T_Binary_Bytes_Deprecated [ drop read-int32 read ] } { T_Binary_Custom [ read bytes>object ] } @@ -60,11 +60,11 @@ DEFER: read-elements { T_Binary_MD5 [ read >string ] } { T_Binary_UUID [ read >string ] } [ "unknown binary sub-type" unknown-bson-type ] - } case ; inline + } case ; inline TYPED: bson-regexp-read ( -- mdbregexp: mdbregexp ) - mdbregexp new - read-cstring >>regexp read-cstring >>options ; inline + mdbregexp new + read-cstring >>regexp read-cstring >>options ; inline TYPED: bson-oid-read ( -- oid: oid ) read-longlong read-int32 oid boa ; inline diff --git a/extra/bson/writer/writer.factor b/extra/bson/writer/writer.factor index e69166c74e..5fed178e73 100644 --- a/extra/bson/writer/writer.factor +++ b/extra/bson/writer/writer.factor @@ -60,11 +60,11 @@ TYPED: write-byte-array ( binary: byte-array -- ) [ T_Binary_Default write1 write ] bi ; inline TYPED: write-mdbregexp ( regexp: mdbregexp -- ) - [ regexp>> write-cstring ] - [ options>> write-cstring ] bi ; inline + [ regexp>> write-cstring ] + [ options>> write-cstring ] bi ; inline TYPED: write-sequence ( array: sequence -- ) - '[ + '[ _ [ number>string swap write-pair ] each-index write-eoo ] with-length-prefix ; inline recursive @@ -85,7 +85,7 @@ UNION: hashtables hashtable linked-assoc ; TYPED: write-assoc ( assoc: hashtables -- ) '[ _ [ write-oid-field ] [ [ skip-field? [ 2drop ] [ write-pair ] if ] assoc-each - ] bi write-eoo + ] bi write-eoo ] with-length-prefix ; inline recursive UNION: code word quotation ; diff --git a/extra/c/preprocessor/preprocessor.factor b/extra/c/preprocessor/preprocessor.factor index 0a1d8255c5..036debf3b2 100644 --- a/extra/c/preprocessor/preprocessor.factor +++ b/extra/c/preprocessor/preprocessor.factor @@ -158,7 +158,7 @@ ERROR: header-file-missing path ; drop f >>processing-disabled? [ 1 - ] change-ifdef-nesting drop - ] [ 2drop ] if + ] [ 2drop ] if ] [ parse-directive ] if ; diff --git a/extra/cgi/cgi.factor b/extra/cgi/cgi.factor index 5e93827579..9372e94547 100644 --- a/extra/cgi/cgi.factor +++ b/extra/cgi/cgi.factor @@ -33,10 +33,10 @@ IN: cgi : parse-post ( -- assoc ) "CONTENT_TYPE" os-env "" or content-type { - { "multipart/form-data" [ multipart ] } - { "application/x-www-form-urlencoded" [ urlencoded ] } - [ drop parse-get ] - } case nip ; + { "multipart/form-data" [ multipart ] } + { "application/x-www-form-urlencoded" [ urlencoded ] } + [ drop parse-get ] + } case nip ; PRIVATE> diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index 0e6063fc0e..91456adf13 100644 --- a/extra/cli/git/git.factor +++ b/extra/cli/git/git.factor @@ -42,7 +42,7 @@ cli-git-num-parallel [ cpus 2 * ] initialize ?file-info dup [ directory? ] when ; : git-current-branch* ( -- name ) - { "git" "rev-parse" "--abbrev-ref" "HEAD" } git-command>string ; + { "git" "rev-parse" "--abbrev-ref" "HEAD" } git-command>string ; : git-current-branch ( directory -- name ) [ git-current-branch* ] with-directory ; diff --git a/extra/combinators/extras/extras-tests.factor b/extra/combinators/extras/extras-tests.factor index b700de0dc4..ebaaa6d2e3 100644 --- a/extra/combinators/extras/extras-tests.factor +++ b/extra/combinators/extras/extras-tests.factor @@ -17,9 +17,9 @@ IN: combinators.extras.tests { { "negative" 0 "positive" } } [ { -1 0 1 } [ { - { [ 0 > ] [ "positive" ] } - { [ 0 < ] [ "negative" ] } - [ ] + { [ 0 > ] [ "positive" ] } + { [ 0 < ] [ "negative" ] } + [ ] } cond-case ] map ] unit-test diff --git a/extra/cpu/8080/emulator/emulator.factor b/extra/cpu/8080/emulator/emulator.factor index b2744af4b9..ed632cf1cc 100644 --- a/extra/cpu/8080/emulator/emulator.factor +++ b/extra/cpu/8080/emulator/emulator.factor @@ -199,7 +199,7 @@ CONSTANT: sign-flag 0x80 swap cpu-f-bitor= ; : clear-flag ( cpu flag -- ) - bitnot 0xFF bitand swap cpu-f-bitand= ; + bitnot 0xFF bitand swap cpu-f-bitand= ; : update-zero-flag ( result cpu -- ) ! If the result of an instruction has the value 0, this diff --git a/extra/crypto/aes/aes-tests.factor b/extra/crypto/aes/aes-tests.factor index a2c4068cd6..40d8a2dbc6 100644 --- a/extra/crypto/aes/aes-tests.factor +++ b/extra/crypto/aes/aes-tests.factor @@ -151,24 +151,26 @@ CONSTANT: key B{ 0x2b 0x7e 0x15 0x16 0x28 0xae 0xd2 0xa6 0xab 0xf7 0x15 0x88 0x0 ! set-d { { 0x01020304 0x02030401 0x03040102 0x04010203 } } [ - { 0x01010101 0x02020202 0x03030303 0x04040404 } shift-rows + { 0x01010101 0x02020202 0x03030303 0x04040404 } shift-rows ] unit-test { { 0x01010101 0x02020202 0x03030303 0x04040404 } } [ - { 0x01020304 0x02030401 0x03040102 0x04010203 } unshift-rows + { 0x01020304 0x02030401 0x03040102 0x04010203 } unshift-rows ] unit-test { 0x02030401 } [ 0x01020304 rotword ] unit-test { -V{ 729683222 682545830 2885096840 164581180 2700803607 2287217841 - 597899577 711751173 4072838642 2056698179 1496678522 1935275647 - 1031817085 1192689214 505642564 1836746811 4014253377 2823969663 - 3060868411 3674975488 3570517752 2089000327 3404904636 301536700 - 1837671290 285949693 3690563137 3389035517 1314191118 1600113139 - 2225491890 1319558223 3939660577 3045964498 824964448 2139957551 - 2893506291 435870753 684796225 1465647214 3491035560 3387827593 - 3779005640 3059944614 } + V{ + 729683222 682545830 2885096840 164581180 2700803607 2287217841 + 597899577 711751173 4072838642 2056698179 1496678522 1935275647 + 1031817085 1192689214 505642564 1836746811 4014253377 2823969663 + 3060868411 3674975488 3570517752 2089000327 3404904636 301536700 + 1837671290 285949693 3690563137 3389035517 1314191118 1600113139 + 2225491890 1319558223 3939660577 3045964498 824964448 2139957551 + 2893506291 435870753 684796225 1465647214 3491035560 3387827593 + 3779005640 3059944614 + } } [ B{ 0x2b 0x7e 0x15 0x16 0x28 0xae 0xd2 0xa6 0xab 0xf7 0x15 0x88 0x09 0xcf 0x4f 0x3c } ! AES-128 key expansion test vector from FIPS-197 (appendix) 10 (expand-enc-key) @@ -176,12 +178,13 @@ V{ 729683222 682545830 2885096840 164581180 2700803607 2287217841 { 0x046681e5 } [ 0x088df419 ui32> t-transform ] unit-test -{ V{ - 0x3925841d - 0x02dc09fb - 0xdc118597 - 0x196a0b32 - } +{ + V{ + 0x3925841d + 0x02dc09fb + 0xdc118597 + 0x196a0b32 + } } [ key plaintext aes-encrypt-block bytes>words ] unit-test diff --git a/extra/crypto/aes/aes.factor b/extra/crypto/aes/aes.factor index 7e63b4803e..22f8729a2e 100644 --- a/extra/crypto/aes/aes.factor +++ b/extra/crypto/aes/aes.factor @@ -225,7 +225,7 @@ SINGLETON: aes-encrypt c0 gb0 c1 gb1 c2 gb2 c3 gb3 >ui32 ; ! c3' : (add-round-key) ( key state -- state' ) - 4 [ bitxor ] unrolled-2map ; + 4 [ bitxor ] unrolled-2map ; : add-round-key ( aes n -- aes' ) over (key-at-nth-round) swap diff --git a/extra/crypto/passwd-md5/passwd-md5-docs.factor b/extra/crypto/passwd-md5/passwd-md5-docs.factor index ff7d9155e5..f3c40593ca 100644 --- a/extra/crypto/passwd-md5/passwd-md5-docs.factor +++ b/extra/crypto/passwd-md5/passwd-md5-docs.factor @@ -5,20 +5,20 @@ IN: crypto.passwd-md5 HELP: authenticate-password { $values - { "shadow" string } { "password" string } - { "?" boolean } } + { "shadow" string } { "password" string } + { "?" boolean } } { $description "Encodes the provided password and compares it to the encoded password entry from a shadowed password file." } ; HELP: parse-shadow-password { $values - { "string" string } - { "magic" string } { "salt" string } { "password" string } } + { "string" string } + { "magic" string } { "salt" string } { "password" string } } { $description "Splits a shadowed password entry into a magic string, a salt, and an encoded password string." } ; HELP: passwd-md5 { $values - { "magic" string } { "salt" string } { "password" string } - { "bytes" "an md5-shadowed password entry" } } + { "magic" string } { "salt" string } { "password" string } + { "bytes" "an md5-shadowed password entry" } } { $description "Encodes the password with the given magic string and salt to an MD5-shadow password entry." } ; ARTICLE: "crypto.passwd-md5" "MD5 shadow passwords" diff --git a/extra/cuda/prettyprint/prettyprint.factor b/extra/cuda/prettyprint/prettyprint.factor index 9a72ea799e..5caa5f36fb 100644 --- a/extra/cuda/prettyprint/prettyprint.factor +++ b/extra/cuda/prettyprint/prettyprint.factor @@ -21,8 +21,8 @@ PREDICATE: cuda-function-word < word M: cuda-function-word definer drop \ CUDA-FUNCTION: \ ; ; M: cuda-function-word definition drop f ; M: cuda-function-word synopsis* - { - [ seeing-word ] - [ definer. ] - [ [ pprint-word ] pprint-cuda-function ] - } cleave ; + { + [ seeing-word ] + [ definer. ] + [ [ pprint-word ] pprint-cuda-function ] + } cleave ; diff --git a/extra/ecdsa/ecdsa.factor b/extra/ecdsa/ecdsa.factor index c01550e628..e1de3e1f70 100644 --- a/extra/ecdsa/ecdsa.factor +++ b/extra/ecdsa/ecdsa.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: kernel accessors sequences sequences.private destructors math namespaces - openssl openssl.libcrypto byte-arrays bit-arrays.private - alien.c-types alien.destructors alien.data ; + openssl openssl.libcrypto byte-arrays bit-arrays.private + alien.c-types alien.destructors alien.data ; IN: ecdsa diff --git a/extra/elevate/elevate-docs.factor b/extra/elevate/elevate-docs.factor index 9e423b967f..d1b9897adb 100644 --- a/extra/elevate/elevate-docs.factor +++ b/extra/elevate/elevate-docs.factor @@ -12,7 +12,7 @@ ABOUT: "elevate" ARTICLE: "elevate" "Elevated permissions API" "The " { $vocab-link "elevate" } " vocabulary provides abstractions for running programs with elevated (administrator) privileges (permissions). It allows code to relaunch itself or other programs with administrator privileges after requiring a password." $nl - "This vocabulary is inspired by and ported from " { $url "https://github.com/barneygale/elevate" "Barney Gale's elevate.py" } "." + "This vocabulary is inspired by and ported from " { $url "https://github.com/barneygale/elevate" "Barney Gale's elevate.py" } "." $nl { $subsections already-root? elevate elevated lowered } "However, there are many caveats: " { $link "elevate.bugs" } "." ; diff --git a/extra/game/debug/debug.factor b/extra/game/debug/debug.factor index a272a61613..1eebd90dd0 100644 --- a/extra/game/debug/debug.factor +++ b/extra/game/debug/debug.factor @@ -83,18 +83,18 @@ debug-text-fragment-shader debug-text-vertex-format ; CONSTANT: debug-text-font T{ font - { name "monospace" } - { size 16 } - { bold? f } - { italic? f } - { foreground COLOR: white } - { background COLOR: black } } + { name "monospace" } + { size 16 } + { bold? f } + { italic? f } + { foreground COLOR: white } + { background COLOR: black } } CONSTANT: debug-text-texture-parameters T{ texture-parameters - { wrap repeat-texcoord } - { min-filter filter-linear } - { min-mipmap-filter f } } + { wrap repeat-texcoord } + { min-filter filter-linear } + { min-mipmap-filter f } } : text>image ( string color -- image ) debug-text-font clone swap >>foreground swap string>image drop ; diff --git a/extra/gamelib/ui/ui.factor b/extra/gamelib/ui/ui.factor index 74e8ce06b0..95747a17d3 100644 --- a/extra/gamelib/ui/ui.factor +++ b/extra/gamelib/ui/ui.factor @@ -17,7 +17,7 @@ TUPLE: board-gadget < gadget dimension bg-color draw-quotes board gests textures wdt cols /i :> cellwidth hgt rows /i :> cellheight - cellwidth cellheight { } 2sequence ; + cellwidth cellheight { } 2sequence ; :: get-dimension-matrix ( n gadget -- matrix ) ! gets a matrix of all starting locations of cells @@ -117,7 +117,7 @@ TUPLE: board-gadget < gadget dimension bg-color draw-quotes board gests textures ! SECTION: gadget methods M: board-gadget pref-dim* - dimension>> ; + dimension>> ; M: board-gadget handle-gesture swap over gests>> ?at diff --git a/extra/generators/generators.factor b/extra/generators/generators.factor index e6cc451727..c9d6157209 100644 --- a/extra/generators/generators.factor +++ b/extra/generators/generators.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2023 Keldan Chapman. ! See http://factorcode.org/license.txt for BSD license. USING: kernel coroutines effects.parser words sequences accessors generalizations - locals.parser summary combinators.smart math continuations make ; +locals.parser summary combinators.smart math continuations make ; IN: generators TUPLE: generator state ; diff --git a/extra/gpu/render/render.factor b/extra/gpu/render/render.factor index 84f9ec3617..e6092519cb 100644 --- a/extra/gpu/render/render.factor +++ b/extra/gpu/render/render.factor @@ -310,12 +310,12 @@ M: object >uniform-vec-array '[ _ head ] map float-array{ } concat-as ; inline M: binary-data >uniform-vec-array drop ; inline M:: object >uniform-matrix ( sequence cols rows -- c-array ) - sequence flip cols head-slice - [ rows head-slice c:float >c-array ] { } map-as concat ; inline + sequence flip cols head-slice + [ rows head-slice c:float >c-array ] { } map-as concat ; inline M: binary-data >uniform-matrix 2drop ; inline M: object >uniform-matrix-array - '[ _ _ >uniform-matrix ] map concat ; inline + '[ _ _ >uniform-matrix ] map concat ; inline M: binary-data >uniform-matrix-array 2drop ; inline M: object bind-uniform-bvec2 ( index sequence -- ) diff --git a/extra/gpu/util/util.factor b/extra/gpu/util/util.factor index 01cf4a4fbc..f1038d889a 100644 --- a/extra/gpu/util/util.factor +++ b/extra/gpu/util/util.factor @@ -118,9 +118,9 @@ CONSTANT: window-vertexes :: <2d-render-texture> ( dim order type -- renderbuffer texture ) order type T{ texture-parameters - { wrap clamp-texcoord-to-edge } - { min-filter filter-linear } - { min-mipmap-filter f } } + { wrap clamp-texcoord-to-edge } + { min-filter filter-linear } + { min-mipmap-filter f } } [ 0 1array f f dim dup { { default-attachment { 0 0 0 } } } clear-framebuffer diff --git a/extra/html/parser/analyzer/analyzer.factor b/extra/html/parser/analyzer/analyzer.factor index 0964b0ad3f..589a35eaec 100644 --- a/extra/html/parser/analyzer/analyzer.factor +++ b/extra/html/parser/analyzer/analyzer.factor @@ -19,7 +19,7 @@ IN: html.parser.analyzer swap attributes>> key? ; : find-all ( seq quot -- alist ) - [ >alist ] [ '[ second @ ] ] bi* filter ; inline + [ >alist ] [ '[ second @ ] ] bi* filter ; inline : loopn-index ( n quot -- ) [ ] [ '[ @ not ] ] bi* find 2drop ; inline diff --git a/extra/html5/html5.factor b/extra/html5/html5.factor index e82f6d2928..508cb5a566 100644 --- a/extra/html5/html5.factor +++ b/extra/html5/html5.factor @@ -665,7 +665,7 @@ M: in-body-mode tree-insert* over tree>> push after-body-mode >>insertion-mode - ] } + ] } { [ dup { [ end-tag? ] [ name>> "html" = ] } 1&& ] [ drop unimplemented* ] } ! { [ ] [ ] } [ @@ -691,7 +691,7 @@ M: after-body-mode tree-insert* { [ dup doctype? ] [ drop ] } { [ dup { [ tag? ] [ name>> "html" = ] } 1&& ] [ unimplemented* - ] } + ] } { [ dup { [ end-tag? ] [ name>> "html" = ] } 1&& ] [ ! XXX: make this a function "html" pick tree>> find-matching-tag diff --git a/extra/http2/hpack/hpack-tests.factor b/extra/http2/hpack/hpack-tests.factor index c6e4a5c153..1b42abeba0 100644 --- a/extra/http2/hpack/hpack-tests.factor +++ b/extra/http2/hpack/hpack-tests.factor @@ -107,7 +107,7 @@ CONSTANT: c53h { { ":status" "200" } ! RFC7541 Appendix C.2.1 { T{ hpack-context f 4096 { { "custom-key" "custom-header" } } } - 26 { "custom-key" "custom-header" } } + 26 { "custom-key" "custom-header" } } [ hpack-context new c21 0 decode-field nipd ] unit-test ! RFC7541 Appendix C.2.2 diff --git a/extra/id3/id3-tests.factor b/extra/id3/id3-tests.factor index 8168c96a00..7c2e1f9f73 100644 --- a/extra/id3/id3-tests.factor +++ b/extra/id3/id3-tests.factor @@ -15,12 +15,12 @@ IN: id3.tests } cleave ; { - "BLAH" - "ARTIST" - "ALBUM" - "2009" - "COMMENT" - "Bluegrass" + "BLAH" + "ARTIST" + "ALBUM" + "2009" + "COMMENT" + "Bluegrass" } [ "vocab:id3/tests/blah.mp3" mp3>id3 id3-params ] unit-test { @@ -33,12 +33,12 @@ IN: id3.tests } [ "vocab:id3/tests/blah2.mp3" mp3>id3 id3-params ] unit-test { - "Stormy Weather" - "Frank Sinatra" - "Night and Day Frank Sinatra" - f - "eng, AG# 08E1C12E" - "Big Band" + "Stormy Weather" + "Frank Sinatra" + "Night and Day Frank Sinatra" + f + "eng, AG# 08E1C12E" + "Big Band" } [ "vocab:id3/tests/blah3.mp3" mp3>id3 id3-params ] unit-test diff --git a/extra/images/gif/gif.factor b/extra/images/gif/gif.factor index 079efdbb5c..5141c7fa8f 100644 --- a/extra/images/gif/gif.factor +++ b/extra/images/gif/gif.factor @@ -114,11 +114,11 @@ CONSTANT: BLOCK-TERMINATOR 0x00 read-sub-blocks >>comment-data ; : read-application-extension ( -- read-application-extension ) - \ application-extension new - 1 read le> >>block-size - 8 read utf8 decode >>identifier - 3 read >>authentication-code - read-sub-blocks >>application-data ; + \ application-extension new + 1 read le> >>block-size + 8 read utf8 decode >>identifier + 3 read >>authentication-code + read-sub-blocks >>application-data ; : read-gif-header ( loading-gif -- loading-gif ) 6 read utf8 decode >>magic ; diff --git a/extra/images/viewer/viewer-tests.factor b/extra/images/viewer/viewer-tests.factor index 10795f7b88..efde37bbde 100644 --- a/extra/images/viewer/viewer-tests.factor +++ b/extra/images/viewer/viewer-tests.factor @@ -14,15 +14,15 @@ IN: images.viewer.tests { } [ { 50 50 } gen-image "s" set ] unit-test { } [ "s" get "ig" set ] unit-test "ig" get [ - [ t ] [ "ig" get image-gadget-texture single-texture? ] unit-test + [ t ] [ "ig" get image-gadget-texture single-texture? ] unit-test ] with-grafted-gadget { } [ "s" get "m" set ] unit-test { } [ { 150 150 } gen-image "s1" set ] unit-test { } [ "m" get "ic" set ] unit-test "ic" get [ - [ t ] [ "ic" get image-gadget-texture single-texture? ] unit-test - [ { 50 50 } ] [ "ic" get texture>> texture-size ] unit-test + [ t ] [ "ic" get image-gadget-texture single-texture? ] unit-test + [ { 50 50 } ] [ "ic" get texture>> texture-size ] unit-test ] with-grafted-gadget ! TODO diff --git a/extra/images/viewer/viewer.factor b/extra/images/viewer/viewer.factor index 28471b37f0..3de44d2c6d 100644 --- a/extra/images/viewer/viewer.factor +++ b/extra/images/viewer/viewer.factor @@ -67,7 +67,7 @@ M: multi-texture texture-size ] [ f ] if* ] [ f ] if* ; : same-internal-format? ( image-gadget -- ? ) - [ texture-format ] [ image>> image-format 2drop ] bi = ; + [ texture-format ] [ image>> image-format 2drop ] bi = ; ! TODO: also keep multitextures if possible ? : keep-same-texture? ( image-gadget -- ? ) diff --git a/extra/infix/infix-tests.factor b/extra/infix/infix-tests.factor index a6bbaa7dd5..9167bb6d6a 100644 --- a/extra/infix/infix-tests.factor +++ b/extra/infix/infix-tests.factor @@ -10,9 +10,10 @@ IN: infix.tests { 3 } [ [infix 2*7%3+1 infix] ] unit-test { 1419857 } [ [infix 17**5 infix] ] unit-test { 1 } [ [infix 2- - 1 - -5* - 0 infix] ] unit-test + 1 + -5* + 0 infix] +] unit-test { 0.0 } [ [infix sin(0) infix] ] unit-test { 10 } [ [infix lcm(2,5) infix] ] unit-test diff --git a/extra/io/files/acls/macosx/ffi/ffi.factor b/extra/io/files/acls/macosx/ffi/ffi.factor index 317ab4d08f..dd39f53aad 100644 --- a/extra/io/files/acls/macosx/ffi/ffi.factor +++ b/extra/io/files/acls/macosx/ffi/ffi.factor @@ -104,25 +104,25 @@ CONSTANT: acl-flag-names { } STRUCT: guid_t - { g_guid { uchar KAUTH_GUID_SIZE } } ; + { g_guid { uchar KAUTH_GUID_SIZE } } ; TYPEDEF: uint kauth_ace_rights_t STRUCT: kauth_ace - { ace_applicable guid_t } - { ace_flags uint } - { ace_rights kauth_ace_rights_t } ; + { ace_applicable guid_t } + { ace_flags uint } + { ace_rights kauth_ace_rights_t } ; TYPEDEF: kauth_ace* kauth_ace_t STRUCT: kauth_acl - { acl_entrycount uint } - { acl_flags uint } - { acl_ace { kauth_ace 1 } } ; + { acl_entrycount uint } + { acl_flags uint } + { acl_ace { kauth_ace 1 } } ; TYPEDEF: kauth_acl* kauth_acl_t STRUCT: kauth_filesec - { fsec_magic uint } - { fsec_owner guid_t } - { fsec_group guid_t } ; + { fsec_magic uint } + { fsec_owner guid_t } + { fsec_group guid_t } ; TYPEDEF: kauth_filesec* kauth_filesec_t FUNCTION: int acl_dup ( acl_t acl ) diff --git a/extra/io/files/acls/macosx/macosx.factor b/extra/io/files/acls/macosx/macosx.factor index cc546bdbad..fd516aaf82 100644 --- a/extra/io/files/acls/macosx/macosx.factor +++ b/extra/io/files/acls/macosx/macosx.factor @@ -90,7 +90,7 @@ ERROR: add-permission-failed permission-set permission ; f acl_permset_t [ acl_get_permset acl-error ] keep ; : filter-strings ( obj strings -- string ) - [ [ 1 = ] dip f ? ] 2map sift "," join ; + [ [ 1 = ] dip f ? ] 2map sift "," join ; : permset>strings ( acl_permset -- strings ) acl-perms [ acl_get_perm_np dup acl-error ] with map @@ -100,7 +100,7 @@ ERROR: add-permission-failed permission-set permission ; acl-entry>permset permset>strings ; : with-new-acl ( quot -- ) - [ [ new-acl &free-acl ] dip call ] with-destructors ; inline + [ [ new-acl &free-acl ] dip call ] with-destructors ; inline : acls. ( path -- ) [ acl>text io:write ] acl-each ; diff --git a/extra/io/streams/256color/256color.factor b/extra/io/streams/256color/256color.factor index 6bce05a25d..4c3f406f81 100644 --- a/extra/io/streams/256color/256color.factor +++ b/extra/io/streams/256color/256color.factor @@ -94,7 +94,7 @@ M: 256color stream-write-table ] with-output-stream* ; M: 256color make-cell-stream - 2drop <256color> ; + 2drop <256color> ; M: 256color dispose drop ; diff --git a/extra/io/streams/ansi/ansi.factor b/extra/io/streams/ansi/ansi.factor index 1717f1b6bd..ca8200da96 100644 --- a/extra/io/streams/ansi/ansi.factor +++ b/extra/io/streams/ansi/ansi.factor @@ -75,7 +75,7 @@ M: ansi stream-write-table ] with-output-stream* ; M: ansi make-cell-stream - 2drop ; + 2drop ; M: ansi dispose drop ; diff --git a/extra/irc/client/chats/chats.factor b/extra/irc/client/chats/chats.factor index 5b90cd4522..5ba7584c5e 100644 --- a/extra/irc/client/chats/chats.factor +++ b/extra/irc/client/chats/chats.factor @@ -13,11 +13,11 @@ TUPLE: irc-nick-chat < irc-chat name ; SYMBOL: +server-chat+ : ( -- irc-server-chat ) - irc-server-chat new + irc-server-chat new >>in-messages ; : ( name -- irc-channel-chat ) - irc-channel-chat new + irc-channel-chat new swap >>name >>in-messages f >>password @@ -25,7 +25,7 @@ SYMBOL: +server-chat+ t >>clear-participants ; : ( name -- irc-nick-chat ) - irc-nick-chat new + irc-nick-chat new swap >>name >>in-messages ; @@ -33,9 +33,9 @@ TUPLE: irc-profile server port nickname password ; C: irc-profile TUPLE: irc-client profile stream in-messages out-messages - chats is-running nick connect is-ready - reconnect-time reconnect-attempts - exceptions ; + chats is-running nick connect is-ready + reconnect-time reconnect-attempts + exceptions ; : ( profile -- irc-client ) dup nickname>> irc-client new diff --git a/extra/irc/client/internals/internals-tests.factor b/extra/irc/client/internals/internals-tests.factor index f68db13db6..6e42eec8e5 100644 --- a/extra/irc/client/internals/internals-tests.factor +++ b/extra/irc/client/internals/internals-tests.factor @@ -190,9 +190,10 @@ M: mb-writer dispose drop ; ] unit-test ] spawning-irc -[ { H{ { "factorbot" T{ participant { nick "factorbot" } { operator t } } } - { "ircuser" T{ participant { nick "ircuser" } } } - { "voiced" T{ participant { nick "voiced" } { voice t } } } } } [ +[ { H{ + { "factorbot" T{ participant { nick "factorbot" } { operator t } } } + { "ircuser" T{ participant { nick "ircuser" } } } + { "voiced" T{ participant { nick "voiced" } { voice t } } } } } [ "#factortest" "ircuser" over join-participant [ %add-named-chat ] keep diff --git a/extra/irc/client/internals/internals.factor b/extra/irc/client/internals/internals.factor index 03632f41f5..adfc191cb0 100644 --- a/extra/irc/client/internals/internals.factor +++ b/extra/irc/client/internals/internals.factor @@ -46,10 +46,10 @@ IN: irc.client.internals ] [ (terminate-irc) ] if* ; : (do-login) ( -- ) - irc> - [ profile>> password>> [ /PASS ] when* ] - [ nick>> /LOGIN ] - bi ; + irc> + [ profile>> password>> [ /PASS ] when* ] + [ nick>> /LOGIN ] + bi ; GENERIC: initialize-chat ( chat -- ) M: irc-chat initialize-chat drop ; diff --git a/extra/irc/logbot/log-line/log-line.factor b/extra/irc/logbot/log-line/log-line.factor index a6a52131ad..9136c2aedf 100644 --- a/extra/irc/logbot/log-line/log-line.factor +++ b/extra/irc/logbot/log-line/log-line.factor @@ -59,7 +59,7 @@ M: participant-mode >log-line [ " has set mode " % mode>> % ] [ " to " % parameter>> % ] } cleave - ] "" make ; + ] "" make ; M: nick >log-line [ "* " % dup sender>> % " is now known as " % nickname>> % ] "" make ; diff --git a/extra/irc/messages/messages-tests.factor b/extra/irc/messages/messages-tests.factor index 2fbc3c59db..9f8bb6ad6a 100644 --- a/extra/irc/messages/messages-tests.factor +++ b/extra/irc/messages/messages-tests.factor @@ -5,67 +5,67 @@ USING: accessors irc.messages irc.messages.parser tools.test ; ! { "someuser" } [ "someuser!n=user@some.where" parse-name ] unit-test { T{ privmsg - { line ":someuser!n=user@some.where PRIVMSG #factortest :hi" } - { prefix "someuser!n=user@some.where" } - { command "PRIVMSG" } - { parameters { "#factortest" } } - { trailing "hi" } - { target "#factortest" } - { text "hi" } - { sender "someuser" } } } + { line ":someuser!n=user@some.where PRIVMSG #factortest :hi" } + { prefix "someuser!n=user@some.where" } + { command "PRIVMSG" } + { parameters { "#factortest" } } + { trailing "hi" } + { target "#factortest" } + { text "hi" } + { sender "someuser" } } } [ ":someuser!n=user@some.where PRIVMSG #factortest :hi" string>irc-message f >>timestamp ] unit-test { T{ join - { line ":someuser!n=user@some.where JOIN :#factortest" } - { prefix "someuser!n=user@some.where" } - { command "JOIN" } - { parameters { } } - { trailing "#factortest" } - { sender "someuser" } - { channel "#factortest" } } } + { line ":someuser!n=user@some.where JOIN :#factortest" } + { prefix "someuser!n=user@some.where" } + { command "JOIN" } + { parameters { } } + { trailing "#factortest" } + { sender "someuser" } + { channel "#factortest" } } } [ ":someuser!n=user@some.where JOIN :#factortest" string>irc-message f >>timestamp ] unit-test { T{ mode - { line ":ircserver.net MODE #factortest +ns" } - { prefix "ircserver.net" } - { command "MODE" } - { parameters { "#factortest" "+ns" } } - { name "#factortest" } - { mode "+ns" } } } + { line ":ircserver.net MODE #factortest +ns" } + { prefix "ircserver.net" } + { command "MODE" } + { parameters { "#factortest" "+ns" } } + { name "#factortest" } + { mode "+ns" } } } [ ":ircserver.net MODE #factortest +ns" string>irc-message f >>timestamp ] unit-test { T{ mode - { line ":ircserver.net MODE #factortest +o someuser" } - { prefix "ircserver.net" } - { command "MODE" } - { parameters { "#factortest" "+o" "someuser" } } - { name "#factortest" } - { mode "+o" } - { parameter "someuser" } } } + { line ":ircserver.net MODE #factortest +o someuser" } + { prefix "ircserver.net" } + { command "MODE" } + { parameters { "#factortest" "+o" "someuser" } } + { name "#factortest" } + { mode "+o" } + { parameter "someuser" } } } [ ":ircserver.net MODE #factortest +o someuser" string>irc-message f >>timestamp ] unit-test { T{ nick - { line ":someuser!n=user@some.where NICK :someuser2" } - { prefix "someuser!n=user@some.where" } - { command "NICK" } - { parameters { } } - { trailing "someuser2" } - { sender "someuser" } - { nickname "someuser2" } } } + { line ":someuser!n=user@some.where NICK :someuser2" } + { prefix "someuser!n=user@some.where" } + { command "NICK" } + { parameters { } } + { trailing "someuser2" } + { sender "someuser" } + { nickname "someuser2" } } } [ ":someuser!n=user@some.where NICK :someuser2" string>irc-message f >>timestamp ] unit-test { T{ rpl-nickname-in-use - { line ":ircserver.net 433 * nickname :Nickname is already in use" } - { prefix "ircserver.net" } - { command "433" } - { parameters { "*" "nickname" } } - { name "nickname" } - { trailing "Nickname is already in use" } } } + { line ":ircserver.net 433 * nickname :Nickname is already in use" } + { prefix "ircserver.net" } + { command "433" } + { parameters { "*" "nickname" } } + { name "nickname" } + { trailing "Nickname is already in use" } } } [ ":ircserver.net 433 * nickname :Nickname is already in use" string>irc-message f >>timestamp ] unit-test diff --git a/extra/lint/vocabs/vocabs.factor b/extra/lint/vocabs/vocabs.factor index c82fcb35de..204e2ac87e 100644 --- a/extra/lint/vocabs/vocabs.factor +++ b/extra/lint/vocabs/vocabs.factor @@ -32,7 +32,7 @@ SYMBOL: cache ; : skip-after ( sequence-parser seq -- sequence-parser ) - [ take-until-sequence* drop ] curry keep ; + [ take-until-sequence* drop ] curry keep ; : skip-after* ( sequence-parser object -- sequence-parser ) [ take-until-object drop ] curry keep ; diff --git a/extra/logic/examples/money/money.factor b/extra/logic/examples/money/money.factor index c4b6a2d2e1..3e820de6b3 100644 --- a/extra/logic/examples/money/money.factor +++ b/extra/logic/examples/money/money.factor @@ -45,15 +45,15 @@ LOGIC-VARS: S E N D M O R Y A L G B T :: S-and-M-can't-be-zero ( seq -- seq' ) seq [| hash | - 1 hash N1 of lnth 0 = not - 1 hash N2 of lnth 0 = not and + 1 hash N1 of lnth 0 = not + 1 hash N2 of lnth 0 = not and ] filter ; :: print-puzzle ( hash-array -- ) hash-array [| hash | - " " printf hash N1 of [ "%d " printf ] leach nl - "+ " printf hash N2 of [ "%d " printf ] leach nl - "----------------" printf nl - " " printf hash N of [ "%d " printf ] leach nl nl + " " printf hash N1 of [ "%d " printf ] leach nl + "+ " printf hash N2 of [ "%d " printf ] leach nl + "----------------" printf nl + " " printf hash N of [ "%d " printf ] leach nl nl ] each ; diff --git a/extra/logic/logic-tests.factor b/extra/logic/logic-tests.factor index 53d28e06cd..5992cdc4c0 100644 --- a/extra/logic/logic-tests.factor +++ b/extra/logic/logic-tests.factor @@ -224,8 +224,8 @@ SYMBOLS: big small a-big-cat a-small-cat ; { { H{ { X Tom } } } } [ { cato X } query ] unit-test { { - H{ { X big } { Y a-big-cat } } - H{ { X small } { Y a-small-cat } } + H{ { X big } { Y a-big-cat } } + H{ { X small } { Y a-small-cat } } } } [ { cato X Y } query ] unit-test { diff --git a/extra/logic/logic.factor b/extra/logic/logic.factor index 39d86d885e..22c3f073f2 100644 --- a/extra/logic/logic.factor +++ b/extra/logic/logic.factor @@ -379,8 +379,8 @@ SYMBOL: *anonymouse-var-no* { [ dup __ = ] [ drop proxy-var-for-'__' ] } { [ dup sequence? ] [ [ replace-'__' ] map ] } { [ dup tuple? ] [ - [ tuple-slots [ replace-'__' ] map ] - [ class-of slots>tuple ] bi ] } + [ tuple-slots [ replace-'__' ] map ] + [ class-of slots>tuple ] bi ] } [ ] } cond ; @@ -570,7 +570,7 @@ PRIVATE> ] when ] loop ] with-return - bindings dup { + bindings dup { [ empty? ] [ first keys empty? ] } 1|| [ drop success? ] [ >array ] if ; @@ -627,7 +627,7 @@ PRIVATE> d-env env-clear f ] if - ] [ f ] if + ] [ f ] if ] each-until ] if ] if ; diff --git a/extra/mason/mason.factor b/extra/mason/mason.factor index 46fe13a8b4..05d4e39320 100644 --- a/extra/mason/mason.factor +++ b/extra/mason/mason.factor @@ -19,8 +19,8 @@ IN: mason : build-loop-error ( error callstack -- ) fatal-error-body - "build loop error" - email-fatal ; + "build loop error" + email-fatal ; : build-loop ( -- ) [ diff --git a/extra/mason/report/report-tests.factor b/extra/mason/report/report-tests.factor index 9cdd1e3270..82a31b8854 100644 --- a/extra/mason/report/report-tests.factor +++ b/extra/mason/report/report-tests.factor @@ -5,9 +5,9 @@ IN: mason.report.tests { 0 0 } [ [ ] with-report ] must-infer-as : verify-report ( -- ) - [ t ] [ "report" file-exists? ] unit-test - [ ] [ "report" file>xml drop ] unit-test - [ ] [ "report" delete-file ] unit-test ; + [ t ] [ "report" file-exists? ] unit-test + [ ] [ "report" file>xml drop ] unit-test + [ ] [ "report" delete-file ] unit-test ; "builds" temp-file builds-dir [ [ diff --git a/extra/math/affine-transforms/affine-transforms.factor b/extra/math/affine-transforms/affine-transforms.factor index 9cebe85df8..00483f26c0 100644 --- a/extra/math/affine-transforms/affine-transforms.factor +++ b/extra/math/affine-transforms/affine-transforms.factor @@ -13,7 +13,7 @@ CONSTANT: identity-transform T{ affine-transform f { 1.0 0.0 } { 0.0 1.0 } { 0.0 0.0 } } : axes ( a -- a' ) - [ x>> ] [ y>> ] bi { 0.0 0.0 } ; + [ x>> ] [ y>> ] bi { 0.0 0.0 } ; : a.v ( a v -- v ) [ [ x>> ] [ first ] bi* v*n ] diff --git a/extra/math/dual/dual.factor b/extra/math/dual/dual.factor index b125861c83..409a921f83 100644 --- a/extra/math/dual/dual.factor +++ b/extra/math/dual/dual.factor @@ -33,10 +33,10 @@ MACRO: ordinary-op ( word -- o ) ! This allows a set of partial derivatives each to be evaluated ! at the same point. MACRO: duals>nweave ( n -- quot ) - dup dup dup - '[ - [ [ epsilon-part>> ] _ napply ] _ nkeep - [ ordinary-part>> ] _ napply _ nweave + dup dup dup + '[ + [ [ epsilon-part>> ] _ napply ] _ nkeep + [ ordinary-part>> ] _ napply _ nweave ] ; MACRO: chain-rule ( word -- e ) diff --git a/extra/math/finance/finance-docs.factor b/extra/math/finance/finance-docs.factor index 3a2cec1609..0bb5932d42 100644 --- a/extra/math/finance/finance-docs.factor +++ b/extra/math/finance/finance-docs.factor @@ -32,43 +32,43 @@ HELP: momentum HELP: biweekly { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of two week periods in a year." } ; HELP: daily-360 { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of days in a 360-day year." } ; HELP: daily-365 { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of days in a 365-day year." } ; HELP: monthly { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of months in a year." } ; HELP: semimonthly { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of half-months in a year. Note that biweekly has two more periods than semimonthly." } ; HELP: weekly { $values - { "x" number } - { "y" number } + { "x" number } + { "y" number } } { $description "Divides a number by the number of weeks in a year." } ; diff --git a/extra/math/text/french/french.factor b/extra/math/text/french/french.factor index 79a5ba335a..2cb3a02997 100644 --- a/extra/math/text/french/french.factor +++ b/extra/math/text/french/french.factor @@ -9,15 +9,17 @@ IN: math.text.french DEFER: basic CONSTANT: literals - H{ { 0 "zéro" } { 1 "un" } { 2 "deux" } { 3 "trois" } { 4 "quatre" } - { 5 "cinq" } { 6 "six" } { 7 "sept" } { 8 "huit" } { 9 "neuf" } - { 10 "dix" } { 11 "onze" } { 12 "douze" } { 13 "treize" } - { 14 "quatorze" } { 15 "quinze" } { 16 "seize" } { 17 "dix-sept" } - { 18 "dix-huit" } { 19 "dix-neuf" } { 20 "vingt" } { 30 "trente" } - { 40 "quarante" } { 50 "cinquante" } { 60 "soixante" } - { 71 "soixante et onze" } { 80 "quatre-vingts" } - { 81 "quatre-vingt-un" } - { 100 "cent" } { 1000 "mille" } } + H{ + { 0 "zéro" } { 1 "un" } { 2 "deux" } { 3 "trois" } { 4 "quatre" } + { 5 "cinq" } { 6 "six" } { 7 "sept" } { 8 "huit" } { 9 "neuf" } + { 10 "dix" } { 11 "onze" } { 12 "douze" } { 13 "treize" } + { 14 "quatorze" } { 15 "quinze" } { 16 "seize" } { 17 "dix-sept" } + { 18 "dix-huit" } { 19 "dix-neuf" } { 20 "vingt" } { 30 "trente" } + { 40 "quarante" } { 50 "cinquante" } { 60 "soixante" } + { 71 "soixante et onze" } { 80 "quatre-vingts" } + { 81 "quatre-vingt-un" } + { 100 "cent" } { 1000 "mille" } + } MEMO: units ( -- seq ) ! up to 10^99 { "m" "b" "tr" "quadr" "quint" "sext" "sept" "oct" diff --git a/extra/merger/merger.factor b/extra/merger/merger.factor index 24bc7b349b..9e5eb04784 100644 --- a/extra/merger/merger.factor +++ b/extra/merger/merger.factor @@ -8,7 +8,7 @@ MAIN-WINDOW: merger-window { { title "Merging" } { pref-dim { 300 220 } } } - vertical + vertical { "From:" "To:" } f f 2array [ [ diff --git a/extra/metar/metar.factor b/extra/metar/metar.factor index 230081f620..295851daf3 100644 --- a/extra/metar/metar.factor +++ b/extra/metar/metar.factor @@ -265,7 +265,7 @@ CONSTANT: compass-directions H{ ] [ string>number "of %s" sprintf ] if* "runway %s visibility %s" sprintf - ] dip " ft" " meters" ? append + ] dip " ft" " meters" ? append ] dip append ; : (parse-weather) ( str -- str' ) diff --git a/extra/models/illusion/illusion.factor b/extra/models/illusion/illusion.factor index 27cee7d13b..5e296132f1 100644 --- a/extra/models/illusion/illusion.factor +++ b/extra/models/illusion/illusion.factor @@ -13,7 +13,7 @@ TUPLE: illusion < arrow ; dup activate-model ; : backtalk ( value object -- ) - [ quot>> [undo] call( a -- b ) ] [ model>> ] bi set-model ; + [ quot>> [undo] call( a -- b ) ] [ model>> ] bi set-model ; M: illusion update-model ( model -- ) [ [ value>> ] keep backtalk ] with-locked-model ; diff --git a/extra/modern/html/html.factor b/extra/modern/html/html.factor index 4082e930cd..1ca076af75 100644 --- a/extra/modern/html/html.factor +++ b/extra/modern/html/html.factor @@ -142,7 +142,7 @@ C: dquote "%" expect-and-span >string [ take-tag-name >string ] dip-1up append [ "%>" slice-til-string [ >string ] bi@ ] dip-2up - ; + ; : read-open-tag ( n string opening -- n' string tag ) [ take-tag-name ] dip-1up diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index 435aaedd69..3096bd2a1f 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -37,7 +37,7 @@ MACRO:: read-double-matched ( open-ch -- quot: ( n string tag ch -- n' string se ] } [ [ tag openstr2 n string ] dip long-opening-mismatch ] } case - ] ; + ] ; : read-double-matched-paren ( n string tag ch -- n' string seq ) CHAR: ( read-double-matched ; : read-double-matched-bracket ( n string tag ch -- n' string seq ) CHAR: [ read-double-matched ; diff --git a/extra/modern/paths/paths.factor b/extra/modern/paths/paths.factor index 2b54684760..f13c35102c 100644 --- a/extra/modern/paths/paths.factor +++ b/extra/modern/paths/paths.factor @@ -11,7 +11,7 @@ ERROR: not-a-source-path path ; no-prefixes [ name>> ] map ; CONSTANT: core-broken-vocabs - { + { "vocabs.loader.test.a" "vocabs.loader.test.b" "vocabs.loader.test.c" diff --git a/extra/mongodb/benchmark/benchmark.factor b/extra/mongodb/benchmark/benchmark.factor index b3b80d29b3..2918b24934 100644 --- a/extra/mongodb/benchmark/benchmark.factor +++ b/extra/mongodb/benchmark/benchmark.factor @@ -127,14 +127,16 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" } : large-doc-prepare ( -- quot: ( i -- doc ) ) large-doc drop - [ "x" DOC-LARGE clone [ set-at ] keep - [ now "access-time" ] dip - [ set-at ] keep ] ; + [ + "x" DOC-LARGE clone [ set-at ] keep + [ now "access-time" ] dip + [ set-at ] keep + ] ; : (insert) ( quot: ( i -- doc ) collection -- ) [ trial-size ] 2dip '[ _ call( i -- doc ) [ _ ] dip - result get lasterror>> [ save ] [ save-unsafe ] if ] each-integer ; + result get lasterror>> [ save ] [ save-unsafe ] if ] each-integer ; : (prepare-batch) ( i b quot: ( i -- doc ) -- batch-seq ) [ [ * ] keep 1 range boa ] dip @@ -143,7 +145,7 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" } : (insert-batch) ( quot: ( i -- doc ) collection -- ) [ trial-size batch-size [ / ] keep ] 2dip '[ _ _ (prepare-batch) [ _ ] dip - result get lasterror>> [ save ] [ save-unsafe ] if + result get lasterror>> [ save ] [ save-unsafe ] if ] each-integer ; : bchar ( boolean -- char ) @@ -202,12 +204,14 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" } : find-range ( quot -- quot: ( -- ) ) drop - [ trial-size batch-size /i - collection-name - trial-size 2 / "$gt" H{ } clone [ set-at ] keep - [ trial-size 2 / batch-size + "$lt" ] dip [ set-at ] keep - "x" H{ } clone [ set-at ] keep - '[ _ _ (find) ] times ] ; + [ + trial-size batch-size /i + collection-name + trial-size 2 / "$gt" H{ } clone [ set-at ] keep + [ trial-size 2 / batch-size + "$lt" ] dip [ set-at ] keep + "x" H{ } clone [ set-at ] keep + '[ _ _ (find) ] times + ] ; : batch ( -- ) result [ t >>batch ] change ; inline @@ -245,11 +249,17 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" } '[ _ call( options -- time ) print-result ] with-scope ; : [bench-quot] ( feat-seq op-word -- quot: ( doc-word -- ) ) - '[ _ swap _ - '[ [ [ _ execute( -- quot ) ] dip - [ execute( -- ) ] each _ execute( quot -- quot ) gc - benchmark ] with-result ] each - print-separator ] ; + '[ + _ swap _ + '[ + [ + [ _ execute( -- quot ) ] dip + [ execute( -- ) ] each _ execute( quot -- quot ) gc + benchmark + ] with-result + ] each + print-separator + ] ; : run-serialization-bench ( doc-word-seq feat-seq -- ) "Serialization Tests" print diff --git a/extra/mongodb/connection/connection.factor b/extra/mongodb/connection/connection.factor index f93f489d20..f48a13139b 100644 --- a/extra/mongodb/connection/connection.factor +++ b/extra/mongodb/connection/connection.factor @@ -96,9 +96,10 @@ CONSTRUCTOR: mdb-connection ( instance -- mdb-connection ) ; check-ok [ drop ] [ throw ] if ; inline : authenticate-connection ( mdb-connection -- ) - [ mdb-connection get instance>> auth? - [ perform-authentication ] when - ] with-connection ; inline + [ + mdb-connection get instance>> auth? + [ perform-authentication ] when + ] with-connection ; inline : open-connection ( mdb-connection node -- mdb-connection ) [ >>node ] [ address>> ] bi @@ -109,24 +110,24 @@ CONSTRUCTOR: mdb-connection ( instance -- mdb-connection ) ; "admin.$cmd" H{ { "ismaster" 1 } } send-query-1result ; : split-host-str ( hoststr -- host port ) - ":" split [ first ] [ second string>number ] bi ; inline + ":" split [ first ] [ second string>number ] bi ; inline : eval-ismaster-result ( node result -- ) - [ + [ [ "ismaster" ] dip at dup string? [ >integer 1 = ] when >>master? drop - ] [ + ] [ [ "remote" ] dip at [ split-host-str f >>remote ] when* drop ] 2bi ; : check-node ( mdb node -- ) - [ &dispose ] dip - [ [ open-connection ] [ 3drop f ] recover ] keep swap - [ [ get-ismaster eval-ismaster-result ] with-connection ] [ drop ] if* ; + [ &dispose ] dip + [ [ open-connection ] [ 3drop f ] recover ] keep swap + [ [ get-ismaster eval-ismaster-result ] with-connection ] [ drop ] if* ; : nodelist>table ( seq -- assoc ) - [ [ master?>> ] keep 2array ] map >hashtable ; + [ [ master?>> ] keep 2array ] map >hashtable ; PRIVATE> @@ -154,7 +155,7 @@ ERROR: mongod-connection-error address message ; ] recover ; : mdb-close ( mdb-connection -- ) - [ [ dispose ] when* f ] change-handle drop ; + [ [ dispose ] when* f ] change-handle drop ; M: mdb-connection dispose - mdb-close ; + mdb-close ; diff --git a/extra/mongodb/driver/driver.factor b/extra/mongodb/driver/driver.factor index cd9fb587f7..cfc0a84829 100644 --- a/extra/mongodb/driver/driver.factor +++ b/extra/mongodb/driver/driver.factor @@ -109,9 +109,9 @@ SYNTAX: r/ H{ } clone [ set-at ] keep ; : ( db host port -- mdb ) - t [ ] keep - H{ } clone [ set-at ] keep - [ verify-nodes ] keep ; + t [ ] keep + H{ } clone [ set-at ] keep + [ verify-nodes ] keep ; GENERIC: create-collection ( name/collection -- ) @@ -155,9 +155,11 @@ M: mdb-collection create-collection ( collection -- ) : (ensure-collection) ( collection mdb-instance -- collection ) ensure-collection-map [ dup ] dip key? - [ ] [ [ ensure-valid-collection-name ] - [ create-collection ] - [ ] tri ] if ; + [ ] [ + [ ensure-valid-collection-name ] + [ create-collection ] + [ ] tri + ] if ; : reserved-namespace? ( name -- ? ) [ "$cmd" = ] [ "system" head? ] bi or ; diff --git a/extra/mongodb/operations/operations.factor b/extra/mongodb/operations/operations.factor index 8e5fe548e4..3c499b0fd9 100644 --- a/extra/mongodb/operations/operations.factor +++ b/extra/mongodb/operations/operations.factor @@ -112,9 +112,9 @@ PRIVATE> : write-insert-message ( message -- ) [ - [ flags>> write-int32 ] - [ collection>> write-cstring ] - [ objects>> [ assoc>stream ] each ] tri + [ flags>> write-int32 ] + [ collection>> write-cstring ] + [ objects>> [ assoc>stream ] each ] tri ] (write-message) ; inline : write-update-message ( message -- ) @@ -150,9 +150,9 @@ PRIVATE> : write-killcursors-message ( message -- ) [ - [ flags>> write-int32 ] - [ cursors#>> write-int32 ] - [ cursors>> [ write-longlong ] each ] tri + [ flags>> write-int32 ] + [ cursors#>> write-int32 ] + [ cursors>> [ write-longlong ] each ] tri ] (write-message) ; inline PRIVATE> diff --git a/extra/mongodb/tuple/collection/collection.factor b/extra/mongodb/tuple/collection/collection.factor index 1d7f25bd0c..1c8c94af64 100644 --- a/extra/mongodb/tuple/collection/collection.factor +++ b/extra/mongodb/tuple/collection/collection.factor @@ -34,19 +34,19 @@ CONSTANT: MDB_USER_KEY "mongodb_user_key" CONSTANT: MDB_COLLECTION_MAP "mongodb_collection_map" MEMO: id-slot ( class -- slot ) - MDB_USER_KEY word-prop - dup [ drop "_id" ] unless ; + MDB_USER_KEY word-prop + dup [ drop "_id" ] unless ; PRIVATE> : >toid ( object -- toid ) - [ id>> ] [ class-of id-slot ] bi ; + [ id>> ] [ class-of id-slot ] bi ; M: mdb-persistent id>> ( object -- id ) - dup class-of id-slot reader-word execute( object -- id ) ; + dup class-of id-slot reader-word execute( object -- id ) ; M: mdb-persistent id<< ( object value -- ) - over class-of id-slot writer-word execute( object value -- ) ; + over class-of id-slot writer-word execute( object value -- ) ; @@ -98,7 +98,7 @@ GENERIC: mdb-index-map ( tuple -- sequence ) PRIVATE> : MDB_ADDON_SLOTS ( -- slots ) - { $[ MDB_OID_FIELD MDB_META_FIELD ] } ; inline + { $[ MDB_OID_FIELD MDB_META_FIELD ] } ; inline : link-class ( collection class -- ) over classes>> @@ -161,7 +161,7 @@ GENERIC: ( name -- mdb-tuple-collection ) M: string collection-map [ ] [ key? ] 2bi [ at ] [ [ mdb-tuple-collection new dup ] 2dip - [ [ >>name ] keep ] dip set-at ] if ; inline + [ [ >>name ] keep ] dip set-at ] if ; inline M: mdb-tuple-collection ; M: mdb-collection [ name>> ] keep diff --git a/extra/mongodb/tuple/persistent/persistent.factor b/extra/mongodb/tuple/persistent/persistent.factor index fd4216ca3c..c0dcc5dbbb 100644 --- a/extra/mongodb/tuple/persistent/persistent.factor +++ b/extra/mongodb/tuple/persistent/persistent.factor @@ -15,18 +15,18 @@ DEFER: assoc>tuple tuple-class ( tuple-info -- class ) - [ first ] keep second lookup-word ; inline + [ first ] keep second lookup-word ; inline : tuple-instance ( tuple-info -- instance ) mdbinfo>tuple-class new ; inline : prepare-assoc>tuple ( assoc -- tuple keylist mirror assoc ) - [ tuple-info tuple-instance dup - [ keys ] keep ] keep swap ; inline + [ tuple-info tuple-instance dup + [ keys ] keep ] keep swap ; inline : make-tuple ( assoc -- tuple ) - prepare-assoc>tuple - '[ dup _ at assoc>tuple swap _ set-at ] each ; inline recursive + prepare-assoc>tuple + '[ dup _ at assoc>tuple swap _ set-at ] each ; inline recursive : at+ ( value key assoc -- value ) 2dup key? @@ -37,73 +37,74 @@ DEFER: assoc>tuple [ assoc? not ] [ drop f ] if ; inline : add-storable ( assoc ns toid -- ) - [ [ H{ } clone ] dip object-map get at+ ] dip - swap set-at ; inline + [ [ H{ } clone ] dip object-map get at+ ] dip + swap set-at ; inline : write-field? ( tuple key value -- ? ) - pick mdb-persistent? [ - { [ 2nip not ] - [ drop transient-slot? ] } 3|| not ] [ 3drop t ] if ; inline + pick mdb-persistent? + [ { [ 2nip not ] [ drop transient-slot? ] } 3|| not ] + [ 3drop t ] if ; inline TUPLE: cond-value value quot ; CONSTRUCTOR: cond-value ( value quot -- cond-value ) ; : write-mdb-persistent ( value quot -- value' ) - over [ call( tuple -- assoc ) ] dip - [ [ tuple-collection name>> ] [ >toid ] bi ] keep - [ add-storable ] dip - [ tuple-collection name>> ] [ id>> ] bi ; + over [ call( tuple -- assoc ) ] dip + [ [ tuple-collection name>> ] [ >toid ] bi ] keep + [ add-storable ] dip + [ tuple-collection name>> ] [ id>> ] bi ; : write-field ( value quot -- value' ) - { - { [ dup value>> mdb-special-value? ] [ value>> ] } - { [ dup value>> mdb-persistent? ] - [ [ value>> ] [ quot>> ] bi write-mdb-persistent ] } - { [ dup value>> data-tuple? ] - [ [ value>> ] [ quot>> ] bi ( tuple -- assoc ) call-effect ] } - { [ dup value>> [ hashtable? ] [ linked-assoc? ] bi or ] - [ [ value>> ] [ quot>> ] bi '[ _ write-field ] assoc-map ] } - [ value>> ] - } cond ; + { + { [ dup value>> mdb-special-value? ] [ value>> ] } + { [ dup value>> mdb-persistent? ] + [ [ value>> ] [ quot>> ] bi write-mdb-persistent ] } + { [ dup value>> data-tuple? ] + [ [ value>> ] [ quot>> ] bi ( tuple -- assoc ) call-effect ] } + { [ dup value>> [ hashtable? ] [ linked-assoc? ] bi or ] + [ [ value>> ] [ quot>> ] bi '[ _ write-field ] assoc-map ] } + [ value>> ] + } cond ; : write-tuple-fields ( mirror tuple assoc quot: ( tuple -- assoc ) -- ) - swap ! m t q q a - '[ _ 2over write-field? - [ _ write-field swap _ set-at ] - [ 2drop ] if - ] assoc-each ; + swap ! m t q a + '[ + _ 2over write-field? + [ _ write-field swap _ set-at ] + [ 2drop ] if + ] assoc-each ; : prepare-assoc ( tuple -- assoc mirror tuple assoc ) - H{ } clone swap [ ] keep pick ; inline + H{ } clone swap [ ] keep pick ; inline : with-object-map ( quot: ( -- ) -- store-assoc ) - [ H{ } clone dup object-map ] dip with-variable ; inline + [ H{ } clone dup object-map ] dip with-variable ; inline : (tuple>assoc) ( tuple -- assoc ) - [ prepare-assoc [ tuple>assoc ] write-tuple-fields ] keep - over set-tuple-info ; inline + [ prepare-assoc [ tuple>assoc ] write-tuple-fields ] keep + over set-tuple-info ; inline PRIVATE> GENERIC: tuple>storable ( tuple -- storable ) : ensure-oid ( tuple -- tuple ) - dup id>> [ >>id ] unless ; inline + dup id>> [ >>id ] unless ; inline M: mdb-persistent tuple>storable ( mdb-persistent -- object-map ) - '[ _ [ tuple>assoc ] write-mdb-persistent drop ] with-object-map ; inline + '[ _ [ tuple>assoc ] write-mdb-persistent drop ] with-object-map ; inline M: mdb-persistent tuple>assoc ( tuple -- assoc ) - ensure-oid (tuple>assoc) ; + ensure-oid (tuple>assoc) ; M: tuple tuple>assoc ( tuple -- assoc ) - (tuple>assoc) ; + (tuple>assoc) ; M: tuple tuple>selector ( tuple -- assoc ) prepare-assoc [ tuple>selector ] write-tuple-fields ; : assoc>tuple ( assoc -- tuple ) - dup assoc? [ + dup assoc? [ [ dup tuple-info? [ make-tuple ] when ] ignore-errors - ] when ; inline recursive + ] when ; inline recursive diff --git a/extra/mongodb/tuple/state/state.factor b/extra/mongodb/tuple/state/state.factor index 8a569d19f8..cd983c8540 100644 --- a/extra/mongodb/tuple/state/state.factor +++ b/extra/mongodb/tuple/state/state.factor @@ -16,7 +16,7 @@ PRIVATE> [ MDB_TUPLE_INFO ] dip at ; inline : set-tuple-info ( tuple assoc -- ) - [ MDB_TUPLE_INFO ] dip set-at ; inline + [ MDB_TUPLE_INFO ] dip set-at ; inline : tuple-info? ( assoc -- ? ) - [ MDB_TUPLE_INFO ] dip key? ; + [ MDB_TUPLE_INFO ] dip key? ; diff --git a/extra/mongodb/tuple/tuple.factor b/extra/mongodb/tuple/tuple.factor index 8ec6cba964..1ddc358cbb 100644 --- a/extra/mongodb/tuple/tuple.factor +++ b/extra/mongodb/tuple/tuple.factor @@ -21,18 +21,19 @@ SYNTAX: MDBTUPLE: : ensure-table ( class -- ) tuple-collection [ create-collection ] - [ [ mdb-index-map values ] keep - '[ _ name>> >>ns ensure-index ] each + [ + [ mdb-index-map values ] keep + '[ _ name>> >>ns ensure-index ] each ] bi ; : ensure-tables ( classes -- ) [ ensure-table ] each ; : drop-table ( class -- ) - tuple-collection - [ [ mdb-index-map values ] keep - '[ _ name>> swap name>> drop-index ] each ] - [ name>> drop-collection ] bi ; + tuple-collection + [ [ mdb-index-map values ] keep + '[ _ name>> swap name>> drop-index ] each ] + [ name>> drop-collection ] bi ; : recreate-table ( class -- ) [ drop-table ] @@ -45,15 +46,17 @@ DEFER: tuple>query GENERIC: id-selector ( object -- selector ) M: toid id-selector - [ value>> ] [ key>> ] bi associate ; inline + [ value>> ] [ key>> ] bi associate ; inline M: mdb-persistent id-selector - >toid id-selector ; + >toid id-selector ; : (save-tuples) ( collection assoc -- ) - swap '[ [ _ ] 2dip - [ id-selector ] dip - >upsert update ] assoc-each ; inline + swap '[ + [ _ ] 2dip + [ id-selector ] dip + >upsert update + ] assoc-each ; inline : prepare-tuple-query ( tuple/query -- query ) dup mdb-query-msg? [ tuple>query ] unless ; @@ -73,32 +76,32 @@ PRIVATE> update-tuple ; : insert-tuple ( tuple -- ) - [ tuple-collection name>> ] - [ tuple>assoc ] bi - save ; + [ tuple-collection name>> ] + [ tuple>assoc ] bi + save ; : delete-tuple ( tuple -- ) - [ tuple-collection name>> ] keep - id-selector delete ; + [ tuple-collection name>> ] keep + id-selector delete ; : delete-tuples ( seq -- ) [ delete-tuple ] each ; : tuple>query ( tuple -- query ) - [ tuple-collection name>> ] keep - tuple>selector ; + [ tuple-collection name>> ] keep + tuple>selector ; : select-tuple ( tuple/query -- tuple/f ) - prepare-tuple-query - find-one [ assoc>tuple ] [ f ] if* ; + prepare-tuple-query + find-one [ assoc>tuple ] [ f ] if* ; : select-tuples ( tuple/query -- cursor tuples/f ) - prepare-tuple-query - find [ assoc>tuple ] map ; + prepare-tuple-query + find [ assoc>tuple ] map ; : select-all-tuples ( tuple/query -- tuples ) - prepare-tuple-query - find-all [ assoc>tuple ] map ; + prepare-tuple-query + find-all [ assoc>tuple ] map ; : count-tuples ( tuple/query -- n ) - dup mdb-query-msg? [ tuple>query ] unless count ; + dup mdb-query-msg? [ tuple>query ] unless count ; diff --git a/extra/odbc/odbc.factor b/extra/odbc/odbc.factor index f7bfa4d87c..71607392da 100644 --- a/extra/odbc/odbc.factor +++ b/extra/odbc/odbc.factor @@ -115,14 +115,14 @@ FUNCTION: SQLRETURN SQLNumResultCols ( SQLHSTMT statementHandle, SQLSMALLINT* co FUNCTION: SQLRETURN SQLDescribeCol ( SQLHSTMT statementHandle, SQLSMALLINT columnNumber, SQLCHAR* columnName, SQLSMALLINT bufferLength, SQLSMALLINT* nameLengthPtr, SQLSMALLINT* dataTypePtr, SQLUINTEGER* columnSizePtr, SQLSMALLINT* decimalDigitsPtr, SQLSMALLINT* nullablePtr ) FUNCTION: SQLRETURN SQLGetData ( SQLHSTMT statementHandle, SQLUSMALLINT columnNumber, SQLSMALLINT targetType, SQLPOINTER targetValuePtr, SQLINTEGER bufferLength, SQLINTEGER* strlen_or_indPtr ) FUNCTION: SQLRETURN SQLGetDiagRec ( - SQLSMALLINT HandleType, - SQLHANDLE Handle, - SQLSMALLINT RecNumber, - SQLCHAR* SQLState, - SQLINTEGER* NativeErrorPtr, - SQLCHAR* MessageText, - SQLSMALLINT BufferLength, - SQLSMALLINT* TextLengthPtr ) + SQLSMALLINT HandleType, + SQLHANDLE Handle, + SQLSMALLINT RecNumber, + SQLCHAR* SQLState, + SQLINTEGER* NativeErrorPtr, + SQLCHAR* MessageText, + SQLSMALLINT BufferLength, + SQLSMALLINT* TextLengthPtr ) : alloc-handle ( type parent -- handle ) f void* [ SQLAllocHandle ] keep swap succeeded? [ diff --git a/extra/project-euler/009/009.factor b/extra/project-euler/009/009.factor index 7099a5571b..39b367fb01 100644 --- a/extra/project-euler/009/009.factor +++ b/extra/project-euler/009/009.factor @@ -40,7 +40,7 @@ IN: project-euler.009 sum pickd = [ next-pq 2dup abc (ptriplet) ] unless ; : ptriplet ( target -- triplet ) - 3 1 { 3 4 5 } (ptriplet) abc nip ; + 3 1 { 3 4 5 } (ptriplet) abc nip ; PRIVATE> diff --git a/extra/project-euler/047/047.factor b/extra/project-euler/047/047.factor index e5e94560d6..20db49716f 100644 --- a/extra/project-euler/047/047.factor +++ b/extra/project-euler/047/047.factor @@ -72,7 +72,7 @@ SYMBOL: sieve sieve get length 1 - over ; : increment-counts ( n -- ) - multiples [ sieve get [ 1 + ] change-nth ] each ; + multiples [ sieve get [ 1 + ] change-nth ] each ; : prime-tau-upto ( limit -- seq ) dup initialize-sieve 2 swap [a..b) [ @@ -80,7 +80,7 @@ SYMBOL: sieve ] each sieve get ; : consecutive-under ( limit m -- n/f ) - [ prime-tau-upto ] [ dup ] bi* subseq-index ; + [ prime-tau-upto ] [ dup ] bi* subseq-index ; PRIVATE> diff --git a/extra/project-euler/051/051.factor b/extra/project-euler/051/051.factor index 73b6325b2c..6670d9bc85 100644 --- a/extra/project-euler/051/051.factor +++ b/extra/project-euler/051/051.factor @@ -54,7 +54,7 @@ SYMBOL: large-families : save-family ( family -- ) dup family-count get at 8 = [ large-families get adjoin ] [ drop ] if ; : increment-family ( family -- ) - family-count get inc-at ; + family-count get inc-at ; : handle-family ( family -- ) [ increment-family ] [ save-family ] bi ; diff --git a/extra/project-euler/070/070.factor b/extra/project-euler/070/070.factor index 07e45fff3d..9ab0c38869 100644 --- a/extra/project-euler/070/070.factor +++ b/extra/project-euler/070/070.factor @@ -60,8 +60,8 @@ IN: project-euler.070 PRIVATE> : euler070 ( -- answer ) - likely-prime-factors 2 all-combinations [ n-and-phi ] map - [ fit-requirements? ] filter minimum-ratio ; + likely-prime-factors 2 all-combinations [ n-and-phi ] map + [ fit-requirements? ] filter minimum-ratio ; ! [ euler070 ] 100 ave-time ! 379 ms ave run time - 1.15 SD (100 trials) diff --git a/extra/project-euler/099/099.factor b/extra/project-euler/099/099.factor index 36fae686d5..0426935d32 100644 --- a/extra/project-euler/099/099.factor +++ b/extra/project-euler/099/099.factor @@ -45,7 +45,7 @@ IN: project-euler.099 PRIVATE> : euler099 ( -- answer ) - source-099 solve ; + source-099 solve ; ! [ euler099 ] 100 ave-time ! 16 ms ave run timen - 1.67 SD (100 trials) diff --git a/extra/project-euler/116/116.factor b/extra/project-euler/116/116.factor index 229c62ec74..c3282555a4 100644 --- a/extra/project-euler/116/116.factor +++ b/extra/project-euler/116/116.factor @@ -41,7 +41,7 @@ IN: project-euler.116 [ length swap - 1 - ] keep ?nth 0 or ; : next ( colortile seq -- ) - [ nth* ] [ last + ] [ push ] tri ; + [ nth* ] [ last + ] [ push ] tri ; : ways ( length colortile -- permutations ) V{ 1 } clone [ [ next ] 2curry times ] keep last 1 - ; diff --git a/extra/project-euler/151/151.factor b/extra/project-euler/151/151.factor index 45777ae56a..9ee666ac8a 100644 --- a/extra/project-euler/151/151.factor +++ b/extra/project-euler/151/151.factor @@ -63,7 +63,7 @@ DEFER: (euler151) { { 0 1 0 0 } [ { 0 0 1 1 } (euler151) 1 + ] } { { 1 0 0 0 } [ { 0 1 1 1 } (euler151) 1 + ] } [ [ dup length [ pick-sheet ] with map-sum ] [ sum ] bi / ] - } case ] cache ; + } case ] cache ; : euler151 ( -- answer ) [ diff --git a/extra/punycode/punycode-tests.factor b/extra/punycode/punycode-tests.factor index e8ba19939e..2b86badded 100644 --- a/extra/punycode/punycode-tests.factor +++ b/extra/punycode/punycode-tests.factor @@ -48,8 +48,8 @@ punycode.private tools.test urls ; ! (D) Czech: { - "\u{0050}\u{0072}\u{006F}\u{010D}\u{0070}\u{0072}\u{006F}\u{0073}\u{0074}\u{011B}\u{006E}\u{0065}\u{006D}\u{006C}\u{0075}\u{0076}\u{00ED}\u{010D}\u{0065}\u{0073}\u{006B}\u{0079}" - "Proprostnemluvesky-uyb24dma41a" + "\u{0050}\u{0072}\u{006F}\u{010D}\u{0070}\u{0072}\u{006F}\u{0073}\u{0074}\u{011B}\u{006E}\u{0065}\u{006D}\u{006C}\u{0075}\u{0076}\u{00ED}\u{010D}\u{0065}\u{0073}\u{006B}\u{0079}" + "Proprostnemluvesky-uyb24dma41a" } ! (E) Hebrew: @@ -110,7 +110,7 @@ punycode.private tools.test urls ; ! (N) Hello-Another-Way- { "\u{0048}\u{0065}\u{006C}\u{006C}\u{006F}\u{002D}\u{0041}\u{006E}\u{006F}\u{0074}\u{0068}\u{0065}\u{0072}\u{002D}\u{0057}\u{0061}\u{0079}\u{002D}\u{305D}\u{308C}\u{305E}\u{308C}\u{306E}\u{5834}\u{6240}" - "Hello-Another-Way--fc4qua05auwb3674vfr0b" + "Hello-Another-Way--fc4qua05auwb3674vfr0b" } ! (O) 2 @@ -121,14 +121,14 @@ punycode.private tools.test urls ; ! (P) MajiKoi5 { - "\u{004D}\u{0061}\u{006A}\u{0069}\u{3067}\u{004B}\u{006F}\u{0069}\u{3059}\u{308B}\u{0035}\u{79D2}\u{524D}" - "MajiKoi5-783gue6qz075azm5e" + "\u{004D}\u{0061}\u{006A}\u{0069}\u{3067}\u{004B}\u{006F}\u{0069}\u{3059}\u{308B}\u{0035}\u{79D2}\u{524D}" + "MajiKoi5-783gue6qz075azm5e" } ! (Q) de { - "\u{30D1}\u{30D5}\u{30A3}\u{30FC}\u{0064}\u{0065}\u{30EB}\u{30F3}\u{30D0}" - "de-jg4avhby1noc0d" + "\u{30D1}\u{30D5}\u{30A3}\u{30FC}\u{0064}\u{0065}\u{30EB}\u{30F3}\u{30D0}" + "de-jg4avhby1noc0d" } ! (R) @@ -139,7 +139,7 @@ punycode.private tools.test urls ; ! (S) -> $1.00 <- { - "\u{002D}\u{003E}\u{0020}\u{0024}\u{0031}\u{002E}\u{0030}\u{0030}\u{0020}\u{003C}\u{002D}" + "\u{002D}\u{003E}\u{0020}\u{0024}\u{0031}\u{002E}\u{0030}\u{0030}\u{0020}\u{003C}\u{002D}" "-> $1.00 <--" } } [ diff --git a/extra/raylib/demo/mesh-picking/mesh-picking.factor b/extra/raylib/demo/mesh-picking/mesh-picking.factor index 2d9b98ad4d..575cc8558f 100644 --- a/extra/raylib/demo/mesh-picking/mesh-picking.factor +++ b/extra/raylib/demo/mesh-picking/mesh-picking.factor @@ -176,7 +176,7 @@ SYMBOL: mesh-picking-frame tri bary [ first3 "Barycenter: %3.2f %3.2f %3.2f" sprintf 10 ypos 45 + 10 BLACK draw-text - ] when* + ] when* ] [ drop ] if "Use Mouse to Move Camera" 10 screen-height 20 - 10 GRAY draw-text diff --git a/extra/readline/readline.factor b/extra/readline/readline.factor index 2e8417d612..ad44bbd1c0 100644 --- a/extra/readline/readline.factor +++ b/extra/readline/readline.factor @@ -25,7 +25,7 @@ IN: readline : set-completion ( quot -- ) [ - '[ + '[ [ @ [ utf8 malloc-string ] [ f ] if* ] readline.ffi:rl_compentry_func_t ] ( -- alien ) define-temp diff --git a/extra/rosetta-code/animation/animation.factor b/extra/rosetta-code/animation/animation.factor index 806d201f86..7a57f76cb6 100644 --- a/extra/rosetta-code/animation/animation.factor +++ b/extra/rosetta-code/animation/animation.factor @@ -37,7 +37,7 @@ TUPLE: animated-label < label-control reversed alarm ; animated-label H{ { T{ button-down } [ [ not ] change-reversed drop ] } - } set-gestures + } set-gestures M: animated-label graft* [ [ [ model>> ] [ reversed>> ] bi update-model ] curry 400 milliseconds every ] keep diff --git a/extra/rosetta-code/bulls-and-cows/bulls-and-cows.factor b/extra/rosetta-code/bulls-and-cows/bulls-and-cows.factor index 3e84fa2e9e..04b3e10caa 100644 --- a/extra/rosetta-code/bulls-and-cows/bulls-and-cows.factor +++ b/extra/rosetta-code/bulls-and-cows/bulls-and-cows.factor @@ -58,7 +58,7 @@ TUPLE: bull ; } cond ; : add-to-score ( arr -- score ) - [ bull? [ inc-bulls ] [ inc-cows ] if ] reduce ; + [ bull? [ inc-bulls ] [ inc-cows ] if ] reduce ; : check-win ( score -- ? ) bulls>> 4 = ; diff --git a/extra/rosetta-code/dice7/dice7.factor b/extra/rosetta-code/dice7/dice7.factor index a5d3780c72..cd50842034 100644 --- a/extra/rosetta-code/dice7/dice7.factor +++ b/extra/rosetta-code/dice7/dice7.factor @@ -42,7 +42,7 @@ IN: rosetta-code.dice7 ! Output a random integer 1..5. : dice5 ( -- x ) - 5 [1..b] random ; + 5 [1..b] random ; ! Output a random integer 1..7 using dice5 as randomness source. : dice7 ( -- x ) diff --git a/extra/rosetta-code/inverted-index/inverted-index.factor b/extra/rosetta-code/inverted-index/inverted-index.factor index 7a26e51ae0..cb7891a594 100644 --- a/extra/rosetta-code/inverted-index/inverted-index.factor +++ b/extra/rosetta-code/inverted-index/inverted-index.factor @@ -25,7 +25,7 @@ IN: rosetta-code.inverted-index '[ _ [ _ add-to-file-list ] change-at ] each ; : (index-files) ( files index -- ) - [ [ [ file-words ] keep ] dip swap add-to-index ] curry each ; + [ [ [ file-words ] keep ] dip swap add-to-index ] curry each ; : index-files ( files -- index ) H{ } clone [ (index-files) ] keep ; diff --git a/extra/rosetta-code/metronome/metronome.factor b/extra/rosetta-code/metronome/metronome.factor index 6425ce9b2e..02f88fc037 100644 --- a/extra/rosetta-code/metronome/metronome.factor +++ b/extra/rosetta-code/metronome/metronome.factor @@ -65,6 +65,6 @@ M: metronome-gadget pref-dim* drop { 200 200 } ; "Example: metronome " write print-defaults flush ; : metronome-main ( -- ) - [ [ metronome-cmdline metronome-ui ] [ drop metronome-usage 1 exit ] recover ] with-ui ; + [ [ metronome-cmdline metronome-ui ] [ drop metronome-usage 1 exit ] recover ] with-ui ; MAIN: metronome-main diff --git a/extra/rosetta-code/n-queens/n-queens.factor b/extra/rosetta-code/n-queens/n-queens.factor index f55981122e..99952f1928 100644 --- a/extra/rosetta-code/n-queens/n-queens.factor +++ b/extra/rosetta-code/n-queens/n-queens.factor @@ -10,13 +10,13 @@ IN: rosetta-code.n-queens :: safe? ( board q -- ? ) [let q board nth :> x - q [ - x swap - [ board nth ] keep - q swap - - [ + = not ] - [ - = not ] 3bi and - ] all? + q [ + x swap + [ board nth ] keep + q swap - + [ + = not ] + [ - = not ] 3bi and + ] all? ] ; : solution? ( board -- ? ) diff --git a/extra/rosetta-code/y-combinator/y-combinator.factor b/extra/rosetta-code/y-combinator/y-combinator.factor index 5e75afa7eb..7fc4f3cbbd 100644 --- a/extra/rosetta-code/y-combinator/y-combinator.factor +++ b/extra/rosetta-code/y-combinator/y-combinator.factor @@ -36,8 +36,8 @@ IN: rosetta-code.y-combinator :: almost-ack ( quot -- quot ) [ { - { [ over zero? ] [ nip 1 + ] } - { [ dup zero? ] [ [ 1 - ] [ drop 1 ] bi* quot call ] } - [ [ drop 1 - ] [ 1 - quot call ] 2bi quot call ] + { [ over zero? ] [ nip 1 + ] } + { [ dup zero? ] [ [ 1 - ] [ drop 1 ] bi* quot call ] } + [ [ drop 1 - ] [ 1 - quot call ] 2bi quot call ] } cond ] ; diff --git a/extra/sequences/extras/extras-docs.factor b/extra/sequences/extras/extras-docs.factor index a02097947d..f20e99505b 100644 --- a/extra/sequences/extras/extras-docs.factor +++ b/extra/sequences/extras/extras-docs.factor @@ -169,7 +169,7 @@ HELP: second? HELP: subseq* { $values - { "from" integer } { "to" integer } { "seq" sequence } { "subseq" sequence } } + { "from" integer } { "to" integer } { "seq" sequence } { "subseq" sequence } } { $description "Outputs a new sequence using positions relative to one or both ends of the sequence. Positive values describes offsets relative to the start of the sequence, negative values relative to the end. Values of " { $link f } " for " { $snippet "from" } " indicate the beginning of the sequence, while an " { $link f } " for " { $snippet "to" } " indicates the end of the sequence." } { $notes "Both " { $snippet "from" } " and " { $snippet "to" } " can be safely set to values outside the length of the sequence. Also, " { $snippet "from" } " can safely reference a smaller or greater index position than " { $snippet "to" } "." } { $examples @@ -216,7 +216,7 @@ HELP: unsurround HELP: start-all { $values - { "seq" sequence } { "subseq" sequence } { "indices" sequence } } + { "seq" sequence } { "subseq" sequence } { "indices" sequence } } { $description "Outputs the starting indices of the non-overlapping occurrences of " { $snippet "subseq" } " in " { $snippet "seq" } "." } { $examples { $example "USING: prettyprint sequences.extras ;" diff --git a/extra/sequences/extras/extras.factor b/extra/sequences/extras/extras.factor index 149f7814e1..09e7a9acad 100644 --- a/extra/sequences/extras/extras.factor +++ b/extra/sequences/extras/extras.factor @@ -374,7 +374,7 @@ PRIVATE> ] if ; inline : unsurround ( newseq seq2 seq3 -- seq1 ) - [ ?head drop ] [ ?tail drop ] bi* ; + [ ?head drop ] [ ?tail drop ] bi* ; : >string-list ( seq -- seq' ) [ "\"" 1surround ] map "," join ; @@ -484,7 +484,7 @@ PRIVATE> [ [ dup ] compose [ ] ] dip produce-as nip ; inline : loop>array ( ... quot: ( ... -- ... obj/f ) -- ... array ) - { } loop>sequence ; inline + { } loop>sequence ; inline : zero-loop>sequence ( ... quot: ( ... n -- ... obj/f ) exemplar -- ... seq ) [ 0 ] [ '[ _ keep 1 + swap ] ] [ loop>sequence ] tri* nip ; inline diff --git a/extra/smalltalk/compiler/compiler-tests.factor b/extra/smalltalk/compiler/compiler-tests.factor index 60b24c5644..8868fdb3fa 100644 --- a/extra/smalltalk/compiler/compiler-tests.factor +++ b/extra/smalltalk/compiler/compiler-tests.factor @@ -14,74 +14,72 @@ IN: smalltalk.compiler.tests { 2 1 } [ T{ ast-block f - { "a" "b" } - { - T{ ast-message-send f - T{ ast-name f "a" } - "+" - { T{ ast-name f "b" } } - } - } + { "a" "b" } + { + T{ ast-message-send f + T{ ast-name f "a" } + "+" + { T{ ast-name f "b" } } + } + } } test-inference ] unit-test { 3 1 } [ T{ ast-block f - { "a" "b" "c" } - { - T{ ast-assignment f - T{ ast-name f "a" } - T{ ast-message-send f - T{ ast-name f "c" } - "+" - { T{ ast-name f "b" } } - } - } - T{ ast-message-send f - T{ ast-name f "b" } - "blah:" - { 123.456 } - } - T{ ast-return f T{ ast-name f "c" } } - } + { "a" "b" "c" } + { + T{ ast-assignment f + T{ ast-name f "a" } + T{ ast-message-send f + T{ ast-name f "c" } + "+" + { T{ ast-name f "b" } } + } + } + T{ ast-message-send f + T{ ast-name f "b" } + "blah:" + { 123.456 } + } + T{ ast-return f T{ ast-name f "c" } } + } } test-inference ] unit-test { 0 1 } [ T{ ast-block f - { } - { } - { - T{ ast-message-send - { receiver 1 } - { selector "to:do:" } - { arguments - { - 10 - T{ ast-block - { arguments { "i" } } - { body - { - T{ ast-message-send - { receiver - T{ ast-name { name "i" } } + { } + { } + { + T{ ast-message-send + { receiver 1 } + { selector "to:do:" } + { arguments + { + 10 + T{ ast-block + { arguments { "i" } } + { body + { + T{ ast-message-send + { receiver T{ ast-name { name "i" } } } + { selector "print" } + } } - { selector "print" } - } - } - } + } + } } } - } - } + } } } test-inference ] unit-test { "a" } [ T{ ast-block f - { } - { } - { { T{ ast-block { body { "a" } } } } } + { } + { } + { { T{ ast-block { body { "a" } } } } } } test-compilation call first call ] unit-test diff --git a/extra/smalltalk/parser/parser-tests.factor b/extra/smalltalk/parser/parser-tests.factor index ab5eb12be9..be384b67e9 100644 --- a/extra/smalltalk/parser/parser-tests.factor +++ b/extra/smalltalk/parser/parser-tests.factor @@ -55,22 +55,22 @@ test = { T{ ast-block - { arguments { "i" } } - { body - { - T{ ast-message-send - { receiver T{ ast-name { name "i" } } } - { selector "print" } - } - } - } + { arguments { "i" } } + { body + { + T{ ast-message-send + { receiver T{ ast-name { name "i" } } } + { selector "print" } + } + } + } } } [ "[ :i | i print ]" test-Literal ] unit-test { T{ ast-block - { body { 5 self } } + { body { 5 self } } } } [ "[5. self]" test-Literal ] unit-test @@ -141,50 +141,50 @@ test = { T{ ast-message-send - { receiver - T{ ast-message-send - { receiver - T{ ast-message-send - { receiver 1 } - { selector "<" } - { arguments { 10 } } - } - } - { selector "ifTrue:ifFalse:" } - { arguments - { - T{ ast-block { body { "HI" } } } - T{ ast-block { body { "BYE" } } } - } + { receiver + T{ ast-message-send + { receiver + T{ ast-message-send + { receiver 1 } + { selector "<" } + { arguments { 10 } } + } + } + { selector "ifTrue:ifFalse:" } + { arguments + { + T{ ast-block { body { "HI" } } } + T{ ast-block { body { "BYE" } } } + } + } } - } - } - { selector "print" } + } + { selector "print" } } } [ "((1 < 10) ifTrue: [ 'HI' ] ifFalse: [ 'BYE' ]) print" test-Expression ] unit-test { T{ ast-cascade - { receiver 12 } - { messages - { - T{ ast-message f "sqrt" } - T{ ast-message f "+" { 2 } } - } - } + { receiver 12 } + { messages + { + T{ ast-message f "sqrt" } + T{ ast-message f "+" { 2 } } + } + } } } [ "12 sqrt; + 2" test-Expression ] unit-test { T{ ast-cascade - { receiver T{ ast-message-send f 12 "sqrt" } } - { messages - { - T{ ast-message f "+" { 1 } } - T{ ast-message f "+" { 2 } } - } + { receiver T{ ast-message-send f 12 "sqrt" } } + { messages + { + T{ ast-message f "+" { 1 } } + T{ ast-message f "+" { 2 } } + } } } } @@ -192,12 +192,12 @@ test = { T{ ast-cascade - { receiver T{ ast-message-send f 12 "squared" } } - { messages - { - T{ ast-message f "to:" { 100 } } - T{ ast-message f "sqrt" } - } + { receiver T{ ast-message-send f 12 "squared" } } + { messages + { + T{ ast-message f "to:" { 100 } } + T{ ast-message f "sqrt" } + } } } } @@ -214,14 +214,14 @@ test = { T{ ast-message-send - { receiver - T{ ast-message-send - { receiver { T{ ast-block { body { "a" } } } } } - { selector "at:" } - { arguments { 0 } } - } - } - { selector "value" } + { receiver + T{ ast-message-send + { receiver { T{ ast-block { body { "a" } } } } } + { selector "at:" } + { arguments { 0 } } + } + } + { selector "value" } } } [ "(#(['a']) at: 0) value" test-Expression ] unit-test diff --git a/extra/sodium/ffi/ffi.factor b/extra/sodium/ffi/ffi.factor index 0aec267b43..3159c0027a 100644 --- a/extra/sodium/ffi/ffi.factor +++ b/extra/sodium/ffi/ffi.factor @@ -572,7 +572,7 @@ FUNCTION: int crypto_secretstream_xchacha20poly1305_pull ( uchar* c, ulonglong clen, uchar* ad, ulonglong adlen ) FUNCTION: void crypto_secretstream_xchacha20poly1305_rekey ( - crypto_secretstream_xchacha20poly1305_state* state ) + crypto_secretstream_xchacha20poly1305_state* state ) ! sodium_runtime_H FUNCTION: int sodium_runtime_has_neon ( ) diff --git a/extra/spider/spider-docs.factor b/extra/spider/spider-docs.factor index 4e0aef8089..f1ed395423 100644 --- a/extra/spider/spider-docs.factor +++ b/extra/spider/spider-docs.factor @@ -5,13 +5,13 @@ IN: spider HELP: { $values - { "base" "a string or url" } - { "spider" spider } } + { "base" "a string or url" } + { "spider" spider } } { $description "Creates a new web spider with a given base url." } ; HELP: run-spider { $values - { "spider" spider } } + { "spider" spider } } { $description "Runs a spider until completion. See the " { $subsection "spider-tutorial" } " for a complete description of the tuple slots that affect how thet spider works." } ; ARTICLE: "spider-tutorial" "Spider tutorial" diff --git a/extra/tools/wc/wc.factor b/extra/tools/wc/wc.factor index 52f6403fa1..2eee8a35cd 100644 --- a/extra/tools/wc/wc.factor +++ b/extra/tools/wc/wc.factor @@ -13,17 +13,17 @@ IN: tools.wc fixnum ] reduce - ] [ [ CHAR: \n = ] count + >fixnum ] bi* + aligned-slices [ + uchar-16 cast-array swap + [ 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/trees/trees-tests.factor b/extra/trees/trees-tests.factor index 3ee169ba38..f89dbe6480 100644 --- a/extra/trees/trees-tests.factor +++ b/extra/trees/trees-tests.factor @@ -243,7 +243,7 @@ CONSTANT: test-tree2 TREE{ { V{ { 10 10 } { 15 10 } { 20 20 } - { 15 20 } { 30 30 } { 35 30 } + { 15 20 } { 30 30 } { 35 30 } } } [ TREE{ { 20 20 } { 10 10 } { 30 30 } } clone V{ } clone [ dupd 6 [ [ diff --git a/extra/trees/trees.factor b/extra/trees/trees.factor index 617024a3dd..32bc6c29ac 100644 --- a/extra/trees/trees.factor +++ b/extra/trees/trees.factor @@ -190,8 +190,8 @@ M: tree >alist to-key node right>> node-right? [ end-comparator (node>subalist-right) ] [ - [ from-key ] 2dip start-comparator - end-comparator (node>subalist) + [ from-key ] 2dip start-comparator + end-comparator (node>subalist) ] if ] when ] when ; inline recursive diff --git a/extra/webapps/blogs/blogs.factor b/extra/webapps/blogs/blogs.factor index 27ddc58afe..741b2cfe73 100644 --- a/extra/webapps/blogs/blogs.factor +++ b/extra/webapps/blogs/blogs.factor @@ -173,7 +173,7 @@ M: comment entity-url { blogs "new-post" } >>template - + "make a new blog post" >>description ; : authorize-author ( author -- ) @@ -222,7 +222,7 @@ M: comment entity-url "author" value posts-by-url ] >>submit - + "delete a blog post" >>description ; : ( -- action ) @@ -240,7 +240,7 @@ M: comment entity-url "author" value posts-by-url ] >>submit - + "delete a blog post" >>description ; : validate-comment ( -- ) @@ -265,7 +265,7 @@ M: comment entity-url [ insert-tuple ] [ entity-url ] bi ] >>submit - + "make a comment" >>description ; : ( -- action ) diff --git a/extra/webapps/wiki/wiki.factor b/extra/webapps/wiki/wiki.factor index 3074915bb0..0fcd0ce80b 100644 --- a/extra/webapps/wiki/wiki.factor +++ b/extra/webapps/wiki/wiki.factor @@ -266,7 +266,7 @@ M: revision feed-entry-url id>> revision-url ; URL" $wiki" ] >>submit - + "delete wiki articles" >>description { can-delete-wiki-articles? } >>capabilities ; diff --git a/extra/wordlet/wordlet.factor b/extra/wordlet/wordlet.factor index 05a0bbd5ed..45ded6361a 100644 --- a/extra/wordlet/wordlet.factor +++ b/extra/wordlet/wordlet.factor @@ -46,7 +46,7 @@ TUPLE: wordlet-game secret-word chances guesses ; : reamining-chars ( game -- chars ) [ secret-word>> ] [ guesses>> ] bi [ - guess>chars + guess>chars ] with map concat members [ background of ] assoc-map [ drop ] collect-value-by diff --git a/extra/yaml/ffi/ffi.factor b/extra/yaml/ffi/ffi.factor index e3574cd95b..9556d52312 100644 --- a/extra/yaml/ffi/ffi.factor +++ b/extra/yaml/ffi/ffi.factor @@ -609,9 +609,9 @@ STRUCT: yaml_node_pair_t { style yaml_mapping_style_t } ; UNION-STRUCT: node_data - { scalar scalar_node_data } - { sequence sequence_node_data } - { mapping mapping_node_data } + { scalar scalar_node_data } + { sequence sequence_node_data } + { mapping mapping_node_data } ; STRUCT: yaml_node_t diff --git a/extra/yaml/yaml-tests.factor b/extra/yaml/yaml-tests.factor index 8b30a629d7..23e2b65b34 100644 --- a/extra/yaml/yaml-tests.factor +++ b/extra/yaml/yaml-tests.factor @@ -419,16 +419,16 @@ CONSTANT: construct-merge-obj { H{ { "x" 0 } { "y" 2 } } :> LEFT H{ { "r" 10 } } :> BIG H{ { "r" 1 } } :> SMALL - { - CENTER - LEFT - BIG - SMALL - H{ { "x" 1 } { "y" 2 } { "r" 10 } { "label" "center/big" } } - H{ { T{ yaml-merge } CENTER } { "r" 10 } { "label" "center/big" } } - H{ { T{ yaml-merge } { CENTER BIG } } { "label" "center/big" } } - H{ { T{ yaml-merge } { BIG LEFT SMALL } } { "x" 1 } { "label" "center/big" } } -} ; + { + CENTER + LEFT + BIG + SMALL + H{ { "x" 1 } { "y" 2 } { "r" 10 } { "label" "center/big" } } + H{ { T{ yaml-merge } CENTER } { "r" 10 } { "label" "center/big" } } + H{ { T{ yaml-merge } { CENTER BIG } } { "label" "center/big" } } + H{ { T{ yaml-merge } { BIG LEFT SMALL } } { "x" 1 } { "label" "center/big" } } + } ; CONSTANT: construct-merge-str "--- - &CENTER { x: 1, 'y': 2 } @@ -722,7 +722,7 @@ f value [ ${ construct-value-unsafe-obj } [ $ construct-value-unsafe-obj >yaml-docs yaml-docs> ] unit-test ${ construct-value-safe-obj } [ $ construct-value-str yaml-docs> [ - dup "link with" swap [ [ scalar-value ] map ] change-at + dup "link with" swap [ [ scalar-value ] map ] change-at ] map ] unit-test ] with-variable diff --git a/extra/yaml/yaml.factor b/extra/yaml/yaml.factor index 7ffb146dbc..dc800dce27 100644 --- a/extra/yaml/yaml.factor +++ b/extra/yaml/yaml.factor @@ -174,7 +174,7 @@ DEFER: parse-mapping ] if ] with-destructors done [ 2drop ] [ - [ [ parser event ] dip next-complex-value ] unless , + [ [ parser event ] dip next-complex-value ] unless , ] if ] until ] { } make ; @@ -205,7 +205,7 @@ M: sets:set (deref-aliases) [ assoc-map ] [ drop clear-assoc ] [ drop swap assoc-union! ] 2tri ; inline M: assoc (deref-aliases) - [ [ (deref-aliases) ] bi-curry@ bi ] withd assoc-map! ; + [ [ (deref-aliases) ] bi-curry@ bi ] withd assoc-map! ; : merge-values ( seq -- assoc ) reverse [ ] [ assoc-union ] map-reduce ; diff --git a/extra/yenc/yenc.factor b/extra/yenc/yenc.factor index ed85ea67a0..8ec374592b 100644 --- a/extra/yenc/yenc.factor +++ b/extra/yenc/yenc.factor @@ -71,7 +71,7 @@ PRIVATE> >string " " split [ "=" split1 ] H{ } map>assoc ; : find-metadata ( lines type -- metadata i ) - [ '[ _ head? ] find ] keep ?head drop parse-metadata swap ; + [ '[ _ head? ] find ] keep ?head drop parse-metadata swap ; PRIVATE> diff --git a/extra/zealot/factor/factor.factor b/extra/zealot/factor/factor.factor index ac9f8b4d48..059e975cfb 100644 --- a/extra/zealot/factor/factor.factor +++ b/extra/zealot/factor/factor.factor @@ -156,11 +156,11 @@ M: windows factor-path "./factor.com" ; +new-group+ >>group ; : zealot-test-commands ( path -- ) - [ + [ 32 [ load-and-test-command ] map [ try-process ] parallel-each - ] with-directory ; + ] with-directory ; : zealot-test-commands-old ( path -- ) [ diff --git a/extra/zoneinfo/zoneinfo-tests.factor b/extra/zoneinfo/zoneinfo-tests.factor index 1fd0d878d6..e20deb49ee 100644 --- a/extra/zoneinfo/zoneinfo-tests.factor +++ b/extra/zoneinfo/zoneinfo-tests.factor @@ -7,11 +7,11 @@ tools.test zoneinfo ; { T{ raw-zone - { name "EST" } - { gmt-offset "-5:00" } - { rules/save "-" } - { format "EST" } - { until { } } + { name "EST" } + { gmt-offset "-5:00" } + { rules/save "-" } + { format "EST" } + { until { } } } } [ "EST" find-zone -- 2.34.1