I think custom actions is a great path forward, but the case for emmiting empty 
words is still pretty strong, imo.  Another use case is mentioned in last 
section of this essay,

http://code.jsoftware.com/wiki/User:Pascal_Jasmin/sequential_machine_intro

"Nothing to output"/empty is a genuine part of many data structures.

For function codes 2 and 4, the output could be i,0 (when j=-1)

The workarounds are fairly expensive contortions, and I assume, that 
useractions would exist as codes on top of the built-ins.





________________________________
From: 'Pascal Jasmin' via Programming <[email protected]>
To: Programming Forum <[email protected]> 
Sent: Thursday, March 23, 2017 5:10 PM
Subject: [Jprogramming] fsm suggestion. ew when j=_1 should emit empty    
box/word



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

Reply via email to