Log in - Edit - History

Plof's design

Plof is intended to be an extremely flexible programming language. This is reflected in the language in many ways:

var List = Object : [
    this(next, val) {
        this.next = next
        this.val = val
    }

    map = (fun) {
        if (next) (
            new List(next.map(fun), fun(val))
        ) else (
            new List(Null, fun(val))
        )
    )
]
var if = (cond) {
    ((cond&&True).
        ifTrue( return ((then) { then; selff }); )).
        ifFalse(return ((then) { id }); )
}

, and is called like this:

if (condition) (
    // code to run if the condition is true
) else (
    // code to run if the condition is false
)

. Note the use of parenthesis instead of braces: These aren't blocks, they're just expressions which may or may not be evaluated by "if".