To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

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

There are no comments on this page.

New comment
Reply
Code previewClose
Feedback 👍
Comments are sent via email to me.