Yes it is.  The example looks strange because the first character of a is
"a", not normally used as a separator.  If the first character is a blank
(say), then it looks more normal.  e.g.

   state=: 3 2 2$ 1 1 2 1  2 0 2 2 1 0  2 2
   a=: ' a good way to start the day'
   (0;state;<a.={.a);:a;:a
┌──┬─────┬────┬───┬──────┬────┬────┐
│ a│ good│ way│ to│ start│ the│ day│
└──┴─────┴────┴───┴──────┴────┴────┘
   <;.1 a
┌──┬─────┬────┬───┬──────┬────┬────┐
│ a│ good│ way│ to│ start│ the│ day│
└──┴─────┴────┴───┴──────┴────┴────┘
   S=: 0;state;<a.={.a
   (S&;: -: <;.1) a
1
   (S&;: -: <;.1) ' the quick brown fox jumps over the lazy dog'
1
   x=: 1e6$' the quick brown fox jumps over the lazy dog'
   (S&;: -: <;.1) x
1

Now the thing that surprised me when I saw it the first time:

   timer=: 6!:2
   10 timer '<;.1 x'
0.0630174
   10 timer 'S&;: x'
0.0675069

<;.1 is implemented using hand-coded C.



2012/3/8 Linda Alvord <lindaalv...@verizon.net>

> Roger, I'm not sure that this is  what you had in mind.
>
>
>   a=:'a good way to start the day'
>   <;.1 a
> ---------T--------T---------T--┐
> │a good w│ay to st│art the d│ay│
> L--------+--------+---------+---
>   state=: 3 2 2$ 1 1 2 1  2 0 2 2 1 0  2 2
>   (0;state;<a.={.a);:a
> ---------T--------T---------T--┐
> │a good w│ay to st│art the d│ay│
> L--------+--------+---------+---
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to