I'm learning OCaml at the moment, and I was caught out by the syntax today. This code (pictured) gives a type error saying that Sad is not a boolean. https://gist.github.com/Wilfred/ce4b7177f404a482b8fccc0044d15e4c
This is the classic 'dangling else' syntax problem, but with match statements rather than if statements.
miniblog.
Related Posts
After seeing yet another YAML dialect for controlling systems, I think we need a hierarchy of YAML dialect expressiveness.
(1) Has its own variable binding system.
(2) Supports if statements.
(3) Supports loops.
(4) Supports function definition.
2 seems to be the most common, but I've seen all of 1-3. Does level 4 exist in the wild yet?
After seeing yet another YAML dialect for controlling systems, I think we need a hierarchy of YAML dialect expressiveness.
(1) Has its own variable binding system.
(2) Supports if statements.
(3) Supports loops.
(4) Supports function definition.
I've been playing with GitHub Copilot, and it feels unlike any other completion tool I've used. In a bunch of cases, it can write short snippets that are exactly what I want.
(I tested it on a toy interpreter I'm working on. I'm tweaking how statements are represented.)


