Archive for March 10th, 2009

Declarations vs. assignments

Tuesday, March 10th, 2009

Oh dear, another keyword. I’m not doing very well at this “as little syntax as possible” thing. But I don’t really know what else to do about this: I don’t think SSA would be a very good fit.

My new nemesis: var. Other candidates like def or val haven’t been ruled out yet, though, except that they have the wrong connotations to me — defs are re-evaluated every time they are used, and vals are sort of semi-constant1.So that’s why I’m thinking var.

(more…)


  1. Specifically, final in Scala. 

Reserved words so far

Tuesday, March 10th, 2009

The shorter this post is, the happier I’ll be. It’s meant to be more of a reference as I inevitably have to add new things. Assuming I remember to update it of course.

(more…)

Variable argument lists?

Tuesday, March 10th, 2009

Re: multi-way if, how about something like

if := fun (cond, lazy then) `(conds, lazy thens) {
    case cond {
        false, 0, nil := case conds.len {
            0 := nil
            _ := if `(conds, thens)
        }
        _ := then
    }
}
else := true

if { x = 2,
    println("x is 2")
} { x < 2,
    println("x is less than 2")
} { else,
    println("x is more than 2")
}

(more…)

A language

Tuesday, March 10th, 2009

As if the pile-up of university assignments doesn’t give me enough to do, I’ve been thinking about writing a tiny programming language, where as few things are taken as primitive as possible, so the user can define almost any syntax they want. So far, though, what I’ve thought of amounts to little more than Lisp with the brackets in different places. Oh, and infix operators.

Note that none of this is implemented yet, I’m just throwing out any ideas I have. Even if they’re terrible.

(more…)