contains behavior related to the case statement

Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
inspect = "DefaultBehavior Case"
kind = "DefaultBehavior Case"
notice = "DefaultBehavior Case"
Active cells (details)
case(value, [elseCode] nil, +[whensAndThens])

takes one argument that should evaluate to a value, zero or more whenAndThen pairs and one optional else clause. will first evaluate the initial value, then check each whenAndThen pair against this value. if the when part of a pair returns true, then return the result of evaluating the then part. if no pair matches and no else clause is present, returns nil. if an else clause is there, it should be the last one. each whenAndThen pair is comprised of two arguments, where the first is the when argument and the second is the then argument. the when part will be evaluated and the result of this evaluation will be sent a === message with the value as argument.

case:and(+args)

nil

method(+args, 
  DefaultBehavior Case AndCombiner with(components: args))
case:else()

nil

method(
  DefaultBehavior Case Else)
case:nand(first, +args)

nil

method(first, +args, 
  DefaultBehavior Case NAndCombiner with(first: first, components: args))
case:nor(first, +args)

nil

method(first, +args, 
  DefaultBehavior Case NOrCombiner with(first: first, components: args))
case:not(other)

nil

method(other, 
  DefaultBehavior Case NotCombiner with(other: other))
case:or(+args)

nil

method(+args, 
  DefaultBehavior Case OrCombiner with(components: args))
case:otherwise()

nil

method(
  DefaultBehavior Case Else)
case:xor(first, +args)

nil

method(first, +args, 
  DefaultBehavior Case XOrCombiner with(first: first, components: args))