From e189954ecce029eac92a1151849c6262043deb30 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 1 Jun 2017 16:59:35 -0500 Subject: [PATCH] core: Rename iota to so we can have TUPLE: iota ... ; instead of TUPLE: iota-tuple ... ; --- basis/alien/endian/endian.factor | 2 +- .../binary-search/binary-search-tests.factor | 2 +- basis/bit-sets/bit-sets.factor | 2 +- basis/bitstreams/bitstreams.factor | 2 +- basis/checksums/crc16/crc16.factor | 2 +- basis/checksums/md5/md5.factor | 2 +- basis/checksums/sha/sha-tests.factor | 6 +-- basis/cocoa/enumeration/enumeration.factor | 2 +- basis/cocoa/messages/messages.factor | 2 +- basis/combinators/random/random.factor | 2 +- basis/compiler/cfg/builder/alien/alien.factor | 2 +- .../cfg/dominance/dominance-tests.factor | 2 +- .../cfg/intrinsics/allot/allot.factor | 2 +- .../compiler/cfg/intrinsics/simd/simd.factor | 2 +- .../linearization/linearization-tests.factor | 2 +- .../cfg/liveness/liveness-tests.factor | 2 +- basis/compiler/cfg/rpo/rpo.factor | 2 +- .../coalescing/coalescing-tests.factor | 2 +- basis/compiler/cfg/stacks/local/local.factor | 2 +- .../cfg/stacks/padding/padding.factor | 2 +- basis/compiler/cfg/stacks/stacks.factor | 2 +- .../expressions/expressions.factor | 2 +- .../cfg/value-numbering/simd/simd.factor | 2 +- basis/compiler/tests/codegen.factor | 2 +- basis/compiler/tests/curry.factor | 2 +- basis/compiler/tests/intrinsics.factor | 2 +- basis/compiler/tests/optimizer.factor | 4 +- basis/compiler/tests/redefine23.factor | 2 +- .../tree/cleanup/cleanup-tests.factor | 10 ++-- .../tree/dead-code/branches/branches.factor | 2 +- .../modular-arithmetic-tests.factor | 6 +-- .../propagation/transforms/transforms.factor | 2 +- basis/compression/huffman/huffman.factor | 2 +- basis/compression/inflate/inflate.factor | 4 +- basis/compression/lzw/lzw.factor | 2 +- .../combinators/combinators-tests.factor | 6 +-- basis/db/queries/queries.factor | 2 +- basis/db/tester/tester.factor | 4 +- basis/fry/fry-tests.factor | 2 +- basis/game/input/dinput/dinput.factor | 2 +- basis/game/input/gtk/gtk.factor | 2 +- basis/game/input/x11/x11.factor | 2 +- basis/generalizations/generalizations.factor | 4 +- basis/grouping/grouping-docs.factor | 2 +- basis/heaps/heaps-tests.factor | 4 +- basis/hints/hints.factor | 2 +- basis/images/images.factor | 2 +- basis/images/processing/processing.factor | 2 +- basis/io/encodings/iso2022/iso2022.factor | 2 +- basis/io/files/unique/unique.factor | 2 +- basis/io/ports/ports-tests.factor | 4 +- .../io/sockets/secure/openssl/openssl.factor | 2 +- basis/io/styles/styles-docs.factor | 4 +- basis/lcs/lcs.factor | 8 +-- basis/macros/expander/expander.factor | 2 +- basis/math/bitwise/bitwise.factor | 2 +- .../combinatorics/combinatorics-docs.factor | 2 +- .../combinatorics/combinatorics-tests.factor | 8 +-- basis/math/combinatorics/combinatorics.factor | 10 ++-- basis/math/functions/functions.factor | 2 +- basis/math/intervals/intervals-tests.factor | 6 +-- .../matrices/elimination/elimination.factor | 6 +-- basis/math/matrices/matrices.factor | 22 ++++---- basis/math/polynomials/polynomials.factor | 4 +- .../miller-rabin/miller-rabin-tests.factor | 2 +- .../primes/miller-rabin/miller-rabin.factor | 4 +- basis/math/statistics/statistics-tests.factor | 2 +- basis/math/vectors/simd/simd-tests.factor | 8 +-- .../nibble-arrays/nibble-arrays-tests.factor | 2 +- basis/persistent/vectors/vectors-tests.factor | 8 +-- basis/porter-stemmer/porter-stemmer.factor | 2 +- basis/prettyprint/prettyprint-tests.factor | 4 +- basis/prettyprint/sections/sections.factor | 2 +- basis/random/random-tests.factor | 6 +-- basis/random/random.factor | 2 +- basis/random/sfmt/sfmt.factor | 4 +- basis/regexp/disambiguate/disambiguate.factor | 2 +- .../generalizations/generalizations.factor | 2 +- basis/sequences/unrolled/unrolled.factor | 4 +- .../specialized-arrays-docs.factor | 2 +- .../stack-checker/stack-checker-tests.factor | 2 +- basis/suffix-arrays/suffix-arrays.factor | 2 +- basis/threads/threads-docs.factor | 2 +- basis/threads/threads-tests.factor | 2 +- basis/tools/deploy/windows/ico/ico.factor | 2 +- basis/tools/hexdump/hexdump-tests.factor | 2 +- .../profiler/sampling/sampling-tests.factor | 4 +- basis/tools/scaffold/scaffold-tests.factor | 4 +- basis/tr/tr.factor | 2 +- basis/tuple-arrays/tuple-arrays.factor | 2 +- basis/ui/gadgets/gadgets-tests.factor | 2 +- .../gadgets/scrollers/scrollers-tests.factor | 2 +- basis/ui/pens/gradient/gradient.factor | 2 +- basis/unicode/breaks/breaks-tests.factor | 2 +- basis/unicode/breaks/breaks.factor | 14 ++--- basis/unicode/collation/collation.factor | 2 +- basis/unicode/unicode.factor | 2 +- basis/windows/registry/registry.factor | 2 +- core/assocs/assocs-tests.factor | 2 +- core/assocs/assocs.factor | 4 +- core/checksums/crc32/crc32.factor | 2 +- core/classes/tuple/tuple.factor | 6 +-- core/combinators/combinators.factor | 4 +- core/continuations/continuations-tests.factor | 2 +- core/hash-sets/hash-sets-tests.factor | 2 +- core/hashtables/hashtables-tests.factor | 8 +-- core/io/binary/binary.factor | 4 +- core/io/encodings/utf16/utf16.factor | 2 +- core/io/encodings/utf8/utf8-tests.factor | 2 +- core/kernel/kernel-docs.factor | 2 +- core/kernel/kernel-tests.factor | 2 +- core/math/floats/floats-tests.factor | 2 +- core/memory/memory-tests.factor | 2 +- core/sbufs/sbufs-tests.factor | 2 +- core/sequences/sequences-docs.factor | 16 +++--- core/sequences/sequences-tests.factor | 54 +++++++++---------- core/sequences/sequences.factor | 20 +++---- core/slots/slots.factor | 2 +- core/sorting/sorting-tests.factor | 2 +- core/vectors/vectors-tests.factor | 4 +- extra/alien/data/map/map-tests.factor | 4 +- extra/arrays/shaped/shaped.factor | 8 +-- extra/audio/vorbis/vorbis.factor | 4 +- extra/benchmark/base64/base64.factor | 2 +- extra/benchmark/beust2/beust2.factor | 4 +- .../bloom-filters/bloom-filters.factor | 2 +- .../chameneos-redux/chameneos-redux.factor | 2 +- .../combinatorics/combinatorics.factor | 2 +- extra/benchmark/csv/csv.factor | 2 +- extra/benchmark/dawes/dawes.factor | 2 +- extra/benchmark/dispatch2/dispatch2.factor | 6 +-- extra/benchmark/dlists/dlists.factor | 4 +- extra/benchmark/e-decimals/e-decimals.factor | 2 +- extra/benchmark/e-ratios/e-ratios.factor | 2 +- .../empty-loop-2/empty-loop-2.factor | 2 +- extra/benchmark/fannkuch/fannkuch.factor | 2 +- extra/benchmark/fasta/fasta.factor | 2 +- extra/benchmark/gc1/gc1.factor | 2 +- extra/benchmark/gc3/gc3.factor | 2 +- extra/benchmark/hash-sets/hash-sets.factor | 2 +- extra/benchmark/iteration/iteration.factor | 2 +- extra/benchmark/json/json.factor | 2 +- .../linked-assocs/linked-assocs.factor | 2 +- extra/benchmark/make/make.factor | 6 +-- extra/benchmark/mandel/colors/colors.factor | 2 +- extra/benchmark/mandel/mandel.factor | 2 +- .../matrix-exponential-scalar.factor | 2 +- .../matrix-exponential-simd.factor | 2 +- extra/benchmark/md5/md5.factor | 2 +- extra/benchmark/memoize/memoize.factor | 2 +- extra/benchmark/msgpack/msgpack.factor | 2 +- .../parse-bignum/parse-bignum.factor | 2 +- .../parse-fixnum/parse-fixnum.factor | 2 +- .../partial-sums/partial-sums.factor | 2 +- extra/benchmark/randomize/randomize.factor | 2 +- .../raytracer-simd/raytracer-simd.factor | 8 +-- extra/benchmark/raytracer/raytracer.factor | 6 +-- extra/benchmark/regexp/regexp.factor | 4 +- extra/benchmark/ring/ring.factor | 2 +- extra/benchmark/sha1/sha1.factor | 8 +-- extra/benchmark/simd-1/simd-1.factor | 2 +- extra/benchmark/sort/sort.factor | 2 +- .../spectral-norm-simd.factor | 4 +- .../spectral-norm/spectral-norm.factor | 4 +- extra/benchmark/splay/splay.factor | 2 +- extra/benchmark/splitting/splitting.factor | 2 +- extra/benchmark/sum-file/sum-file.factor | 2 +- extra/benchmark/tcp-echo0/tcp-echo0.factor | 2 +- .../tuple-arrays/tuple-arrays.factor | 2 +- extra/benchmark/udp-echo0/udp-echo0.factor | 2 +- extra/benchmark/ui-panes/ui-panes.factor | 2 +- extra/benchmark/wrap/wrap.factor | 2 +- extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor | 10 ++-- .../bloom-filters/bloom-filters-tests.factor | 10 ++-- extra/bson/writer/writer.factor | 2 +- extra/chipmunk/demo/demo.factor | 4 +- extra/classes/struct/vectored/vectored.factor | 2 +- .../cfg/gvn/expressions/expressions.factor | 2 +- extra/compiler/cfg/gvn/simd/simd.factor | 2 +- extra/crypto/passwd-md5/passwd-md5.factor | 2 +- extra/crypto/xor/xor.factor | 2 +- extra/cuda/devices/devices.factor | 4 +- extra/enigma/enigma-tests.factor | 2 +- extra/enigma/enigma.factor | 6 +-- extra/game/debug/debug.factor | 2 +- .../input/demos/joysticks/joysticks.factor | 2 +- extra/gpu/render/render.factor | 6 +-- extra/gpu/shaders/shaders.factor | 2 +- extra/graphviz/graphviz-docs.factor | 14 ++--- extra/graphviz/graphviz-tests.factor | 10 ++-- extra/grid-meshes/grid-meshes.factor | 2 +- extra/grouping/extras/extras-tests.factor | 4 +- extra/html/parser/analyzer/analyzer.factor | 2 +- extra/id3/id3-tests.factor | 2 +- extra/images/atlas/atlas.factor | 2 +- extra/images/pbm/pbm.factor | 2 +- extra/images/png/png.factor | 2 +- extra/images/tga/tga.factor | 10 ++-- extra/io/streams/peek/peek-tests.factor | 2 +- extra/jamshred/gl/gl.factor | 2 +- extra/koszul/koszul.factor | 16 +++--- extra/lcd/lcd.factor | 2 +- extra/lint/lint.factor | 2 +- extra/macho/macho.factor | 2 +- extra/mason/common/common.factor | 2 +- extra/math/extras/extras-tests.factor | 10 ++-- extra/math/extras/extras.factor | 12 ++--- extra/math/factorials/factorials-tests.factor | 18 +++---- extra/math/finance/finance-tests.factor | 8 +-- extra/math/matrices/laplace/laplace.factor | 2 +- .../solovay-strassen-tests.factor | 2 +- .../solovay-strassen/solovay-strassen.factor | 2 +- extra/math/splines/splines.factor | 2 +- extra/math/splines/viewer/viewer.factor | 2 +- extra/math/transforms/fft/fft.factor | 4 +- extra/multi-methods/multi-methods.factor | 4 +- extra/noise/noise.factor | 4 +- extra/nurbs/nurbs.factor | 2 +- extra/odbc/odbc.factor | 2 +- extra/pcre/pcre.factor | 2 +- extra/picomath/picomath.factor | 4 +- extra/project-euler/001/001.factor | 4 +- extra/project-euler/011/011.factor | 4 +- extra/project-euler/024/024.factor | 2 +- extra/project-euler/027/027.factor | 2 +- extra/project-euler/030/030.factor | 2 +- extra/project-euler/032/032.factor | 4 +- extra/project-euler/043/043.factor | 2 +- extra/project-euler/052/052.factor | 2 +- extra/project-euler/053/053.factor | 2 +- extra/project-euler/055/055.factor | 2 +- extra/project-euler/057/057.factor | 2 +- extra/project-euler/081/081.factor | 2 +- extra/project-euler/150/150.factor | 6 +-- extra/project-euler/151/151.factor | 2 +- extra/project-euler/164/164.factor | 2 +- extra/project-euler/265/265.factor | 4 +- extra/project-euler/common/common.factor | 2 +- extra/python/python-docs.factor | 2 +- extra/python/python.factor | 4 +- extra/random/cmwc/cmwc-tests.factor | 6 +-- .../bitmap-bezier/bitmap-bezier.factor | 2 +- .../knapsack-unbounded.factor | 2 +- extra/rosetta-code/knapsack/knapsack.factor | 4 +- .../long-multiplication.factor | 2 +- extra/rosetta-code/luhn-test/luhn-test.factor | 2 +- extra/rosetta-code/n-queens/n-queens.factor | 6 +-- .../one-d-cellular/one-d-cellular.factor | 2 +- extra/sequences/extras/extras-tests.factor | 36 ++++++------- extra/sequences/extras/extras.factor | 4 +- extra/sequences/rotated/rotated.factor | 2 +- extra/sequences/shifted/shifted-tests.factor | 10 ++-- extra/sequences/snipped/snipped-tests.factor | 8 +-- extra/sets/extras/extras-tests.factor | 2 +- extra/snake-game/game/game.factor | 2 +- extra/snake-game/sprites/sprites.factor | 6 +-- extra/sorting/extras/extras-tests.factor | 4 +- extra/space-invaders/space-invaders.factor | 2 +- extra/spelling/spelling.factor | 4 +- extra/sudoku/sudoku.factor | 2 +- extra/synth/synth.factor | 2 +- extra/talks/tc-lisp-talk/tc-lisp-talk.factor | 6 +-- extra/tetris/board/board.factor | 6 +-- extra/tetris/gl/gl.factor | 4 +- extra/trees/avl/avl-tests.factor | 2 +- extra/trees/splay/splay-tests.factor | 6 +-- extra/ui/gadgets/charts/demos/demos.factor | 4 +- .../gadgets/charts/lines/lines-tests.factor | 2 +- extra/zeromq/examples/hwclient.factor | 2 +- extra/zeromq/examples/tasksink.factor | 2 +- unmaintained/images/jpeg/jpeg.factor | 6 +-- unmaintained/sudokus/sudokus.factor | 2 +- 272 files changed, 518 insertions(+), 518 deletions(-) diff --git a/basis/alien/endian/endian.factor b/basis/alien/endian/endian.factor index a7593c05b7..2c32f2fdcd 100644 --- a/basis/alien/endian/endian.factor +++ b/basis/alien/endian/endian.factor @@ -22,7 +22,7 @@ MACRO: byte-reverse ( n signed? -- quot ) [ drop [ - dup iota [ + dup [ [ 1 + - -8 * ] [ nip 8 * ] 2bi '[ _ shift 0xff bitand _ shift ] ] with map diff --git a/basis/binary-search/binary-search-tests.factor b/basis/binary-search/binary-search-tests.factor index b36c5f0382..98517a0d60 100644 --- a/basis/binary-search/binary-search-tests.factor +++ b/basis/binary-search/binary-search-tests.factor @@ -6,7 +6,7 @@ USING: binary-search kernel math.order sequences tools.test ; { 3 } [ 4 { 1 2 3 4 5 6 } [ <=> ] with search drop ] unit-test { 2 } [ 3.5 { 1 2 3 4 5 6 7 8 } [ <=> ] with search drop ] unit-test { 4 } [ 5.5 { 1 2 3 4 5 6 7 8 } [ <=> ] with search drop ] unit-test -{ 10 } [ 10 20 iota [ <=> ] with search drop ] unit-test +{ 10 } [ 10 20 [ <=> ] with search drop ] unit-test { 0 } [ "alligator" { "alligator" "cat" "fish" "hello" "ikarus" "java" } sorted-index ] unit-test { 3 } [ "hey" { "alligator" "cat" "fish" "hello" "ikarus" "java" } sorted-index ] unit-test diff --git a/basis/bit-sets/bit-sets.factor b/basis/bit-sets/bit-sets.factor index 0f1bca7999..5b31296d92 100644 --- a/basis/bit-sets/bit-sets.factor +++ b/basis/bit-sets/bit-sets.factor @@ -60,7 +60,7 @@ M: bit-set subset? [ intersect ] keep = ; M: bit-set members - table>> [ length iota ] keep '[ _ nth-unsafe ] filter ; + table>> [ length ] keep '[ _ nth-unsafe ] filter ; > ; :: byte-array-n>sequence ( byte-array n -- seq ) - byte-array length 8 * n / iota + byte-array length 8 * n / byte-array '[ drop n _ read ] { } map-as ; diff --git a/basis/checksums/crc16/crc16.factor b/basis/checksums/crc16/crc16.factor index d70f49849f..415a4090a4 100644 --- a/basis/checksums/crc16/crc16.factor +++ b/basis/checksums/crc16/crc16.factor @@ -8,7 +8,7 @@ CONSTANT: crc16-polynomial 0xa001 CONSTANT: crc16-table V{ } -256 iota [ +256 [ 8 [ [ 2/ ] [ even? ] bi [ crc16-polynomial bitxor ] unless ] times diff --git a/basis/checksums/md5/md5.factor b/basis/checksums/md5/md5.factor index 80c136b207..391344bc87 100644 --- a/basis/checksums/md5/md5.factor +++ b/basis/checksums/md5/md5.factor @@ -30,7 +30,7 @@ M: md5 initialize-checksum-state drop ; [ old-state<< ] [ state<< ] bi ; inline CONSTANT: T $[ - 80 iota [ sin abs 32 2^ * >integer ] uint-array{ } map-as + 80 [ sin abs 32 2^ * >integer ] uint-array{ } map-as ] :: F ( X Y Z -- FXYZ ) diff --git a/basis/checksums/sha/sha-tests.factor b/basis/checksums/sha/sha-tests.factor index 82ab54482e..9aa5b89b0c 100644 --- a/basis/checksums/sha/sha-tests.factor +++ b/basis/checksums/sha/sha-tests.factor @@ -92,9 +92,9 @@ ERROR: checksums-differ algorithm seq incremental-checksum one-go-checksum ; checksums-differ ] if ; -{ t } [ 100 iota [ drop sha1 100 [ 100 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test -{ t } [ 100 iota [ drop sha1 20 [ 20 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test -{ t } [ 100 iota [ drop sha1 10 [ 10 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test +{ t } [ 100 [ drop sha1 100 [ 100 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test +{ t } [ 100 [ drop sha1 20 [ 20 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test +{ t } [ 100 [ drop sha1 10 [ 10 random random-bytes ] replicate compare-checksum-calculations ] all? ] unit-test { t } [ sha1 { B{ 105 27 166 214 73 114 110 } diff --git a/basis/cocoa/enumeration/enumeration.factor b/basis/cocoa/enumeration/enumeration.factor index a78a29bd7f..4f5a69697a 100644 --- a/basis/cocoa/enumeration/enumeration.factor +++ b/basis/cocoa/enumeration/enumeration.factor @@ -20,7 +20,7 @@ CONSTANT: NS-EACH-BUFFER-SIZE 16 object state stackbuf count -> countByEnumeratingWithState:objects:count: :> items-count items-count 0 = [ state itemsPtr>> [ items-count id ] [ stackbuf ] if* :> items - items-count iota [ items nth quot call ] each + items-count [ items nth quot call ] each object quot state stackbuf count (NSFastEnumeration-each) ] unless ; inline recursive diff --git a/basis/cocoa/messages/messages.factor b/basis/cocoa/messages/messages.factor index 4814a36e48..63cbe0224e 100644 --- a/basis/cocoa/messages/messages.factor +++ b/basis/cocoa/messages/messages.factor @@ -223,7 +223,7 @@ ERROR: no-objc-type name ; (free) ; : method-arg-types ( method -- args ) - dup method_getNumberOfArguments iota + dup method_getNumberOfArguments [ method-arg-type ] with map ; : method-return-type ( method -- ctype ) diff --git a/basis/combinators/random/random.factor b/basis/combinators/random/random.factor index 661ed3f08d..9363ede491 100644 --- a/basis/combinators/random/random.factor +++ b/basis/combinators/random/random.factor @@ -47,7 +47,7 @@ MACRO: (casep) ( assoc -- quot ) (casep>quot) ; [ swap nth ] 2bi * ; : conditional-probabilities ( seq -- seq' ) - dup length iota [ (conditional-probabilities) ] with map ; + dup length [ (conditional-probabilities) ] with map ; : (direct>conditional) ( assoc -- assoc' ) [ keys conditional-probabilities ] [ values ] bi zip ; diff --git a/basis/compiler/cfg/builder/alien/alien.factor b/basis/compiler/cfg/builder/alien/alien.factor index 2f7d6a4413..57e96997f2 100644 --- a/basis/compiler/cfg/builder/alien/alien.factor +++ b/basis/compiler/cfg/builder/alien/alien.factor @@ -26,7 +26,7 @@ IN: compiler.cfg.builder.alien : unbox-parameters ( parameters -- vregs reps ) [ - [ length iota ] keep + [ length ] keep [ [ peek-loc ] [ base-type ] bi* unbox-parameter ] 2 2 mnmap [ concat ] bi@ ] diff --git a/basis/compiler/cfg/dominance/dominance-tests.factor b/basis/compiler/cfg/dominance/dominance-tests.factor index bd9e195cae..d963c96140 100644 --- a/basis/compiler/cfg/dominance/dominance-tests.factor +++ b/basis/compiler/cfg/dominance/dominance-tests.factor @@ -74,7 +74,7 @@ V{ } 5 test-bb { t } [ 0 5 [a,b] [ get dom-parent 0 get eq? ] all? ] unit-test : non-det-test ( -- cfg ) - 9 iota [ V{ } clone over insns>block ] { } map>assoc dup + 9 [ V{ } clone over insns>block ] { } map>assoc dup { { 0 1 } { 1 2 } { 1 7 } diff --git a/basis/compiler/cfg/intrinsics/allot/allot.factor b/basis/compiler/cfg/intrinsics/allot/allot.factor index ff6e1b9b5c..65623ce473 100644 --- a/basis/compiler/cfg/intrinsics/allot/allot.factor +++ b/basis/compiler/cfg/intrinsics/allot/allot.factor @@ -75,7 +75,7 @@ IN: compiler.cfg.intrinsics.allot :: zero-byte-array ( len reg -- ) 0 ^^load-literal :> elt reg ^^tagged>integer :> reg - len cell align cell /i iota [ + len cell align cell /i [ [ elt reg ] dip cells byte-array-offset + int-rep f ##store-memory-imm, ] each ; diff --git a/basis/compiler/cfg/intrinsics/simd/simd.factor b/basis/compiler/cfg/intrinsics/simd/simd.factor index 083a73b04a..3d64fe2c6e 100644 --- a/basis/compiler/cfg/intrinsics/simd/simd.factor +++ b/basis/compiler/cfg/intrinsics/simd/simd.factor @@ -76,7 +76,7 @@ CONSTANT: rep>half { : >variable-shuffle ( shuffle rep -- shuffle' ) rep-component-type heap-size [ dup >byte-array ] - [ iota >byte-array ] bi + [ >byte-array ] bi '[ _ n*v _ v+ ] map concat ; : ^load-immediate-shuffle ( shuffle rep -- dst ) diff --git a/basis/compiler/cfg/linearization/linearization-tests.factor b/basis/compiler/cfg/linearization/linearization-tests.factor index 9c3e9c4aa6..60620c0039 100644 --- a/basis/compiler/cfg/linearization/linearization-tests.factor +++ b/basis/compiler/cfg/linearization/linearization-tests.factor @@ -29,7 +29,7 @@ V{ } 2 test-bb ] unit-test { { 0 1 2 3 4 5 } } [ - 6 iota [ V{ } clone over insns>block ] { } map>assoc dup + 6 [ V{ } clone over insns>block ] { } map>assoc dup { { 0 1 } { 0 2 } { 0 5 } { 2 3 } diff --git a/basis/compiler/cfg/liveness/liveness-tests.factor b/basis/compiler/cfg/liveness/liveness-tests.factor index cb95300ca0..5c26f6a328 100644 --- a/basis/compiler/cfg/liveness/liveness-tests.factor +++ b/basis/compiler/cfg/liveness/liveness-tests.factor @@ -91,7 +91,7 @@ IN: compiler.cfg.liveness.tests ! liveness-step { 3 } [ init-liveness - 3 iota [ swap >>number ] map + 3 [ swap >>number ] map [ connect-Nto1-bbs ] keep liveness-step length ] unit-test diff --git a/basis/compiler/cfg/rpo/rpo.factor b/basis/compiler/cfg/rpo/rpo.factor index 402d74d6cb..2c3435daa0 100644 --- a/basis/compiler/cfg/rpo/rpo.factor +++ b/basis/compiler/cfg/rpo/rpo.factor @@ -13,7 +13,7 @@ IN: compiler.cfg.rpo ] [ drop ] if ; inline recursive : number-blocks ( blocks -- ) - dup length iota + dup length [ >>number drop ] 2each ; : post-order ( cfg -- blocks ) diff --git a/basis/compiler/cfg/ssa/destruction/coalescing/coalescing-tests.factor b/basis/compiler/cfg/ssa/destruction/coalescing/coalescing-tests.factor index d119e17958..bc7fe6f6db 100644 --- a/basis/compiler/cfg/ssa/destruction/coalescing/coalescing-tests.factor +++ b/basis/compiler/cfg/ssa/destruction/coalescing/coalescing-tests.factor @@ -98,7 +98,7 @@ IN: compiler.cfg.ssa.destruction.coalescing.tests : make-phi-inputs ( -- assoc ) H{ } clone [ { 2287 2288 } [ - 10 iota 1 sample first rot set-at + 10 1 sample first rot set-at ] with each ] keep ; diff --git a/basis/compiler/cfg/stacks/local/local.factor b/basis/compiler/cfg/stacks/local/local.factor index f02e6dfaa4..ce9b1b2e5c 100644 --- a/basis/compiler/cfg/stacks/local/local.factor +++ b/basis/compiler/cfg/stacks/local/local.factor @@ -58,7 +58,7 @@ SYMBOLS: locs>vregs local-peek-set replaces ; height-state get global-loc>local replaces get set-at ; : kill-locations ( begin inc -- seq ) - 0 min neg iota [ swap - ] with map ; + 0 min neg [ swap - ] with map ; : local-kill-set ( ds-begin ds-inc rs-begin rs-inc -- set ) [ kill-locations ] 2bi@ diff --git a/basis/compiler/cfg/stacks/padding/padding.factor b/basis/compiler/cfg/stacks/padding/padding.factor index 9bc5d9a8c4..0c24d993e2 100644 --- a/basis/compiler/cfg/stacks/padding/padding.factor +++ b/basis/compiler/cfg/stacks/padding/padding.factor @@ -21,7 +21,7 @@ IN: compiler.cfg.stacks.padding swap 2dup second member? [ 2drop 2 ] [ first >= [ 1 ] [ 0 ] if ] if ; : shift-stack ( n stack -- stack' ) - first2 pick '[ _ + ] map [ 0 >= ] filter pick 0 max iota sets:union + first2 pick '[ _ + ] map [ 0 >= ] filter pick 0 max sets:union [ + ] dip 2array ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/basis/compiler/cfg/stacks/stacks.factor b/basis/compiler/cfg/stacks/stacks.factor index 24bc647218..9b6e3aef99 100644 --- a/basis/compiler/cfg/stacks/stacks.factor +++ b/basis/compiler/cfg/stacks/stacks.factor @@ -24,7 +24,7 @@ IN: compiler.cfg.stacks [ swap new swap >>n ] with map ; : stack-locs ( loc-class n -- locs ) - iota create-locs ; + create-locs ; : (load-vregs) ( n loc-class -- vregs ) swap stack-locs [ peek-loc ] map ; diff --git a/basis/compiler/cfg/value-numbering/expressions/expressions.factor b/basis/compiler/cfg/value-numbering/expressions/expressions.factor index 79dd2ce2b8..d020409e2a 100644 --- a/basis/compiler/cfg/value-numbering/expressions/expressions.factor +++ b/basis/compiler/cfg/value-numbering/expressions/expressions.factor @@ -27,7 +27,7 @@ GENERIC: >expr ( insn -- expr ) [ [ , [ f ] % ] [ - dup iota [ + dup [ - 1 - , [ swap [ set-array-nth ] keep ] % ] with each ] bi diff --git a/basis/compiler/cfg/value-numbering/simd/simd.factor b/basis/compiler/cfg/value-numbering/simd/simd.factor index d17e4ce289..1c0e8ac88c 100644 --- a/basis/compiler/cfg/value-numbering/simd/simd.factor +++ b/basis/compiler/cfg/value-numbering/simd/simd.factor @@ -13,7 +13,7 @@ IN: compiler.cfg.value-numbering.simd ! should be redone completely. : useless-shuffle-vector-imm? ( insn -- ? ) - [ shuffle>> ] [ rep>> rep-length iota ] bi sequence= ; + [ shuffle>> ] [ rep>> rep-length ] bi sequence= ; : compose-shuffle-vector-imm ( outer inner -- insn' ) 2dup [ rep>> ] bi@ eq? [ diff --git a/basis/compiler/tests/codegen.factor b/basis/compiler/tests/codegen.factor index cab83b89ac..294ea1be3e 100644 --- a/basis/compiler/tests/codegen.factor +++ b/basis/compiler/tests/codegen.factor @@ -316,7 +316,7 @@ cell 4 = [ ! Bug with ##return node construction : return-recursive-bug ( nodes -- ? ) - { fixnum } declare iota [ + { fixnum } declare [ dup 3 bitand 1 = [ drop t ] [ dup 3 bitand 2 = [ return-recursive-bug diff --git a/basis/compiler/tests/curry.factor b/basis/compiler/tests/curry.factor index 50888e54c1..1bf5e052d9 100644 --- a/basis/compiler/tests/curry.factor +++ b/basis/compiler/tests/curry.factor @@ -47,7 +47,7 @@ IN: compiler.tests.curry ] { } make ; inline [ t ] [| | - 1000 iota [ drop 1,000,000 random 1,000,000 random ] H{ } map>assoc :> a-hashtable + 1000 [ drop 1,000,000 random 1,000,000 random ] H{ } map>assoc :> a-hashtable a-hashtable [ [ drop , ] funky-assoc>map ] compile-call a-hashtable keys = ] unit-test diff --git a/basis/compiler/tests/intrinsics.factor b/basis/compiler/tests/intrinsics.factor index 28dbe3bc95..52ccb4d275 100644 --- a/basis/compiler/tests/intrinsics.factor +++ b/basis/compiler/tests/intrinsics.factor @@ -339,7 +339,7 @@ ERROR: bug-in-fixnum* x y a b ; [ ] [ 10000 [ - 5 random iota [ drop 32 random-bits ] map product >bignum + 5 random [ drop 32 random-bits ] map product >bignum dup [ bignum>fixnum ] keep compiled-bignum>fixnum = [ drop ] [ "Oops" throw ] if ] times diff --git a/basis/compiler/tests/optimizer.factor b/basis/compiler/tests/optimizer.factor index 8565b91346..ca38939336 100644 --- a/basis/compiler/tests/optimizer.factor +++ b/basis/compiler/tests/optimizer.factor @@ -92,7 +92,7 @@ TUPLE: pred-test ; : double-label-2 ( a -- b ) dup array? [ ] [ ] if 0 t double-label-1 ; -[ 0 ] [ 10 iota double-label-2 ] unit-test +[ 0 ] [ 10 double-label-2 ] unit-test ! regression GENERIC: void-generic ( obj -- * ) @@ -337,7 +337,7 @@ TUPLE: some-tuple x ; [ 5 ] [ { 1 2 { 3 { 4 5 } } } deep-find-test ] unit-test [ f ] [ { 1 2 { 3 { 4 } } } deep-find-test ] unit-test -[ B{ 0 1 2 3 4 5 6 7 } ] [ [ 8 iota [ ] B{ } map-as ] compile-call ] unit-test +[ B{ 0 1 2 3 4 5 6 7 } ] [ [ 8 [ ] B{ } map-as ] compile-call ] unit-test [ 0 ] [ 1234 [ { fixnum } declare -64 shift ] compile-call ] unit-test diff --git a/basis/compiler/tests/redefine23.factor b/basis/compiler/tests/redefine23.factor index ad2090989e..40db63ef09 100644 --- a/basis/compiler/tests/redefine23.factor +++ b/basis/compiler/tests/redefine23.factor @@ -4,7 +4,7 @@ compiler.units vocabs tools.test specialized-arrays.private ; STRUCT: my-struct { x int } ; SPECIALIZED-ARRAY: my-struct -: my-word ( a -- b ) iota [ my-struct ] my-struct-array{ } map-as ; +: my-word ( a -- b ) [ my-struct ] my-struct-array{ } map-as ; [ ] [ [ diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index 7630a0e332..53a4ce8fda 100644 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -329,23 +329,23 @@ cell-bits 32 = [ ] unit-test { t } [ - [ { fixnum } declare iota [ drop ] each ] + [ { fixnum } declare [ drop ] each ] { < <-integer-fixnum +-integer-fixnum + } inlined? ] unit-test { t } [ - [ { fixnum } declare iota 0 [ + ] reduce ] + [ { fixnum } declare 0 [ + ] reduce ] { < <-integer-fixnum nth-unsafe } inlined? ] unit-test { f } [ - [ { fixnum } declare iota 0 [ + ] reduce ] + [ { fixnum } declare 0 [ + ] reduce ] \ +-integer-fixnum inlined? ] unit-test { t } [ [ - { integer } declare iota [ ] map + { integer } declare [ ] map ] \ integer>fixnum inlined? ] unit-test @@ -388,7 +388,7 @@ cell-bits 32 = [ { t } [ [ - { integer } declare iota [ 0 >= ] map + { integer } declare [ 0 >= ] map ] { >= fixnum>= } inlined? ] unit-test diff --git a/basis/compiler/tree/dead-code/branches/branches.factor b/basis/compiler/tree/dead-code/branches/branches.factor index fc03c85756..40e4081334 100644 --- a/basis/compiler/tree/dead-code/branches/branches.factor +++ b/basis/compiler/tree/dead-code/branches/branches.factor @@ -31,7 +31,7 @@ M: #branch remove-dead-code* pad-with-bottom >>phi-in-d drop ; : live-value-indices ( values -- indices ) - [ length iota ] keep live-values get + [ length ] keep live-values get '[ _ nth _ key? ] filter ; inline : drop-indexed-values ( values indices -- node ) diff --git a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor index 3cf0d2e836..96a7b36e71 100644 --- a/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor +++ b/basis/compiler/tree/modular-arithmetic/modular-arithmetic-tests.factor @@ -77,7 +77,7 @@ TUPLE: declared-fixnum { x fixnum } ; { t } [ [ - { fixnum } declare iota 0 swap + { fixnum } declare 0 swap [ drop 615949 * 797807 + 20 2^ rem dup 19 2^ - ] map @@ -98,7 +98,7 @@ TUPLE: declared-fixnum { x fixnum } ; { t } [ [ - { integer } declare iota [ 256 mod ] map + { integer } declare [ 256 mod ] map ] { mod fixnum-mod } inlined? ] unit-test @@ -134,7 +134,7 @@ TUPLE: declared-fixnum { x fixnum } ; { t } [ [ - { iota-tuple } declare [ 256 rem ] map + { iota } declare [ 256 rem ] map ] { mod fixnum-mod rem } inlined? ] unit-test diff --git a/basis/compiler/tree/propagation/transforms/transforms.factor b/basis/compiler/tree/propagation/transforms/transforms.factor index 67b0e5cba1..75f9de07e3 100644 --- a/basis/compiler/tree/propagation/transforms/transforms.factor +++ b/basis/compiler/tree/propagation/transforms/transforms.factor @@ -255,7 +255,7 @@ CONSTANT: lookup-table-at-max 256 } 1&& ; : lookup-table-seq ( assoc -- table ) - [ keys supremum 1 + iota ] keep '[ _ at ] { } map-as ; + [ keys supremum 1 + ] keep '[ _ at ] { } map-as ; : lookup-table-quot ( seq -- newquot ) lookup-table-seq diff --git a/basis/compression/huffman/huffman.factor b/basis/compression/huffman/huffman.factor index 03927e5a48..33d7b17f05 100644 --- a/basis/compression/huffman/huffman.factor +++ b/basis/compression/huffman/huffman.factor @@ -27,7 +27,7 @@ TUPLE: huffman-code :: all-patterns ( huffman-code n -- seq ) n log2 huffman-code size>> - :> free-bits free-bits 0 > - [ free-bits 2^ iota [ huffman-code code>> free-bits 2^ * + ] map ] + [ free-bits 2^ [ huffman-code code>> free-bits 2^ * + ] map ] [ huffman-code code>> free-bits neg 2^ /i 1array ] if ; :: huffman-each ( ... tdesc quot: ( ... huffman-code -- ... ) -- ... ) diff --git a/basis/compression/inflate/inflate.factor b/basis/compression/inflate/inflate.factor index 27e35daef8..400f02e0e2 100644 --- a/basis/compression/inflate/inflate.factor +++ b/basis/compression/inflate/inflate.factor @@ -59,7 +59,7 @@ CONSTANT: clen-shuffle { 16 17 18 0 8 7 9 6 10 5 11 4 12 3 13 2 14 1 15 } ] reduce [ dup array? [ second 0 ] [ 1array ] if ] map concat nip swap cut 2array - [ [ length>> iota ] [ ] bi get-table ] map ; + [ [ length>> ] [ ] bi get-table ] map ; MEMO: static-huffman-tables ( -- obj ) [ @@ -69,7 +69,7 @@ MEMO: static-huffman-tables ( -- obj ) 280 287 [a,b] length [ 8 ] replicate append ] append-outputs 0 31 [a,b] length [ 5 ] replicate 2array - [ [ length>> iota ] [ ] bi get-table ] map ; + [ [ length>> ] [ ] bi get-table ] map ; CONSTANT: length-table { diff --git a/basis/compression/lzw/lzw.factor b/basis/compression/lzw/lzw.factor index cb1d70c55e..7c9adc9c79 100755 --- a/basis/compression/lzw/lzw.factor +++ b/basis/compression/lzw/lzw.factor @@ -20,7 +20,7 @@ TUPLE: tiff-lzw < lzw ; TUPLE: gif-lzw < lzw ; : initial-uncompress-table ( size -- seq ) - iota [ 1vector ] V{ } map-as ; + [ 1vector ] V{ } map-as ; : reset-lzw-uncompress ( lzw -- lzw ) dup end-of-information-code>> 1 + initial-uncompress-table >>table diff --git a/basis/concurrency/combinators/combinators-tests.factor b/basis/concurrency/combinators/combinators-tests.factor index 54e343f88a..6e3a8eb8ab 100644 --- a/basis/concurrency/combinators/combinators-tests.factor +++ b/basis/concurrency/combinators/combinators-tests.factor @@ -17,12 +17,12 @@ IN: concurrency.combinators.tests [ error>> "Even" = ] must-fail-with { V{ 0 3 6 9 } } -[ 10 iota [ 3 mod zero? ] parallel-filter ] unit-test +[ 10 [ 3 mod zero? ] parallel-filter ] unit-test { 10 } [ V{ } clone - 10 iota over [ push ] curry parallel-each + 10 over [ push ] curry parallel-each length ] unit-test @@ -41,7 +41,7 @@ IN: concurrency.combinators.tests { 20 } [ V{ } clone - 10 iota 10 iota pick [ [ push ] [ push ] bi ] curry 2parallel-each + 10 10 iota pick [ [ push ] [ push ] bi ] curry 2parallel-each length ] unit-test diff --git a/basis/db/queries/queries.factor b/basis/db/queries/queries.factor index 7dafa8560e..00799950bf 100644 --- a/basis/db/queries/queries.factor +++ b/basis/db/queries/queries.factor @@ -34,7 +34,7 @@ SINGLETON: retryable ] 2map >>bind-params ; M: retryable execute-statement* ( statement type -- ) - drop [ retries>> iota ] [ + drop [ retries>> ] [ [ nip [ query-results dispose t ] diff --git a/basis/db/tester/tester.factor b/basis/db/tester/tester.factor index b8b00e52c6..ea89166e51 100644 --- a/basis/db/tester/tester.factor +++ b/basis/db/tester/tester.factor @@ -74,7 +74,7 @@ test-2 "TEST2" { test-2 ensure-table ] with-db ] [ - 10 iota [ + 10 [ drop 10 [ dup [ @@ -93,7 +93,7 @@ test-2 "TEST2" { ] [ [ [ - 10 iota [ + 10 [ 10 [ test-1-tuple insert-tuple yield ] times diff --git a/basis/fry/fry-tests.factor b/basis/fry/fry-tests.factor index dc77863673..a61afe7eac 100644 --- a/basis/fry/fry-tests.factor +++ b/basis/fry/fry-tests.factor @@ -65,7 +65,7 @@ SYMBOLS: a b c d e f g h ; { "hi" 3 } [ "h" "i" 3 [ append ] funny-dip ] unit-test { { 1 2 3 } } [ - 3 1 '[ _ iota [ _ + ] map ] call + 3 1 '[ _ [ _ + ] map ] call ] unit-test { { 1 { 2 { 3 } } } } [ diff --git a/basis/game/input/dinput/dinput.factor b/basis/game/input/dinput/dinput.factor index ca7c2502ec..f2aaff1656 100755 --- a/basis/game/input/dinput/dinput.factor +++ b/basis/game/input/dinput/dinput.factor @@ -315,7 +315,7 @@ CONSTANT: pov-values } case ; : fill-mouse-state ( buffer count -- state ) - iota [ +mouse-state+ get-global ] 2dip swap [ nth (fill-mouse-state) ] curry each ; + [ +mouse-state+ get-global ] 2dip swap [ nth (fill-mouse-state) ] curry each ; : get-device-state ( device DIJOYSTATE2 -- ) [ dup IDirectInputDevice8W::Poll check-ole32-error ] dip diff --git a/basis/game/input/gtk/gtk.factor b/basis/game/input/gtk/gtk.factor index b6fde1c85d..e2084a1515 100644 --- a/basis/game/input/gtk/gtk.factor +++ b/basis/game/input/gtk/gtk.factor @@ -84,7 +84,7 @@ M: linux x>hid-bit-order } ; inline : x-bits>hid-bits ( bit-array -- bit-array ) - 256 iota zip [ first ] filter values + 256 zip [ first ] filter values x>hid-bit-order [ nth ] curry map 256 swap [ t swap pick set-nth ] each ; diff --git a/basis/game/input/x11/x11.factor b/basis/game/input/x11/x11.factor index 44e3fda673..29b7249183 100644 --- a/basis/game/input/x11/x11.factor +++ b/basis/game/input/x11/x11.factor @@ -78,7 +78,7 @@ M: linux x>hid-bit-order } ; inline : x-bits>hid-bits ( bit-array -- bit-array ) - 256 iota [ 2array ] { } 2map-as [ first ] filter values + 256 [ 2array ] { } 2map-as [ first ] filter values x>hid-bit-order [ nth ] curry map 256 swap [ t swap pick set-nth ] each ; diff --git a/basis/generalizations/generalizations.factor b/basis/generalizations/generalizations.factor index 698d49bf79..37d4733d25 100644 --- a/basis/generalizations/generalizations.factor +++ b/basis/generalizations/generalizations.factor @@ -91,7 +91,7 @@ MACRO: spread* ( n -- quot ) MACRO: nspread* ( m n -- quot ) [ drop [ ] ] [ [ * 0 ] [ drop neg ] 2bi - rest >array dup length iota + rest >array dup length [ '[ [ [ _ ndip ] curry ] _ ndip ] ] 2map dup rest-slice [ [ compose ] compose ] map! drop @@ -122,7 +122,7 @@ MACRO: mnswap ( m n -- quot ) 1 + '[ _ -nrot ] swap '[ _ _ napply ] ; MACRO: nweave ( n -- quot ) - [ dup iota [ '[ _ _ mnswap ] ] with map ] keep + [ dup [ '[ _ _ mnswap ] ] with map ] keep '[ _ _ ncleave ] ; : nbi-curry ( n -- ) diff --git a/basis/grouping/grouping-docs.factor b/basis/grouping/grouping-docs.factor index 02accfcefb..83b6dcbdb9 100644 --- a/basis/grouping/grouping-docs.factor +++ b/basis/grouping/grouping-docs.factor @@ -89,7 +89,7 @@ HELP: { $examples { $example "USING: arrays kernel prettyprint sequences grouping ;" - "9 iota >array 3 " + "9 >array 3 " "dup [ reverse! drop ] each concat >array ." "{ 2 1 0 5 4 3 8 7 6 }" } diff --git a/basis/heaps/heaps-tests.factor b/basis/heaps/heaps-tests.factor index 7fa0d5fae0..49a0d31725 100644 --- a/basis/heaps/heaps-tests.factor +++ b/basis/heaps/heaps-tests.factor @@ -31,7 +31,7 @@ IN: heaps.tests [ heap-push-all ] keep heap-pop-all ; : random-alist ( n -- alist ) - iota [ + [ drop 32 random-bits dup number>string ] H{ } map>assoc >alist ; @@ -57,7 +57,7 @@ IN: heaps.tests : test-entry-indices ( n -- ? ) random-alist [ heap-push-all ] keep - data>> dup length iota swap [ index>> ] map sequence= ; + data>> dup length swap [ index>> ] map sequence= ; 14 [ [ t ] swap [ 2^ test-entry-indices ] curry unit-test diff --git a/basis/hints/hints.factor b/basis/hints/hints.factor index b5b41603d2..2cea955f07 100644 --- a/basis/hints/hints.factor +++ b/basis/hints/hints.factor @@ -24,7 +24,7 @@ M: object specializer-declaration class-of ; "specializer" word-prop ; : make-specializer ( specs -- quot ) - dup length iota + dup length [ (picker) 2array ] 2map [ drop object eq? ] assoc-reject [ [ t ] ] [ diff --git a/basis/images/images.factor b/basis/images/images.factor index a8439e5113..95b77e756e 100644 --- a/basis/images/images.factor +++ b/basis/images/images.factor @@ -171,7 +171,7 @@ PRIVATE> :: each-pixel ( ... image quot: ( ... x y pixel -- ... ) -- ... ) image dim>> first2 :> ( width height ) image bytes-per-pixel :> n - height width [ iota ] bi@ [| y x | + height width [ ] bi@ [| y x | y width * x + :> start start n * :> from from n + :> to diff --git a/basis/images/processing/processing.factor b/basis/images/processing/processing.factor index 4d33f4c260..cebb6ec522 100644 --- a/basis/images/processing/processing.factor +++ b/basis/images/processing/processing.factor @@ -6,7 +6,7 @@ math.ranges math.vectors sequences sequences.deep fry ; IN: images.processing : coord-matrix ( dim -- m ) - [ iota ] map first2 cartesian-product ; + [ ] map first2 cartesian-product ; : map^2 ( m quot -- m' ) '[ _ map ] map ; inline : each^2 ( m quot -- m' ) '[ _ each ] each ; inline diff --git a/basis/io/encodings/iso2022/iso2022.factor b/basis/io/encodings/iso2022/iso2022.factor index 1d96475841..9419293d16 100644 --- a/basis/io/encodings/iso2022/iso2022.factor +++ b/basis/io/encodings/iso2022/iso2022.factor @@ -18,7 +18,7 @@ SYMBOL: jis212 "vocab:io/encodings/iso2022/212.txt" load-codetable-file jis212 set-global SYMBOL: ascii -128 iota dup zip >biassoc ascii set-global +128 dup zip >biassoc ascii set-global TUPLE: iso2022-state type ; diff --git a/basis/io/files/unique/unique.factor b/basis/io/files/unique/unique.factor index 0fba9e4e19..93ad08cc7a 100644 --- a/basis/io/files/unique/unique.factor +++ b/basis/io/files/unique/unique.factor @@ -26,7 +26,7 @@ SYMBOL: unique-retries unique-length get random-string ; : retry ( quot: ( -- ? ) n -- ) - iota swap [ drop ] prepose attempt-all ; inline + swap [ drop ] prepose attempt-all ; inline PRIVATE> diff --git a/basis/io/ports/ports-tests.factor b/basis/io/ports/ports-tests.factor index d30bdaa6eb..4299209aa9 100644 --- a/basis/io/ports/ports-tests.factor +++ b/basis/io/ports/ports-tests.factor @@ -11,7 +11,7 @@ locals math namespaces sequences tools.test ; { } [ path binary [ [ - 100,000 iota + 100,000 0 100,000 int malloc-array &free [ copy ] keep write ] with-destructors @@ -20,7 +20,7 @@ locals math namespaces sequences tools.test ; { t } [ path binary [ - 100,000 4 * read int cast-array 100,000 iota sequence= + 100,000 4 * read int cast-array 100,000 sequence= ] with-file-reader ] unit-test diff --git a/basis/io/sockets/secure/openssl/openssl.factor b/basis/io/sockets/secure/openssl/openssl.factor index 4aec171ae3..413d323aee 100644 --- a/basis/io/sockets/secure/openssl/openssl.factor +++ b/basis/io/sockets/secure/openssl/openssl.factor @@ -338,7 +338,7 @@ M: ssl-handle dispose* X509_get_issuer_name x509name>string ; : name-stack>sequence ( name-stack -- seq ) - dup sk_num iota [ sk_value GENERAL_NAME_st memory>struct ] with map ; + dup sk_num [ sk_value GENERAL_NAME_st memory>struct ] with map ; : alternative-dns-names ( certificate -- dns-names ) NID_subject_alt_name f f X509_get_ext_d2i diff --git a/basis/io/styles/styles-docs.factor b/basis/io/styles/styles-docs.factor index 1cffdf8532..ecc72ae65b 100644 --- a/basis/io/styles/styles-docs.factor +++ b/basis/io/styles/styles-docs.factor @@ -206,7 +206,7 @@ HELP: foreground { $examples { $code "USING: colors.gray io.styles hashtables sequences kernel math ;" - "10 iota [" + "10 [" " \"Hello world\\n\"" " swap 10 / 1 foreground associate format" "] each" @@ -218,7 +218,7 @@ HELP: background { $examples { $code "USING: colors hashtables io io.styles kernel math sequences ;" - "10 iota [" + "10 [" " \"Hello world\\n\"" " swap 10 / 1 over - over 1 " " background associate format" diff --git a/basis/lcs/lcs.factor b/basis/lcs/lcs.factor index 7c0b62224c..fc7589209a 100644 --- a/basis/lcs/lcs.factor +++ b/basis/lcs/lcs.factor @@ -20,15 +20,15 @@ TYPED:: loop-step ( i j matrix: array old new step -- ) i 1 + j 1 + matrix nth-unsafe set-nth-unsafe ; inline : lcs-initialize ( |str1| |str2| -- matrix ) - iota [ drop 0 ] with map ; + [ drop 0 ] with map ; : levenshtein-initialize ( |str1| |str2| -- matrix ) - [ iota ] bi@ [ [ + ] curry map ] with map ; + [ ] bi@ [ [ + ] curry map ] with map ; :: run-lcs ( old new init step -- matrix ) old length 1 + new length 1 + init call :> matrix - old length iota [| i | - new length iota [| j | + old length [| i | + new length [| j | i j matrix old new step loop-step ] each ] each matrix ; inline diff --git a/basis/macros/expander/expander.factor b/basis/macros/expander/expander.factor index 73d8765735..812d1b9c92 100644 --- a/basis/macros/expander/expander.factor +++ b/basis/macros/expander/expander.factor @@ -42,7 +42,7 @@ M: wrapper expand-macros* wrapped>> literal ; stack get pop end [ [ expand-macros ] [ ] map-as '[ _ dip ] % ] [ - length iota [ ] keep + length [ ] keep [ '[ _ ndrop _ nnip call ] [ ] like ] 2map , \ dispatch , ] bi ; diff --git a/basis/math/bitwise/bitwise.factor b/basis/math/bitwise/bitwise.factor index 658d3586e0..b5e3f3816c 100644 --- a/basis/math/bitwise/bitwise.factor +++ b/basis/math/bitwise/bitwise.factor @@ -83,7 +83,7 @@ DEFER: byte-bit-count << \ byte-bit-count -256 iota [ +256 [ 8 0 [ [ 1 + ] when ] reduce ] B{ } map-as '[ 0xff bitand _ nth-unsafe ] ( byte -- table ) define-declared diff --git a/basis/math/combinatorics/combinatorics-docs.factor b/basis/math/combinatorics/combinatorics-docs.factor index 7523bffb24..f178f8cc2f 100644 --- a/basis/math/combinatorics/combinatorics-docs.factor +++ b/basis/math/combinatorics/combinatorics-docs.factor @@ -73,7 +73,7 @@ HELP: combination { $notes "Combinations are 0-based and a bounds error will be thrown if " { $snippet "m" } " is larger than " { $snippet "seq length k nCk" } "." } { $examples { $example "USING: math.combinatorics sequences prettyprint ;" - "6 7 iota 4 combination ." "{ 0 1 3 6 }" } + "6 7 4 combination ." "{ 0 1 3 6 }" } { $example "USING: math.combinatorics prettyprint ;" "0 { \"a\" \"b\" \"c\" \"d\" } 2 combination ." "{ \"a\" \"b\" }" } } ; diff --git a/basis/math/combinatorics/combinatorics-tests.factor b/basis/math/combinatorics/combinatorics-tests.factor index e7dd416468..55fca4b72b 100644 --- a/basis/math/combinatorics/combinatorics-tests.factor +++ b/basis/math/combinatorics/combinatorics-tests.factor @@ -30,9 +30,9 @@ IN: math.combinatorics.tests { { 0 1 3 2 } } [ { 0 0 1 0 } >permutation ] unit-test { { 1 2 0 6 3 5 4 } } [ { 1 1 0 3 0 1 0 } >permutation ] unit-test -{ { 0 1 2 3 } } [ 0 4 iota permutation-indices ] unit-test -{ { 0 1 3 2 } } [ 1 4 iota permutation-indices ] unit-test -{ { 1 2 0 6 3 5 4 } } [ 859 7 iota permutation-indices ] unit-test +{ { 0 1 2 3 } } [ 0 4 permutation-indices ] unit-test +{ { 0 1 3 2 } } [ 1 4 permutation-indices ] unit-test +{ { 1 2 0 6 3 5 4 } } [ 859 7 permutation-indices ] unit-test { { "a" "b" "c" "d" } } [ 0 { "a" "b" "c" "d" } permutation ] unit-test { { "d" "c" "b" "a" } } [ 23 { "a" "b" "c" "d" } permutation ] unit-test @@ -102,7 +102,7 @@ IN: math.combinatorics.tests { { 2 1 3 } } [ { 1 2 3 } [ first 2 = ] find-permutation ] unit-test { { { 0 1 2 } { 0 2 1 } { 1 0 2 } { 1 2 0 } { 2 0 1 } { 2 1 0 } } } -[ 3 iota >array ] unit-test +[ 3 >array ] unit-test { { "as" "ad" "af" "sa" "sd" "sf" "da" "ds" "df" "fa" "fs" "fd" } } [ "asdf" 2 >array ] unit-test diff --git a/basis/math/combinatorics/combinatorics.factor b/basis/math/combinatorics/combinatorics.factor index efa2d2ee07..b1a1a21f71 100644 --- a/basis/math/combinatorics/combinatorics.factor +++ b/basis/math/combinatorics/combinatorics.factor @@ -17,7 +17,7 @@ GENERIC: nths-unsafe ( indices seq -- seq' ) M: string nths-unsafe (nths-unsafe) ; M: array nths-unsafe (nths-unsafe) ; M: vector nths-unsafe (nths-unsafe) ; -M: iota-tuple nths-unsafe (nths-unsafe) ; +M: iota nths-unsafe (nths-unsafe) ; M: object nths-unsafe (nths-unsafe) ; : possible? ( n m -- ? ) @@ -57,8 +57,8 @@ MEMO: factorial ( n -- n! ) : permutation-indices ( n seq -- permutation ) length [ factoradic ] dip 0 pad-head >permutation ; -: permutation-iota ( seq -- iota ) - length factorial iota ; inline +: permutation-iota ( seq -- ) + length factorial ; inline PRIVATE> @@ -101,7 +101,7 @@ DEFER: next-permutation array ] [ ] tri ] dip + [ [ permutation-iota ] [ length >array ] [ ] tri ] dip '[ drop _ [ _ nths-unsafe @ ] keep next-permutation drop ] ; inline PRIVATE> @@ -216,7 +216,7 @@ INSTANCE: combinations immutable-sequence :: combinations-quot ( seq k quot -- seq quot' ) seq length :> n - n k nCk iota k iota >array seq quot n + n k nCk k iota >array seq quot n '[ drop _ [ _ nths-unsafe @ ] keep _ next-combination drop ] ; inline PRIVATE> diff --git a/basis/math/functions/functions.factor b/basis/math/functions/functions.factor index ce061ae4dc..26c5bbfc50 100644 --- a/basis/math/functions/functions.factor +++ b/basis/math/functions/functions.factor @@ -373,7 +373,7 @@ M: float round dup sgn 2 /f + truncate ; : roots ( x t -- seq ) [ [ log ] [ recip ] bi* * e^ ] [ recip 2pi * 0 swap complex boa e^ ] - [ iota [ ^ * ] 2with map ] tri ; + [ [ ^ * ] 2with map ] tri ; : sigmoid ( x -- y ) neg e^ 1 + recip ; inline diff --git a/basis/math/intervals/intervals-tests.factor b/basis/math/intervals/intervals-tests.factor index e729b232bd..b3ddf4c853 100644 --- a/basis/math/intervals/intervals-tests.factor +++ b/basis/math/intervals/intervals-tests.factor @@ -322,7 +322,7 @@ unary-ops [ ] if ; binary-ops [ - [ [ t ] ] dip '[ 8000 iota [ drop _ binary-test ] all? ] unit-test + [ [ t ] ] dip '[ 8000 [ drop _ binary-test ] all? ] unit-test ] each : comparison-ops ( -- alist ) @@ -339,7 +339,7 @@ binary-ops [ second execute( a b -- ? ) dup incomparable eq? [ 2drop t ] [ = ] if ; comparison-ops [ - [ [ t ] ] dip '[ 8000 iota [ drop _ comparison-test ] all? ] unit-test + [ [ t ] ] dip '[ 8000 [ drop _ comparison-test ] all? ] unit-test ] each { t } [ -10 10 [a,b] 0 100 [a,b] assume> 0 10 (a,b] = ] unit-test @@ -377,7 +377,7 @@ comparison-ops [ commutative-ops [ [ [ t ] ] dip '[ - 8000 iota [ + 8000 [ drop random-interval-or-empty random-interval-or-empty _ [ execute ] [ swapd execute ] 3bi = diff --git a/basis/math/matrices/elimination/elimination.factor b/basis/math/matrices/elimination/elimination.factor index 176a140d4f..d9117f023f 100644 --- a/basis/math/matrices/elimination/elimination.factor +++ b/basis/math/matrices/elimination/elimination.factor @@ -42,7 +42,7 @@ SYMBOL: matrix [ [ clear-scale ] 2keep [ n*v ] dip v+ ] change-row ; : rows-from ( row# -- slice ) - rows dup iota ; + rows dup ; : clear-col ( col# row# rows -- ) [ nth-row ] dip [ [ 2dup ] dip (clear-col) ] each 2drop ; @@ -79,9 +79,9 @@ SYMBOL: matrix : reduced ( matrix' -- matrix'' ) [ - rows iota [ + rows [ dup nth-row leading drop - [ swap dup iota clear-col ] [ drop ] if* + [ swap dup clear-col ] [ drop ] if* ] each ] with-matrix ; diff --git a/basis/math/matrices/matrices.factor b/basis/math/matrices/matrices.factor index d1894108c0..55105965a5 100644 --- a/basis/math/matrices/matrices.factor +++ b/basis/math/matrices/matrices.factor @@ -24,22 +24,22 @@ IN: math.matrices 1 diagonal-matrix ; inline : eye ( m n k -- matrix ) - [ [ iota ] bi@ ] dip neg '[ _ + = 1 0 ? ] cartesian-map ; + [ [ ] bi@ ] dip neg '[ _ + = 1 0 ? ] cartesian-map ; : hilbert-matrix ( m n -- matrix ) - [ iota ] bi@ [ + 1 + recip ] cartesian-map ; + [ ] bi@ [ + 1 + recip ] cartesian-map ; : toeplitz-matrix ( n -- matrix ) - iota dup [ - abs 1 + ] cartesian-map ; + dup [ - abs 1 + ] cartesian-map ; : hankel-matrix ( n -- matrix ) - [ iota dup ] keep '[ + abs 1 + dup _ > [ drop 0 ] when ] cartesian-map ; + [ dup ] keep '[ + abs 1 + dup _ > [ drop 0 ] when ] cartesian-map ; : box-matrix ( r -- matrix ) 2 * 1 + dup '[ _ 1 ] replicate ; : vandermonde-matrix ( u n -- matrix ) - iota [ v^n ] with map reverse flip ; + [ v^n ] with map reverse flip ; :: rotation-matrix3 ( axis theta -- matrix ) theta cos :> c @@ -207,10 +207,10 @@ ERROR: negative-power-matrix m n ; '[ _ map ] map ; inline : column-map ( matrix quot -- seq ) - [ [ first length iota ] keep ] dip '[ _ col @ ] map ; inline + [ [ first length ] keep ] dip '[ _ col @ ] map ; inline : cartesian-square-indices ( n -- matrix ) - iota dup cartesian-product ; inline + dup cartesian-product ; inline : cartesian-matrix-map ( matrix quot -- matrix' ) [ [ first length cartesian-square-indices ] keep ] dip @@ -227,17 +227,17 @@ ERROR: negative-power-matrix m n ; : sample-cov-matrix ( matrix -- cov ) 1 cov-matrix-ddof ; inline GENERIC: square-rows ( object -- matrix ) -M: integer square-rows iota square-rows ; +M: integer square-rows square-rows ; M: sequence square-rows [ length ] keep >array '[ _ clone ] { } replicate-as ; GENERIC: square-cols ( object -- matrix ) -M: integer square-cols iota square-cols ; +M: integer square-cols square-cols ; M: sequence square-cols [ length ] keep [ ] with { } map-as ; : make-matrix-with-indices ( m n quot -- matrix ) - [ [ iota ] bi@ ] dip '[ @ ] cartesian-map ; inline + [ [ ] bi@ ] dip '[ @ ] cartesian-map ; inline : null-matrix? ( matrix -- ? ) empty? ; inline @@ -255,7 +255,7 @@ M: sequence square-cols { [ well-formed-matrix? ] [ dim all-eq? ] } 1&& ; : matrix-coordinates ( dim -- coordinates ) - first2 [ iota ] bi@ cartesian-product ; inline + first2 [ ] bi@ cartesian-product ; inline : dimension-range ( matrix -- dim range ) dim [ matrix-coordinates ] [ first [1,b] ] bi ; diff --git a/basis/math/polynomials/polynomials.factor b/basis/math/polynomials/polynomials.factor index b2ce6945f2..5312804ff2 100644 --- a/basis/math/polynomials/polynomials.factor +++ b/basis/math/polynomials/polynomials.factor @@ -33,7 +33,7 @@ ALIAS: n*p n*v : p* ( p q -- r ) 2unempty pextend-conv - [ drop length [ iota ] keep ] + [ drop length [ ] keep ] [ nip ] [ drop ] 2tri '[ _ _ _ v* sum ] map reverse! ; @@ -86,7 +86,7 @@ PRIVATE> [ V{ 0 } clone V{ 1 } clone ] 2dip swap (pgcd) [ >array ] bi@ ; : pdiff ( p -- p' ) - dup length iota v* rest ; + dup length v* rest ; : polyval ( x p -- p[x] ) ! Horner scheme diff --git a/basis/math/primes/miller-rabin/miller-rabin-tests.factor b/basis/math/primes/miller-rabin/miller-rabin-tests.factor index 7121b67079..29b515fc9f 100644 --- a/basis/math/primes/miller-rabin/miller-rabin-tests.factor +++ b/basis/math/primes/miller-rabin/miller-rabin-tests.factor @@ -8,4 +8,4 @@ IN: math.primes.miller-rabin.tests { t } [ 37 miller-rabin ] unit-test { t } [ 2135623355842621559 miller-rabin ] unit-test -{ f } [ 1000 iota [ drop 15 miller-rabin ] any? ] unit-test +{ f } [ 1000 [ drop 15 miller-rabin ] any? ] unit-test diff --git a/basis/math/primes/miller-rabin/miller-rabin.factor b/basis/math/primes/miller-rabin/miller-rabin.factor index f46af20249..94707c990d 100644 --- a/basis/math/primes/miller-rabin/miller-rabin.factor +++ b/basis/math/primes/miller-rabin/miller-rabin.factor @@ -10,13 +10,13 @@ IN: math.primes.miller-rabin n 1 - :> n-1 n-1 factor-2s :> ( r s ) 0 :> a! - trials iota [ + trials [ drop 2 n 2 - [a,b] random a! a s n ^mod 1 = [ f ] [ - r iota [ + r [ 2^ s * a swap n ^mod n-1 = ] any? not ] if diff --git a/basis/math/statistics/statistics-tests.factor b/basis/math/statistics/statistics-tests.factor index 8602a3148e..60ce318097 100644 --- a/basis/math/statistics/statistics-tests.factor +++ b/basis/math/statistics/statistics-tests.factor @@ -183,7 +183,7 @@ IN: math.statistics.tests { { 0 0 0 } } [ { 1 1 1 } standardize ] unit-test -{ { 0 1/4 1/2 3/4 1 } } [ 5 iota rescale ] unit-test +{ { 0 1/4 1/2 3/4 1 } } [ 5 rescale ] unit-test { diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index cefe886b72..7f65078fd9 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -469,7 +469,7 @@ simd-classes [ [ [ { } ] ] dip [ new length shuffles-for ] keep '[ - _ [ [ _ new [ length iota ] keep like 1quotation ] dip '[ _ vshuffle ] ] + _ [ [ _ new [ length ] keep like 1quotation ] dip '[ _ vshuffle ] ] [ = ] check-optimizer ] unit-test ] each @@ -480,7 +480,7 @@ simd-classes [ '[ _ [ [ _ new - [ [ length iota ] keep like ] + [ [ length ] keep like ] [ [ length dup dup + [a,b) ] keep like ] bi [ ] 2sequence ] dip '[ _ vshuffle2-elements ] ] [ = ] check-optimizer @@ -567,7 +567,7 @@ TUPLE: inconsistent-vector-test bool branch ; ! Test element access -- it should box bignums for int-4 on x86 : test-accesses ( seq -- failures ) - [ length iota dup [ >bignum ] map append ] keep + [ length dup [ >bignum ] map append ] keep '[ [ _ 1quotation ] dip '[ _ swap nth ] ] [ = ] check-optimizer ; inline { { } } [ float-4{ 1.0 2.0 3.0 4.0 } test-accesses ] unit-test @@ -584,7 +584,7 @@ TUPLE: inconsistent-vector-test bool branch ; "== Checking broadcast" print : test-broadcast ( seq -- failures ) - [ length iota >array ] keep + [ length >array ] keep '[ [ _ 1quotation ] dip '[ _ vbroadcast ] ] [ = ] check-optimizer ; { { } } [ float-4{ 1.0 2.0 3.0 4.0 } test-broadcast ] unit-test diff --git a/basis/nibble-arrays/nibble-arrays-tests.factor b/basis/nibble-arrays/nibble-arrays-tests.factor index 68c161e1f2..77610111da 100644 --- a/basis/nibble-arrays/nibble-arrays-tests.factor +++ b/basis/nibble-arrays/nibble-arrays-tests.factor @@ -3,6 +3,6 @@ IN: nibble-arrays.tests [ -1 ] [ T{ bad-array-length f -1 } = ] must-fail-with -{ t } [ 16 iota dup >nibble-array sequence= ] unit-test +{ t } [ 16 dup >nibble-array sequence= ] unit-test { N{ 4 2 1 3 } } [ N{ 3 1 2 4 } reverse ] unit-test { N{ 1 4 9 0 9 4 } } [ N{ 1 2 3 4 5 6 } [ sq ] map ] unit-test diff --git a/basis/persistent/vectors/vectors-tests.factor b/basis/persistent/vectors/vectors-tests.factor index 0a2e9e1645..7a0f13a484 100644 --- a/basis/persistent/vectors/vectors-tests.factor +++ b/basis/persistent/vectors/vectors-tests.factor @@ -18,14 +18,14 @@ vectors math math.order ; ] unit-test { 100 1060 2000 10000 100000 1000000 } [ - [ t ] swap [ iota dup >persistent-vector sequence= ] curry unit-test + [ t ] swap [ dup >persistent-vector sequence= ] curry unit-test ] each { } [ 10000 [ 16 random-bits ] PV{ } replicate-as "1" set ] unit-test { } [ "1" get >vector "2" set ] unit-test { t } [ - 3000 iota [ + 3000 [ drop 16 random-bits 10000 random [ "1" [ new-nth ] change ] @@ -56,11 +56,11 @@ vectors math math.order ; ] unit-test { t } [ - 10000 iota >persistent-vector 752 [ ppop ] times dup length iota sequence= + 10000 >persistent-vector 752 [ ppop ] times dup length iota sequence= ] unit-test { t } [ - 100 iota [ + 100 [ drop 100 random [ 16 random-bits [ "1" [ ppush ] change ] [ "2" get push ] bi diff --git a/basis/porter-stemmer/porter-stemmer.factor b/basis/porter-stemmer/porter-stemmer.factor index e3cb186bf8..4214e67cd0 100644 --- a/basis/porter-stemmer/porter-stemmer.factor +++ b/basis/porter-stemmer/porter-stemmer.factor @@ -36,7 +36,7 @@ IN: porter-stemmer [ 0 0 ] dip skip-consonants (consonant-seq) ; : stem-vowel? ( str -- ? ) - [ length iota ] keep [ consonant? ] curry all? not ; + [ length ] keep [ consonant? ] curry all? not ; : double-consonant? ( i str -- ? ) over 1 < [ diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 8ba11bdf76..b98acc9374 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -457,12 +457,12 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ; ] unit-test { "{ 0 1 2 3 4 }" } [ - [ 5 length-limit [ 5 iota >array pprint ] with-variable ] + [ 5 length-limit [ 5 >array pprint ] with-variable ] with-string-writer ] unit-test { "{ 0 1 2 3 ~2 more~ }" } [ - [ 5 length-limit [ 6 iota >array pprint ] with-variable ] + [ 5 length-limit [ 6 >array pprint ] with-variable ] with-string-writer ] unit-test diff --git a/basis/prettyprint/sections/sections.factor b/basis/prettyprint/sections/sections.factor index 8a37a6b720..6ad8f49df0 100644 --- a/basis/prettyprint/sections/sections.factor +++ b/basis/prettyprint/sections/sections.factor @@ -325,7 +325,7 @@ SYMBOL: next : group-flow ( seq -- newseq ) [ - dup length iota [ + dup length [ 2dup 1 - swap ?nth prev namespaces:set 2dup 1 + swap ?nth next namespaces:set swap nth dup split-before dup , split-after diff --git a/basis/random/random-tests.factor b/basis/random/random-tests.factor index 2c1d6d53b8..8ab979019b 100644 --- a/basis/random/random-tests.factor +++ b/basis/random/random-tests.factor @@ -11,8 +11,8 @@ IN: random.tests { 2 } [ V{ 10 20 30 } [ delete-random drop ] keep length ] unit-test [ V{ } [ delete-random drop ] keep length ] must-fail -{ t } [ 10000 [ iota 0 [ drop 187 random + ] reduce ] keep / 2 * 187 10 ~ ] unit-test -{ t } [ 10000 [ iota 0 [ drop 400 random + ] reduce ] keep / 2 * 400 10 ~ ] unit-test +{ t } [ 10000 [ 0 [ drop 187 random + ] reduce ] keep / 2 * 187 10 ~ ] unit-test +{ t } [ 10000 [ 0 [ drop 400 random + ] reduce ] keep / 2 * 400 10 ~ ] unit-test { t } [ 1000 [ 400 random ] replicate members length 256 > ] unit-test @@ -29,7 +29,7 @@ IN: random.tests [ { 1 2 } 3 sample ] [ too-many-samples? ] must-fail-with { 3 } [ { 1 2 3 4 } 3 sample members length ] unit-test -{ 99 } [ 100 iota 99 sample members length ] unit-test +{ 99 } [ 100 99 sample members length ] unit-test { } [ [ 100 random-bytes ] with-system-random drop ] unit-test diff --git a/basis/random/random.factor b/basis/random/random.factor index 37e05bb6aa..cbc9e6dc0b 100644 --- a/basis/random/random.factor +++ b/basis/random/random.factor @@ -128,7 +128,7 @@ ERROR: too-many-samples seq n ; : sample ( seq n -- seq' ) 2dup [ length ] dip < [ too-many-samples ] when - [ [ length iota >array ] dip [ randomize-n-last ] keep tail-slice* ] + [ [ length >array ] dip [ randomize-n-last ] keep tail-slice* ] [ drop ] 2bi nths-unsafe ; : delete-random ( seq -- elt ) diff --git a/basis/random/sfmt/sfmt.factor b/basis/random/sfmt/sfmt.factor index 6e9605f220..f4a50cde72 100644 --- a/basis/random/sfmt/sfmt.factor +++ b/basis/random/sfmt/sfmt.factor @@ -66,7 +66,7 @@ M:: sfmt generate ( sfmt -- ) state n>> :> n state mask>> :> mask - n m - >fixnum iota [| i | + n m - >fixnum [| i | i array nth-unsafe i m + array nth-unsafe mask state r1>> state r2>> formula :> r @@ -77,7 +77,7 @@ M:: sfmt generate ( sfmt -- ) ] each ! n m - 1 + n [a,b) [ - m 1 - iota [ + m 1 - [ n m - 1 + + >fixnum :> i i array nth-unsafe m n - i + array nth-unsafe diff --git a/basis/regexp/disambiguate/disambiguate.factor b/basis/regexp/disambiguate/disambiguate.factor index cb5eb954ee..4b952a7d1c 100644 --- a/basis/regexp/disambiguate/disambiguate.factor +++ b/basis/regexp/disambiguate/disambiguate.factor @@ -11,7 +11,7 @@ TUPLE: parts in out ; zip [ first ] partition [ values ] bi@ parts boa ; : powerset-partition ( sequence -- partitions ) - [ length [ 2^ iota ] keep ] keep '[ _ _ make-partition ] map rest ; + [ length [ 2^ ] keep ] keep '[ _ _ make-partition ] map rest ; : partition>class ( parts -- class ) [ out>> [ ] map ] diff --git a/basis/sequences/generalizations/generalizations.factor b/basis/sequences/generalizations/generalizations.factor index d0feb06063..e15796c9b5 100644 --- a/basis/sequences/generalizations/generalizations.factor +++ b/basis/sequences/generalizations/generalizations.factor @@ -22,7 +22,7 @@ MACRO: firstn ( n -- quot ) MACRO: set-firstn-unsafe ( n -- quot ) [ 1 + ] - [ iota [ '[ _ rot [ set-nth-unsafe ] keep ] ] map ] bi + [ [ '[ _ rot [ set-nth-unsafe ] keep ] ] map ] bi '[ _ -nrot _ spread drop ] ; MACRO: set-firstn ( n -- quot ) diff --git a/basis/sequences/unrolled/unrolled.factor b/basis/sequences/unrolled/unrolled.factor index ad28dde00d..2353dcbe96 100644 --- a/basis/sequences/unrolled/unrolled.factor +++ b/basis/sequences/unrolled/unrolled.factor @@ -9,7 +9,7 @@ IN: sequences.unrolled swap '[ _ call( i -- ) ] each-integer ; << \ (unrolled-each-integer) [ - iota [ '[ _ swap call( i -- ) ] ] [ ] map-as '[ _ cleave ] + [ '[ _ swap call( i -- ) ] ] [ ] map-as '[ _ cleave ] ] 1 define-partial-eval >> : (unrolled-collect) ( quot into -- quot' ) @@ -95,4 +95,4 @@ PRIVATE> 4 npick unrolled-2map-as ; inline : unrolled-map-index ( seq len quot: ( x i -- newx ) -- newseq ) - [ dup length iota ] 2dip unrolled-2map ; inline + [ dup length ] 2dip unrolled-2map ; inline diff --git a/basis/specialized-arrays/specialized-arrays-docs.factor b/basis/specialized-arrays/specialized-arrays-docs.factor index 9dc02de976..1be89a4e6d 100644 --- a/basis/specialized-arrays/specialized-arrays-docs.factor +++ b/basis/specialized-arrays/specialized-arrays-docs.factor @@ -107,7 +107,7 @@ ARTICLE: "specialized-array-examples" "Specialized array examples" { $code "1.0 [ sin ] [ cos ] [ tan ] tri float-array{ } 3sequence ." } "Create a float array and sum the elements:" { $code - "1000 iota [ 1000 /f pi * sin ] float-array{ } map-as" + "1000 [ 1000 /f pi * sin ] float-array{ } map-as" "0.0 [ + ] reduce ." } ; diff --git a/basis/stack-checker/stack-checker-tests.factor b/basis/stack-checker/stack-checker-tests.factor index 5426b773b2..93a3957dc3 100644 --- a/basis/stack-checker/stack-checker-tests.factor +++ b/basis/stack-checker/stack-checker-tests.factor @@ -459,7 +459,7 @@ DEFER: eee' ] [ 4drop ] if ; inline recursive : recursive-reduce ( seq i quot: ( prev elt -- next ) -- result ) swapd [ 0 ] 2dip over length (recursive-reduce) ; inline -{ 24995000 } [ 10000 iota 0 [ dup even? [ + ] [ drop ] if ] recursive-reduce ] unit-test +{ 24995000 } [ 10000 0 [ dup even? [ + ] [ drop ] if ] recursive-reduce ] unit-test { 3 1 } [ [ member? [ 1 + ] when ] curry recursive-reduce ] must-infer-as [ [ [ write write ] each ] infer ] [ unbalanced-branches-error? ] must-fail-with diff --git a/basis/suffix-arrays/suffix-arrays.factor b/basis/suffix-arrays/suffix-arrays.factor index 92c3fa2921..a5200f77d3 100644 --- a/basis/suffix-arrays/suffix-arrays.factor +++ b/basis/suffix-arrays/suffix-arrays.factor @@ -7,7 +7,7 @@ IN: suffix-arrays [ tail-slice ] with map ; : prefix<=> ( begin seq -- <=> ) [ <=> ] [ swap head? ] 2bi [ drop +eq+ ] when ; diff --git a/basis/threads/threads-docs.factor b/basis/threads/threads-docs.factor index 94e03064d6..43b7e8e61a 100644 --- a/basis/threads/threads-docs.factor +++ b/basis/threads/threads-docs.factor @@ -184,7 +184,7 @@ $nl ! Don't use $example below: it won't pass help-lint. { $code "USING: math.parser threads ;" - "[ 10 iota [ number>string write nl yield ] each ] \"test\" spawn drop" + "[ 10 [ number>string write nl yield ] each ] \"test\" spawn drop" "10 [ yield ] times" "0" "1" diff --git a/basis/threads/threads-tests.factor b/basis/threads/threads-tests.factor index 6cbe48605f..5d9ef155f2 100644 --- a/basis/threads/threads-tests.factor +++ b/basis/threads/threads-tests.factor @@ -44,7 +44,7 @@ yield { f } [ f get-global ] unit-test { { 0 3 6 9 12 15 18 21 24 27 } } [ - 10 iota [ + 10 [ 0 "i" tset [ "i" [ yield 3 + ] tchange diff --git a/basis/tools/deploy/windows/ico/ico.factor b/basis/tools/deploy/windows/ico/ico.factor index e656597a38..aa706c8b9d 100755 --- a/basis/tools/deploy/windows/ico/ico.factor +++ b/basis/tools/deploy/windows/ico/ico.factor @@ -47,7 +47,7 @@ STRUCT: group-directory-entry ico-header heap-size bytes header ImageCount>> ico-directory-entry :> directory - directory dup length iota [ ico>group-directory-entry ] { } 2map-as + directory dup length [ ico>group-directory-entry ] { } 2map-as :> group-directory directory [ bytes ico-icon ] { } map-as :> icon-bytes diff --git a/basis/tools/hexdump/hexdump-tests.factor b/basis/tools/hexdump/hexdump-tests.factor index 845462132f..ff1cb85bc0 100644 --- a/basis/tools/hexdump/hexdump-tests.factor +++ b/basis/tools/hexdump/hexdump-tests.factor @@ -4,7 +4,7 @@ IN: tools.hexdump.tests { t } [ B{ } hexdump "Length: 0, 0h\n" = ] unit-test { t } [ "abcdefghijklmnopqrstuvwxyz" >byte-array hexdump "Length: 26, 1ah\n00000000h: 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop\n00000010h: 71 72 73 74 75 76 77 78 79 7a qrstuvwxyz\n" = ] unit-test -{ t } [ 256 iota [ ] B{ } map-as hexdump "Length: 256, 100h\n00000000h: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................\n00000010h: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f ................\n00000020h: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f !\"#$%&'()*+,-./\n00000030h: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 0123456789:;<=>?\n00000040h: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @ABCDEFGHIJKLMNO\n00000050h: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f PQRSTUVWXYZ[\\]^_\n00000060h: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f `abcdefghijklmno\n00000070h: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f pqrstuvwxyz{|}~.\n00000080h: 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f ................\n00000090h: 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f ................\n000000a0h: a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af ................\n000000b0h: b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf ................\n000000c0h: c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf ................\n000000d0h: d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df ................\n000000e0h: e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef ................\n000000f0h: f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff ................\n" = ] unit-test +{ t } [ 256 [ ] B{ } map-as hexdump "Length: 256, 100h\n00000000h: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................\n00000010h: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f ................\n00000020h: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f !\"#$%&'()*+,-./\n00000030h: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 0123456789:;<=>?\n00000040h: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f @ABCDEFGHIJKLMNO\n00000050h: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f PQRSTUVWXYZ[\\]^_\n00000060h: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f `abcdefghijklmno\n00000070h: 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f pqrstuvwxyz{|}~.\n00000080h: 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f ................\n00000090h: 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f ................\n000000a0h: a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af ................\n000000b0h: b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf ................\n000000c0h: c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf ................\n000000d0h: d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df ................\n000000e0h: e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef ................\n000000f0h: f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff ................\n" = ] unit-test { diff --git a/basis/tools/profiler/sampling/sampling-tests.factor b/basis/tools/profiler/sampling/sampling-tests.factor index ac5cd5fd6f..58ebf0cddf 100644 --- a/basis/tools/profiler/sampling/sampling-tests.factor +++ b/basis/tools/profiler/sampling/sampling-tests.factor @@ -17,8 +17,8 @@ TUPLE: boom ; { } [ 10 [ [ 100 [ 1000 random (byte-array) drop ] times compact-gc ] profile ] times ] unit-test { } [ 2 [ [ 1 seconds sleep ] profile ] times ] unit-test -{ } [ [ 300,000 iota [ sq sq sq ] map drop ] profile flat profile. ] unit-test -{ } [ [ 300,000 iota [ sq sq sq ] map drop ] profile top-down profile. ] unit-test +{ } [ [ 300,000 [ sq sq sq ] map drop ] profile flat profile. ] unit-test +{ } [ [ 300,000 [ sq sq sq ] map drop ] profile top-down profile. ] unit-test f raw-profile-data set-global gc diff --git a/basis/tools/scaffold/scaffold-tests.factor b/basis/tools/scaffold/scaffold-tests.factor index ce96a0cab8..014fc1be20 100644 --- a/basis/tools/scaffold/scaffold-tests.factor +++ b/basis/tools/scaffold/scaffold-tests.factor @@ -21,11 +21,11 @@ IN: tools.scaffold.tests ] unit-test { -"HELP: iota-tuple +"HELP: iota { $class-description \"\" } ; " } [ - [ \ iota-tuple (help.) ] with-string-writer + [ \ iota (help.) ] with-string-writer ] unit-test { sequence t } [ "seq" lookup-type ] unit-test diff --git a/basis/tr/tr.factor b/basis/tr/tr.factor index b937b25b93..2de706bb14 100644 --- a/basis/tr/tr.factor +++ b/basis/tr/tr.factor @@ -18,7 +18,7 @@ M: bad-tr summary [ [ ascii? ] all? ] both? [ bad-tr ] unless ; : compute-tr ( quot from to -- mapping ) - [ 128 iota ] 3dip zip + [ 128 ] 3dip zip '[ [ _ call( x -- y ) _ at ] keep or ] B{ } map-as ; inline : tr-hints ( word -- ) diff --git a/basis/tuple-arrays/tuple-arrays.factor b/basis/tuple-arrays/tuple-arrays.factor index 40cd416297..1ed3c86726 100644 --- a/basis/tuple-arrays/tuple-arrays.factor +++ b/basis/tuple-arrays/tuple-arrays.factor @@ -22,7 +22,7 @@ MACRO: boa-unsafe ( class -- quot ) tuple-layout '[ _ ] ; MACRO: write-tuple ( class -- quot ) [ '[ [ _ boa ] undo ] ] - [ tuple-arity iota [ '[ [ _ ] dip set-nth-unsafe ] ] map '[ _ cleave ] ] + [ tuple-arity [ '[ [ _ ] dip set-nth-unsafe ] ] map '[ _ cleave ] ] bi '[ _ dip @ ] ; : check-final ( class -- ) diff --git a/basis/ui/gadgets/gadgets-tests.factor b/basis/ui/gadgets/gadgets-tests.factor index 9d97ff2568..d3a32b59e4 100644 --- a/basis/ui/gadgets/gadgets-tests.factor +++ b/basis/ui/gadgets/gadgets-tests.factor @@ -163,7 +163,7 @@ ui-running? [ ui-notify-flag set-global [ fake-ui-loop ] "Fake UI" spawn drop - 8001 iota [ layout-later ] each + 8001 [ layout-later ] each ui-notify-flag get-global value>> layout-queue delete-all ] unit-test diff --git a/basis/ui/gadgets/scrollers/scrollers-tests.factor b/basis/ui/gadgets/scrollers/scrollers-tests.factor index 35df5030f3..a8f209bc64 100644 --- a/basis/ui/gadgets/scrollers/scrollers-tests.factor +++ b/basis/ui/gadgets/scrollers/scrollers-tests.factor @@ -70,7 +70,7 @@ dup layout "s" set { t } [ - 10 iota [ + 10 [ drop "g2" get scroll>gadget "s" get layout diff --git a/basis/ui/pens/gradient/gradient.factor b/basis/ui/pens/gradient/gradient.factor index 277ebc564f..aa91644895 100644 --- a/basis/ui/pens/gradient/gradient.factor +++ b/basis/ui/pens/gradient/gradient.factor @@ -16,7 +16,7 @@ TUPLE: gradient < caching-pen colors last-vertices last-colors ; :: gradient-vertices ( direction dim colors -- seq ) direction dim v* dim over v- swap - colors length [ iota ] [ 1 - ] bi v/n [ v*n ] with map + colors length [ ] [ 1 - ] bi v/n [ v*n ] with map swap [ over v+ 2array ] curry map concat concat float >c-array ; diff --git a/basis/unicode/breaks/breaks-tests.factor b/basis/unicode/breaks/breaks-tests.factor index 11bc5eac66..d7dcd604c3 100644 --- a/basis/unicode/breaks/breaks-tests.factor +++ b/basis/unicode/breaks/breaks-tests.factor @@ -51,4 +51,4 @@ IN: unicode.breaks.tests grapheme-break-test parse-test-file [ >graphemes ] test word-break-test parse-test-file [ >words ] test -{ { t f t t f t } } [ 6 iota [ "as df" word-break-at? ] map ] unit-test +{ { t f t t f t } } [ 6 [ "as df" word-break-at? ] map ] unit-test diff --git a/basis/unicode/breaks/breaks.factor b/basis/unicode/breaks/breaks.factor index 1aa5ec3000..a032096b6f 100644 --- a/basis/unicode/breaks/breaks.factor +++ b/basis/unicode/breaks/breaks.factor @@ -84,14 +84,14 @@ SYMBOL: table : make-grapheme-table ( -- ) { CR } { LF } connect - { Control CR LF } graphemes iota disconnect - graphemes iota { Control CR LF } disconnect + { Control CR LF } graphemes disconnect + graphemes { Control CR LF } disconnect { L } { L V LV LVT } connect { LV V } { V T } connect { LVT T } { T } connect - graphemes iota { Extend } connect - graphemes iota { SpacingMark } connect - { Prepend } graphemes iota connect ; + graphemes { Extend } connect + graphemes { SpacingMark } connect + { Prepend } graphemes connect ; "grapheme-table" create-word-in graphemes init-table table @@ -146,8 +146,8 @@ SYMBOL: check-number-after : make-word-table ( -- ) { wCR } { wLF } connect - { wNewline wCR wLF } unicode-words iota disconnect - unicode-words iota { wNewline wCR wLF } disconnect + { wNewline wCR wLF } unicode-words disconnect + unicode-words { wNewline wCR wLF } disconnect { wALetter } { wMidLetter wMidNumLet } check-letter-after set-table { wMidLetter wMidNumLet } { wALetter } check-letter-before set-table { wNumeric wALetter } { wNumeric wALetter } connect diff --git a/basis/unicode/collation/collation.factor b/basis/unicode/collation/collation.factor index 36ac433b6a..92f827d077 100644 --- a/basis/unicode/collation/collation.factor +++ b/basis/unicode/collation/collation.factor @@ -83,7 +83,7 @@ ducet get-global insert-helpers : add ( char -- ) dup blocked? [ 1string , ] [ - dup possible-bases dup length iota + dup possible-bases dup length [ ?combine ] 2with any? [ drop ] [ 1string , ] if ] if ; diff --git a/basis/unicode/unicode.factor b/basis/unicode/unicode.factor index 5e5a8cea36..ba478a841c 100644 --- a/basis/unicode/unicode.factor +++ b/basis/unicode/unicode.factor @@ -100,7 +100,7 @@ PRIVATE> over tail-slice first-word + ; : last-word ( str -- i ) - [ length iota ] keep '[ _ word-break-at? ] find-last drop 0 or ; + [ length ] keep '[ _ word-break-at? ] find-last drop 0 or ; : last-word-from ( end str -- i ) swap head-slice last-word ; diff --git a/basis/windows/registry/registry.factor b/basis/windows/registry/registry.factor index 968b52fbe4..465d617a3d 100644 --- a/basis/windows/registry/registry.factor +++ b/basis/windows/registry/registry.factor @@ -98,7 +98,7 @@ TUPLE: registry-enum-key ; :: reg-enum-keys ( registry-info -- seq ) - registry-info sub-keys>> iota [ + registry-info sub-keys>> [ [ registry-info key>> ] dip registry-value-max-length TCHAR dup :> registry-value registry-value length dup :> registry-value-length diff --git a/core/assocs/assocs-tests.factor b/core/assocs/assocs-tests.factor index 9200547144..c56edcc671 100644 --- a/core/assocs/assocs-tests.factor +++ b/core/assocs/assocs-tests.factor @@ -315,5 +315,5 @@ unit-test { 2 V{ 2 5 8 } } } } [ - 10 iota [ 3 mod ] collect-by + 10 [ 3 mod ] collect-by ] unit-test diff --git a/core/assocs/assocs.factor b/core/assocs/assocs.factor index 88d5021cc0..3f4b3b890c 100644 --- a/core/assocs/assocs.factor +++ b/core/assocs/assocs.factor @@ -231,7 +231,7 @@ M: assoc value-at* swap [ = nip ] curry assoc-find nip ; { } zip-as ; inline : zip-index-as ( values exemplar -- assoc ) - [ dup length iota ] dip zip-as ; inline + [ dup length ] dip zip-as ; inline : zip-index ( values -- alist ) { } zip-index-as ; inline @@ -295,7 +295,7 @@ M: enum delete-at seq>> remove-nth! drop ; inline M: enum >alist ( enum -- alist ) ; inline -M: enum keys seq>> length iota >array ; inline +M: enum keys seq>> length >array ; inline M: enum values seq>> >array ; inline diff --git a/core/checksums/crc32/crc32.factor b/core/checksums/crc32/crc32.factor index da3df72974..f6f6870041 100644 --- a/core/checksums/crc32/crc32.factor +++ b/core/checksums/crc32/crc32.factor @@ -8,7 +8,7 @@ CONSTANT: crc32-polynomial 0xedb88320 CONSTANT: crc32-table V{ } -256 iota [ +256 [ 8 [ [ 2/ ] [ even? ] bi [ crc32-polynomial bitxor ] unless ] times diff --git a/core/classes/tuple/tuple.factor b/core/classes/tuple/tuple.factor index 9c84375ceb..f903d0088b 100644 --- a/core/classes/tuple/tuple.factor +++ b/core/classes/tuple/tuple.factor @@ -64,7 +64,7 @@ M: tuple class-of layout-of 2 slot { word } declare ; inline dup tuple? [ not-a-tuple ] unless ; inline : prepare-tuple-slots ( tuple -- n tuple ) - check-tuple [ tuple-size iota ] keep ; + check-tuple [ tuple-size ] keep ; : copy-tuple-slots ( n tuple -- array ) [ array-nth ] curry map ; @@ -98,7 +98,7 @@ GENERIC: slots>tuple ( seq class -- tuple ) M: tuple-class slots>tuple ( seq class -- tuple ) check-slots pad-slots tuple-layout [ - [ tuple-size iota ] + [ tuple-size ] [ [ set-array-nth ] curry ] bi 2each ] keep ; @@ -372,7 +372,7 @@ M: tuple equal? over tuple? [ tuple= ] [ 2drop f ] if ; [ [ drop 1000003 ] dip [ class-of hashcode ] [ tuple-size ] bi - [ dup fixnum+fast 82520 fixnum+fast ] [ iota ] bi + [ dup fixnum+fast 82520 fixnum+fast ] [ ] bi ] 2keep [ swapd array-nth hashcode* >fixnum rot fixnum-bitxor pick fixnum*fast [ [ fixnum+fast ] keep ] dip swap diff --git a/core/combinators/combinators.factor b/core/combinators/combinators.factor index f348155d36..abfea43001 100644 --- a/core/combinators/combinators.factor +++ b/core/combinators/combinators.factor @@ -137,7 +137,7 @@ ERROR: no-case object ; ] if ; : ( initial length -- array ) - next-power-of-2 iota swap [ nip clone ] curry map ; + next-power-of-2 swap [ nip clone ] curry map ; : distribute-buckets ( alist initial quot -- buckets ) swapd [ [ dup first ] dip call 2array ] curry map @@ -202,7 +202,7 @@ M: reversed hashcode* [ sequence-hashcode ] recursive-hashcode ; M: slice hashcode* [ sequence-hashcode ] recursive-hashcode ; -M: iota-tuple hashcode* +M: iota hashcode* over 0 <= [ 2drop 0 ] [ nip length 0 swap [ sequence-hashcode-step ] each-integer ] if ; diff --git a/core/continuations/continuations-tests.factor b/core/continuations/continuations-tests.factor index c6acfdda62..5b8153deb4 100644 --- a/core/continuations/continuations-tests.factor +++ b/core/continuations/continuations-tests.factor @@ -22,7 +22,7 @@ IN: continuations.tests ] with-variables ] callcc0 "x" get 5 = ; -{ t } [ 10 callcc1-test 10 iota reverse >vector = ] unit-test +{ t } [ 10 callcc1-test 10 reverse >vector = ] unit-test { t } [ callcc-namespace-test ] unit-test [ 5 throw ] [ 5 = ] must-fail-with diff --git a/core/hash-sets/hash-sets-tests.factor b/core/hash-sets/hash-sets-tests.factor index d9a2b9c17b..e56adb2a44 100644 --- a/core/hash-sets/hash-sets-tests.factor +++ b/core/hash-sets/hash-sets-tests.factor @@ -51,7 +51,7 @@ sets sorting tools.test ; ! make sure growth and capacity use same load-factor { t } [ - 100 iota + 100 [ [ ] map ] [ [ HS{ } clone [ '[ _ adjoin ] each-integer ] keep ] map ] bi [ [ array>> length ] bi@ = ] 2all? diff --git a/core/hashtables/hashtables-tests.factor b/core/hashtables/hashtables-tests.factor index a238eef90d..ec51435eec 100644 --- a/core/hashtables/hashtables-tests.factor +++ b/core/hashtables/hashtables-tests.factor @@ -3,10 +3,10 @@ math namespaces sequences tools.test ; { H{ } } [ { } [ dup ] H{ } map>assoc ] unit-test -{ } [ 1000 iota [ dup sq ] H{ } map>assoc "testhash" set ] unit-test +{ } [ 1000 [ dup sq ] H{ } map>assoc "testhash" set ] unit-test { V{ } } -[ 1000 iota [ dup sq swap "testhash" get at = ] reject ] +[ 1000 [ dup sq swap "testhash" get at = ] reject ] unit-test { t } @@ -141,7 +141,7 @@ H{ } "x" set ! make sure growth and capacity use same load-factor { t } [ - 100 iota + 100 [ [ ] map ] [ [ H{ } clone [ '[ dup _ set-at ] each-integer ] keep ] map ] bi [ [ array>> length ] bi@ = ] 2all? @@ -183,4 +183,4 @@ H{ } "x" set { 1 } [ 2 "h" get at ] unit-test ! Random test case -{ "A" } [ 100 iota [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 of ] unit-test +{ "A" } [ 100 [ dup ] H{ } map>assoc 32 over delete-at "A" 32 pick set-at 32 of ] unit-test diff --git a/core/io/binary/binary.factor b/core/io/binary/binary.factor index d69ddb0d77..b85e9316e3 100644 --- a/core/io/binary/binary.factor +++ b/core/io/binary/binary.factor @@ -18,9 +18,9 @@ IN: io.binary PRIVATE> -: >le ( x n -- byte-array ) iota map-bytes ; +: >le ( x n -- byte-array ) map-bytes ; -: >be ( x n -- byte-array ) iota map-bytes ; +: >be ( x n -- byte-array ) map-bytes ; : d>w/w ( d -- w1 w2 ) [ 0xffffffff bitand ] [ -32 shift 0xffffffff bitand ] bi ; diff --git a/core/io/encodings/utf16/utf16.factor b/core/io/encodings/utf16/utf16.factor index b18db487b2..bce99cbcca 100644 --- a/core/io/encodings/utf16/utf16.factor +++ b/core/io/encodings/utf16/utf16.factor @@ -106,7 +106,7 @@ M: utf16le encode-char ( char stream encoding -- ) set-nth-unsafe ; inline : ascii-string>utf16-byte-array ( off string -- byte-array ) - [ length >fixnum [ iota ] [ 2 fixnum*fast ] bi ] keep + [ length >fixnum [ ] [ 2 fixnum*fast ] bi ] keep [ [ ascii-char>utf16-byte-array ] 2curry with each ] 2keep drop ; inline : ascii-string>utf16le ( string stream -- ) diff --git a/core/io/encodings/utf8/utf8-tests.factor b/core/io/encodings/utf8/utf8-tests.factor index efeeb708d0..f6ee250173 100644 --- a/core/io/encodings/utf8/utf8-tests.factor +++ b/core/io/encodings/utf8/utf8-tests.factor @@ -26,7 +26,7 @@ IN: io.encodings.utf8.tests { 3 } [ 2 "lápis" >utf8-index ] unit-test -{ V{ } } [ 100000 iota [ [ code-point-length ] [ 1string utf8 encode length ] bi = ] reject ] unit-test +{ V{ } } [ 100000 [ [ code-point-length ] [ 1string utf8 encode length ] bi = ] reject ] unit-test { { CHAR: replacement-character } } [ { 0b110,00000 0b10,000000 } decode-utf8-w/stream ] unit-test { { CHAR: replacement-character } } [ { 0b110,00001 0b10,111111 } decode-utf8-w/stream ] unit-test diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index f3c57776af..f37a851e03 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -810,7 +810,7 @@ HELP: with { $notes "This operation is efficient and does not copy the quotation." } { $examples { $example "USING: kernel math prettyprint sequences ;" "1 { 1 2 3 } [ / ] with map ." "{ 1 1/2 1/3 }" } - { $example "USING: kernel math prettyprint sequences ;" "1000 100 5 iota [ sq + + ] 2with map ." "{ 1100 1101 1104 1109 1116 }" } + { $example "USING: kernel math prettyprint sequences ;" "1000 100 5 [ sq + + ] 2with map ." "{ 1100 1101 1104 1109 1116 }" } } ; HELP: 2with diff --git a/core/kernel/kernel-tests.factor b/core/kernel/kernel-tests.factor index f5c19123ab..23f12b419d 100644 --- a/core/kernel/kernel-tests.factor +++ b/core/kernel/kernel-tests.factor @@ -20,7 +20,7 @@ IN: kernel.tests { 1 2 8 } { 1 2 9 } } -} [ 1 2 10 iota [ 3array ] 2with map ] unit-test +} [ 1 2 10 [ 3array ] 2with map ] unit-test ! Don't leak extra roots if error is thrown { } [ 1000 [ [ 3 throw ] ignore-errors ] times ] unit-test diff --git a/core/math/floats/floats-tests.factor b/core/math/floats/floats-tests.factor index 8350a297b5..ff48b47f89 100644 --- a/core/math/floats/floats-tests.factor +++ b/core/math/floats/floats-tests.factor @@ -57,7 +57,7 @@ unit-test { 0 } [ 1/0. >bignum ] unit-test -{ t } [ 64 iota [ 2^ 0.5 * ] map [ < ] monotonic? ] unit-test +{ t } [ 64 [ 2^ 0.5 * ] map [ < ] monotonic? ] unit-test { 5 } [ 10.5 1.9 /i ] unit-test diff --git a/core/memory/memory-tests.factor b/core/memory/memory-tests.factor index 4e858f3b39..1a3b8f1111 100644 --- a/core/memory/memory-tests.factor +++ b/core/memory/memory-tests.factor @@ -110,7 +110,7 @@ TUPLE: tup2 a b c d ; drop 2097103 ; : outer ( -- lag ) - 9 iota [ inner ] map + 9 [ inner ] map ! D 0 is scrubbed, but if the branch calling 'inner' was ! called, then both D 0 and D 1 should have been scrubbed. 0 9 1 tup2 boa ; diff --git a/core/sbufs/sbufs-tests.factor b/core/sbufs/sbufs-tests.factor index 1f827ea236..c2ee4171f7 100644 --- a/core/sbufs/sbufs-tests.factor +++ b/core/sbufs/sbufs-tests.factor @@ -20,7 +20,7 @@ sequences.private strings tools.test ; { fixnum } [ 1 >bignum SBUF" " new-sequence length class-of ] unit-test -{ fixnum } [ 1 >bignum iota [ ] SBUF" " map-as length class-of ] unit-test +{ fixnum } [ 1 >bignum [ ] SBUF" " map-as length class-of ] unit-test [ 1.5 SBUF" " new-sequence ] must-fail diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 8d70f695bf..c8bd6778c8 100644 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1249,7 +1249,7 @@ HELP: selector { $description "Creates a new vector to accumulate the values which return true for a predicate. Returns a new quotation which accepts an object to be tested and stored in the collector if the test yields true. The collector is left on the stack for convenience." } { $examples { $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;" - "10 iota [ even? ] selector [ each ] dip ." + "10 [ even? ] selector [ each ] dip ." "V{ 0 2 4 6 8 }" } } @@ -1485,7 +1485,7 @@ HELP: binary-reduce { $description "Like " { $link reduce } ", but splits the sequence in half recursively until each sequence is small enough, and calls the quotation on these smaller sequences. If the quotation computes values that depend on the size of their input, such as bignum arithmetic, then this algorithm can be more efficient than using " { $link reduce } "." } { $examples "Computing factorial:" { $example "USING: prettyprint sequences math ;" - "40 iota rest-slice 1 [ * ] binary-reduce ." + "40 rest-slice 1 [ * ] binary-reduce ." "20397882081197443358640281739902897356800000000" } } ; @@ -1583,13 +1583,13 @@ HELP: shorten "V{ 1 2 3 }" } } ; -HELP: iota +HELP: { $values { "n" integer } { "iota" iota } } { $description "Creates an immutable virtual sequence containing the integers from 0 to " { $snippet "n-1" } "." } { $examples { $example "USING: math sequences prettyprint ;" - "3 iota [ sq ] map ." + "3 [ sq ] map ." "{ 0 1 4 }" } } ; @@ -1676,12 +1676,12 @@ $nl ARTICLE: "sequences-integers" "Counted loops" "A virtual sequence is defined for iterating over integers from zero." -{ $subsection iota } -"For example, calling " { $link iota } " on the integer 3 produces a sequence containing the elements 0, 1, and 2. This is very useful for performing counted loops using words such as " { $link each } ":" -{ $example "USING: sequences prettyprint ; 3 iota [ . ] each" "0\n1\n2" } +{ $subsection } +"For example, calling " { $link } " on the integer 3 produces a sequence containing the elements 0, 1, and 2. This is very useful for performing counted loops using words such as " { $link each } ":" +{ $example "USING: sequences prettyprint ; 3 [ . ] each" "0\n1\n2" } "A common idiom is to iterate over a sequence, while also maintaining a loop counter. This can be done using " { $link each-index } ", " { $link map-index } " and " { $link reduce-index } "." $nl -"Combinators that produce new sequences, such as " { $link map } ", will output an array if the input is an instance of " { $link iota } "." +"Combinators that produce new sequences, such as " { $link map } ", will output an array if the input is an instance of " { $link } "." $nl "More elaborate counted loops can be performed with " { $link "math.ranges" } "." ; diff --git a/core/sequences/sequences-tests.factor b/core/sequences/sequences-tests.factor index a91bf4e100..72a326aaab 100644 --- a/core/sequences/sequences-tests.factor +++ b/core/sequences/sequences-tests.factor @@ -6,13 +6,13 @@ IN: sequences.tests { "empty" } [ { } [ "empty" ] [ "not empty" ] if-empty ] unit-test { { 1 } "not empty" } [ { 1 } [ "empty" ] [ "not empty" ] if-empty ] unit-test -{ V{ 1 2 3 4 } } [ 1 5 dup iota >vector ] unit-test -{ 3 } [ 1 4 dup iota length ] unit-test +{ V{ 1 2 3 4 } } [ 1 5 dup >vector ] unit-test +{ 3 } [ 1 4 dup length ] unit-test { 2 } [ 1 3 { 1 2 3 4 } length ] unit-test { V{ 2 3 } } [ 1 3 { 1 2 3 4 } >vector ] unit-test { V{ 4 5 } } [ { 1 2 3 4 5 } 2 tail-slice* >vector ] unit-test -{ V{ 3 4 } } [ 2 4 1 10 dup iota subseq >vector ] unit-test -{ V{ 3 4 } } [ 0 2 2 4 1 10 dup iota subseq >vector ] unit-test +{ V{ 3 4 } } [ 2 4 1 10 dup subseq >vector ] unit-test +{ V{ 3 4 } } [ 0 2 2 4 1 10 dup subseq >vector ] unit-test [ 0 10 "hello" ] must-fail [ -10 3 "hello" ] must-fail [ 2 1 "hello" ] must-fail @@ -129,7 +129,7 @@ IN: sequences.tests { t } [ B{ 0 } { 1 } append byte-array? ] unit-test { t } [ B{ 0 } { 1 } prepend byte-array? ] unit-test -{ "0123456789" } [ 58 iota [ 48 < ] "" reject-as ] unit-test +{ "0123456789" } [ 58 [ 48 < ] "" reject-as ] unit-test { [ ] } [ 1 [ ] remove ] unit-test { [ ] } [ 1 [ 1 ] remove ] unit-test @@ -166,7 +166,7 @@ IN: sequences.tests [ 4 [ CHAR: a ] { } map-integers ] unit-test -{ V{ 1 3 5 7 9 } } [ 10 iota >vector [ even? ] reject! ] unit-test +{ V{ 1 3 5 7 9 } } [ 10 >vector [ even? ] reject! ] unit-test { V{ } } [ "f" V{ } clone remove! ] unit-test { V{ } } [ "f" V{ "f" } clone remove! ] unit-test @@ -174,11 +174,11 @@ unit-test { V{ "x" } } [ "f" V{ "f" "x" "f" } clone remove! ] unit-test { V{ "y" "x" } } [ "f" V{ "y" "f" "x" "f" } clone remove! ] unit-test -{ V{ 0 1 4 5 } } [ 6 iota >vector 2 4 pick delete-slice ] unit-test +{ V{ 0 1 4 5 } } [ 6 >vector 2 4 pick delete-slice ] unit-test [ 6 >vector 2 8 pick delete-slice ] must-fail -{ V{ } } [ 6 iota >vector 0 6 pick delete-slice ] unit-test +{ V{ } } [ 6 >vector 0 6 pick delete-slice ] unit-test { { 1 2 "a" "b" 5 6 7 } } [ { "a" "b" } 2 4 { 1 2 3 4 5 6 7 } @@ -265,18 +265,18 @@ unit-test { 0 } [ f length ] unit-test [ f first ] must-fail -{ 3 } [ 3 10 iota nth ] unit-test -{ 3 } [ 3 10 iota nth-unsafe ] unit-test -[ -3 10 iota nth ] must-fail -[ 11 10 iota nth ] must-fail +{ 3 } [ 3 10 nth ] unit-test +{ 3 } [ 3 10 nth-unsafe ] unit-test +[ -3 10 nth ] must-fail +[ 11 10 nth ] must-fail { f } [ f ?first ] unit-test { f } [ { } ?first ] unit-test -{ 0 } [ 10 iota ?first ] unit-test +{ 0 } [ 10 ?first ] unit-test { f } [ f ?last ] unit-test { f } [ { } ?last ] unit-test -{ 9 } [ 10 iota ?last ] unit-test +{ 9 } [ 10 ?last ] unit-test [ -1/0. 0 remove-nth! ] must-fail { "" } [ "" [ CHAR: \s = ] trim ] unit-test @@ -288,10 +288,10 @@ unit-test { "asdf " } [ " asdf " [ CHAR: \s = ] trim-head ] unit-test { " asdf" } [ " asdf " [ CHAR: \s = ] trim-tail ] unit-test -{ 328350 } [ 100 iota [ sq ] map-sum ] unit-test +{ 328350 } [ 100 [ sq ] map-sum ] unit-test -{ 50 } [ 100 iota [ even? ] count ] unit-test -{ 50 } [ 100 iota [ odd? ] count ] unit-test +{ 50 } [ 100 [ even? ] count ] unit-test +{ 50 } [ 100 [ odd? ] count ] unit-test { { "b" "d" } } [ { 1 3 } { "a" "b" "c" "d" } nths ] unit-test { { "a" "b" "c" "d" } } [ { 0 1 2 3 } { "a" "b" "c" "d" } nths ] unit-test @@ -328,14 +328,14 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ; { V{ 0 3 } } [ "A" { "A" "B" "C" "A" "D" } indices ] unit-test -[ "asdf" iota ] must-fail -[ -1 iota ] must-fail -{ T{ iota-tuple { n 10 } } } [ 10 iota ] unit-test -{ 0 } [ 10 iota first ] unit-test -{ 0 } [ 0 iota sum ] unit-test -{ 0 } [ 1 iota sum ] unit-test -{ 10 } [ 5 iota sum ] unit-test -{ 15 } [ 6 iota sum ] unit-test +[ "asdf" ] must-fail +[ -1 ] must-fail +{ T{ iota { n 10 } } } [ 10 ] unit-test +{ 0 } [ 10 first ] unit-test +{ 0 } [ 0 sum ] unit-test +{ 0 } [ 1 sum ] unit-test +{ 10 } [ 5 sum ] unit-test +{ 15 } [ 6 sum ] unit-test { "hi" 3 } [ { 1 2 3 4 5 6 7 8 } [ H{ { 3 "hi" } } at ] map-find @@ -371,8 +371,8 @@ M: bogus-hashcode hashcode* 2drop 0 >bignum ; [ { } { } [ + ] [ + ] 2map-reduce ] must-fail { 24 } [ { 1 2 } { 3 4 } [ + ] [ * ] 2map-reduce ] unit-test -{ 4 } [ 5 iota [ ] supremum-by ] unit-test -{ 0 } [ 5 iota [ ] infimum-by ] unit-test +{ 4 } [ 5 [ ] supremum-by ] unit-test +{ 0 } [ 5 [ ] infimum-by ] unit-test { "bar" } [ { "bar" "baz" "qux" } [ length ] supremum-by ] unit-test { "bar" } [ { "bar" "baz" "qux" } [ length ] infimum-by ] unit-test { { "foo" } } [ { { "foo" } { "bar" } } [ first ] supremum-by ] unit-test diff --git a/core/sequences/sequences.factor b/core/sequences/sequences.factor index 715b3b9107..b547bde298 100644 --- a/core/sequences/sequences.factor +++ b/core/sequences/sequences.factor @@ -102,18 +102,18 @@ M: f like drop [ f ] when-empty ; inline INSTANCE: f immutable-sequence ! Integer sequences -TUPLE: iota-tuple { n integer read-only } ; +TUPLE: iota { n integer read-only } ; ERROR: non-negative-integer-expected n ; -: iota ( n -- iota ) +: ( n -- iota ) dup 0 < [ non-negative-integer-expected ] when - iota-tuple boa ; inline + iota boa ; inline -M: iota-tuple length n>> ; inline -M: iota-tuple nth-unsafe drop ; inline +M: iota length n>> ; inline +M: iota nth-unsafe drop ; inline -INSTANCE: iota-tuple immutable-sequence +INSTANCE: iota immutable-sequence (each-index) each-integer ; inline : map-index-as ( ... seq quot: ( ... elt index -- ... newelt ) exemplar -- ... newseq ) - [ dup length iota ] 2dip 2map-as ; inline + [ dup length ] 2dip 2map-as ; inline : map-index ( ... seq quot: ( ... elt index -- ... newelt ) -- ... newseq ) { } map-index-as ; inline @@ -1059,7 +1059,7 @@ PRIVATE> GENERIC: sum ( seq -- n ) M: object sum 0 [ + ] binary-reduce ; inline -M: iota-tuple sum length dup 1 - * 2/ ; inline +M: iota sum length dup 1 - * 2/ ; inline M: repetition sum [ elt>> ] [ length>> ] bi * ; inline : product ( seq -- n ) 1 [ * ] binary-reduce ; @@ -1114,7 +1114,7 @@ PRIVATE> : generic-flip ( matrix -- newmatrix ) [ [ first-unsafe length 1 ] keep - [ length min ] setup-each (each-integer) iota + [ length min ] setup-each (each-integer) ] keep [ [ nth-unsafe ] with { } map-as ] curry { } map-as ; inline @@ -1127,7 +1127,7 @@ USE: arrays { array } declare [ [ first-unsafe array-length 1 ] keep - [ array-length min ] setup-each (each-integer) iota + [ array-length min ] setup-each (each-integer) ] keep [ [ { array } declare array-nth ] with { } map-as ] curry { } map-as ; diff --git a/core/slots/slots.factor b/core/slots/slots.factor index d0a9459af8..5560bdcea3 100644 --- a/core/slots/slots.factor +++ b/core/slots/slots.factor @@ -271,7 +271,7 @@ M: slot-spec make-slot [ make-slot ] map ; : finalize-slots ( specs base -- specs ) - over length iota [ + ] with map [ >>offset ] 2map ; + over length [ + ] with map [ >>offset ] 2map ; : slot-named* ( name specs -- offset spec/f ) [ name>> = ] with find ; diff --git a/core/sorting/sorting-tests.factor b/core/sorting/sorting-tests.factor index 70716c905b..5c2d0972ee 100644 --- a/core/sorting/sorting-tests.factor +++ b/core/sorting/sorting-tests.factor @@ -4,7 +4,7 @@ sorting tools.test vocabs ; { { } } [ { } natural-sort ] unit-test { { 270000000 270000001 } } -[ T{ slice f 270000000 270000002 T{ iota-tuple f 270000002 } } natural-sort ] +[ T{ slice f 270000000 270000002 T{ iota f 270000002 } } natural-sort ] unit-test { t } [ diff --git a/core/vectors/vectors-tests.factor b/core/vectors/vectors-tests.factor index e208c29693..432d9e7edf 100644 --- a/core/vectors/vectors-tests.factor +++ b/core/vectors/vectors-tests.factor @@ -88,11 +88,11 @@ namespaces random sequences tools.test vectors ; { 4 } [ 5 V{ 1 2 3 4 5 } index ] unit-test { t } [ - 100 iota >array dup >vector >array [ reverse ] dip = + 100 >array dup >vector >array [ reverse ] dip = ] unit-test { fixnum } [ 1 >bignum V{ } new-sequence length class-of ] unit-test -{ fixnum } [ 1 >bignum iota [ ] V{ } map-as length class-of ] unit-test +{ fixnum } [ 1 >bignum [ ] V{ } map-as length class-of ] unit-test { V{ "lulz" } } [ "lulz" 1vector ] unit-test diff --git a/extra/alien/data/map/map-tests.factor b/extra/alien/data/map/map-tests.factor index 7bbe473371..17c739e2cf 100644 --- a/extra/alien/data/map/map-tests.factor +++ b/extra/alien/data/map/map-tests.factor @@ -19,7 +19,7 @@ IN: alien.data.map.tests float-4{ 2.0 2.0 2.0 2.0 } } } [ - 3 iota [ float-4-with ] data-map( object -- float-4 ) + 3 [ float-4-with ] data-map( object -- float-4 ) float-4 cast-array ] unit-test @@ -30,7 +30,7 @@ IN: alien.data.map.tests float-4{ 8.0 9.0 10.0 11.0 } } } [ - 12 iota [ float-4-boa ] data-map( object[4] -- float-4 ) + 12 [ float-4-boa ] data-map( object[4] -- float-4 ) float-4 cast-array ] unit-test diff --git a/extra/arrays/shaped/shaped.factor b/extra/arrays/shaped/shaped.factor index 70f985c78d..2577556131 100644 --- a/extra/arrays/shaped/shaped.factor +++ b/extra/arrays/shaped/shaped.factor @@ -151,10 +151,10 @@ M: sequence >col-array : ones ( shape -- shaped-array ) 1 repeated-shaped ; : increasing ( shape -- shaped-array ) - [ shape-capacity iota >array ] [ ] bi ; + [ shape-capacity >array ] [ ] bi ; : decreasing ( shape -- shaped-array ) - [ shape-capacity iota >array ] [ ] bi ; + [ shape-capacity >array ] [ ] bi ; : row-length ( shape -- n ) rest-slice product ; inline @@ -215,7 +215,7 @@ ERROR: 2d-expected shaped ; ! : set-shaped-where ( .. elt sa quot -- ) ! [ - ! [ underlying>> [ length iota ] keep zip ] + ! [ underlying>> [ length ] keep zip ] ! [ ] bi ! ] dip '[ _ [ _ set- ] @ ] assoc-each ; inline @@ -251,7 +251,7 @@ TUPLE: block-array shaped shape ; block-array boa ; : iteration-indices ( shaped -- seq ) - [ iota ] [ + [ ] [ cartesian-product concat [ dup first array? [ first2 suffix ] when ] map ] map-reduce ; diff --git a/extra/audio/vorbis/vorbis.factor b/extra/audio/vorbis/vorbis.factor index b8ab44773b..1d2521c246 100644 --- a/extra/audio/vorbis/vorbis.factor +++ b/extra/audio/vorbis/vorbis.factor @@ -172,8 +172,8 @@ ERROR: no-vorbis-in-ogg ; len max-len min :> len' pcm #channels void* :> channel*s - len' iota [| sample | - #channels iota [| channel | + len' [| sample | + #channels [| channel | channel channel*s nth len c:float sample swap nth float>short-sample short-buffer push diff --git a/extra/benchmark/base64/base64.factor b/extra/benchmark/base64/base64.factor index 95202f35f9..4f8499a4e3 100644 --- a/extra/benchmark/base64/base64.factor +++ b/extra/benchmark/base64/base64.factor @@ -4,7 +4,7 @@ USING: math sequences kernel base64 ; IN: benchmark.base64 : base64-benchmark ( -- ) - 65535 iota [ 255 bitand ] "" map-as + 65535 [ 255 bitand ] "" map-as 20 [ >base64 base64> ] times drop ; diff --git a/extra/benchmark/beust2/beust2.factor b/extra/benchmark/beust2/beust2.factor index 90187c0b77..732f58bab8 100644 --- a/extra/benchmark/beust2/beust2.factor +++ b/extra/benchmark/beust2/beust2.factor @@ -6,7 +6,7 @@ IN: benchmark.beust2 ! http://crazybob.org/BeustSequence.java.html :: (count-numbers) ( remaining first value used max listener: ( -- ) -- ? ) - 10 first - iota [| i | + 10 first - [| i | i first + :> digit digit 2^ :> mask i value + :> value' @@ -28,7 +28,7 @@ IN: benchmark.beust2 ] any? ; inline recursive :: count-numbers ( max listener -- ) - 10 iota [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ; inline + 10 [ 1 + 1 1 0 max listener (count-numbers) ] any? drop ; inline :: beust2-benchmark ( -- ) 0 :> i! diff --git a/extra/benchmark/bloom-filters/bloom-filters.factor b/extra/benchmark/bloom-filters/bloom-filters.factor index 95b0a62b45..7efa3f2d05 100644 --- a/extra/benchmark/bloom-filters/bloom-filters.factor +++ b/extra/benchmark/bloom-filters/bloom-filters.factor @@ -3,7 +3,7 @@ USING: bloom-filters kernel math sequences ; IN: benchmark.bloom-filters : insert-data ( bloom-filter -- bloom-filter ) - 100 [ 2,000 iota [ over bloom-filter-insert ] each ] times ; + 100 [ 2,000 [ over bloom-filter-insert ] each ] times ; : test-hit ( bloom-filter -- bloom-filter ) 100,000 [ 100 over bloom-filter-member? drop ] times ; diff --git a/extra/benchmark/chameneos-redux/chameneos-redux.factor b/extra/benchmark/chameneos-redux/chameneos-redux.factor index bcc0e85620..2b6d79feeb 100644 --- a/extra/benchmark/chameneos-redux/chameneos-redux.factor +++ b/extra/benchmark/chameneos-redux/chameneos-redux.factor @@ -27,7 +27,7 @@ TUPLE: meeting-place count mailbox ; >>mailbox ; : make-creatures ( colors -- seq ) - [ length iota ] [ ] bi [ ] 2map ; + [ length ] [ ] bi [ ] 2map ; : complement-color ( color1 color2 -- color3 ) 2dup = [ drop ] [ diff --git a/extra/benchmark/combinatorics/combinatorics.factor b/extra/benchmark/combinatorics/combinatorics.factor index ce7c26bddc..ac925117e9 100644 --- a/extra/benchmark/combinatorics/combinatorics.factor +++ b/extra/benchmark/combinatorics/combinatorics.factor @@ -17,7 +17,7 @@ IN: benchmark.combinatorics ] with each ; : bench-permutations ( n -- ) - iota { + { [ all-permutations drop ] [ [ drop ] each-permutation ] [ [ first 2 = ] find-permutation drop ] diff --git a/extra/benchmark/csv/csv.factor b/extra/benchmark/csv/csv.factor index e5df41e1d2..a430db8798 100644 --- a/extra/benchmark/csv/csv.factor +++ b/extra/benchmark/csv/csv.factor @@ -4,7 +4,7 @@ USING: arrays csv kernel math.parser sequences ; IN: benchmark.csv : csv-benchmark ( -- ) - 1,000 200 iota [ number>string ] map + 1,000 200 [ number>string ] map [ csv>string string>csv ] keep assert= ; MAIN: csv-benchmark diff --git a/extra/benchmark/dawes/dawes.factor b/extra/benchmark/dawes/dawes.factor index 839bd89dc0..3a4180061b 100644 --- a/extra/benchmark/dawes/dawes.factor +++ b/extra/benchmark/dawes/dawes.factor @@ -8,7 +8,7 @@ IN: benchmark.dawes : count-ones ( int-array -- n ) [ 1 = ] count ; inline : make-int-array ( -- int-array ) - 120000 iota [ 255 bitand ] int-array{ } map-as ; inline + 120000 [ 255 bitand ] int-array{ } map-as ; inline : dawes-benchmark ( -- ) 200 make-int-array '[ _ count-ones ] replicate drop ; diff --git a/extra/benchmark/dispatch2/dispatch2.factor b/extra/benchmark/dispatch2/dispatch2.factor index c57fbdb998..659a2428fa 100644 --- a/extra/benchmark/dispatch2/dispatch2.factor +++ b/extra/benchmark/dispatch2/dispatch2.factor @@ -5,8 +5,8 @@ IN: benchmark.dispatch2 : sequences ( -- seq ) [ - 1 iota , - 10 >bignum iota , + 1 , + 10 >bignum , { 1 2 3 } , "hello world" , SBUF" sbuf world" , @@ -14,7 +14,7 @@ IN: benchmark.dispatch2 double-array{ 1.0 2.0 3.0 } , "hello world" 4 tail-slice , 10 f , - 100 iota 2 , + 100 2 , "hello" , { { 1 2 } { 3 4 } } 0 , ?{ t f t } , diff --git a/extra/benchmark/dlists/dlists.factor b/extra/benchmark/dlists/dlists.factor index 04c2acfd59..9e7f7219b4 100644 --- a/extra/benchmark/dlists/dlists.factor +++ b/extra/benchmark/dlists/dlists.factor @@ -4,8 +4,8 @@ USING: deques dlists kernel math sequences ; IN: benchmark.dlists : dlists-benchmark ( -- ) - 5,000 iota [ - [ iota 0 swap >dlist [ + ] slurp-deque ] + 5,000 [ + [ 0 swap >dlist [ + ] slurp-deque ] [ dup 1 - * 2 / ] bi assert= ] each ; diff --git a/extra/benchmark/e-decimals/e-decimals.factor b/extra/benchmark/e-decimals/e-decimals.factor index 4da5cff828..c1220231fd 100644 --- a/extra/benchmark/e-decimals/e-decimals.factor +++ b/extra/benchmark/e-decimals/e-decimals.factor @@ -5,7 +5,7 @@ sequences ; IN: benchmark.e-decimals : D-factorial ( n -- D! ) - iota DECIMAL: 1 [ 0 DECIMAL: 1 D+ D* ] reduce ; inline + DECIMAL: 1 [ 0 DECIMAL: 1 D+ D* ] reduce ; inline :: calculate-e-decimals ( n -- e ) n [1,b] DECIMAL: 1 diff --git a/extra/benchmark/e-ratios/e-ratios.factor b/extra/benchmark/e-ratios/e-ratios.factor index b4bec1409d..6d1e03b4d0 100644 --- a/extra/benchmark/e-ratios/e-ratios.factor +++ b/extra/benchmark/e-ratios/e-ratios.factor @@ -4,7 +4,7 @@ USING: kernel math math.combinatorics math.ranges sequences ; IN: benchmark.e-ratios : calculate-e-ratios ( n -- e ) - iota [ factorial recip ] map-sum ; + [ factorial recip ] map-sum ; : e-ratios-benchmark ( -- ) 5 [ 300 calculate-e-ratios drop ] times ; diff --git a/extra/benchmark/empty-loop-2/empty-loop-2.factor b/extra/benchmark/empty-loop-2/empty-loop-2.factor index ff72d5db44..45b280a4d8 100644 --- a/extra/benchmark/empty-loop-2/empty-loop-2.factor +++ b/extra/benchmark/empty-loop-2/empty-loop-2.factor @@ -2,7 +2,7 @@ USING: math math.private kernel sequences ; IN: benchmark.empty-loop-2 : empty-loop-2 ( n -- ) - iota [ drop ] each ; + [ drop ] each ; : empty-loop-2-benchmark ( -- ) 50000000 empty-loop-2 ; diff --git a/extra/benchmark/fannkuch/fannkuch.factor b/extra/benchmark/fannkuch/fannkuch.factor index a81990aa3b..d07824e796 100644 --- a/extra/benchmark/fannkuch/fannkuch.factor +++ b/extra/benchmark/fannkuch/fannkuch.factor @@ -24,7 +24,7 @@ IN: benchmark.fannkuch : fannkuch ( n -- ) [ - [ 0 0 ] dip iota [ 1 + ] B{ } map-as + [ 0 0 ] dip [ 1 + ] B{ } map-as [ fannkuch-step ] each-permutation nip ] keep "Pfannkuchen(" write pprint ") = " write . ; diff --git a/extra/benchmark/fasta/fasta.factor b/extra/benchmark/fasta/fasta.factor index ccf695bf72..f602db3b03 100644 --- a/extra/benchmark/fasta/fasta.factor +++ b/extra/benchmark/fasta/fasta.factor @@ -69,7 +69,7 @@ TYPED: write-random-fasta ( seed: float n: fixnum chars: byte-array floats: doub TYPED:: make-repeat-fasta ( k: fixnum len: fixnum alu: string -- k': fixnum ) alu length :> kn - len iota [ k + kn mod alu nth-unsafe ] "" map-as print + len [ k + kn mod alu nth-unsafe ] "" map-as print k len + ; : write-repeat-fasta ( n alu desc id -- ) diff --git a/extra/benchmark/gc1/gc1.factor b/extra/benchmark/gc1/gc1.factor index d18c4a8261..68be9402dd 100644 --- a/extra/benchmark/gc1/gc1.factor +++ b/extra/benchmark/gc1/gc1.factor @@ -3,6 +3,6 @@ USING: math sequences kernel ; IN: benchmark.gc1 -: gc1-benchmark ( -- ) 600000 iota [ >bignum 1 + ] map drop ; +: gc1-benchmark ( -- ) 600000 [ >bignum 1 + ] map drop ; MAIN: gc1-benchmark diff --git a/extra/benchmark/gc3/gc3.factor b/extra/benchmark/gc3/gc3.factor index a6fbefb78c..926096bd17 100644 --- a/extra/benchmark/gc3/gc3.factor +++ b/extra/benchmark/gc3/gc3.factor @@ -4,7 +4,7 @@ USING: math.parser fry sequences kernel assocs hashtables ; IN: benchmark.gc3 : gc3-benchmark ( -- ) - 1000000 iota + 1000000 1000000 '[ [ number>string ] keep _ set-at ] each ; diff --git a/extra/benchmark/hash-sets/hash-sets.factor b/extra/benchmark/hash-sets/hash-sets.factor index cef4f99622..8e4b8d49ad 100644 --- a/extra/benchmark/hash-sets/hash-sets.factor +++ b/extra/benchmark/hash-sets/hash-sets.factor @@ -6,7 +6,7 @@ IN: benchmark.hash-sets CONSTANT: test-sets $[ { 10 100 1,000 10,000 50,000 100,000 } - [ iota >hash-set ] map dup append + [ >hash-set ] map dup append ] : do-times ( n quot: ( set1 set2 -- set' ) -- ) diff --git a/extra/benchmark/iteration/iteration.factor b/extra/benchmark/iteration/iteration.factor index 4b2a14fb0d..563621ef1e 100644 --- a/extra/benchmark/iteration/iteration.factor +++ b/extra/benchmark/iteration/iteration.factor @@ -2,7 +2,7 @@ IN: benchmark.iteration USING: sequences vectors arrays strings sbufs math math.vectors kernel ; -: ( from to -- seq ) dup iota ; inline +: ( from to -- seq ) dup ; inline : vector-iter ( -- ) 100 [ 0 100000 >vector [ ] map drop ] times ; : array-iter ( -- ) 100 [ 0 100000 >array [ ] map drop ] times ; diff --git a/extra/benchmark/json/json.factor b/extra/benchmark/json/json.factor index 2f6e3f762b..06acfaa4fd 100644 --- a/extra/benchmark/json/json.factor +++ b/extra/benchmark/json/json.factor @@ -5,7 +5,7 @@ sequences ; IN: benchmark.json : json-benchmark ( -- ) - 200 iota [ [ number>string ] keep ] H{ } map>assoc + 200 [ [ number>string ] keep ] H{ } map>assoc 1,000 [ >json json> ] times drop ; MAIN: json-benchmark diff --git a/extra/benchmark/linked-assocs/linked-assocs.factor b/extra/benchmark/linked-assocs/linked-assocs.factor index 4e4a38cf14..e91d87301e 100644 --- a/extra/benchmark/linked-assocs/linked-assocs.factor +++ b/extra/benchmark/linked-assocs/linked-assocs.factor @@ -4,7 +4,7 @@ sequences ; IN: benchmark.linked-assocs : (linked-assocs-benchmark) ( -- ) - 10,000 iota { + 10,000 { [ '[ 0 swap _ set-at ] each ] [ '[ _ at ] map-sum 0 assert= ] [ '[ dup _ set-at ] each ] diff --git a/extra/benchmark/make/make.factor b/extra/benchmark/make/make.factor index 9eb8d155f1..b28c202c8b 100644 --- a/extra/benchmark/make/make.factor +++ b/extra/benchmark/make/make.factor @@ -9,13 +9,13 @@ IN: benchmark.make [ [ CHAR: a , ] times ] "" make ; : make-arrays ( n -- seq ) - [ iota % ] { } make ; + [ % ] { } make ; : make-vectors ( n -- seq ) - [ iota % ] V{ } make ; + [ % ] V{ } make ; : make-benchmark ( -- ) - 5,000 iota [ + 5,000 [ [ make-strings ] [ make-arrays ] [ make-vectors ] tri 3drop ] each ; diff --git a/extra/benchmark/mandel/colors/colors.factor b/extra/benchmark/mandel/colors/colors.factor index 87a2df6fe5..bcae43ea41 100644 --- a/extra/benchmark/mandel/colors/colors.factor +++ b/extra/benchmark/mandel/colors/colors.factor @@ -11,7 +11,7 @@ CONSTANT: sat 0.85 CONSTANT: val 0.85 : ( nb-cols -- map ) - [ iota ] keep '[ + [ ] keep '[ 360 * _ 1 + / sat val 1 >rgba scale-rgb ] map ; diff --git a/extra/benchmark/mandel/mandel.factor b/extra/benchmark/mandel/mandel.factor index f973411030..9d30ff39c9 100644 --- a/extra/benchmark/mandel/mandel.factor +++ b/extra/benchmark/mandel/mandel.factor @@ -24,7 +24,7 @@ IN: benchmark.mandel [ color-map [ length mod ] keep nth ] [ B{ 0 0 0 } ] if* ; inline : render ( -- ) - height iota [ width iota swap '[ _ c pixel color write ] each ] each ; inline + height [ width iota swap '[ _ c pixel color write ] each ] each ; inline : ppm-header ( -- ) ascii encode-output diff --git a/extra/benchmark/matrix-exponential-scalar/matrix-exponential-scalar.factor b/extra/benchmark/matrix-exponential-scalar/matrix-exponential-scalar.factor index c830c5a0ed..8324f8266e 100644 --- a/extra/benchmark/matrix-exponential-scalar/matrix-exponential-scalar.factor +++ b/extra/benchmark/matrix-exponential-scalar/matrix-exponential-scalar.factor @@ -9,7 +9,7 @@ IN: benchmark.matrix-exponential-scalar { 0.0 0.0 0.0 0.0 } { 0.0 0.0 0.0 0.0 } } - iterations iota [| i | + iterations [| i | m i m^n i factorial >float m/n m+ ] each ; diff --git a/extra/benchmark/matrix-exponential-simd/matrix-exponential-simd.factor b/extra/benchmark/matrix-exponential-simd/matrix-exponential-simd.factor index 2ff938f520..e9de8eebaa 100644 --- a/extra/benchmark/matrix-exponential-simd/matrix-exponential-simd.factor +++ b/extra/benchmark/matrix-exponential-simd/matrix-exponential-simd.factor @@ -4,7 +4,7 @@ IN: benchmark.matrix-exponential-simd TYPED:: e^m4 ( m: matrix4 iterations: fixnum -- e^m: matrix4 ) zero-matrix4 - iterations iota [| i | + iterations [| i | m i m4^n i factorial >float m4/n m4+ ] each ; diff --git a/extra/benchmark/md5/md5.factor b/extra/benchmark/md5/md5.factor index 3ec429248a..40926758f8 100644 --- a/extra/benchmark/md5/md5.factor +++ b/extra/benchmark/md5/md5.factor @@ -2,6 +2,6 @@ USING: checksums checksums.md5 sequences byte-arrays kernel ; IN: benchmark.md5 : md5-benchmark ( -- ) - 2000000 iota >byte-array md5 checksum-bytes drop ; + 2000000 >byte-array md5 checksum-bytes drop ; MAIN: md5-benchmark diff --git a/extra/benchmark/memoize/memoize.factor b/extra/benchmark/memoize/memoize.factor index 093b66ad5d..f48e85ebae 100644 --- a/extra/benchmark/memoize/memoize.factor +++ b/extra/benchmark/memoize/memoize.factor @@ -11,7 +11,7 @@ MEMO: mem4 ( n n n n -- n ) + + + ; : memoize-benchmark ( -- ) 1000 [ - 1000 iota [ + 1000 [ mem0 [ mem1 ] keep [ mem2 ] 2keep [ mem3 ] 3keep mem4 drop ] each ] times ; diff --git a/extra/benchmark/msgpack/msgpack.factor b/extra/benchmark/msgpack/msgpack.factor index 010839b4f1..bbd70c738b 100644 --- a/extra/benchmark/msgpack/msgpack.factor +++ b/extra/benchmark/msgpack/msgpack.factor @@ -8,7 +8,7 @@ IN: benchmark.msgpack [ >msgpack msgpack> length ] map-sum ; : msgpack-benchmark ( -- ) - 500,000 iota pack-sum 124,999,750,000 assert= + 500,000 pack-sum 124,999,750,000 assert= 500,000 "hello" pack-sum-lengths 2,500,000 assert= 500,000 pi pack-sum 0x1.7f7ec53a9f04ap20 assert= ; diff --git a/extra/benchmark/parse-bignum/parse-bignum.factor b/extra/benchmark/parse-bignum/parse-bignum.factor index 856a1a0f40..33077555da 100644 --- a/extra/benchmark/parse-bignum/parse-bignum.factor +++ b/extra/benchmark/parse-bignum/parse-bignum.factor @@ -2,7 +2,7 @@ USING: kernel math math.parser sequences ; IN: benchmark.parse-bignum : parse-bignum-benchmark ( -- ) - 3000 iota [ + 3000 [ 2^ [ number>string string>number ] [ assert= ] bi ] each ; diff --git a/extra/benchmark/parse-fixnum/parse-fixnum.factor b/extra/benchmark/parse-fixnum/parse-fixnum.factor index c88c3c5151..b4898cdf92 100644 --- a/extra/benchmark/parse-fixnum/parse-fixnum.factor +++ b/extra/benchmark/parse-fixnum/parse-fixnum.factor @@ -2,7 +2,7 @@ USING: kernel math.parser sequences ; IN: benchmark.parse-fixnum : parse-fixnum-benchmark ( -- ) - 2,000,000 iota [ + 2,000,000 [ [ number>string string>number ] [ assert= ] bi ] each ; diff --git a/extra/benchmark/partial-sums/partial-sums.factor b/extra/benchmark/partial-sums/partial-sums.factor index b32ce928a2..dc898a5be9 100644 --- a/extra/benchmark/partial-sums/partial-sums.factor +++ b/extra/benchmark/partial-sums/partial-sums.factor @@ -5,7 +5,7 @@ combinators hints fry sequences ; IN: benchmark.partial-sums ! Helper words -: summing-integers ( n quot -- y ) [ 0.0 ] [ iota ] [ ] tri* '[ 1 + @ + ] each ; inline +: summing-integers ( n quot -- y ) [ 0.0 ] [ ] [ ] tri* '[ 1 + @ + ] each ; inline : summing-floats ( n quot -- y ) '[ >float @ ] summing-integers ; inline : cube ( x -- y ) dup dup * * ; inline : -1^ ( n -- -1/1 ) 2 mod 2 * 1 - ; inline diff --git a/extra/benchmark/randomize/randomize.factor b/extra/benchmark/randomize/randomize.factor index 54388a72c4..55e05ea944 100644 --- a/extra/benchmark/randomize/randomize.factor +++ b/extra/benchmark/randomize/randomize.factor @@ -1,7 +1,7 @@ USING: arrays kernel literals random sequences ; IN: benchmark.randomize -CONSTANT: data $[ 10,000,000 iota >array ] +CONSTANT: data $[ 10,000,000 >array ] : randomize-benchmark ( -- ) data randomize drop ; diff --git a/extra/benchmark/raytracer-simd/raytracer-simd.factor b/extra/benchmark/raytracer-simd/raytracer-simd.factor index 6052922a39..86f438cd4c 100644 --- a/extra/benchmark/raytracer-simd/raytracer-simd.factor +++ b/extra/benchmark/raytracer-simd/raytracer-simd.factor @@ -140,8 +140,8 @@ CONSTANT: create-offsets : ray-pixel ( scene point -- ray-grid ) [ 0.0 ] 2dip - oversampling iota [ - oversampling iota [ + oversampling [ + oversampling [ ss-point v+ normalize double-4{ 0.0 0.0 -4.0 0.0 } swap swap cast-ray + @@ -149,8 +149,8 @@ CONSTANT: create-offsets ] 2with each ; inline no-compile : ray-trace ( scene -- grid ) - size iota [ - size iota [ + size [ + size [ [ size 0.5 * - ] bi@ swap size 0.0 double-4-boa ray-pixel ] 2with map diff --git a/extra/benchmark/raytracer/raytracer.factor b/extra/benchmark/raytracer/raytracer.factor index c246f1538f..1252d402ab 100644 --- a/extra/benchmark/raytracer/raytracer.factor +++ b/extra/benchmark/raytracer/raytracer.factor @@ -148,7 +148,7 @@ DEFER: create [ oversampling /f ] bi@ 0.0 double-array{ } 3sequence ; : ss-grid ( -- ss-grid ) - oversampling iota [ oversampling iota [ ss-point ] with map ] map ; + oversampling [ oversampling iota [ ss-point ] with map ] map ; : ray-grid ( point ss-grid -- ray-grid ) [ @@ -160,8 +160,8 @@ DEFER: create [ [ swap cast-ray + ] with each ] with each ; : pixel-grid ( -- grid ) - size iota reverse [ - size iota [ + size reverse [ + size [ [ size 0.5 * - ] bi@ swap size double-array{ } 3sequence ] with map diff --git a/extra/benchmark/regexp/regexp.factor b/extra/benchmark/regexp/regexp.factor index aa0d5bff2c..823c4899b9 100644 --- a/extra/benchmark/regexp/regexp.factor +++ b/extra/benchmark/regexp/regexp.factor @@ -6,8 +6,8 @@ IN: benchmark.regexp : regexp-benchmark ( -- ) 200 - 20,000 iota [ number>string ] map - 200 iota [ 1 + CHAR: a ] map + 20,000 [ number>string ] map + 200 [ 1 + CHAR: a ] map '[ _ R/ \d+/ [ matches? ] curry all? t assert= _ R/ [a]+/ [ matches? ] curry all? t assert= diff --git a/extra/benchmark/ring/ring.factor b/extra/benchmark/ring/ring.factor index 509538a175..6281824a21 100644 --- a/extra/benchmark/ring/ring.factor +++ b/extra/benchmark/ring/ring.factor @@ -13,7 +13,7 @@ SYMBOL: done ] times ; : send-messages ( messages target -- ) - [ dup iota ] dip [ send ] curry each [ receive drop ] times ; + [ dup ] dip [ send ] curry each [ receive drop ] times ; : destroy-ring ( target -- ) done swap send [ done eq? ] receive-if drop ; diff --git a/extra/benchmark/sha1/sha1.factor b/extra/benchmark/sha1/sha1.factor index 50675645e0..523de80627 100644 --- a/extra/benchmark/sha1/sha1.factor +++ b/extra/benchmark/sha1/sha1.factor @@ -2,17 +2,17 @@ USING: checksums checksums.sha sequences byte-arrays kernel ; IN: benchmark.sha1 : sha1-benchmark ( -- ) - 2000000 iota >byte-array sha1 checksum-bytes drop ; + 2000000 >byte-array sha1 checksum-bytes drop ; : sha224-benchmark ( -- ) - 2000000 iota >byte-array sha-224 checksum-bytes drop ; + 2000000 >byte-array sha-224 checksum-bytes drop ; : sha256-benchmark ( -- ) - 2000000 iota >byte-array sha-256 checksum-bytes drop ; + 2000000 >byte-array sha-256 checksum-bytes drop ; USE: checksums.openssl : openssl-sha1-benchmark ( -- ) - 2000000 iota >byte-array openssl-sha1 checksum-bytes drop ; + 2000000 >byte-array openssl-sha1 checksum-bytes drop ; MAIN: sha1-benchmark diff --git a/extra/benchmark/simd-1/simd-1.factor b/extra/benchmark/simd-1/simd-1.factor index 41e26ed771..bfe932b932 100644 --- a/extra/benchmark/simd-1/simd-1.factor +++ b/extra/benchmark/simd-1/simd-1.factor @@ -11,7 +11,7 @@ IN: benchmark.simd-1 0.0 float-4-boa ; inline : make-points ( len -- points ) - iota [ ] float-4-array{ } map-as ; inline + [ ] float-4-array{ } map-as ; inline : normalize-points ( points -- ) [ normalize ] map! drop ; inline diff --git a/extra/benchmark/sort/sort.factor b/extra/benchmark/sort/sort.factor index c3f8ae32d0..70744c13de 100644 --- a/extra/benchmark/sort/sort.factor +++ b/extra/benchmark/sort/sort.factor @@ -2,7 +2,7 @@ USING: assocs kernel literals math random sequences sorting ; IN: benchmark.sort CONSTANT: numbers-to-sort $[ 300,000 200 random-integers ] -CONSTANT: alist-to-sort $[ 1,000 iota dup zip ] +CONSTANT: alist-to-sort $[ 1,000 dup zip ] : sort-benchmark ( -- ) 10 [ numbers-to-sort natural-sort drop ] times diff --git a/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor b/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor index c0c4af8526..03156cc83f 100644 --- a/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor +++ b/extra/benchmark/spectral-norm-simd/spectral-norm-simd.factor @@ -8,8 +8,8 @@ SPECIALIZED-ARRAYS: double double-4 ; IN: benchmark.spectral-norm-simd :: inner-loop ( u n quot -- seq ) - n 4 /i iota [| i | - n iota [| j | u i j quot call ] [ v+ ] map-reduce + n 4 /i [| i | + n [| j | u i j quot call ] [ v+ ] map-reduce ] double-4-array{ } map-as ; inline : eval-A ( i j -- n ) diff --git a/extra/benchmark/spectral-norm/spectral-norm.factor b/extra/benchmark/spectral-norm/spectral-norm.factor index f8ab57028c..cdfca74101 100644 --- a/extra/benchmark/spectral-norm/spectral-norm.factor +++ b/extra/benchmark/spectral-norm/spectral-norm.factor @@ -10,8 +10,8 @@ SPECIALIZED-ARRAY: double IN: benchmark.spectral-norm :: inner-loop ( u n quot -- seq ) - n iota [| i | - n iota 0.0 [| j | + n [| i | + n 0.0 [| j | u i j quot call + ] reduce ] double-array{ } map-as ; inline diff --git a/extra/benchmark/splay/splay.factor b/extra/benchmark/splay/splay.factor index 71bd4e99ea..7ad9d97bc8 100644 --- a/extra/benchmark/splay/splay.factor +++ b/extra/benchmark/splay/splay.factor @@ -7,7 +7,7 @@ sorting trees.splay ; IN: benchmark.splay : initial-alist ( n -- alist ) - iota >array randomize dup zip ; + >array randomize dup zip ; : change-random ( newkeys splay keys -- splay' ) swapd [ first pick delete-at first2 pick set-at ] 2each ; diff --git a/extra/benchmark/splitting/splitting.factor b/extra/benchmark/splitting/splitting.factor index 55351b2082..fb3dc4f722 100644 --- a/extra/benchmark/splitting/splitting.factor +++ b/extra/benchmark/splitting/splitting.factor @@ -2,7 +2,7 @@ USING: kernel math sequences splitting ; IN: benchmark.splitting : test-data ( -- seq seps ) - 1000 iota dup [ 10 /i zero? ] filter ; ! not inline to prevent type inference + 1000 dup [ 10 /i zero? ] filter ; ! not inline to prevent type inference : splitting-benchmark ( -- ) test-data 2,000 [ diff --git a/extra/benchmark/sum-file/sum-file.factor b/extra/benchmark/sum-file/sum-file.factor index b7b37d09b6..893619669a 100644 --- a/extra/benchmark/sum-file/sum-file.factor +++ b/extra/benchmark/sum-file/sum-file.factor @@ -4,7 +4,7 @@ IN: benchmark.sum-file << "sum-file.txt" temp-file ascii [ - 100000 iota [ number>string print ] each + 100000 [ number>string print ] each ] with-file-writer >> diff --git a/extra/benchmark/tcp-echo0/tcp-echo0.factor b/extra/benchmark/tcp-echo0/tcp-echo0.factor index b5a19beb0b..3155ae68f5 100644 --- a/extra/benchmark/tcp-echo0/tcp-echo0.factor +++ b/extra/benchmark/tcp-echo0/tcp-echo0.factor @@ -8,7 +8,7 @@ IN: benchmark.tcp-echo0 ! Max size here is 26 2^ 1 - because array-capacity limits on 32bit platforms CONSTANT: test-size0 $[ 23 2^ 1 - ] -MEMO: test-bytes ( n -- byte-array ) iota >byte-array ; +MEMO: test-bytes ( n -- byte-array ) >byte-array ; TUPLE: tcp-echo < threaded-server #times #bytes ; diff --git a/extra/benchmark/tuple-arrays/tuple-arrays.factor b/extra/benchmark/tuple-arrays/tuple-arrays.factor index 0f5313b41e..1b80330b16 100644 --- a/extra/benchmark/tuple-arrays/tuple-arrays.factor +++ b/extra/benchmark/tuple-arrays/tuple-arrays.factor @@ -8,7 +8,7 @@ TUPLE: point { x float } { y float } { z float } ; final TUPLE-ARRAY: point : tuple-arrays-benchmark ( -- ) - 1,000 iota [ + 1,000 [ drop 5,000 [ [ 1 + ] change-x [ 1 - ] change-y diff --git a/extra/benchmark/udp-echo0/udp-echo0.factor b/extra/benchmark/udp-echo0/udp-echo0.factor index df7755f61f..9338245b62 100644 --- a/extra/benchmark/udp-echo0/udp-echo0.factor +++ b/extra/benchmark/udp-echo0/udp-echo0.factor @@ -11,7 +11,7 @@ IN: benchmark.udp-echo0 : udp-echo ( #times #bytes -- ) '[ - _ iota [ _ >be ] map + _ [ _ >be ] map "127.0.0.1" 0 &dispose "127.0.0.1" 0 &dispose [ send/recv ] 2curry each diff --git a/extra/benchmark/ui-panes/ui-panes.factor b/extra/benchmark/ui-panes/ui-panes.factor index 345ef36d55..f689437887 100644 --- a/extra/benchmark/ui-panes/ui-panes.factor +++ b/extra/benchmark/ui-panes/ui-panes.factor @@ -2,6 +2,6 @@ USING: io kernel math.parser sequences ui.gadgets.panes ; IN: benchmark.ui-panes : ui-panes-benchmark ( -- ) - [ 10000 iota [ number>string print ] each ] make-pane drop ; + [ 10000 [ number>string print ] each ] make-pane drop ; MAIN: ui-panes-benchmark diff --git a/extra/benchmark/wrap/wrap.factor b/extra/benchmark/wrap/wrap.factor index 7bd8d0335f..ca8f1b215f 100644 --- a/extra/benchmark/wrap/wrap.factor +++ b/extra/benchmark/wrap/wrap.factor @@ -4,7 +4,7 @@ USING: kernel math math.parser sequences wrap wrap.strings ; IN: benchmark.wrap : wrap-benchmark ( -- ) - 1,000 iota [ number>string ] map " " join + 1,000 [ number>string ] map " " join 100 [ dup 80 wrap-string drop ] times drop ; MAIN: wrap-benchmark diff --git a/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor b/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor index 3da80ec192..7f47020821 100644 --- a/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor +++ b/extra/benchmark/yuv-to-rgb/yuv-to-rgb.factor @@ -28,9 +28,9 @@ STRUCT: yuv-buffer h >>uv_height w >>y_stride w >>uv_stride - w h * iota [ dup * ] B{ } map-as malloc-byte-array &free >>y - w h * 2/ iota [ dup dup * * ] B{ } map-as malloc-byte-array &free >>u - w h * 2/ iota [ dup * dup * ] B{ } map-as malloc-byte-array &free >>v ; + w h * [ dup * ] B{ } map-as malloc-byte-array &free >>y + w h * 2/ [ dup dup * * ] B{ } map-as malloc-byte-array &free >>u + w h * 2/ [ dup * dup * ] B{ } map-as malloc-byte-array &free >>v ; : clamp ( n -- n ) 255 min 0 max ; inline @@ -75,12 +75,12 @@ STRUCT: yuv-buffer : yuv>rgb-row ( index rgb yuv y -- index ) over stride - pick y_width>> iota + pick y_width>> [ yuv>rgb-pixel ] 4 nwith each ; inline TYPED: yuv>rgb ( rgb: byte-array yuv: yuv-buffer -- ) [ 0 ] 2dip - dup y_height>> iota + dup y_height>> [ yuv>rgb-row ] 2with each drop ; diff --git a/extra/bloom-filters/bloom-filters-tests.factor b/extra/bloom-filters/bloom-filters-tests.factor index 9e0a27f473..205c5e116a 100644 --- a/extra/bloom-filters/bloom-filters-tests.factor +++ b/extra/bloom-filters/bloom-filters-tests.factor @@ -35,7 +35,7 @@ IN: bloom-filters.tests ! Should not generate bignum hash codes. Enhanced double hashing may generate a ! lot of hash codes, and it's better to do this earlier than later. -{ t } [ 10000 iota [ double-hashcodes [ fixnum? ] both? ] all? ] unit-test +{ t } [ 10000 [ double-hashcodes [ fixnum? ] both? ] all? ] unit-test : empty-bloom-filter ( -- bloom-filter ) 0.01 2000 ; @@ -50,24 +50,24 @@ IN: bloom-filters.tests { 1 } [ basic-insert-test-setup count>> ] unit-test : non-empty-bloom-filter ( -- bloom-filter ) - 1000 iota + 1000 empty-bloom-filter [ [ bloom-filter-insert ] curry each ] keep ; : full-bloom-filter ( -- bloom-filter ) - 2000 iota + 2000 empty-bloom-filter [ [ bloom-filter-insert ] curry each ] keep ; ! Should find what we put in there. -{ t } [ 2000 iota +{ t } [ 2000 full-bloom-filter [ bloom-filter-member? ] curry map [ ] all? ] unit-test ! We shouldn't have more than 0.01 false-positive rate. -{ t } [ 1000 iota [ drop most-positive-fixnum random 1000 + ] map +{ t } [ 1000 [ drop most-positive-fixnum random 1000 + ] map full-bloom-filter [ bloom-filter-member? ] curry map [ ] count diff --git a/extra/bson/writer/writer.factor b/extra/bson/writer/writer.factor index 192b1c86bb..086574018f 100644 --- a/extra/bson/writer/writer.factor +++ b/extra/bson/writer/writer.factor @@ -35,7 +35,7 @@ TYPED: with-length ( quot -- bytes-written: integer start-index: integer ) [ nth-byte write1 ] with each ; inline TYPED: write-int32 ( int: integer -- ) INT32-SIZE write-le ; inline diff --git a/extra/chipmunk/demo/demo.factor b/extra/chipmunk/demo/demo.factor index 7f5222342a..132229b1bc 100644 --- a/extra/chipmunk/demo/demo.factor +++ b/extra/chipmunk/demo/demo.factor @@ -107,8 +107,8 @@ M:: chipmunk-world begin-game-world ( world -- ) space 2.0 10000 cpSpaceResizeActiveHash space 1 >>iterations drop - image-height iota [| y | - image-width iota [| x | + image-height [| y | + image-width [| x | x y get-pixel [ x image-width 2 / - 0.05 random-unit * + 2 * image-height 2 / y - 0.05 random-unit * + 2 * diff --git a/extra/classes/struct/vectored/vectored.factor b/extra/classes/struct/vectored/vectored.factor index 53f9fce988..cc5b53495d 100644 --- a/extra/classes/struct/vectored/vectored.factor +++ b/extra/classes/struct/vectored/vectored.factor @@ -108,7 +108,7 @@ M: vectored-T struct-transpose [ vectored-element> ] T-array new map-as ; inline M: T-array struct-transpose - dup length [ nip iota ] [ drop ] [ nip (vectored-T) ] 2tri + dup length [ nip ] [ drop ] [ nip (vectored-T) ] 2tri [ [ [ nth ] [ set-nth ] bi-curry* bi ] 2curry each ] keep ; inline ;FUNCTOR diff --git a/extra/compiler/cfg/gvn/expressions/expressions.factor b/extra/compiler/cfg/gvn/expressions/expressions.factor index e5efdfce83..0cb6682cd6 100644 --- a/extra/compiler/cfg/gvn/expressions/expressions.factor +++ b/extra/compiler/cfg/gvn/expressions/expressions.factor @@ -30,7 +30,7 @@ GENERIC: >expr ( insn -- expr ) [ [ , [ f ] % ] [ - dup iota [ + dup [ - 1 - , [ swap [ set-array-nth ] keep ] % ] with each ] bi diff --git a/extra/compiler/cfg/gvn/simd/simd.factor b/extra/compiler/cfg/gvn/simd/simd.factor index 5ca35162e7..24b59deb0d 100644 --- a/extra/compiler/cfg/gvn/simd/simd.factor +++ b/extra/compiler/cfg/gvn/simd/simd.factor @@ -20,7 +20,7 @@ IN: compiler.cfg.gvn.simd ! should be redone completely. : useless-shuffle-vector-imm? ( insn -- ? ) - [ shuffle>> ] [ rep>> rep-length iota ] bi sequence= ; + [ shuffle>> ] [ rep>> rep-length ] bi sequence= ; : compose-shuffle-vector-imm ( outer inner -- insn' ) 2dup [ rep>> ] bi@ eq? [ diff --git a/extra/crypto/passwd-md5/passwd-md5.factor b/extra/crypto/passwd-md5/passwd-md5.factor index 4a09e82842..0f17e8459c 100644 --- a/extra/crypto/passwd-md5/passwd-md5.factor +++ b/extra/crypto/passwd-md5/passwd-md5.factor @@ -26,7 +26,7 @@ PRIVATE> '[ CHAR: \0 _ ? ] "" map-as append md5 checksum-bytes :> final! - 1000 iota [ + 1000 [ "" swap { [ 0 bit? password final ? append ] diff --git a/extra/crypto/xor/xor.factor b/extra/crypto/xor/xor.factor index 45bbe55d6e..5b274dbd71 100644 --- a/extra/crypto/xor/xor.factor +++ b/extra/crypto/xor/xor.factor @@ -9,4 +9,4 @@ ERROR: empty-xor-key ; : xor-crypt ( seq key -- seq' ) [ empty-xor-key ] when-empty - [ dup length iota ] dip '[ _ mod-nth bitxor ] 2map ; + [ dup length ] dip '[ _ mod-nth bitxor ] 2map ; diff --git a/extra/cuda/devices/devices.factor b/extra/cuda/devices/devices.factor index 079234b2ee..dc69946648 100644 --- a/extra/cuda/devices/devices.factor +++ b/extra/cuda/devices/devices.factor @@ -14,7 +14,7 @@ IN: cuda.devices [ { CUdevice } ] dip '[ _ cuDeviceGet cuda-error ] with-out-parameters ; : enumerate-cuda-devices ( -- devices ) - #cuda-devices iota [ n>cuda-device ] map ; + #cuda-devices [ n>cuda-device ] map ; : with-each-cuda-device ( quot -- ) [ enumerate-cuda-devices ] dip '[ 0 _ with-cuda-context ] each ; inline @@ -64,7 +64,7 @@ IN: cuda.devices : cuda. ( -- ) init-cuda "CUDA Version: " write cuda-version number>string print nl - #cuda-devices iota [ nl ] [ cuda-device. ] interleave ; + #cuda-devices [ nl ] [ cuda-device. ] interleave ; : up/i ( x y -- z ) [ 1 - + ] keep /i ; inline diff --git a/extra/enigma/enigma-tests.factor b/extra/enigma/enigma-tests.factor index a5bf7e9632..93a1030532 100644 --- a/extra/enigma/enigma-tests.factor +++ b/extra/enigma/enigma-tests.factor @@ -3,7 +3,7 @@ USING: enigma kernel math sequences sorting tools.test ; IN: enigma.tests -{ t } [ natural-sort 26 iota sequence= ] unit-test +{ t } [ natural-sort 26 sequence= ] unit-test { "" } [ "" 4 encode ] unit-test diff --git a/extra/enigma/enigma.factor b/extra/enigma/enigma.factor index e70930a183..cc03fef19b 100644 --- a/extra/enigma/enigma.factor +++ b/extra/enigma/enigma.factor @@ -7,13 +7,13 @@ sequences sequences.extras vectors ; IN: enigma : ( -- seq ) - 26 iota >array ; + 26 >array ; : ( -- cog ) randomize ; : ( -- reflector ) - dup length iota >vector [ dup empty? ] [ + dup length >vector [ dup empty? ] [ [ [ delete-random ] [ delete-random ] bi pick exchange @@ -40,7 +40,7 @@ TUPLE: enigma cogs prev-cogs reflector ; ln 1 + ln! cogs [ nth ] each reflector nth cogs reverse [ index ] each CHAR: a + - cogs length iota [ 6 * 1 + ln mod zero? ] filter + cogs length [ 6 * 1 + ln mod zero? ] filter cogs [ unclip prefix ] change-nths ] unless ] map ; diff --git a/extra/game/debug/debug.factor b/extra/game/debug/debug.factor index c05f3488f1..86d8c50e16 100644 --- a/extra/game/debug/debug.factor +++ b/extra/game/debug/debug.factor @@ -162,7 +162,7 @@ CONSTANT: box-vertices { { 1 -1 -1 } { 1 1 -1 } } } CONSTANT: cylinder-vertices - $[ 12 iota [ 2pi 12 / * [ cos ] [ drop 0.0 ] [ sin ] tri 3array ] map ] + $[ 12 [ 2pi 12 / * [ cos ] [ drop 0.0 ] [ sin ] tri 3array ] map ] :: scale-cylinder-vertices ( radius half-height verts -- bot-verts top-verts ) verts diff --git a/extra/game/input/demos/joysticks/joysticks.factor b/extra/game/input/demos/joysticks/joysticks.factor index a6992c2566..fdf910dfae 100644 --- a/extra/game/input/demos/joysticks/joysticks.factor +++ b/extra/game/input/demos/joysticks/joysticks.factor @@ -88,7 +88,7 @@ TUPLE: joystick-demo-gadget < pack axis raxis controller buttons timer ; [ >>raxis ] [ add-gadget-with-border ] bi-curry bi* ; :: (add-button-gadgets) ( gadget shelf -- ) - gadget controller>> read-controller buttons>> length iota [ + gadget controller>> read-controller buttons>> length [ number>string [ drop ] shelf over add-gadget drop ] map gadget buttons<< ; diff --git a/extra/gpu/render/render.factor b/extra/gpu/render/render.factor index 81143ecdd7..d173c46cc5 100755 --- a/extra/gpu/render/render.factor +++ b/extra/gpu/render/render.factor @@ -239,7 +239,7 @@ DEFER: uniform-texture-accessors [ uniform-tuple-texture-accessors ] if ] [ 2dup swap empty? not and [ - iota [ + [ [ swap nth ] swap prefix over length 1 = [ swap first append ] [ swap suffix ] if ] with map @@ -398,7 +398,7 @@ DEFER: [bind-uniform-tuple] { mat4x3-uniform { [ dim 0 ] dip 4 3 >uniform-matrix-array glUniformMatrix4x3fv } } { mat4-uniform { [ dim 0 ] dip 4 4 >uniform-matrix-array glUniformMatrix4fv } } - { texture-uniform { drop dim dup iota [ texture-unit + ] int-array{ } map-as glUniform1iv } } + { texture-uniform { drop dim dup [ texture-unit + ] int-array{ } map-as glUniform1iv } } } at [ uniform invalid-uniform-type ] unless* >quotation :> value-quot type uniform-type-texture-units dim * texture-unit + @@ -450,7 +450,7 @@ DEFER: [bind-uniform-tuple] :: [bind-uniform-struct] ( value>>-quot type texture-unit name dim -- texture-unit' quot ) dim [ - iota + [ [ [ swap nth ] swap prefix ] map ] [ [ number>string name "[" append "]." surround ] map ] bi ] [ diff --git a/extra/gpu/shaders/shaders.factor b/extra/gpu/shaders/shaders.factor index b677d1b763..942aa8f2b5 100755 --- a/extra/gpu/shaders/shaders.factor +++ b/extra/gpu/shaders/shaders.factor @@ -392,7 +392,7 @@ M: vertex-array-object dispose '[ _ swap first2 bind-vertex-format ] each ; inline : (reset-vertex-array) ( -- ) - GL_MAX_VERTEX_ATTRIBS get-gl-int iota [ glDisableVertexAttribArray ] each ; inline + GL_MAX_VERTEX_ATTRIBS get-gl-int [ glDisableVertexAttribArray ] each ; inline :: ( vertex-formats program-instance -- vertex-array ) gen-vertex-array :> handle diff --git a/extra/graphviz/graphviz-docs.factor b/extra/graphviz/graphviz-docs.factor index 47761386c3..396015e09e 100644 --- a/extra/graphviz/graphviz-docs.factor +++ b/extra/graphviz/graphviz-docs.factor @@ -388,7 +388,7 @@ HELP: add-node { $example "USING: accessors graphviz prettyprint sequences ;" "" - " 5 iota [ add-node ] each" + " 5 [ add-node ] each" "statements>> [ id>> . ] each" "\"0\"\n\"1\"\n\"2\"\n\"3\"\n\"4\"" } @@ -612,7 +612,7 @@ $nl "" " over number>string \"K \" prepend =label" "" -" swap iota 2 [ first2 add-edge ] each-combination" +" swap 2 [ first2 add-edge ] each-combination" " preview ;" } $nl @@ -637,7 +637,7 @@ $nl " color " " color =color" " [node color =color ];" -" n iota [" +" n [" " number>string color prepend add-node" " ] each ;" "" @@ -674,7 +674,7 @@ $nl "graphviz graphviz.notation graphviz.render ;" "" ": add-cycle ( graph n -- graph' )" -" [ iota add-path ] [ 1 - 0 add-edge ] bi ;" +" [ add-path ] [ 1 - 0 add-edge ] bi ;" "" ": C_n ( n -- )" " " @@ -703,7 +703,7 @@ $nl "graphviz graphviz.notation graphviz.render ;" "" ": add-cycle ( graph n -- graph' )" -" [ iota add-path ] [ 1 - 0 add-edge ] bi ;" +" [ add-path ] [ 1 - 0 add-edge ] bi ;" "" ": W_n ( n -- )" " " @@ -712,7 +712,7 @@ $nl " over number>string \"W \" prepend =label" " over add-node" " over 1 - add-cycle" -" swap [ ] [ 1 - iota >array ] bi add-edge" +" swap [ ] [ 1 - >array ] bi add-edge" " preview ;" } $nl @@ -788,7 +788,7 @@ $nl "" " 0 [add-node \"invis\" =style \"none\" =shape ];" "" -" 16 iota [" +" 16 [" " [ 0 -- ] [ colored-circle add ] bi" " ] each" "preview" diff --git a/extra/graphviz/graphviz-tests.factor b/extra/graphviz/graphviz-tests.factor index d00d3ab0d9..b92938edee 100644 --- a/extra/graphviz/graphviz-tests.factor +++ b/extra/graphviz/graphviz-tests.factor @@ -58,13 +58,13 @@ SYMBOLS: supported-layouts supported-formats ; [node "point" =shape ]; [graph "t" =labelloc "circo" =layout ]; over number>string "K " prepend =label - swap iota 2 [ first2 add-edge ] each-combination ; + swap 2 [ first2 add-edge ] each-combination ; :: partite-set ( n color -- cluster ) color color =color [node color =color ]; - n iota [ + n [ number>string color prepend add-node ] each ; @@ -78,7 +78,7 @@ SYMBOLS: supported-layouts supported-formats ; n m "K %d,%d" sprintf =label ; : add-cycle ( graph n -- graph' ) - [ iota add-path ] [ 1 - 0 add-edge ] bi ; + [ add-path ] [ 1 - 0 add-edge ] bi ; : C_n ( n -- graph ) @@ -94,7 +94,7 @@ SYMBOLS: supported-layouts supported-formats ; over number>string "W " prepend =label over add-node over 1 - add-cycle - swap [ ] [ 1 - iota >array ] bi add-edge ; + swap [ ] [ 1 - >array ] bi add-edge ; : cluster-example ( -- graph ) @@ -138,7 +138,7 @@ SYMBOLS: supported-layouts supported-formats ; "" =label ]; [edge "invis" =style ]; 0 [add-node "invis" =style "none" =shape ]; - 16 iota [ + 16 [ [ 0 -- ] [ colored-circle add ] bi ] each ; diff --git a/extra/grid-meshes/grid-meshes.factor b/extra/grid-meshes/grid-meshes.factor index be790488ef..a4e3a9fd7a 100644 --- a/extra/grid-meshes/grid-meshes.factor +++ b/extra/grid-meshes/grid-meshes.factor @@ -31,7 +31,7 @@ PRIVATE> : draw-grid-mesh ( grid-mesh -- ) GL_ARRAY_BUFFER over buffer>> [ [ 4 GL_FLOAT 0 f glVertexPointer ] dip - dup dim>> second iota [ draw-vertex-buffer-row ] with each + dup dim>> second [ draw-vertex-buffer-row ] with each ] with-gl-buffer ; : ( dim -- grid-mesh ) diff --git a/extra/grouping/extras/extras-tests.factor b/extra/grouping/extras/extras-tests.factor index 6033921587..7b386af4e1 100644 --- a/extra/grouping/extras/extras-tests.factor +++ b/extra/grouping/extras/extras-tests.factor @@ -29,10 +29,10 @@ IN: grouping.extras { 2 V{ 6 7 8 } } { 3 V{ 9 } } } } [ - 10 iota [ 3 / floor ] group-by + 10 [ 3 / floor ] group-by ] unit-test { V{ { t V{ 0 1 2 3 4 5 6 7 8 9 } } } } -[ 10 iota [ drop t ] group-by ] unit-test +[ 10 [ drop t ] group-by ] unit-test { V{ } } [ { } [ drop t ] group-by ] unit-test diff --git a/extra/html/parser/analyzer/analyzer.factor b/extra/html/parser/analyzer/analyzer.factor index 9a26531525..b564b9009b 100644 --- a/extra/html/parser/analyzer/analyzer.factor +++ b/extra/html/parser/analyzer/analyzer.factor @@ -21,7 +21,7 @@ IN: html.parser.analyzer [ >alist ] [ '[ second @ ] ] bi* filter ; inline : loopn-index ( n quot -- ) - [ iota ] [ '[ @ not ] ] bi* find 2drop ; inline + [ ] [ '[ @ not ] ] bi* find 2drop ; inline : loopn ( n quot -- ) [ drop ] prepose loopn-index ; inline diff --git a/extra/id3/id3-tests.factor b/extra/id3/id3-tests.factor index bd5e9bb27d..8168c96a00 100644 --- a/extra/id3/id3-tests.factor +++ b/extra/id3/id3-tests.factor @@ -43,4 +43,4 @@ IN: id3.tests { t } -[ 10000 iota [ synchsafe>sequence sequence>synchsafe ] map [ < ] monotonic? ] unit-test +[ 10000 [ synchsafe>sequence sequence>synchsafe ] map [ < ] monotonic? ] unit-test diff --git a/extra/images/atlas/atlas.factor b/extra/images/atlas/atlas.factor index 8d03207cd5..3d0904c67a 100644 --- a/extra/images/atlas/atlas.factor +++ b/extra/images/atlas/atlas.factor @@ -76,7 +76,7 @@ ERROR: atlas-image-formats-dont-match images ; image dim>> first2 :> ( w h ) image-placement loc>> first2 :> ( x y ) - h iota [| row | + h [| row | 0 row w image pixel-row-slice-at x y row + w atlas set-pixel-row-at ] each ; inline diff --git a/extra/images/pbm/pbm.factor b/extra/images/pbm/pbm.factor index ae1b258246..f0462df554 100644 --- a/extra/images/pbm/pbm.factor +++ b/extra/images/pbm/pbm.factor @@ -37,7 +37,7 @@ SINGLETON: pbm-image :: read-binary-bits ( width height -- ) width 8 align 8 / height * read width 8 align 8 / [| row | - width iota [| n | + width [| n | n 8 / floor row nth n 8 mod 7 swap - bit? [ 0 ] [ 255 ] if , diff --git a/extra/images/png/png.factor b/extra/images/png/png.factor index 918ea68858..d40ce1f838 100644 --- a/extra/images/png/png.factor +++ b/extra/images/png/png.factor @@ -150,7 +150,7 @@ ERROR: bad-filter n ; prev width tail-slice :> b curr :> a curr width tail-slice :> x - x length iota + x length filter { { filter-none [ drop ] } { filter-sub [ [| n | n x nth n a nth + 256 wrap n x set-nth ] each ] } diff --git a/extra/images/tga/tga.factor b/extra/images/tga/tga.factor index d0b4177d23..6e9d402af5 100644 --- a/extra/images/tga/tga.factor +++ b/extra/images/tga/tga.factor @@ -79,7 +79,7 @@ ERROR: bad-tga-unsupported ; 41 read ascii decode [ 0 = ] trim ; inline : read-author-comments ( -- string ) - 4 iota [ drop 81 read ascii decode [ 0 = ] trim ] map concat ; inline + 4 [ drop 81 read ascii decode [ 0 = ] trim ] map concat ; inline : read-date-timestamp ( -- timestamp ) timestamp new @@ -132,16 +132,16 @@ ERROR: bad-tga-unsupported ; 1 read le> 4 = ; inline : read-scan-line-table ( height -- scan-offsets ) - iota [ drop 4 read le> ] map ; inline + [ drop 4 read le> ] map ; inline : read-postage-stamp-image ( depth -- postage-data ) 8 align 8 / 1 read le> 1 read le> * * read ; inline :: read-color-correction-table ( -- correction-table ) - 256 iota + 256 [ drop - 4 iota + 4 [ drop 2 read le> 65535 /f :> alpha @@ -153,7 +153,7 @@ ERROR: bad-tga-unsupported ; ] map ; inline : read-developer-directory ( -- developer-directory ) - 2 read le> iota + 2 read le> [ drop 2 read le> diff --git a/extra/io/streams/peek/peek-tests.factor b/extra/io/streams/peek/peek-tests.factor index d9a2fb6a16..0d6ab019c7 100644 --- a/extra/io/streams/peek/peek-tests.factor +++ b/extra/io/streams/peek/peek-tests.factor @@ -115,7 +115,7 @@ IN: io.streams.peek.tests [ [ [ - 26 iota >byte-array + 26 >byte-array 4 over stream-peek , 6 over stream-peek , 2 over stream-read , diff --git a/extra/jamshred/gl/gl.factor b/extra/jamshred/gl/gl.factor index 7816907a7d..36d53adfd8 100644 --- a/extra/jamshred/gl/gl.factor +++ b/extra/jamshred/gl/gl.factor @@ -44,7 +44,7 @@ CONSTANT: wall-drawing-offset 0.15 : equally-spaced-radians ( n -- seq ) ! return a sequence of n numbers between 0 and 2pi - [ iota ] keep [ / pi 2 * * ] curry map ; + [ ] keep [ / pi 2 * * ] curry map ; : draw-segment-vertex ( segment theta -- ) over color>> gl-color segment-vertex-and-normal diff --git a/extra/koszul/koszul.factor b/extra/koszul/koszul.factor index e61286c10e..da2b62dd70 100644 --- a/extra/koszul/koszul.factor +++ b/extra/koszul/koszul.factor @@ -74,7 +74,7 @@ SYMBOL: terms [ > ] with count ; : inversions ( seq -- n ) - 0 swap [ length iota ] keep [ + 0 swap [ length ] keep [ [ nth ] 2keep swap 1 + tail-slice (inversions) + ] curry each ; @@ -142,12 +142,12 @@ DEFER: (d) [ dup length pick nth push ] reduce ; : nth-basis-elt ( generators n -- elt ) - over length iota [ + over length [ 3dup bit? [ nth ] [ 2drop f ] if ] map sift 2nip ; : basis ( generators -- seq ) - natural-sort dup length 2^ iota [ nth-basis-elt ] with map ; + natural-sort dup length 2^ [ nth-basis-elt ] with map ; : (tensor) ( seq1 seq2 -- seq ) [ @@ -177,7 +177,7 @@ DEFER: (d) dim-im/ker-d ; : graded-ker/im-d ( graded-basis -- seq ) - [ length iota ] keep [ (graded-ker/im-d) ] curry map ; + [ length ] keep [ (graded-ker/im-d) ] curry map ; : graded-betti ( generators -- seq ) basis graded graded-ker/im-d unzip but-last 0 prefix v- ; @@ -189,8 +189,8 @@ DEFER: (d) dim-im/ker-d ; :: bigraded-ker/im-d ( basis -- seq ) - basis length iota [| z | - basis first length iota [| u | + basis length [| z | + basis first length [| u | u z basis (bigraded-ker/im-d) ] map ] map ; @@ -265,8 +265,8 @@ DEFER: (d) 3array ; :: bigraded-triples ( grid -- triples ) - grid length iota [| z | - grid first length iota [| u | + grid length [| z | + grid first length [| u | u z grid bigraded-triple ] map ] map ; diff --git a/extra/lcd/lcd.factor b/extra/lcd/lcd.factor index 0056df046c..63699ae93d 100644 --- a/extra/lcd/lcd.factor +++ b/extra/lcd/lcd.factor @@ -17,7 +17,7 @@ IN: lcd '[ _ lcd-digit ] { } map-as concat ; : lcd ( digit-str -- string ) - 4 iota [ lcd-row ] with map "\n" join ; + 4 [ lcd-row ] with map "\n" join ; : ( model -- gadget ) [ timestamp>hms lcd ] diff --git a/extra/lint/lint.factor b/extra/lint/lint.factor index dee21564c2..82ad561207 100644 --- a/extra/lint/lint.factor +++ b/extra/lint/lint.factor @@ -29,7 +29,7 @@ CONSTANT: trivial-defs { [ ">" write ] [ "/>" write ] [ " " write ] [ 0 or + ] - [ dup length iota ] + [ dup length ] [ 0 swap copy ] [ dup length ] [ 0 swap ] diff --git a/extra/macho/macho.factor b/extra/macho/macho.factor index 65157c7914..06f49bc0b6 100644 --- a/extra/macho/macho.factor +++ b/extra/macho/macho.factor @@ -892,7 +892,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands ) [ [ class-of heap-size ] [ >c-ptr ] - [ ncmds>> ] tri iota [ + [ ncmds>> ] tri [ drop read-command ] each drop ] { } make ; diff --git a/extra/mason/common/common.factor b/extra/mason/common/common.factor index 3bca866ea3..4d4290a61e 100644 --- a/extra/mason/common/common.factor +++ b/extra/mason/common/common.factor @@ -26,7 +26,7 @@ SYMBOL: current-git-id try-output-process ; : retry ( n quot -- ) - [ iota ] dip + [ ] dip '[ drop @ f ] attempt-all drop ; inline : upload-process ( process -- ) diff --git a/extra/math/extras/extras-tests.factor b/extra/math/extras/extras-tests.factor index 368a1b756c..8acda1801a 100644 --- a/extra/math/extras/extras-tests.factor +++ b/extra/math/extras/extras-tests.factor @@ -7,7 +7,7 @@ tools.test ; IN: math.extras.test { { 1 -1/2 1/6 0 -1/30 0 1/42 0 -1/30 0 } } -[ 10 iota [ bernoulli ] map ] unit-test +[ 10 [ bernoulli ] map ] unit-test { -1 } [ -1 7 jacobi ] unit-test { 0 } [ 3 3 jacobi ] unit-test @@ -143,11 +143,11 @@ IN: math.extras.test { { 0 1 2 3 0 0 1 } } [ { 1 2 3 3 2 1 2 } [ <= ] monotonic-count ] unit-test { 4 } [ { 1 2 3 1 2 3 4 5 } [ < ] max-monotonic-count ] unit-test -{ 2470 } [ 20 iota sum-squares ] unit-test -{ 2470 } [ 20 iota >array sum-squares ] unit-test +{ 2470 } [ 20 sum-squares ] unit-test +{ 2470 } [ 20 >array sum-squares ] unit-test -{ 36100 } [ 20 iota sum-cubes ] unit-test -{ 36100 } [ 20 iota >array sum-cubes ] unit-test +{ 36100 } [ 20 sum-cubes ] unit-test +{ 36100 } [ 20 >array sum-cubes ] unit-test { { diff --git a/extra/math/extras/extras.factor b/extra/math/extras/extras.factor index 1808e1c031..d2a49f6ee9 100644 --- a/extra/math/extras/extras.factor +++ b/extra/math/extras/extras.factor @@ -34,7 +34,7 @@ DEFER: bernoulli ] [ 1 + ] bi [ 0 [ [ nCk ] [ bernoulli * ] bi + ] with reduce ] keep recip neg * ; @@ -119,13 +119,13 @@ PRIVATE> : bartlett ( n -- seq ) dup 1 <= [ 1 = [ 1 1array ] [ { } ] if ] [ - [ iota ] [ 1 - 2 / ] bi [ + [ ] [ 1 - 2 / ] bi [ [ recip * ] [ >= ] 2bi [ 2 swap - ] when ] curry map ] if ; : [0,2pi] ( n -- seq ) - [ iota ] [ 1 - 2pi swap / ] bi v*n ; + [ ] [ 1 - 2pi swap / ] bi v*n ; : hanning ( n -- seq ) dup 1 <= [ 1 = [ 1 1array ] [ { } ] if ] [ @@ -202,7 +202,7 @@ PRIVATE> unzip cum-sum [ last random ] [ bisect-left ] bi swap nth ; : unique-indices ( seq -- unique indices ) - [ members ] keep over dup length iota H{ } zip-as '[ _ at ] map ; + [ members ] keep over dup length H{ } zip-as '[ _ at ] map ; : digitize] ( seq bins -- seq' ) '[ _ bisect-left ] map ; @@ -309,12 +309,12 @@ PRIVATE> GENERIC: sum-squares ( seq -- n ) M: object sum-squares [ sq ] map-sum ; -M: iota-tuple sum-squares +M: iota sum-squares length 1 - [ ] [ 1 + ] [ 1/2 + ] tri * * 3 / ; GENERIC: sum-cubes ( seq -- n ) M: object sum-cubes [ 3 ^ ] map-sum ; -M: iota-tuple sum-cubes sum sq ; +M: iota sum-cubes sum sq ; : mobius ( n -- x ) group-factors values [ 1 ] [ diff --git a/extra/math/factorials/factorials-tests.factor b/extra/math/factorials/factorials-tests.factor index 9850e50033..039a42c25d 100644 --- a/extra/math/factorials/factorials-tests.factor +++ b/extra/math/factorials/factorials-tests.factor @@ -49,32 +49,32 @@ IN: math.factorials { t } [ 20 3 [ 1 factorial-power ] [ falling-factorial ] 2bi = ] unit-test { t } [ 20 3 [ 0 factorial-power ] [ ^ ] 2bi = ] unit-test -{ { 1 2 6 30 210 2310 } } [ 6 iota [ primorial ] map ] unit-test +{ { 1 2 6 30 210 2310 } } [ 6 [ primorial ] map ] unit-test { t } [ - 6 iota + 6 [ [ double-factorial ] map ] [ [ 2 multifactorial ] map ] bi = ] unit-test { { 1 2 12 120 1680 30240 } } -[ 6 iota [ quadruple-factorial ] map ] unit-test +[ 6 [ quadruple-factorial ] map ] unit-test -{ { 1 1 2 12 288 } } [ 5 iota [ super-factorial ] map ] unit-test +{ { 1 1 2 12 288 } } [ 5 [ super-factorial ] map ] unit-test -{ { 1 1 4 108 27648 } } [ 5 iota [ hyper-factorial ] map ] unit-test +{ { 1 1 4 108 27648 } } [ 5 [ hyper-factorial ] map ] unit-test { { 1 1 1 5 19 101 619 4421 35899 326981 } } -[ 10 iota [ alternating-factorial ] map ] unit-test +[ 10 [ alternating-factorial ] map ] unit-test -{ { 1 1 2 9 262144 } } [ 5 iota [ exponential-factorial ] map ] unit-test +{ { 1 1 2 9 262144 } } [ 5 [ exponential-factorial ] map ] unit-test { V{ 2 3 5 7 23 719 5039 } } -[ 10,000 iota [ factorial-prime? ] filter ] unit-test +[ 10,000 [ factorial-prime? ] filter ] unit-test { V{ 3 5 7 29 31 211 2309 2311 } } -[ 10,000 iota [ primorial-prime? ] filter ] unit-test +[ 10,000 [ primorial-prime? ] filter ] unit-test { 10 } [ 3628800 reverse-factorial ] unit-test { 12 } [ 479001600 reverse-factorial ] unit-test diff --git a/extra/math/finance/finance-tests.factor b/extra/math/finance/finance-tests.factor index 44e18b0829..ed2d4cae34 100644 --- a/extra/math/finance/finance-tests.factor +++ b/extra/math/finance/finance-tests.factor @@ -9,12 +9,12 @@ IN: math.finance.tests { { 2 4 } } [ { 1 3 5 } 2 sma ] unit-test -{ { 2 3 4 5 } } [ 6 iota 2 dema ] unit-test +{ { 2 3 4 5 } } [ 6 2 dema ] unit-test -{ t } [ 6 iota 2 [ dema ] [ 1 gdema ] 2bi = ] unit-test +{ t } [ 6 2 [ dema ] [ 1 gdema ] 2bi = ] unit-test -{ { 3 4 5 } } [ 6 iota 2 tema ] unit-test -{ { 6 7 8 9 } } [ 10 iota 3 tema ] unit-test +{ { 3 4 5 } } [ 6 2 tema ] unit-test +{ { 6 7 8 9 } } [ 10 3 tema ] unit-test { { 1 3 1 } } [ { 1 3 2 6 3 } 2 momentum ] unit-test diff --git a/extra/math/matrices/laplace/laplace.factor b/extra/math/matrices/laplace/laplace.factor index 817fa89d9a..a38d152c68 100644 --- a/extra/math/matrices/laplace/laplace.factor +++ b/extra/math/matrices/laplace/laplace.factor @@ -18,7 +18,7 @@ M: missing length seq>> length 1 - ; INSTANCE: missing immutable-sequence : first-sub-matrix ( matrix -- first-row seq ) - [ unclip-slice swap ] [ length iota ] bi + [ unclip-slice swap ] [ length ] bi [ '[ _ ] map ] with map ; :: laplace-expansion ( row matrix -- x ) diff --git a/extra/math/primes/solovay-strassen/solovay-strassen-tests.factor b/extra/math/primes/solovay-strassen/solovay-strassen-tests.factor index 359e01fa5c..9801fc80f3 100644 --- a/extra/math/primes/solovay-strassen/solovay-strassen-tests.factor +++ b/extra/math/primes/solovay-strassen/solovay-strassen-tests.factor @@ -2,6 +2,6 @@ USING: kernel math.primes sequences tools.test ; IN: math.primes.solovay-strassen { t } [ - 100,000 iota [ solovay-strassen ] filter + 100,000 [ solovay-strassen ] filter 100,000 primes-upto = ] unit-test diff --git a/extra/math/primes/solovay-strassen/solovay-strassen.factor b/extra/math/primes/solovay-strassen/solovay-strassen.factor index 3daad08e6f..ac4eb70768 100644 --- a/extra/math/primes/solovay-strassen/solovay-strassen.factor +++ b/extra/math/primes/solovay-strassen/solovay-strassen.factor @@ -9,7 +9,7 @@ IN: math.primes.solovay-strassen [ drop n 1 - [1,b) random :> a a n simple-gcd 1 > [ t ] [ diff --git a/extra/math/splines/splines.factor b/extra/math/splines/splines.factor index db8e87ae61..1352b34322 100644 --- a/extra/math/splines/splines.factor +++ b/extra/math/splines/splines.factor @@ -55,7 +55,7 @@ PRIVATE> acc ; :: ( p0 m0 p1 m1 -- polynomials ) - p0 length iota [ + p0 length [ { [ p0 nth ] [ m0 nth ] [ p1 nth ] [ m1 nth ] diff --git a/extra/math/splines/viewer/viewer.factor b/extra/math/splines/viewer/viewer.factor index 523c927b88..59c347d740 100644 --- a/extra/math/splines/viewer/viewer.factor +++ b/extra/math/splines/viewer/viewer.factor @@ -8,7 +8,7 @@ IN: math.splines.viewer ] keep [ /f swap [ polyval ] with map ] curry with map ] curry map concat ; diff --git a/extra/math/transforms/fft/fft.factor b/extra/math/transforms/fft/fft.factor index b887b55a53..60e0100349 100644 --- a/extra/math/transforms/fft/fft.factor +++ b/extra/math/transforms/fft/fft.factor @@ -11,8 +11,8 @@ DEFER: (fft) ! Discrete Fourier Transform :: (slow-fft) ( seq inverse? -- seq' ) seq length :> N - inverse? 1 -1 ? 2pi * N / N iota n*v :> omega - N iota [| k | + inverse? 1 -1 ? 2pi * N / N n*v :> omega + N [| k | 0 seq omega [ k * cis * + ] 2each inverse? [ N / ] when ] map ; inline diff --git a/extra/multi-methods/multi-methods.factor b/extra/multi-methods/multi-methods.factor index 2909d0b9e7..74b3e0cd6e 100644 --- a/extra/multi-methods/multi-methods.factor +++ b/extra/multi-methods/multi-methods.factor @@ -22,7 +22,7 @@ SYMBOL: total : canonicalize-specializer-1 ( specializer -- specializer' ) [ [ class? ] filter - [ length iota [ 1 + neg ] map ] keep zip + [ length [ 1 + neg ] map ] keep zip [ length args [ max ] change ] keep ] [ @@ -112,7 +112,7 @@ SYMBOL: total swap predicate-def append ; : multi-predicate ( classes -- quot ) - dup length iota + dup length [ picker 2array ] 2map [ drop object eq? ] assoc-reject [ [ t ] ] [ diff --git a/extra/noise/noise.factor b/extra/noise/noise.factor index aa62a4391d..922340baee 100644 --- a/extra/noise/noise.factor +++ b/extra/noise/noise.factor @@ -49,7 +49,7 @@ TYPED: normal-noise-map ( seed: integer dim -- bytes ) ERROR: invalid-perlin-noise-table table ; : ( -- table ) - 256 iota >byte-array randomize dup append ; inline + 256 >byte-array randomize dup append ; inline : validate-table ( table -- table ) dup { [ byte-array? ] [ length 512 >= ] } 1&& @@ -120,7 +120,7 @@ TYPED:: perlin-noise ( table: byte-array point: float-4 -- value: float ) faded trilerp ; MEMO: perlin-noise-map-coords ( dim -- coords ) - first2 iota [| x y | x iota [ y 0.0 0.0 float-4-boa ] float-4-array{ } map-as ] with map concat ; + first2 [| x y | x iota [ y 0.0 0.0 float-4-boa ] float-4-array{ } map-as ] with map concat ; TYPED:: perlin-noise-map ( table: byte-array transform: matrix4 coords: float-4-array -- map: float-array ) coords [| coord | table transform coord m4.v perlin-noise ] data-map( float-4 -- c:float ) diff --git a/extra/nurbs/nurbs.factor b/extra/nurbs/nurbs.factor index 1b5a636914..cc938ff205 100644 --- a/extra/nurbs/nurbs.factor +++ b/extra/nurbs/nurbs.factor @@ -31,7 +31,7 @@ TUPLE: nurbs-curve c1 c2 c3 c4 float-array{ } 4sequence ; : order-knot-constants ( curve order -- knot-constants ) - 2dup [ knots>> length ] dip - iota + 2dup [ knots>> length ] dip - [ order-index-knot-constants ] 2with map ; : knot-constants ( curve -- knot-constants ) diff --git a/extra/odbc/odbc.factor b/extra/odbc/odbc.factor index 6b6c0a706d..ceb2e72b05 100644 --- a/extra/odbc/odbc.factor +++ b/extra/odbc/odbc.factor @@ -243,7 +243,7 @@ C: field : odbc-get-row-fields ( statement -- seq ) [ - dup odbc-number-of-columns iota [ + dup odbc-number-of-columns [ 1 + odbc-get-field value>> , ] with each ] { } make ; diff --git a/extra/pcre/pcre.factor b/extra/pcre/pcre.factor index e1a2a66619..5759c1b3ec 100644 --- a/extra/pcre/pcre.factor +++ b/extra/pcre/pcre.factor @@ -72,7 +72,7 @@ ERROR: pcre-error value ; : name-table-entries ( pcre extra -- addrs ) [ name-table ] [ name-entry-size ] [ name-count ] 2tri - iota [ * + name-table-entry 2array ] 2with map ; + [ * + name-table-entry 2array ] 2with map ; : options ( pcre -- opts ) f PCRE_INFO_OPTIONS pcre-fullinfo ; diff --git a/extra/picomath/picomath.factor b/extra/picomath/picomath.factor index 51e8433c14..217679ec01 100644 --- a/extra/picomath/picomath.factor +++ b/extra/picomath/picomath.factor @@ -368,7 +368,7 @@ DEFER: gamma x 0 <= [ "Invalid input" throw ] when x 12 < [ x gamma abs log ] [ 1.0 x x * / :> z - 7 c nth 7 iota reverse [ [ z * ] [ c nth ] bi* + ] each x / :> series + 7 c nth 7 reverse [ [ z * ] [ c nth ] bi* + ] each x / :> series x 0.5 - x log * x - halfLogTwoPi + series + ] if ; @@ -411,7 +411,7 @@ CONSTANT: Q { 0.0 :> num! 1.0 :> den! y 1 - :> z! - 8 iota [ + 8 [ [ P nth num + z * num! ] [ Q nth den z * + den! ] bi ] each diff --git a/extra/project-euler/001/001.factor b/extra/project-euler/001/001.factor index 5bf44eddc6..1c6b100cda 100644 --- a/extra/project-euler/001/001.factor +++ b/extra/project-euler/001/001.factor @@ -47,14 +47,14 @@ PRIVATE> : euler001b ( -- answer ) - 1000 iota [ [ 5 mod ] [ 3 mod ] bi [ 0 = ] either? ] filter sum ; + 1000 [ [ 5 mod ] [ 3 mod ] bi [ 0 = ] either? ] filter sum ; ! [ euler001b ] 100 ave-time ! 0 ms ave run time - 0.06 SD (100 trials) : euler001c ( -- answer ) - 1000 iota [ { 3 5 } [ divisor? ] with any? ] filter sum ; + 1000 [ { 3 5 } [ divisor? ] with any? ] filter sum ; ! [ euler001c ] 100 ave-time ! 0 ms ave run time - 0.06 SD (100 trials) diff --git a/extra/project-euler/011/011.factor b/extra/project-euler/011/011.factor index 241fc2b626..1b554efa17 100644 --- a/extra/project-euler/011/011.factor +++ b/extra/project-euler/011/011.factor @@ -72,12 +72,12 @@ IN: project-euler.011 : pad-front ( matrix -- matrix ) [ - length iota [ 0 ] map + length [ 0 ] map ] keep [ append ] 2map ; : pad-back ( matrix -- matrix ) [ - length iota [ 0 ] map + length [ 0 ] map ] keep [ append ] 2map ; : diagonal/ ( -- matrix ) diff --git a/extra/project-euler/024/024.factor b/extra/project-euler/024/024.factor index d95dc741eb..627f6499ac 100644 --- a/extra/project-euler/024/024.factor +++ b/extra/project-euler/024/024.factor @@ -24,7 +24,7 @@ IN: project-euler.024 ! -------- : euler024 ( -- answer ) - 999999 10 iota permutation digits>number ; + 999999 10 permutation digits>number ; ! [ euler024 ] 100 ave-time ! 0 ms ave run time - 0.27 SD (100 trials) diff --git a/extra/project-euler/027/027.factor b/extra/project-euler/027/027.factor index cd2620bc4f..6dda6a502b 100644 --- a/extra/project-euler/027/027.factor +++ b/extra/project-euler/027/027.factor @@ -46,7 +46,7 @@ IN: project-euler.027 [ prime? ] filter [ dup [ neg ] map append ] keep cartesian-product concat [ first2 < ] filter ; : quadratic ( b a n -- m ) diff --git a/extra/project-euler/030/030.factor b/extra/project-euler/030/030.factor index 6db9707f73..6c7dbd9d87 100644 --- a/extra/project-euler/030/030.factor +++ b/extra/project-euler/030/030.factor @@ -38,7 +38,7 @@ IN: project-euler.030 PRIVATE> : euler030 ( -- answer ) - 325537 iota [ dup sum-fifth-powers = ] filter sum 1 - ; + 325537 [ dup sum-fifth-powers = ] filter sum 1 - ; ! [ euler030 ] 100 ave-time ! 1700 ms ave run time - 64.84 SD (100 trials) diff --git a/extra/project-euler/032/032.factor b/extra/project-euler/032/032.factor index 00de5e1a85..ff1824463b 100644 --- a/extra/project-euler/032/032.factor +++ b/extra/project-euler/032/032.factor @@ -27,8 +27,8 @@ IN: project-euler.032 number + 9 factorial [ + 9 permutation [ 1 + ] map digits>number ] map ; : 1and4 ( n -- ? ) diff --git a/extra/project-euler/043/043.factor b/extra/project-euler/043/043.factor index 985c53f745..79f4cfce6b 100644 --- a/extra/project-euler/043/043.factor +++ b/extra/project-euler/043/043.factor @@ -82,7 +82,7 @@ PRIVATE> [ unclip 1 head prefix concat ] map [ all-unique? ] filter ; : add-missing-digit ( seq -- seq ) - dup natural-sort 10 iota swap diff prepend ; + dup natural-sort 10 swap diff prepend ; : interesting-pandigitals ( -- seq ) 17 candidates { 13 11 7 5 3 2 } [ diff --git a/extra/project-euler/052/052.factor b/extra/project-euler/052/052.factor index ae603c81fd..9fc2fac588 100644 --- a/extra/project-euler/052/052.factor +++ b/extra/project-euler/052/052.factor @@ -24,7 +24,7 @@ IN: project-euler.052 [ 1 + * ] with map ; inline : all-same-digits? ( seq -- ? ) [ number>digits natural-sort ] map all-equal? ; diff --git a/extra/project-euler/053/053.factor b/extra/project-euler/053/053.factor index 2e2d317401..3e6d6c386d 100644 --- a/extra/project-euler/053/053.factor +++ b/extra/project-euler/053/053.factor @@ -27,7 +27,7 @@ IN: project-euler.053 ! -------- : euler053 ( -- answer ) - 23 100 [a,b] [ dup iota [ nCk 1000000 > ] with count ] map-sum ; + 23 100 [a,b] [ dup [ nCk 1000000 > ] with count ] map-sum ; ! [ euler053 ] 100 ave-time ! 52 ms ave run time - 4.44 SD (100 trials) diff --git a/extra/project-euler/055/055.factor b/extra/project-euler/055/055.factor index 586d76b957..a523d6b696 100644 --- a/extra/project-euler/055/055.factor +++ b/extra/project-euler/055/055.factor @@ -61,7 +61,7 @@ IN: project-euler.055 PRIVATE> : euler055 ( -- answer ) - 10000 iota [ lychrel? ] count ; + 10000 [ lychrel? ] count ; ! [ euler055 ] 100 ave-time ! 478 ms ave run time - 30.63 SD (100 trials) diff --git a/extra/project-euler/057/057.factor b/extra/project-euler/057/057.factor index 4e35c9da58..2850881ac5 100644 --- a/extra/project-euler/057/057.factor +++ b/extra/project-euler/057/057.factor @@ -36,7 +36,7 @@ IN: project-euler.057 >fraction [ number>string length ] bi@ > ; inline : euler057 ( -- answer ) - 0 1000 iota [ drop 2 + recip dup 1 + longer-numerator? ] count nip ; + 0 1000 [ drop 2 + recip dup 1 + longer-numerator? ] count nip ; ! [ euler057 ] 100 ave-time ! 1728 ms ave run time - 80.81 SD (100 trials) diff --git a/extra/project-euler/081/081.factor b/extra/project-euler/081/081.factor index 1c858e63de..d3776ef1d4 100644 --- a/extra/project-euler/081/081.factor +++ b/extra/project-euler/081/081.factor @@ -60,7 +60,7 @@ IN: project-euler.081 3dup minimal-path-sum-to '[ _ + ] change-matrix ; : (euler081) ( matrix -- n ) - dup first length iota dup + dup first length dup [ pick update-minimal-path-sum ] cartesian-each last last ; diff --git a/extra/project-euler/150/150.factor b/extra/project-euler/150/150.factor index c31b2b3e2a..0addaf6d1b 100644 --- a/extra/project-euler/150/150.factor +++ b/extra/project-euler/150/150.factor @@ -52,9 +52,9 @@ IN: project-euler.150 :: (euler150) ( m -- n ) sums-triangle :> table - m iota [| x | - x 1 + iota [| y | - m x - iota [| z | + m [| x | + x 1 + [| y | + m x - [| z | x z + table nth-unsafe [ y z + 1 + swap nth-unsafe ] [ y swap nth-unsafe ] bi - diff --git a/extra/project-euler/151/151.factor b/extra/project-euler/151/151.factor index 1c5ee22b75..6b20511d60 100644 --- a/extra/project-euler/151/151.factor +++ b/extra/project-euler/151/151.factor @@ -62,7 +62,7 @@ DEFER: (euler151) { { 0 0 1 0 } [ { 0 0 0 1 } (euler151) 1 + ] } { { 0 1 0 0 } [ { 0 0 1 1 } (euler151) 1 + ] } { { 1 0 0 0 } [ { 0 1 1 1 } (euler151) 1 + ] } - [ [ dup length iota [ pick-sheet ] with map-sum ] [ sum ] bi / ] + [ [ dup length [ pick-sheet ] with map-sum ] [ sum ] bi / ] } case ] cache ; : euler151 ( -- answer ) diff --git a/extra/project-euler/164/164.factor b/extra/project-euler/164/164.factor index be5d40df9b..6b881cb568 100644 --- a/extra/project-euler/164/164.factor +++ b/extra/project-euler/164/164.factor @@ -18,7 +18,7 @@ IN: project-euler.164 ] bi [ 2array ] with map ; : next-table ( assoc -- assoc ) H{ } clone swap diff --git a/extra/project-euler/265/265.factor b/extra/project-euler/265/265.factor index 261a9e8ff2..3a527c9d42 100644 --- a/extra/project-euler/265/265.factor +++ b/extra/project-euler/265/265.factor @@ -28,7 +28,7 @@ IN: project-euler.265 CONSTANT: N 5 : decompose ( n -- seq ) - N iota [ drop [ 2/ ] [ 1 bitand ] bi ] map nip reverse ; + N [ drop [ 2/ ] [ 1 bitand ] bi ] map nip reverse ; : bits ( seq -- n ) 0 [ [ 2 * ] [ + ] bi* ] reduce ; @@ -37,7 +37,7 @@ CONSTANT: N 5 unclip decompose append [ 1 bitand ] map ; : rotate-bits ( seq -- seq' ) - dup length iota [ cut prepend bits ] with map ; + dup length [ cut prepend bits ] with map ; : ?register ( acc seq -- ) complete rotate-bits diff --git a/extra/project-euler/common/common.factor b/extra/project-euler/common/common.factor index 4b4548e819..d3248a9dfc 100644 --- a/extra/project-euler/common/common.factor +++ b/extra/project-euler/common/common.factor @@ -48,7 +48,7 @@ IN: project-euler.common HINTS: count-digits fixnum ; : max-children ( seq -- seq ) - [ dup length 1 - iota [ nth-pair max , ] with each ] { } make ; + [ dup length 1 - [ nth-pair max , ] with each ] { } make ; ! Propagate one row into the upper one : propagate ( bottom top -- newtop ) diff --git a/extra/python/python-docs.factor b/extra/python/python-docs.factor index e1a072bb6e..d6371151f9 100644 --- a/extra/python/python-docs.factor +++ b/extra/python/python-docs.factor @@ -14,7 +14,7 @@ HELP: >py { $examples { $example "USING: arrays prettyprint python sequences ;" - "10 iota >array >py py> ." + "10 >array >py py> ." "{ 0 1 2 3 4 5 6 7 8 9 }" } } diff --git a/extra/python/python.factor b/extra/python/python.factor index 42c2a48b54..88bceafaf5 100644 --- a/extra/python/python.factor +++ b/extra/python/python.factor @@ -54,10 +54,10 @@ SPECIALIZED-ARRAY: void* [ rot py-list-set-item ] with each-index ; : py-tuple>array ( py-tuple -- arr ) - dup py-tuple-size iota [ py-tuple-get-item ] with map ; + dup py-tuple-size [ py-tuple-get-item ] with map ; : py-list>vector ( py-list -- vector ) - dup py-list-size iota [ py-list-get-item ] with V{ } map-as ; + dup py-list-size [ py-list-get-item ] with V{ } map-as ; DEFER: >py diff --git a/extra/random/cmwc/cmwc-tests.factor b/extra/random/cmwc/cmwc-tests.factor index 27bdb3245f..ad25ee0054 100644 --- a/extra/random/cmwc/cmwc-tests.factor +++ b/extra/random/cmwc/cmwc-tests.factor @@ -26,18 +26,18 @@ IN: random.cmwc.tests } } [ cmwc-4096 - 4096 iota uint >c-array 362436 seed-random [ + 4096 uint >c-array 362436 seed-random [ 10 [ random-32 ] replicate ] with-random ] unit-test { t } [ cmwc-4096 [ - 4096 iota uint >c-array 362436 seed-random [ + 4096 uint >c-array 362436 seed-random [ 10 [ random-32 ] replicate ] with-random ] [ - 4096 iota uint >c-array 362436 seed-random [ + 4096 uint >c-array 362436 seed-random [ 10 [ random-32 ] replicate ] with-random ] bi = diff --git a/extra/rosetta-code/bitmap-bezier/bitmap-bezier.factor b/extra/rosetta-code/bitmap-bezier/bitmap-bezier.factor index e65a13aab7..a38828114e 100644 --- a/extra/rosetta-code/bitmap-bezier/bitmap-bezier.factor +++ b/extra/rosetta-code/bitmap-bezier/bitmap-bezier.factor @@ -20,7 +20,7 @@ IN: rosetta-code.bitmap-bezier ! gives an interval of x from 0 to 1 to map the bezier function : t-interval ( x -- interval ) - [ iota ] keep 1 - [ / ] curry map ; + [ ] keep 1 - [ / ] curry map ; ! turns a list of points into the list of lines between them : points-to-lines ( seq -- seq ) diff --git a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor index 940eb4e3b6..55f54c0f5a 100644 --- a/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor +++ b/extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor @@ -63,5 +63,5 @@ M:: bounty <=> ( a b -- <=> ) ] 2map ; : best-bounty ( -- bounty ) - find-max-amounts [ 1 + iota ] map + find-max-amounts [ 1 + ] map [ ] [ max ] map-reduce ; diff --git a/extra/rosetta-code/knapsack/knapsack.factor b/extra/rosetta-code/knapsack/knapsack.factor index 4f989c2938..a330344599 100644 --- a/extra/rosetta-code/knapsack/knapsack.factor +++ b/extra/rosetta-code/knapsack/knapsack.factor @@ -72,13 +72,13 @@ CONSTANT: limit 400 ] each ; : fill-table ( table -- ) - [ items length iota ] dip + [ items length ] dip '[ _ iterate ] each ; :: extract-packed-items ( table -- items ) [ limit :> weight! - items length iota [| item-no | + items length [| item-no | item-no table nth :> prev item-no 1 + table nth :> curr weight [ curr nth ] [ prev nth ] bi = diff --git a/extra/rosetta-code/long-multiplication/long-multiplication.factor b/extra/rosetta-code/long-multiplication/long-multiplication.factor index 2b3c752f54..e9d313f2dd 100644 --- a/extra/rosetta-code/long-multiplication/long-multiplication.factor +++ b/extra/rosetta-code/long-multiplication/long-multiplication.factor @@ -19,7 +19,7 @@ IN: rosetta-code.long-multiplication : longmult-seq ( xs ys -- zs ) [ * ] cartesian-map - dup length iota [ 0 ] map + dup length [ 0 ] map [ prepend ] 2map [ ] [ [ 0 suffix ] dip v+ ] map-reduce ; diff --git a/extra/rosetta-code/luhn-test/luhn-test.factor b/extra/rosetta-code/luhn-test/luhn-test.factor index a25d1ca80f..e0af49231c 100644 --- a/extra/rosetta-code/luhn-test/luhn-test.factor +++ b/extra/rosetta-code/luhn-test/luhn-test.factor @@ -61,7 +61,7 @@ IN: rosetta-code.luhn-test while drop ; : luhn-digit ( n -- n ) - reversed-digits dup length iota [ + reversed-digits dup length [ 2dup swap nth swap odd? [ 2 * 10 /mod + ] when ] map sum 10 mod diff --git a/extra/rosetta-code/n-queens/n-queens.factor b/extra/rosetta-code/n-queens/n-queens.factor index 8b26a812c5..1fcc647991 100644 --- a/extra/rosetta-code/n-queens/n-queens.factor +++ b/extra/rosetta-code/n-queens/n-queens.factor @@ -10,7 +10,7 @@ IN: rosetta-code.n-queens :: safe? ( board q -- ? ) [let q board nth :> x - q iota [ + q [ x swap [ board nth ] keep q swap - @@ -20,10 +20,10 @@ IN: rosetta-code.n-queens ] ; : solution? ( board -- ? ) - dup length iota [ dupd safe? ] all? nip ; + dup length [ dupd safe? ] all? nip ; : queens ( n -- l ) - iota all-permutations [ solution? ] filter ; + all-permutations [ solution? ] filter ; : queens. ( n -- ) queens [ [ 1 + "%d " printf ] each nl ] each ; diff --git a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor index 405b1924bd..ed61fb912c 100644 --- a/extra/rosetta-code/one-d-cellular/one-d-cellular.factor +++ b/extra/rosetta-code/one-d-cellular/one-d-cellular.factor @@ -33,7 +33,7 @@ IN: rosetta-code.one-d-cellular index [ 1 - ] [ 1 + ] bi [ world ?nth ] bi@ bool-sum ; : count-neighbours ( world -- neighbours ) - [ length iota ] keep [ neighbours ] curry map ; + [ length ] keep [ neighbours ] curry map ; : life-law ( alive? neighbours -- alive? ) swap [ 1 = ] [ 2 = ] if ; diff --git a/extra/sequences/extras/extras-tests.factor b/extra/sequences/extras/extras-tests.factor index a8eed85a1e..06cfdd3fd4 100644 --- a/extra/sequences/extras/extras-tests.factor +++ b/extra/sequences/extras/extras-tests.factor @@ -35,7 +35,7 @@ IN: sequences.extras.tests "--ABC--" } } [ - "ABC" 8 iota [ CHAR: - pad-center ] with map + "ABC" 8 [ CHAR: - pad-center ] with map ] unit-test { { 0 1 0 1 } } [ @@ -103,7 +103,7 @@ IN: sequences.extras.tests { "lohel" } [ "hello" dup -12 rotate! ] unit-test { { } } [ { } [ ] map-concat ] unit-test -{ V{ 0 0 1 0 1 2 } } [ 4 iota [ iota ] map-concat ] unit-test +{ V{ 0 0 1 0 1 2 } } [ 4 [ iota ] map-concat ] unit-test { "abc" } [ "abc" [ 1string ] map-concat ] unit-test { "abc" } [ { 97 98 99 } [ 1string ] map-concat ] unit-test { { 97 98 99 } } [ "abc" [ 1string ] { } map-concat-as ] unit-test @@ -112,12 +112,12 @@ IN: sequences.extras.tests { { } } [ { } [ ] [ even? ] map-filter ] unit-test { "bcde" } [ "abcd" [ 1 + ] [ drop t ] map-filter ] unit-test -{ { 0 4 16 36 64 } } [ 10 iota [ sq ] [ even? ] { } map-filter-as ] unit-test +{ { 0 4 16 36 64 } } [ 10 [ sq ] [ even? ] { } map-filter-as ] unit-test -{ V{ 0 4 16 36 64 } } [ 10 iota [ even? ] [ sq ] filter-map ] unit-test -{ { 2 6 10 14 18 } } [ 10 iota [ odd? ] [ 2 * ] { } filter-map-as ] unit-test +{ V{ 0 4 16 36 64 } } [ 10 [ even? ] [ sq ] filter-map ] unit-test +{ { 2 6 10 14 18 } } [ 10 [ odd? ] [ 2 * ] { } filter-map-as ] unit-test -{ 8 } [ 3 iota dup [ 1 + * ] 2map-sum ] unit-test +{ 8 } [ 3 dup [ 1 + * ] 2map-sum ] unit-test { 4 } [ "hello" "jello" [ = ] 2count ] unit-test { { } } [ { } round-robin ] unit-test @@ -149,12 +149,12 @@ IN: sequences.extras.tests { { { 5 8 0 } { 6 9 1 } { 7 10 2 } } } [ { 5 6 7 } { 8 9 10 } [ 3array ] 2map-index ] unit-test { { } } [ { } >array ] unit-test -{ { 0 2 } } [ 4 iota >array ] unit-test -{ { 0 2 4 } } [ 5 iota >array ] unit-test +{ { 0 2 } } [ 4 >array ] unit-test +{ { 0 2 4 } } [ 5 >array ] unit-test { { } } [ { } >array ] unit-test -{ { 1 3 } } [ 5 iota >array ] unit-test -{ { 1 3 5 } } [ 6 iota >array ] unit-test +{ { 1 3 } } [ 5 >array ] unit-test +{ { 1 3 5 } } [ 6 >array ] unit-test { 1 } [ { 1 7 3 7 6 3 7 } arg-max ] unit-test { 0 } [ { 1 7 3 7 6 3 7 } arg-min ] unit-test @@ -204,8 +204,8 @@ IN: sequences.extras.tests { { 1 2 3 } } [ { 1 2 3 } flatten1 ] unit-test { { 1 2 3 { { 4 } } } } [ { 1 { 2 } { 3 { { 4 } } } } flatten1 ] unit-test -{ t 3 3 } [ 10 iota [ [ odd? ] [ 1 > ] bi* and ] map-find-index ] unit-test -{ f f f } [ 10 iota [ [ odd? ] [ 9 > ] bi* and ] map-find-index ] unit-test +{ t 3 3 } [ 10 [ [ odd? ] [ 1 > ] bi* and ] map-find-index ] unit-test +{ f f f } [ 10 [ [ odd? ] [ 9 > ] bi* and ] map-find-index ] unit-test { "abcdef" } [ f f "abcdef" subseq* ] unit-test { "abcdef" } [ 0 f "abcdef" subseq* ] unit-test @@ -218,13 +218,13 @@ IN: sequences.extras.tests { "" " foo" } [ " foo" [ blank? ] cut-when ] unit-test { "foo" " bar" } [ "foo bar" [ blank? ] cut-when ] unit-test -{ { 4 0 3 1 2 } } [ { 0 4 1 3 2 } 5 iota [ nth* ] curry map ] unit-test +{ { 4 0 3 1 2 } } [ { 0 4 1 3 2 } 5 [ nth* ] curry map ] unit-test { 1 "beef" } [ { "chicken" "beef" "moose" } [ length ] infimum-by* ] unit-test { 0 "chicken" } [ { "chicken" "beef" "moose" } [ length ] supremum-by* ] unit-test { 2 "moose" } [ { "chicken" "beef" "moose" } [ first ] supremum-by* ] unit-test -{ 3/10 } [ 10 iota [ 3 < ] count* ] unit-test +{ 3/10 } [ 10 [ 3 < ] count* ] unit-test { { 0 } } [ "ABA" "ABABA" start-all ] unit-test { { 0 2 } } [ "ABA" "ABABA" start-all* ] unit-test @@ -245,10 +245,10 @@ IN: sequences.extras.tests { } [ "test:" all-words [ name>> over prepend ] map-zip 2drop ] unit-test -{ { 0 1 2 3 } } [ 8 iota [ 4 < ] take-while >array ] unit-test +{ { 0 1 2 3 } } [ 8 [ 4 < ] take-while >array ] unit-test { { } } [ { 15 16 } [ 4 < ] take-while >array ] unit-test -{ { 0 1 2 } } [ 3 iota [ 4 < ] take-while >array ] unit-test +{ { 0 1 2 } } [ 3 [ 4 < ] take-while >array ] unit-test -{ { 4 5 6 7 } } [ 8 iota [ 4 < ] drop-while >array ] unit-test +{ { 4 5 6 7 } } [ 8 [ 4 < ] drop-while >array ] unit-test { { 15 16 } } [ { 15 16 } [ 4 < ] drop-while >array ] unit-test -{ { } } [ 3 iota [ 4 < ] drop-while >array ] unit-test +{ { } } [ 3 [ 4 < ] drop-while >array ] unit-test diff --git a/extra/sequences/extras/extras.factor b/extra/sequences/extras/extras.factor index 4cb2536f7c..0832d15a46 100644 --- a/extra/sequences/extras/extras.factor +++ b/extra/sequences/extras/extras.factor @@ -207,7 +207,7 @@ ERROR: underlying-mismatch slice1 slice2 ; ] until 3drop ; : all-rotations ( seq -- seq' ) - dup length iota [ rotate ] with map ; + dup length [ rotate ] with map ; : round-robin ( seq -- newseq ) [ { } ] [ - [ longest length iota ] keep + [ longest length ] keep [ [ ?nth ] with map ] curry map concat sift ] if-empty ; diff --git a/extra/sequences/rotated/rotated.factor b/extra/sequences/rotated/rotated.factor index eb38af9469..dd7bc0b555 100644 --- a/extra/sequences/rotated/rotated.factor +++ b/extra/sequences/rotated/rotated.factor @@ -23,4 +23,4 @@ M: rotated virtual-exemplar seq>> ; INSTANCE: rotated virtual-sequence : all-rotations ( seq -- seq' ) - dup length iota [ ] with map ; + dup length [ ] with map ; diff --git a/extra/sequences/shifted/shifted-tests.factor b/extra/sequences/shifted/shifted-tests.factor index a25a2b883f..9ae89e9dbe 100644 --- a/extra/sequences/shifted/shifted-tests.factor +++ b/extra/sequences/shifted/shifted-tests.factor @@ -3,8 +3,8 @@ USING: arrays sequences tools.test ; IN: sequences.shifted -{ { 1 2 3 7 } } [ 4 iota -1 7 >array ] unit-test -{ { 7 0 1 2 } } [ 4 iota 1 7 >array ] unit-test -{ { 0 1 2 3 } } [ 4 iota 0 f >array ] unit-test -{ { f f f f } } [ 4 iota 4 f >array ] unit-test -{ { f f f f } } [ 4 iota -4 f >array ] unit-test +{ { 1 2 3 7 } } [ 4 -1 7 >array ] unit-test +{ { 7 0 1 2 } } [ 4 1 7 >array ] unit-test +{ { 0 1 2 3 } } [ 4 0 f >array ] unit-test +{ { f f f f } } [ 4 4 f >array ] unit-test +{ { f f f f } } [ 4 -4 f >array ] unit-test diff --git a/extra/sequences/snipped/snipped-tests.factor b/extra/sequences/snipped/snipped-tests.factor index 49eb46e911..3d3af20793 100644 --- a/extra/sequences/snipped/snipped-tests.factor +++ b/extra/sequences/snipped/snipped-tests.factor @@ -3,7 +3,7 @@ USING: arrays sequences tools.test ; IN: sequences.snipped -{ { 0 1 2 5 6 } } [ 3 5 7 iota >array ] unit-test -{ { 0 1 2 } } [ 3 10 7 iota >array ] unit-test -{ { 6 } } [ -1 5 7 iota >array ] unit-test -{ { } } [ -1 10 7 iota >array ] unit-test +{ { 0 1 2 5 6 } } [ 3 5 7 >array ] unit-test +{ { 0 1 2 } } [ 3 10 7 >array ] unit-test +{ { 6 } } [ -1 5 7 >array ] unit-test +{ { } } [ -1 10 7 >array ] unit-test diff --git a/extra/sets/extras/extras-tests.factor b/extra/sets/extras/extras-tests.factor index a33d88d231..1545567013 100644 --- a/extra/sets/extras/extras-tests.factor +++ b/extra/sets/extras/extras-tests.factor @@ -23,6 +23,6 @@ IN: sets.extras.tests { "abc" } [ "abcddd" non-repeating ] unit-test { "" } [ "aabbcc" non-repeating ] unit-test -{ HS{ 0 10 20 30 40 } } [ 5 iota [ 10 * ] mapped-set ] unit-test +{ HS{ 0 10 20 30 40 } } [ 5 [ 10 * ] mapped-set ] unit-test { { 1 2 4 } } [ { 1 2 3 4 5 } [ 2/ ] unique-by ] unit-test diff --git a/extra/snake-game/game/game.factor b/extra/snake-game/game/game.factor index f8f01b89ae..70fdd9597c 100644 --- a/extra/snake-game/game/game.factor +++ b/extra/snake-game/game/game.factor @@ -49,7 +49,7 @@ C: snake-part opposite-dir prefix [ >>dir ] 2map ; : all-indices ( -- points ) - snake-game-dim first2 * iota ; + snake-game-dim first2 * ; : snake-occupied-locs ( snake head-loc -- points ) [ dir>> relative-loc ] accumulate nip ; diff --git a/extra/snake-game/sprites/sprites.factor b/extra/snake-game/sprites/sprites.factor index cac3e33960..6af031bdde 100644 --- a/extra/snake-game/sprites/sprites.factor +++ b/extra/snake-game/sprites/sprites.factor @@ -13,7 +13,7 @@ IN: snake-game.sprites :: image-part ( image x y w h -- image ) image w h new-image-like :> new-image - h iota [| i | + h [| i | new-image bitmap>> x y i + w image pixel-row-slice-at append! drop @@ -22,8 +22,8 @@ IN: snake-game.sprites :: generate-sprite-sheet ( image rows cols -- seq ) cols rows 2array :> split-dims image dim>> split-dims [ / ] 2map first2 :> ( sw sh ) - rows iota sh v*n :> ys - cols iota sh v*n :> xs + rows sh v*n :> ys + cols sh v*n :> xs ys xs [ swap [ image ] 2dip sw sh image-part ] cartesian-map f join ; diff --git a/extra/sorting/extras/extras-tests.factor b/extra/sorting/extras/extras-tests.factor index d4b9c20e9f..b15b2849a2 100644 --- a/extra/sorting/extras/extras-tests.factor +++ b/extra/sorting/extras/extras-tests.factor @@ -22,12 +22,12 @@ IN: sorting.extras { { 0 1 2 3 4 5 6 7 8 9 } } [ { } - 10 iota >array randomize + 10 >array randomize [ swap insort-right ] each ] unit-test { V{ 0 1 2 3 4 5 6 7 8 9 } } [ V{ } clone - 10 iota >array randomize + 10 >array randomize [ swap insort-right! ] each ] unit-test diff --git a/extra/space-invaders/space-invaders.factor b/extra/space-invaders/space-invaders.factor index c6ae64c7f1..fd385162c5 100755 --- a/extra/space-invaders/space-invaders.factor +++ b/extra/space-invaders/space-invaders.factor @@ -322,7 +322,7 @@ CONSTANT: red { 255 0 0 } plot-bitmap-pixel ; : do-bitmap-update ( bitmap value addr -- ) - addr>xy swap 8 iota [ plot-bitmap-bits ] with with with each ; + addr>xy swap 8 [ plot-bitmap-bits ] with with with each ; M: space-invaders update-video over 0x2400 >= [ diff --git a/extra/spelling/spelling.factor b/extra/spelling/spelling.factor index 22b6024db9..78e5b20a31 100644 --- a/extra/spelling/spelling.factor +++ b/extra/spelling/spelling.factor @@ -9,7 +9,7 @@ IN: spelling CONSTANT: ALPHABET "abcdefghijklmnopqrstuvwxyz" : deletes ( word -- edits ) - [ length iota ] keep '[ _ remove-nth ] map ; + [ length ] keep '[ _ remove-nth ] map ; : transposes ( word -- edits ) [ length [1,b) ] keep '[ @@ -17,7 +17,7 @@ CONSTANT: ALPHABET "abcdefghijklmnopqrstuvwxyz" ] map ; : replaces ( word -- edits ) - [ length iota ] keep '[ + [ length ] keep '[ ALPHABET [ swap _ clone [ set-nth-unsafe ] keep ] with { } map-as diff --git a/extra/sudoku/sudoku.factor b/extra/sudoku/sudoku.factor index 47ab274cd1..9f8453b9e4 100644 --- a/extra/sudoku/sudoku.factor +++ b/extra/sudoku/sudoku.factor @@ -17,7 +17,7 @@ SYMBOL: board : cell-any? ( n x y i -- ? ) 3 /mod pair+ board> = ; : box-any? ( n x y -- ? ) - [ 3 /i 3 * ] bi@ 9 iota [ cell-any? ] 3 nwith any? ; + [ 3 /i 3 * ] bi@ 9 [ cell-any? ] 3 nwith any? ; : board-any? ( n x y -- ? ) { [ nip row-any? ] [ drop col-any? ] [ box-any? ] } 3|| ; diff --git a/extra/synth/synth.factor b/extra/synth/synth.factor index 8d1299042a..da591bc314 100755 --- a/extra/synth/synth.factor +++ b/extra/synth/synth.factor @@ -4,7 +4,7 @@ USING: accessors kernel locals math math.constants math.functions memoize openal IN: synth MEMO: single-sine-wave ( samples/wave -- seq ) - [ iota ] [ pi 2 * swap / [ * sin ] curry ] bi map ; + [ ] [ pi 2 * swap / [ * sin ] curry ] bi map ; : (sine-wave) ( samples/wave n-samples -- seq ) [ single-sine-wave ] dip ; diff --git a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor index c2a0c14ed8..f8d7de66da 100644 --- a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor +++ b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor @@ -56,7 +56,7 @@ CONSTANT: tc-lisp-slides { $slide "Non-static stack effect" "Not a good practice, nor useful" "Not compiled by the optimizing compiler" - { $code "100 iota [ ] each" } + { $code "100 [ ] each" } } { $slide "Module system" "Code divided up into vocabulary roots" @@ -359,7 +359,7 @@ var price = (order == null ? null : order.price);" } [ 1 - fib ] [ 2 - fib ] bi + ] unless ;" } - { $code "36 iota [ fib ] map ." } + { $code "36 [ fib ] map ." } } { $slide "Memoized Fibonacci" "Change one word and it's efficient" @@ -368,7 +368,7 @@ var price = (order == null ? null : order.price);" } [ 1 - fib ] [ 2 - fib ] bi + ] unless ;" } - { $code "36 iota [ fib ] map ." } + { $code "36 [ fib ] map ." } } { $slide "Destructors" "Deterministic resource disposal" diff --git a/extra/tetris/board/board.factor b/extra/tetris/board/board.factor index 44d2837aaf..e41dc1f725 100644 --- a/extra/tetris/board/board.factor +++ b/extra/tetris/board/board.factor @@ -6,7 +6,7 @@ IN: tetris.board TUPLE: board { width integer } { height integer } rows ; : make-rows ( width height -- rows ) - iota [ drop f ] with map ; + [ drop f ] with map ; : ( width height -- board ) 2dup make-rows board boa ; @@ -24,8 +24,8 @@ TUPLE: board { width integer } { height integer } rows ; : block-free? ( board block -- ? ) block not ; : block-in-bounds? ( board block -- ? ) - [ first swap width>> iota bounds-check? ] - [ second swap height>> iota bounds-check? ] 2bi and ; + [ first swap width>> bounds-check? ] + [ second swap height>> bounds-check? ] 2bi and ; : location-valid? ( board block -- ? ) 2dup block-in-bounds? [ block-free? ] [ 2drop f ] if ; diff --git a/extra/tetris/gl/gl.factor b/extra/tetris/gl/gl.factor index f9323f917e..d5aed2fca2 100644 --- a/extra/tetris/gl/gl.factor +++ b/extra/tetris/gl/gl.factor @@ -26,10 +26,10 @@ IN: tetris.gl [ gl-color 2array draw-block ] [ 3drop ] if ; : draw-row ( y row -- ) - [ length iota swap ] keep [ (draw-row) ] 2curry each ; + [ length swap ] keep [ (draw-row) ] 2curry each ; : draw-board ( board -- ) - rows>> [ length iota ] keep + rows>> [ length ] keep [ dupd nth draw-row ] curry each ; : scale-board ( width height board -- ) diff --git a/extra/trees/avl/avl-tests.factor b/extra/trees/avl/avl-tests.factor index 65bbdf5cd1..90389ea17d 100644 --- a/extra/trees/avl/avl-tests.factor +++ b/extra/trees/avl/avl-tests.factor @@ -126,4 +126,4 @@ IN: trees.avl.tests ! test that converting from a balanced tree doesn't reshape ! the tree -{ t } [ 10 iota >array reverse dup zip >avl dup >avl = ] unit-test +{ t } [ 10 >array reverse dup zip >avl dup >avl = ] unit-test diff --git a/extra/trees/splay/splay-tests.factor b/extra/trees/splay/splay-tests.factor index db4302f5e3..9fbff0c616 100644 --- a/extra/trees/splay/splay-tests.factor +++ b/extra/trees/splay/splay-tests.factor @@ -5,10 +5,10 @@ tools.test trees.splay ; IN: trees.splay.tests : randomize-numeric-splay-tree ( splay-tree -- ) - 100 iota [ drop 100 random of drop ] with each ; + 100 [ drop 100 random of drop ] with each ; : make-numeric-splay-tree ( n -- splay-tree ) - iota [ '[ dup _ set-at ] each ] keep ; + [ '[ dup _ set-at ] each ] keep ; { t } [ 100 make-numeric-splay-tree dup randomize-numeric-splay-tree @@ -33,7 +33,7 @@ IN: trees.splay.tests ] unit-test { 0 } [ - 100 iota [ dup zip >splay ] keep + 100 [ dup zip >splay ] keep [ over delete-at ] each assoc-size ] unit-test diff --git a/extra/ui/gadgets/charts/demos/demos.factor b/extra/ui/gadgets/charts/demos/demos.factor index 96546edc4a..cb4529fd07 100644 --- a/extra/ui/gadgets/charts/demos/demos.factor +++ b/extra/ui/gadgets/charts/demos/demos.factor @@ -9,12 +9,12 @@ IN: ui.gadgets.charts.demos CONSTANT: -pi $[ pi neg ] : sine-wave ( steps -- seq ) - [ iota ] keep + [ ] keep pi 2 * swap / [ * pi - dup sin 2array ] curry map ${ pi $[ pi sin ] } suffix ; : cosine-wave ( steps -- seq ) - [ iota ] keep + [ ] keep pi 2 * swap / [ * pi - dup cos 2array ] curry map ${ pi $[ pi cos ] } suffix ; diff --git a/extra/ui/gadgets/charts/lines/lines-tests.factor b/extra/ui/gadgets/charts/lines/lines-tests.factor index e3c71a6ba5..4d2f918591 100644 --- a/extra/ui/gadgets/charts/lines/lines-tests.factor +++ b/extra/ui/gadgets/charts/lines/lines-tests.factor @@ -234,7 +234,7 @@ IN: ui.gadgets.charts.lines.tests { { 0 30 60 90 120 150 180 210 240 270 300 } } [ - 11 iota [ 10 + ] map [ 300 swap 20 10 scale ] map + 11 [ 10 + ] map [ 300 swap 20 10 scale ] map ] unit-test { { } } diff --git a/extra/zeromq/examples/hwclient.factor b/extra/zeromq/examples/hwclient.factor index 377e1b7a39..0bf6fc868f 100644 --- a/extra/zeromq/examples/hwclient.factor +++ b/extra/zeromq/examples/hwclient.factor @@ -10,7 +10,7 @@ IN: zeromq.examples.hwclient "Connecting to hello world server…" print ZMQ_REQ &dispose dup "tcp://localhost:5555" zmq-connect - 10 iota [ + 10 [ [ "Hello" dup rot "Sending %s %d...\n" printf dupd >byte-array 0 zmq-send ] [ [ dup 0 zmq-recv >string ] dip diff --git a/extra/zeromq/examples/tasksink.factor b/extra/zeromq/examples/tasksink.factor index 9741b75cd4..1e4e225e71 100644 --- a/extra/zeromq/examples/tasksink.factor +++ b/extra/zeromq/examples/tasksink.factor @@ -14,7 +14,7 @@ IN: zeromq.examples.tasksink ! Start our clock now now ! Process 100 confirmations - 100 iota [ + 100 [ pick 0 zmq-recv drop 10 rem zero? [ ":" ] [ "." ] if write flush ] each diff --git a/unmaintained/images/jpeg/jpeg.factor b/unmaintained/images/jpeg/jpeg.factor index 4b530091ee..eb4433ad83 100644 --- a/unmaintained/images/jpeg/jpeg.factor +++ b/unmaintained/images/jpeg/jpeg.factor @@ -134,7 +134,7 @@ TUPLE: jpeg-color-info data>> binary [ - read1 iota + read1 [ drop read1 jpeg> color-info>> nth clone read1 16 /mod [ >>dc-huff-table ] [ >>ac-huff-table ] bi* @@ -195,7 +195,7 @@ MEMO: yuv>bgr-matrix ( -- m ) { 8 8 } coord-matrix [ { u v } [ wave ] 2map product ] map^2 1 u v [ 0 = [ 2 sqrt / ] when ] bi@ 4 / m*n ; -MEMO: dct-matrix ( -- m ) 64 iota [ 8 /mod dct-vect flatten ] map ; +MEMO: dct-matrix ( -- m ) 64 [ 8 /mod dct-vect flatten ] map ; : mb-dim ( component -- dim ) [ h>> ] [ v>> ] bi 2array ; @@ -265,7 +265,7 @@ MEMO: dct-matrix-blas ( -- m ) dct-matrix >float-blas-matrix ; :: draw-macroblock-yuv444 ( mb blocks -- ) mb { 8 8 } v* :> pos - 3 iota [ [ blocks nth pos ] [ jpeg> draw-block ] bi ] each ; + 3 [ [ blocks nth pos ] [ jpeg> draw-block ] bi ] each ; :: draw-macroblock-y ( mb blocks -- ) mb { 8 8 } v* :> pos diff --git a/unmaintained/sudokus/sudokus.factor b/unmaintained/sudokus/sudokus.factor index 8944488019..a45df31f1d 100644 --- a/unmaintained/sudokus/sudokus.factor +++ b/unmaintained/sudokus/sudokus.factor @@ -14,7 +14,7 @@ IN: sudokus :: solutions ( puzzle random? -- solutions ) f puzzle random? [ indices [ f ] [ random? swap nth-or-lower ] if-empty ] [ index ] if [ :> pos - 1 9 [a,b] 80 iota [ pos near ] filter [ puzzle nth ] map prune diff + 1 9 [a,b] 80 [ pos near ] filter [ puzzle nth ] map prune diff [ 1array puzzle pos cut-slice rest surround ] map >list [ random? solutions ] bind ] [ puzzle list-monad return ] if* ; -- 2.34.1