J's E. implements Boyer-Moore, which makes it much faster than a standard
search. You could implement a standard search using sequential machines
(well, if you don't mind a transition table that grows with the size of the
label to find), but I'm fairly sure it's impossible to implement Boyer-Moore
using sequential machines, so your search would be several times slower and
probably not worth the advantage you get from stopping early.

Marshall

On Wed, Oct 12, 2011 at 1:41 PM, Alan Stebbens <a...@stebbens.org> wrote:

> It seems to me that another possibility for iterative and lazy evaluation
> is the finite sequential machine (;:), with a cleverly designed state table,
> such that a "stop" (code 6) or an "error" (_1) is thrown and then caught by
> logic in the state table, so that parsing all the input is not always
> required.
>
> Alan
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to