> Subject: /Re: [Jprogramming] What a drag
> 
> > This scan pattern seems so simple in explicit code,
> > that it's surprizing that in J to run it
> > efficiently it requires quite a trick:
> >
> >    ([^:(0=]))~ /\.&.|. 3 0 0 2 0 4
> > 3 3 3 2 2 4
> >
> 
> I've been looking for something like this, only I think I conceived it in
> another context:
> 
> An adverb I call trace, that shows a series of states, given a finite
> state
> machine, an initial state, and a series of transitions:
> 
>    fsm trace S_init,transitions
> 
> My initial solution was
> 
>    fsm/\init,transitions
> 
> but I can see how
> 
>    fsm~/\. &. |.
> 
> would work as well.
> 
> Therefore:
> 
>     trace =: 1 : 'u~/\.&.|.'

Tacitly,

trace=. ((~/)\.)(&.|.)

> 
> works for me.



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to