From 8917ae9ad7f195a68edcabc7f47a02bb3295587e Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 23 Mar 2013 11:11:40 -0700 Subject: [PATCH] grouping: Remove , old is now . Fixes --- basis/compiler/crossref/crossref.factor | 2 +- basis/grouping/grouping-docs.factor | 27 +++++-------------- basis/grouping/grouping-tests.factor | 8 ------ basis/grouping/grouping.factor | 11 ++------ basis/images/tessellation/tessellation.factor | 6 ++--- basis/io/ports/ports.factor | 2 +- basis/tools/memory/memory.factor | 4 +-- 7 files changed, 15 insertions(+), 45 deletions(-) diff --git a/basis/compiler/crossref/crossref.factor b/basis/compiler/crossref/crossref.factor index acadf82fee..5071cc5ea2 100644 --- a/basis/compiler/crossref/crossref.factor +++ b/basis/compiler/crossref/crossref.factor @@ -90,7 +90,7 @@ generic-call-site-crossref [ H{ } clone ] initialize get remove-vertex* ; : generic-call-sites ( word -- alist ) - "generic-call-sites" word-prop 2 ; + "generic-call-sites" word-prop 2 group ; : compiled-unxref ( word -- ) { diff --git a/basis/grouping/grouping-docs.factor b/basis/grouping/grouping-docs.factor index 6a02e2198e..571555e4e1 100644 --- a/basis/grouping/grouping-docs.factor +++ b/basis/grouping/grouping-docs.factor @@ -5,7 +5,7 @@ ARTICLE: "grouping" "Groups and clumps" "Splitting a sequence into disjoint, fixed-length subsequences:" { $subsections group } "A virtual sequence for splitting a sequence into disjoint, fixed-length subsequences:" -{ $subsections groups } +{ $subsections groups } "Splitting a sequence into overlapping, fixed-length subsequences:" { $subsections clump } "Splitting a sequence into overlapping, fixed-length subsequences, wrapping around the end of the sequence:" @@ -62,7 +62,7 @@ ABOUT: "grouping" HELP: groups { $class-description "Instances are virtual sequences whose elements are disjoint fixed-length subsequences of an underlying sequence. Groups are mutable and resizable if the underlying sequence is mutable and resizable, respectively." $nl -"New groups are created by calling " { $link } " and " { $link } "." } ; +"New groups are created by calling " { $link } "." } ; HELP: group { $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "array" "a sequence of sequences" } } @@ -74,32 +74,17 @@ HELP: group HELP: { $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "groups" groups } } -{ $description "Outputs a virtual sequence whose elements are disjoint subsequences of " { $snippet "n" } " elements from the underlying sequence." } -{ $examples - { $example - "USING: arrays kernel prettyprint sequences grouping ;" - "9 iota >array 3 reverse! concat >array ." "{ 6 7 8 3 4 5 0 1 2 }" - } - { $example - "USING: kernel prettyprint sequences grouping ;" - "{ 1 2 3 4 5 6 } 3 first ." - "{ 1 2 3 }" - } -} ; - -HELP: -{ $values { "seq" "a sequence" } { "n" "a non-negative integer" } { "groups" groups } } { $description "Outputs a virtual sequence whose elements are slices of disjoint subsequences of " { $snippet "n" } " elements from the underlying sequence." } { $examples { $example "USING: arrays kernel prettyprint sequences grouping ;" - "9 iota >array 3 " + "9 iota >array 3 " "dup [ reverse! drop ] each concat >array ." "{ 2 1 0 5 4 3 8 7 6 }" } { $example "USING: kernel prettyprint sequences grouping ;" - "{ 1 2 3 4 5 6 } 3 second ." + "{ 1 2 3 4 5 6 } 3 second ." "T{ slice { from 3 } { to 6 } { seq { 1 2 3 4 5 6 } } }" } } ; @@ -107,7 +92,7 @@ HELP: HELP: clumps { $class-description "Instances are virtual sequences whose elements are overlapping fixed-length subsequences of an underlying sequence. Clumps are mutable and resizable if the underlying sequence is mutable and resizable, respectively." $nl -"New clumps are created by calling " { $link } " and " { $link } "." } ; +"New clumps are created by calling " { $link } " and " { $link } "." } ; HELP: circular-clumps { $class-description "Instances are virtual sequences whose elements are overlapping fixed-length subsequences of an underlying sequence, beginning with every element in the original sequence and wrapping around its end. Circular clumps are mutable and resizable if the underlying sequence is mutable and resizable, respectively." @@ -178,7 +163,7 @@ HELP: { } related-words -{ } related-words +{ } related-words HELP: monotonic? { $values { "seq" sequence } { "quot" { $quotation "( elt1 elt2 -- ? )" } } { "?" "a boolean" } } diff --git a/basis/grouping/grouping-tests.factor b/basis/grouping/grouping-tests.factor index 6e207ceffa..c90488ff29 100644 --- a/basis/grouping/grouping-tests.factor +++ b/basis/grouping/grouping-tests.factor @@ -6,12 +6,6 @@ IN: grouping.tests [ { "hell" "o wo" "rld" } ] [ "hello world" 4 group ] unit-test -[ { V{ "a" "b" } V{ 0 0 } } ] [ - V{ "a" "b" } clone 2 - 2 over set-length - >array -] unit-test - [ 0 ] [ { } 2 length ] unit-test [ 0 ] [ { 1 } 2 length ] unit-test [ 1 ] [ { 1 2 } 2 length ] unit-test @@ -44,5 +38,3 @@ IN: grouping.tests [ f ] [ [ 1.0 1 1 ] all-equal? ] unit-test [ t ] [ { 1 2 3 4 } [ < ] monotonic? ] unit-test [ f ] [ { 1 2 3 4 } [ > ] monotonic? ] unit-test - -[ { 6 7 8 3 4 5 0 1 2 } ] [ 9 iota >array dup 3 reverse! drop ] unit-test diff --git a/basis/grouping/grouping.factor b/basis/grouping/grouping.factor index 522fbcf6a6..0e604d5812 100644 --- a/basis/grouping/grouping.factor +++ b/basis/grouping/grouping.factor @@ -65,19 +65,12 @@ TUPLE: chunking-seq { seq read-only } { n read-only } ; PRIVATE> TUPLE: groups < chunking-seq ; -INSTANCE: groups subseq-chunking +INSTANCE: groups slice-chunking INSTANCE: groups abstract-groups : ( seq n -- groups ) groups new-groups ; inline -TUPLE: sliced-groups < chunking-seq ; -INSTANCE: sliced-groups slice-chunking -INSTANCE: sliced-groups abstract-groups - -: ( seq n -- groups ) - sliced-groups new-groups ; inline - TUPLE: clumps < chunking-seq ; INSTANCE: clumps subseq-chunking INSTANCE: clumps abstract-clumps @@ -92,7 +85,7 @@ INSTANCE: sliced-clumps abstract-clumps : ( seq n -- clumps ) sliced-clumps new-groups ; inline -: group ( seq n -- array ) { } like ; +: group ( seq n -- array ) [ ] 2keep drop '[ _ like ] map ; : clump ( seq n -- array ) { } like ; diff --git a/basis/images/tessellation/tessellation.factor b/basis/images/tessellation/tessellation.factor index a37c67b5b4..bd43bf0f90 100644 --- a/basis/images/tessellation/tessellation.factor +++ b/basis/images/tessellation/tessellation.factor @@ -5,13 +5,13 @@ images math.vectors arrays ; IN: images.tessellation : group-rows ( bitmap bitmap-dim -- rows ) - first ; inline + first ; inline : tesselate-rows ( bitmap-rows tess-dim -- bitmaps ) - second ; inline + second ; inline : tesselate-columns ( bitmap-rows tess-dim -- bitmaps ) - first '[ _ ] map flip ; inline + first '[ _ ] map flip ; inline : tesselate-bitmap ( bitmap bitmap-dim tess-dim -- bitmap-grid ) [ group-rows ] dip diff --git a/basis/io/ports/ports.factor b/basis/io/ports/ports.factor index d46672df72..5b48db5175 100644 --- a/basis/io/ports/ports.factor +++ b/basis/io/ports/ports.factor @@ -126,7 +126,7 @@ M: output-port stream-write1 : write-in-groups ( byte-array port -- ) [ binary-object uchar ] dip - [ buffer>> size>> ] [ '[ _ stream-write ] ] bi + [ buffer>> size>> ] [ '[ _ stream-write ] ] bi each ; M: output-port stream-write diff --git a/basis/tools/memory/memory.factor b/basis/tools/memory/memory.factor index bb612d046f..fd8cd7dda6 100644 --- a/basis/tools/memory/memory.factor +++ b/basis/tools/memory/memory.factor @@ -204,7 +204,7 @@ TUPLE: code-block { size read-only } { entry-point read-only } ; -TUPLE: code-blocks { blocks sliced-groups } { cache hashtable } ; +TUPLE: code-blocks { blocks groups } { cache hashtable } ; ( seq -- code-blocks ) - 6 H{ } clone \ code-blocks boa ; + 6 H{ } clone \ code-blocks boa ; SYMBOL: code-heap-start SYMBOL: code-heap-end