[Jprogramming] fsm suggestion. ew when j=_1 should emit empty box/word
Raul Miller
rauldmiller at gmail.com
Fri Mar 24 02:21:45 UTC 2017
I have been wishing for an option to get the first of the s columns of
the trace. Currently, you can use (5;...) and index column 4, but i
anticipate it being significantly faster (and more order-of-magnitude
more space efficient) to just get the one column.
The point being that it can be useful to analyze a body of text using
;: and extract the state of each character (state being the row# which
will handle the next character). (Note that the parsing operation is
mostly irrelevant, here, except as something that happens to exist.)
Thanks,
--
Raul
On Thu, Mar 23, 2017 at 5:18 PM, Henry Rich <henryhrich at gmail.com> wrote:
> I would like to throw the discussion open to ways to generalize FSM, perhaps
> by invoking a user-defined emit verb.
>
> Henry Rich
>
>
> On 3/23/2017 5:10 PM, 'Pascal Jasmin' via Programming wrote:
>>
>> I understand that current behaviour is to crash with index error if an ew
>> action is invoked while j=_1
>>
>> It would actually be extremely convenient to emit an empty box (word)
>> instead. I'm unsure that a crash is helpful.
>>
>> One use case is splitting words by parentheses groups (without the outter
>> parentheses), such that only odd indexes are paren groups. The workaround
>> is to append an empty box if leading char is (, and to replace ')('
>> (consecutive close then open) strings with a sequence of nulls long enough
>> to not have likely occurred with natural probability.
>>
>> setting j=0 on start is not allowed, because it must be smaller than i.
>>
>> ew on first char ( (empty word) would work well. Because I wish to
>> discard closing ), ew on immediately following ( (again empty word) with a (
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list