Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationlist_compose

Official ZPE/YASS documentationlist_compose

list_compose (integer count, function composer) ⇒ list

Produces a list containing a specified number of values created from the composer function.

First available: Version 1.10.1

Examples

This function can speed up development of complex lists, including the sequence of doubling numbers:

YASS
$l = list_compose(100, function($i, $previous) {
  if ($previous == null)
    return 1
  else
    return $previous * 2
  end if
})
Comments
Feedback 👍
Comments are sent via email to me.