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

6 methods from Object ► show

Instance Methods

Inherited instance methods

1 methods from FilterPattern ► show
43 methods from Pattern ► show
159 methods from AbstractFunction ► show
260 methods from Object ► show

Undocumented instance methods

.dict

.dict = value

.embedInStream(inval)

.levels

.levels = value

.rewriteList(list, inval, level)

Examples

The examples use the () shortcut for Event.