unfold/ tail

This function is similar to unfold, except that it can also be used to build an improper list.

This function will return e(seed) if pred(seed) is true.  Otherwise it builds a pair of the form pair(f(seed), unfold(pred, f, g, g(seed) )) .

If e always returns #() then unfold/tail has the same behavior as unfold.

Exported from

Arguments

predAn instance of <function>.  This function takes a seed value and returns #t to terminate the sequence of recursive calls building the list.
fAn instance of <function>.  This function takes a seed value and produces a list element.
gAn instance of <function>.  This function takes a seed value and returns a new seed value.
eAn instance of <function>.  When pred returns #t this function is called on the seed to return the value of the tail of the last pair of the list.
seedAn instance of <object>.  The initial seed value.

Values

new-listAn instance of <list>.
This function is dual to reduce; instead of taking some functions and a list and producing a value, it takes a value and some functions and produces a list.
This function is similar to unfold, except that it can also be used to build an improper list.
Sequence-Utilities, written by Matthias Hölzl, provides common or oft-used operations performed on <sequence>s.
The class of objects that can be applied to arguments.
The class of all Dylan objects.
The class of linked lists.