RFC on range design for D2

Sergey Gromov snake.scaly at gmail.com
Thu Sep 11 02:51:05 PDT 2008


Benji Smith <dlanguage at benjismith.net> wrote:
> Bill Baxter wrote:
> > Hmm, for FSMs you can't really define a good end state.  There may not
> > be any particular end state. ... ah, but wait I forgot.  That's the
> > beauty of a range -- the end "state" doesn't have to be a "state" per
> > se.  It can be any predicate you want it to be.  "Range" is misleading
> > in this case.  This is one of those cases where you just have to
> > remember "range" means "current value plus stopping criterion".
> 
> That's what I was saying earlier.
> 
> I think the mechanics are good. And for contiguous, sequential 
> containers, the word "range" is great. For other types of containers, or 
> other selection/iteration scenarios, you can shoehorn your mental model 
> into the "range" metaphor. But it's weird.

It seems to me like a misuse of ranges.  Do you really want to iterate 
over a state machine?  FSM is a mailbox with a 'message' hole.  You put 
messages into it and it does things.  How do you iterate over a mailbox?


More information about the Digitalmars-d-announce mailing list