Meta Project

The Unofficial Meta Documentation

EITHER

Summary

EITHER The Meta way of using an ELSE branch

Category

CONTROLS

Usage

EITHER condition block1 block2

Arguments

condition - condition that determines the block to execute.

block1 - This block is executed if the condition is true

block2 - This block is executed if the condition is not true

Refinements

This method has no refinements

Description

EITHER is the Meta (Rebol) way of using an IF THEN ELSE construction. Because Rebol is interpreted it makes a difference to know in advance whether or not an IF statement will include an ELSE branch. The way to know is simple to use a different word in such a case. When changing to an from an IF you must remember the extra block the EITHER needs.

Example Code

Meta-is-cool?: true
EITHER Meta-is-cool? [
    write/line "Meta is COOL!"
][
    write/line "Meta is COOL anyway!"
]

Related

IF  
UNLESS  

Back to the Meta Methods Reference index