Caterpillar

Daily Thought - 2024-08-15

< back to list

I think yesterday's thought raises two questions:

  1. Couldn't we solve this, by teaching the type system about groups of closures, only one of which can be called? Then it should be fine for all closures in the group to ostensibly take ownership of the same linear value, because only one of them will actually do that.
  2. Isn't the problem that if is a built-in function? Can't it be made a special syntax then, that the compiler understands?

Both true! As for 1, that's basically what a pattern matching function is. I have some ideas for that, but let's save that for later. As for 2, that's exactly what I considered first. But then I thought, if I implement a special thing that the compiler needs to understand, why not try pattern matching instead? I'll go into the reasons for that tomorrow.

<< previous thoughtnext thought >>