pack: use cum-sum0 from math.statistics.

db4
John Benediktsson 2015-07-14 17:49:04 -07:00
parent 6e9dfc86c3
commit 20ff03f5c0
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,8 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types ascii assocs combinators combinators.smart
endian fry io kernel macros math math.vectors sequences strings ;
endian fry io kernel macros math math.statistics math.vectors
sequences strings ;
IN: pack
GENERIC: >n-byte-array ( obj n -- byte-array )
@ -115,7 +116,7 @@ MACRO: pack ( str -- quot )
<PRIVATE
: start/end ( seq -- seq1 seq2 )
[ 0 [ + ] accumulate nip dup ] keep v+ ; inline
[ cum-sum0 ] keep v+ ; inline
PRIVATE>