cleanup: with fry, _ call is @

db4
Jon Harper 2012-08-04 22:25:03 +02:00 committed by John Benediktsson
parent 87aeec7c63
commit e980e26f70
1 changed files with 4 additions and 2 deletions

View File

@ -24,8 +24,10 @@ IN: rosetta-code.y-combinator
: Y ( quot -- quot )
'[ [ dup call call ] curry @ ] dup call ; inline
! factorial sequence
: almost-fac ( quot -- quot )
'[ dup zero? [ drop 1 ] [ dup 1 - _ call * ] if ] ;
'[ dup zero? [ drop 1 ] [ dup 1 - @ * ] if ] ;
! fibonacci sequence
: almost-fib ( quot -- quot )
'[ dup 2 >= [ 1 2 [ - _ call ] bi-curry@ bi + ] when ] ;
'[ dup 2 >= [ 1 2 [ - @ ] bi-curry@ bi + ] when ] ;