AetherlangLib: Generators

Generators is a library that provides functions for creating arrays of certain patterns.


rng
range start [step] end @-> array
@ where start: number
@       step: number
@       end: number
@ creates an array (without actually allocating it) with numbers from START to END with STEP. STEP defaults to 1.

gencoll exp varname arr [cond] [else] @-> array
@ where exp: symbol
@       varname: symbol or string
@       arr: array
@       cond: symbol
@       else: symbol
@ creates an array by looping through ARR with VARNAME and evaluating EXP. if COND is given and evaluated to void and ELSE is given, puts evaluated ELSE expression instead. if COND is void but ELSE is not given, skips the step.