Hi PLJ -
The email reformatting made it a little hard to figure out what you are
saying, but I think it boils down to "why do these two expressions give
different results?":
   3{.&.>a:
+-----+
|0 0 0|
+-----+
   3{.&.><''
+---+
|   |
+---+
NB. But
   a: -: <''
1
NB. However
   a: -: <i.0
1



On Wed, Aug 26, 2020 at 2:46 PM Henry Rich <[email protected]> wrote:

>     ]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
>


-- 

Devon McCormick, CFA

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

Reply via email to