Prewrite:
Filter:
Classes | Streams-Patterns-Events > Patterns > List > Indexing

Prewrite : FilterPattern : Pattern : AbstractFunction : Object

L-system pattern for selfsimilar structures
Source: Prewrite.sc

Description

Lindenmayer system pattern for selfsimilar structures. Its dictionary (or event) maps one element to an array of child elements. The algorithm replaces iteratively (levels deep) elements by arrays of elements starting with the values in the pattern.

Class Methods

Prewrite.new(pattern, dict, levels: 1)

Arguments:

pattern

starting value

dict

a dictionary or an event.

levels

number of levels

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.dict

.dict = value

.embedInStream(inval)

.levels

.levels = value

.rewriteList(list, inval, level)

Examples

The examples use the () shortcut for Event.