Types True = Boolean primitive("clone") setValue(1)
Types False = Boolean primitive("clone") setValue(0)
Types None = Boolean primitive("clone")

Boolean clone = Boolean

Object do (
    #ifNonError evaluates the argument and returns the result
    ifNonError = Object get("evalArg")

    #ifError returns self
    ifError = method(self)

    #catch returns self
    catch = method(self)

    #ifNone returns self
    ifNone = method(self)

    #ifTrue returns self
    ifTrue = method(self)

    #ifFalse returns self
    ifFalse = method(self)

    #or returns True
    or = True

    #and evaluates the argument and return the result
    and = Object get("evalArg")
)

True do (
    #ifTrue evaluates the argument and returns the result
    ifTrue = Object get("evalArg")

    #ifFalse does not evaluate the argument and returns True
    ifFalse = True

    #and evaluates the argument and returns the result
    and = Object get("evalArg")

    #or does not evaluate the argument and returns True
    or = True

    #not returns False
    not = False

    #clone returns True
    clone = True

    #__repr__/__str__ returns True
    __repr__ = __str__ = method("True")
)

False do (
    #ifTrue does not evaluate the argument and returns False
    ifTrue = False

    #ifFalse evaluates the argument and returns self
    ifFalse = Object get("evalArg")

    #and does not evaluate the argument and returns False
    and = False

    #or evaluates the argument and returns the result
    or = Object get("evalArg")

    #not returns True
    not = True

    #clone returns False
    clone = False

    #__repr__/__str__ returns False
    __repr__ = __str__ = method("False")
)

None do (
    #ifTrue does not evaluate the argument and returns False
    ifTrue = False

    #ifFalse evaluates the argument and returns self
    ifFalse = method(call message arg(0); self) 

    #ifNone evaluates the argument and returns self
    ifNone = Object get("evalArg")

    #and does not evaluate the argument and returns False
    and = False

    #or evaluates the argument and returns the result
    or = Object get("evalArg")

    #not returns True
    not = True

    #clone returns False
    clone = None

    #__repr__/__str__ returns None
    __repr__ = __str__ = method("None")
)

# Order matters here. Cloneable first.
Importer import("cloneable")
Importer import("iterable")
Importer import("comparable")

# Followed by builtins
Root builtins = Importer import("builtins")

import range
import error
import object
import operators
import syntactic
