Use constant stack effect to prevent compilation errors

db4
Samuel Tardieu 2007-12-31 00:24:24 +01:00
parent c06d328ea3
commit b55f6d9114
1 changed files with 4 additions and 7 deletions

View File

@ -72,13 +72,13 @@ IN: project-euler.011
: pad-front ( matrix -- matrix )
[
length [ 0 <repetition> ] each
] keep [ append ] map ;
length [ 0 <repetition> ] map
] keep [ append ] 2map ;
: pad-back ( matrix -- matrix )
<reversed> [
length [ 0 <repetition> ] each
] keep [ <reversed> append ] map ;
length [ 0 <repetition> ] map
] keep [ <reversed> append ] 2map ;
: diagonal/ ( -- matrix )
horizontal reverse pad-front pad-back flip ;
@ -98,9 +98,6 @@ PRIVATE>
[ call 4 max-product , ] each
] { } make supremum ;
! TODO: solution works but doesn't completely compile due to the creation of
! the diagonal matrices, there must be a cleaner way to generate those
! [ euler011 ] 100 ave-time
! 4 ms run / 0 ms GC ave time - 100 trials