For version 0.7.0.
To top.  Up: ..Shapes..Control

[standard prelude]

cond


Alphabetical index
cond

Namespace:  ..Shapes..Control

The primary tools that the Shapes core language provides for program flow control and conditional evaluation, are the escape continuations and the ..Shapes..if function. This extension provides abstractions for some other common conditional constructs found in other programming languages.
Sections:    Multi-clause conditionals

Multi-clause conditionals

At the moment, there is just one function here.
cond
<>::{§ConsPair} §Value
Dynamic references:none
Takes any number of §ConsPair pairs as arguments, and searches from left for a pair with true car (predicate) part, returning the corresponding cdr (consequence) part.
To provide a default result one must simply pass a §ConsPair with a predicate part which is just true.
Using the cond function
One application of cond, and one case where cond could have been used, but wasn't.

Source: show/hide visit

stdout: show/hide
Get Shapes at SourceForge.net. Fast, secure and Free Open Source software downloads