Tuesday, August 02, 2005

Stupid keywords

I spent like 20 minutes trying to figure out what I was doing wrong with the syntax of pattern matching in Ocaml, only to discover the problem wasn't with pattern matching at all: I was trying to bind the name val, which is a keyword in ML:
let (key, val) = List.find( ... )
Learning a new language is such a pain. I thought I'd grown out of stupid problems like this. You almost can't blame developers for resisting learning new technologies.


Marius said...

Hey Dave,

Usually a decent syntax highlighter helps with that problem. If it turns blue, it's a bad variable name =)

(How come you're learning OCaml?)

Dave Herman said...

That's a good point. In my case, I'm forced to work with a minimal emacs installation over SSH on someone else's Linux box, because I'm playing with alphaCaml and that was the only place I could get it installed. So I don't even have an Ocaml mode.

How come you're learning Ocaml?

I'm working with alphaCaml, because I'm interested in languages that deal with binders.

Marius said...

Awesome. Funny enough, I've been interested in the same topic lately. In particular, higher order abstract syntax. alphaCaml is on my list.

Dave Herman said...

All right, you convinced me. I got X-forwarding set up and I have my precious syntax highlighting. So much better.