Pif:
Filter:

Pif : Pattern : AbstractFunction : Object

Pattern-based conditional expression
Source: Patterns.sc

Class Methods

Pif.new(condition, iftrue, iffalse, default)

Arguments:

condition

A pattern or stream returning a Boolean value.

iftrue

This stream is evaluated if the Boolean is true.

iffalse

This stream is evaluated if the Boolean is false.

default

This value (not stream) is returned if "iftrue" or "iffalse" return nil at any time.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

.asStream

.condition

.condition = value

.default

.default = value

.iffalse

.iffalse = value

.iftrue

.iftrue = value

Examples