24 lines
346 B
Text
24 lines
346 B
Text
// Bind : is faster than assignment :=
|
|
// loop is faster than to_pre (which uses a closure)
|
|
() Integer
|
|
[
|
|
if this < 2
|
|
[this]
|
|
else
|
|
[
|
|
!prev: 1
|
|
!next: 1
|
|
!sum
|
|
!count: this - 2
|
|
loop
|
|
[
|
|
if count = 0 [exit]
|
|
count--
|
|
sum : prev + next
|
|
prev : next
|
|
next : sum
|
|
]
|
|
|
|
next
|
|
]
|
|
]
|