Banjo

52 thoughts
last posted Nov. 9, 2015, 7:13 p.m.

1 earlier thought

0

Some syntax ideas

// Functions
f(x) = x * 2
f = (x) -> x * 2


// Objects
x = { foo = bar, baz = quux }

// Lists
y = [foo, bar, baz, quux]

// Let
f(x) = (
  y = x*x
) => y*y

// Single-line
f(x) = (y = x*x) => y*y

// Methods
obj = {
    val = 5
    obj.plus_val(x) = x + obj.val 
}
bla = obj.val //  bla == 5
blo = obj.plus_val(3) // blo == 8

// Operator definitions
true = {
   (true || x) = true
   (true && x) = x
}
false = {
    (false || x) = x
    (false && x) = false
}

50 later thoughts