| Home | Libraries | People | FAQ | More

#### List Generation

One of the most interesting capabilities of FC++ is the generation of infinite lazy lists which are evaluated only at need. The most simple example of this is

    enum_from(1)

which returns the generator for integers 1,2,3,..... infinity.

    take(4,enum_from(1))

returns a list of the first 4 of the list.

    at(enum_from(1),3)

returns the fourth member using zero indexed access. Both of the lists returned are lazy and only evaluated when the list members are accessed.