Fibonacci[optional A: (Integer[A] val & (U8 val | U16 val | U32 val | U64 val | U128 val | ULong val | USize val))]

Useful for microbenchmarks to impress your friends. Look y'all, Pony goes fast! We suppose if you are into Agile planning poker that you could also use this in conjunction with Random to assign User Story Points.

class ref Fibonacci[optional A: (Integer[A] val & (U8 val | U16 val | U32 val | 
    U64 val | U128 val | ULong val | 
    USize val))] is
  Iterator[A] ref

Implements


Constructors

create

new iso create()
: Fibonacci[A] iso^

Returns


Public Functions

apply

fun box apply(
  n: U8 val)
: A

Parameters

  • n: U8 val

Returns

  • A

has_next

fun box has_next()
: Bool val

Returns


next

fun ref next()
: A

Returns

  • A