so something like action code 7 calls u (i,j,r,c) ? could u output characters not in the stream? This would be handy, and wouldn't break function code 2, though there wouldn't be enough info to know if the words were emitted by builtin or custom action.
if u gets passed in ar form, then could passing u`v`w result in code 7 invoking u, 8 v, and 9 w? in terms that information passed to u, (i,j,r,c,evstacki, evstackr); previousoutput? would be possible ... though the latter previous output seems dubious. the return value of u should be newj;outputword to allow outputword to be stripped or enhanced. though possibly (newj, newr, newc);outputword, though can't think of a good case for this. ________________________________ From: Henry Rich <[email protected]> To: [email protected] Sent: Thursday, March 23, 2017 5:18 PM Subject: Re: [Jprogramming] fsm suggestion. ew when j=_1 should emit empty box/word 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
