O'Reilly logo
  • Peter Tessin thinks this is interesting:

function fibs(n = 10) fib = int64(zeros(n)) fib[1] = 1 produce fib[1) fib[2] produce fib[2] for i = 3:n fib[i] = fib[i-1] + fib[i-2] produce(fib[i]) end produce(-1) end

From

Cover of Mastering Julia

Note

slight errors in function:

function fibs(n = 10)
fib = round(Int64, zeros(n))
fib[1] = 1
produce(fib[1])
fib[2] = 1
produce(fib[2])
for i = 3:n
fib[i] = fib[i-1] + fib[i-2]
produce(fib[i])
end
produce(-1)
end