Preferences

Is there a way to combine:

Higher order finite state machines that require other states as parameters to work.

https://github.com/sdzx-1/ray-game/blob/master/src/select.zi...

The select, inside, and hover states here are all high-level states, and all require two state parameters. And these three states form a small state machine for handling mouse interactive selection.

Can I think of this way of using higher-order state machines as a kind of composition? A semantic composition.


mxkopy
This sounds more like a product than a composition but I’m not sure. I think the parent is hinting to use established compcomp language. Sipser is a good read for this
goless OP
I'm not sure if this is a new form of state machine.

If you look at the code here you'll see that the select state uses some functions from the parameter state.

https://github.com/sdzx-1/ray-game/blob/master/src/select.zi...

So you can see that the select state itself is incomplete, and the parameter state completes it.

It doesn't seem to be any of the 3 described above.

Perhaps it is reasonable to call it semantic composition.

goless OP
Here I must mention the great advantage of the Zig language: it has the expressiveness of a dynamic language and the type safety of a static language.
goless OP
From this perspective, do you think my previous description is accurate?

This item has no comments currently.