]lines=: <;._2 'NB. add them//x+y/'
+------------++---+
|NB. add them||x+y|
+------------++---+
      ]words=: ;:&.> lines
+--------------++-------+
|+------------+||+-+-+-+|
||NB. add them||||x|+|y||
|+------------+||+-+-+-+|
+--------------++-------+
      ]last=: {:&.> words
+--------------+--+---+
|+------------+|++|+-+|
||NB. add them||||||y||
|+------------+|++|+-+|
+--------------+--+---+
      ]prefix=: 3{.&.> ;last
+---+-----+---+
|NB.|0 0 0|y  |
+---+-----+---+

The center box in 'last' is fill, created by {: on the empty (boxed) list in words, and it is a:, which has (empty) boolean contents.

What you have done is equivalent to

   3 {. > {: ;: ''
0 0 0

To fix it you can use

   3 {. > {:!.(<'') ;: ''

Henry Rich





On 8/26/2020 2:26 PM, Paul Jackson wrote:
I was working on code analysis a couple of months ago, and thought
about code display and which elements needed blanks around them.
Without that side trip I might not have noticed that I was getting
numbers instead of characters. The problem was easy to get around,
just test for and ignore the empty lines, so I got on with my work and
left a note to report it later.

I originally saw the issue on Android 901, and have just confirmed it
on Windows 902 beta, both 64-bit if that matters.

  NB. Cut into lines where / is like LF]lines=: <;._2 'NB. add them//x+y/'

NB. add them x+y

  NB. Words in each element of lines]words=: ;:&.> lines

NB. add them
x + y

  NB. Get the last word in each line]last=: {:&.> words

NB. add them
y

  NB. Get first three characters of each]prefix=: 3{.&.> ;last

NB. 0 0 0 y
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


--
This email has been checked for viruses by AVG.
https://www.avg.com

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to