From f24bbffb2aaa1ccc72c656166d5b65e632645aa8 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 30 May 2015 21:55:27 -0700 Subject: [PATCH] math.bitwise: change bitfield to reduce from first argument rather than zero. --- basis/math/bitwise/bitwise.factor | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/basis/math/bitwise/bitwise.factor b/basis/math/bitwise/bitwise.factor index 93765116df..5ad335e7f9 100644 --- a/basis/math/bitwise/bitwise.factor +++ b/basis/math/bitwise/bitwise.factor @@ -51,8 +51,7 @@ ERROR: bit-range-error x high low ; : W* ( x y -- z ) * 64 bits ; inline : symbols>flags ( symbols assoc -- flag-bits ) - [ at ] curry map - 0 [ bitor ] reduce ; + '[ _ at ] map 0 [ bitor ] reduce ; ! bitfield MACRO: bitfield ( bitspec -- ) - [ 0 ] [ (bitfield-quot) compose ] reduce ; + [ [ 0 ] ] [ + [ (bitfield-quot) ] map unclip + [ '[ @ _ dip bitor ] ] reduce + ] if-empty ; ! bit-count