Revert "sequences: require integers for slice and repetition."
This reverts commit 5e87cdb3a9b5885c6648ffaf6e5e9a2edc5fd200.db4
parent
6ed0db20fd
commit
47b96f6891
|
@ -1120,7 +1120,7 @@ HELP: trim-tail-slice
|
||||||
{ $examples
|
{ $examples
|
||||||
{ $example "USING: prettyprint math sequences ;"
|
{ $example "USING: prettyprint math sequences ;"
|
||||||
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail-slice ."
|
"{ 0 0 1 2 3 0 0 } [ zero? ] trim-tail-slice ."
|
||||||
"T{ slice { to 5 } { seq { 0 0 1 2 3 0 0 } } }"
|
"T{ slice { from 0 } { to 5 } { seq { 0 0 1 2 3 0 0 } } }"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -214,8 +214,8 @@ INSTANCE: reversed virtual-sequence
|
||||||
|
|
||||||
! A slice of another sequence.
|
! A slice of another sequence.
|
||||||
TUPLE: slice
|
TUPLE: slice
|
||||||
{ from integer read-only }
|
{ from read-only }
|
||||||
{ to integer read-only }
|
{ to read-only }
|
||||||
{ seq read-only } ;
|
{ seq read-only } ;
|
||||||
|
|
||||||
: collapse-slice ( m n slice -- m' n' seq )
|
: collapse-slice ( m n slice -- m' n' seq )
|
||||||
|
@ -266,7 +266,7 @@ M: slice length [ to>> ] [ from>> ] bi - ; inline
|
||||||
INSTANCE: slice virtual-sequence
|
INSTANCE: slice virtual-sequence
|
||||||
|
|
||||||
! One element repeated many times
|
! One element repeated many times
|
||||||
TUPLE: repetition { len integer read-only } { elt read-only } ;
|
TUPLE: repetition { len read-only } { elt read-only } ;
|
||||||
|
|
||||||
: <repetition> ( len elt -- repetition )
|
: <repetition> ( len elt -- repetition )
|
||||||
over 0 < [ non-negative-integer-expected ] when
|
over 0 < [ non-negative-integer-expected ] when
|
||||||
|
|
Loading…
Reference in New Issue