] unless
writer bytes>> ;
-:: byte-array-n>seq ( byte-array n -- seq )
+:: byte-array-n>sequence ( byte-array n -- seq )
byte-array length 8 * n / iota
byte-array <msb0-bit-reader> '[
drop n _ read
: bignum-radix ( -- n ) bignum-bits 2^ 1 - ;
-: bignum>seq ( n -- seq )
+: bignum>sequence ( n -- seq )
#! n is positive or zero.
[ dup 0 > ]
[ [ bignum-bits neg shift ] [ bignum-radix bitand ] bi ]
produce nip ;
: emit-bignum ( n -- )
- dup dup 0 < [ neg ] when bignum>seq
+ dup dup 0 < [ neg ] when bignum>sequence
[ nip length 1 + emit-fixnum ]
[ drop 0 < 1 0 ? emit ]
[ nip emit-seq ]
[ prepare-message-schedule ]
[ [ block-size>> ] [ H>> clone ] [ ] tri process-chunk ] bi ;
-: seq>byte-array ( seq n -- string )
+: sequence>byte-array ( seq n -- string )
'[ _ >be ] map B{ } concat-as ;
: sha1>checksum ( sha2 -- bytes )
- H>> 4 seq>byte-array ;
+ H>> 4 sequence>byte-array ;
: sha-224>checksum ( sha2 -- bytes )
- H>> 7 head 4 seq>byte-array ;
+ H>> 7 head 4 sequence>byte-array ;
: sha-256>checksum ( sha2 -- bytes )
- H>> 4 seq>byte-array ;
+ H>> 4 sequence>byte-array ;
: pad-last-short-block ( state -- )
[ bytes>> t ] [ bytes-read>> pad-last-block ] [ ] tri
: flatten ( seq class -- newseq )
'[ dup _ instance? [ seq>> ] [ 1array ] if ] map concat ; inline
-:: seq>instance ( seq empty class -- instance )
+:: sequence>instance ( seq empty class -- instance )
seq length {
{ 0 [ empty ] }
{ 1 [ seq first ] }
[ or-class? ] partition
class-partition boa ;
-: class-partition>seq ( class-partition -- seq )
+: class-partition>sequence ( class-partition -- seq )
[
{
[ integers>> ]
: repartition ( partition -- partition' )
! This could be made more efficient; only and and or are effected
- class-partition>seq partition-classes ;
+ class-partition>sequence partition-classes ;
: filter-not-integers ( partition -- partition' )
dup
[ t swap remove ] change-other
dup contradiction?
[ drop f ]
- [ filter-not-integers class-partition>seq members t and-class seq>instance ] if ;
+ [ filter-not-integers class-partition>sequence members t and-class sequence>instance ] if ;
: <and-class> ( seq -- class )
dup and-class flatten partition-classes
[ f swap remove ] change-other
dup tautology?
[ drop t ]
- [ filter-integers class-partition>seq members f or-class seq>instance ] if ;
+ [ filter-integers class-partition>sequence members f or-class sequence>instance ] if ;
: <or-class> ( seq -- class )
dup or-class flatten partition-classes
[ [ prolog>> ] [ before>> ] [ after>> ] tri ] dip
swap <xml> ;
-: seq>xml ( xml seq -- newxml )
+: sequence>xml ( xml seq -- newxml )
over body>> like tag>xml ;
PRIVATE>
M: xml like
swap dup xml? [ nip ] [
- dup tag? [ tag>xml ] [ seq>xml ] if
+ dup tag? [ tag>xml ] [ sequence>xml ] if
] if ;
! tag with children=f is contained
{ $values { "seq" sequence } { "from-axis" rh-up } }
{ $description "Destructively swizzles the first three elements of the input sequence to a right-handed 3D coordinate system where Y is up and returns the modified sequence." } ;
-HELP: source>seq
+HELP: source>sequence
{ $values { "source-tag" tag } { "up-axis" rh-up } { "scale" number } { "sequence" sequence } }
{ $description "Convert the " { $emphasis "float_array" } " in a " { $emphasis "source tag" } " to a sequence of number sequences according to the element stride. The values are scaled according to " { $emphasis "scale" } " and swizzled from " { $emphasis "up-axis" } " so that the Y coordinate points up." } ;
[ 0 swap set-nth ] tri
] bi ;
-: source>seq ( source-tag up-axis scale -- sequence )
+: source>sequence ( source-tag up-axis scale -- sequence )
rot
[ "float_array" x/ xt string>numbers [ * ] with map ]
[ nip "technique_common" x/ "accessor" x/ "stride" x@ string>number ] 2bi
: source>pair ( source-tag -- pair )
[ "id" x@ ]
- [ up-axis get unit-ratio get source>seq ] bi 2array ;
+ [ up-axis get unit-ratio get source>sequence ] bi 2array ;
: mesh>sources ( mesh-tag -- hashtable )
"source" [ source>pair ] x* >hashtable ;
"Classical"
] [ "vocab:id3/tests/blah2.mp3" mp3>id3 id3-params ] unit-test
-[
+[
"Stormy Weather"
"Frank Sinatra"
"Night and Day Frank Sinatra"
[ t ]
-[ 10000 iota [ synchsafe>seq seq>synchsafe ] map [ < ] monotonic? ] unit-test
+[ 10000 iota [ synchsafe>sequence sequence>synchsafe ] map [ < ] monotonic? ] unit-test
} cleave
] output>array sift ;
-: seq>synchsafe ( seq -- n )
+: sequence>synchsafe ( seq -- n )
0 [ [ 7 shift ] dip bitor ] reduce ;
-: synchsafe>seq ( n -- seq )
+: synchsafe>sequence ( n -- seq )
dup 1 + log2 1 + 7 / ceiling
[ [ -7 shift ] keep 0x7f bitand ] replicate nip reverse ;
[ <frame> ] dip
{
[ 4 head-slice decode-text >>tag ]
- [ [ 4 8 ] dip subseq seq>synchsafe >>size ]
+ [ [ 4 8 ] dip subseq sequence>synchsafe >>size ]
[ [ 8 10 ] dip subseq >byte-array >>flags ]
[ read-frame-data decode-text >>data ]
} cleave ;
{
[ [ 3 5 ] dip <slice> >array >>version ]
[ [ 5 ] dip nth >>flags ]
- [ [ 6 10 ] dip <slice> seq>synchsafe >>size ]
+ [ [ 6 10 ] dip <slice> sequence>synchsafe >>size ]
} cleave ;
: merge-frames ( id3 assoc -- id3 )
color-index>>
] }
{ 8 [ color-lookup ] }
- { 4 [ [ 4 b:byte-array-n>seq ] change-color-index color-lookup ] }
- { 1 [ [ 1 b:byte-array-n>seq ] change-color-index color-lookup ] }
+ { 4 [ [ 4 b:byte-array-n>sequence ] change-color-index color-lookup ] }
+ { 1 [ [ 1 b:byte-array-n>sequence ] change-color-index color-lookup ] }
[ bmp-not-supported ]
} case >byte-array ;