Coding 2023-08-13

Tags:
By Max Woerner Chase

I'm messing a bit more with the Smalltalk-inspired stuff, and I don't think it's going to deliver on its goals of readability, unless I can come up with a better type definition syntax than let type list-of: 'a be nil or cons: 'a onto: list-of: 'a. Either I need to figure out a reasonable way to make that read more like prose, or I need to come up with a more modest goal. Or just scrap the whole thing.

To be honest, I do like the aspect of putting in the parameter's purpose next to its usage. So, maybe I want to focus my efforts on make the usage conform to some standard, and don't worry so much about the definition...

Oh man, I just tried annotating types on a function definition, and I think I actually really like what I came up with.

In that case, now I want to focus on match/switch/case statements. Right now, it's generically ML-ish, which doesn't particularly mesh with the pseudo-English going on around it. Let's look at the parts involved:

Thinking about it that way implies that, instead of ->, I should be using the second keywords from the various forms of definition. That's no use without something for the beginning to coordinate with it, though.

Hm. If you squint at it hard enough, like maybe really really hard, a match construct kind of looks like an anonymous function that gets pipelined into.

...

Okay, I've got an idea. It's weird, but at this point, it's commit, or be committed. The new syntax I'm trying out is when _ is _ (be|do|then) _, and...

I like it.

I am going to have so much trouble convincing people this isn't an esolang.

Anyway, I'm going to wrap up for tonight, and ponder something else for a bit: should I have an equivalent to rec from OCaml, or just not, like in Koka?

Good night.