> From: Raul Miller > > > array =: 0 1 2 3... > > 4 5 6 7... > > 8 9 10 11... > > > > I would like to do a "line continuation" at the end of every line > > but have no idea how to do it. I searched the literature for a > > couple hours but didn't find anything. > > > > Is this possible? > > array=: _". (0 :0)-.LF > 0 1 2 3 > 4 5 6 7 > 8 9 10 11 > ) > > Note that this assumes that lines are indented. > > If that is a problem for you -- if you want newlines > treated as whitespace, you could instead use > > require'strings' > array=: _". (LF,' ')charsub 0 :0
The short answer is that you can't do line continuations in J, but as Raul has shown you can define a multiline noun and parse it. Here is another parsing option, but I think I like Raul's charsub idea better. array=: ; <@(_&".);._2 noun define 0 1 2 3 4 5 6 7 8 9 10 11 ) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
