Fix bug curry -> swap curry

release
Doug Coleman 2007-12-05 09:49:39 -06:00
parent 6ffd6456c4
commit 70299ba86a
1 changed files with 4 additions and 3 deletions

View File

@ -93,9 +93,9 @@ C: <p-list> p-list
>r make-p-list r> (each-permutation) ;
MEMO: builder-permutations ( n -- seq )
{ compose curry } swap permutations
[ >quotation ] map ; foldable
: builder-permutations ( n -- seq )
{ [ compose ] [ swap curry ] } swap permutations
[ concat ] map ; foldable
: all-quot-permutations ( seq -- newseq )
dup length 1- builder-permutations
@ -103,3 +103,4 @@ MEMO: builder-permutations ( n -- seq )
[ swap [ >r seq>stack r> call ] curry* map ] curry* map ;
! clear { map sq 10 } all-quot-permutations [ [ [ [ [ call ] keep datastack length 2 = [ . .s nl ] when ] catch ] in-thread drop ] each ] each
! clear { map sq sq 10 } all-quot-permutations [ [ [ [ [ call ] keep datastack length 2 = [ . .s nl ] when ] catch ] in-thread drop ] each ] each