In another language, I have had something call itself with the new state to maintain it but I don’t see how to do that with scala actors. Something like this is how I would envision this:
def act(state)
react {
case blah => act(doSomething(state, blah))
}
}
Well.. funny thing. I tweak my question a little and find it compiles. I realized that all that happens is that I have to return a partial function. Well I can return a partial function that has a parameter in there, so…
The nice thing is that with a little more tweaking, it could be generalized quite easily.