A work around is to use function code 2, and look for gaps in emitted words. If all gaps mean an empty word, then that is easiest. if gap meaning is dependent on state row, then function code 4 can be used.
I'd expect it would be much faster if the suggestion were implemented though. Another suggestion though: For numeric y, have the last (or first) column in the (2d) sj matrix mean "other" input. This would not break any existing machines that did not currently crash, and would allow unicode processing (embedded with other codes). The case for the first column, is that for "character" data, any value outside of 256 would get mapped to 0. The other application would be ragged arrays, with delimiter code(s), and "data" ________________________________ From: 'Pascal Jasmin' via Programming <[email protected]> To: "[email protected]" <[email protected]> Sent: Friday, March 24, 2017 11:17 AM Subject: Re: [Jprogramming] fsm suggestion. ew when j=_1 should emit empty box/word 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
