Newsgroups: comp.lang.apl Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!blister!itcyyz!yrloc!hui From: hui@yrloc.ipsa.reuter.COM (Roger Hui) Subject: Re: Rank 0 catenation. Message-ID: <1991Jun27.052421.809@yrloc.ipsa.reuter.COM> Organization: Iverson Software Inc. References: <1991Jun24.161151.12366@watmath.waterloo.edu> Date: Thu, 27 Jun 91 05:24:21 GMT In article weg@convx1.ccit.arizona.edu (Eythan Weg) writes: > [stuff] > > Any time I start playing with this toy I find new ways to recombine > its constituents. Is it the language equivalent to Lego? I am > confident that this is a common experience. But here is a point that > puzzles me. I wish J to possess a regular expression automaton to be > used in much the same way as it is used in unix utilities. Is there > anything wrong with this desire? I thought it might be used with E. > for example. a) It is not so unusual that the same nontrivial idea can be expressed in more than one way. One can say "to be or not to be" or "what now?" as appropriate; does that make English a Lego language? :-) b) If the regular expression automaton in UNIX is to your liking, you can invoke it from within J by 0!:0 or by using LinkJ. I have some epsilon-baked ideas on how a FSM can be introduced. A gerund is an array of atomic representations of verbs. The conjunction ` returns gerund results, for example, +`-`*`(+/) is a 4-element gerund; and the conjunction g`:n defined various verbs from a gerund. (See Bernecky & Hui, APL91.) If g is a gerund matrix, one can define: fsm =. g`:57 fsm is applied to successive elements of an integer vector of inputs. The initial state is 0. If the current state is i and the current input is j, then the verb represented by (