Skip to content

Some improvements #34

@sdzx-1

Description

@sdzx-1
  1. In retrospect, designs like Fsm, State, and FsmState seem unnecessary. We only need State, and by convention, State must always have info, containing information such as the state machine name.
  2. We still seem to need a similar Data type.
pub const FindWord = union(enum) {
    to_check_word: Data(.next, CheckWord),
    exit: Dtat(.current, ps.Exit),
    no_transition: Data(.current, FindWord),
  ...
};
  1. Re-examine the names of states. For example, if there is a state S(A, B), then its name should be S.This will greatly reduce the length of the name.
  2. Is it allowed for messages to carry data? Before designing the troupe, I didn't understand how to handle messages carrying data. Now I do understand; it requires both a handler and a prehandler function to exist. Is this design worthwhile? I tend to think it is.

Although many of the ideas here come from troupe, troupe cannot replace polystate.

@milogreg I'd like to hear your opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions