bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] quote-quote should display a blank line


From: Blake McBride
Subject: Re: [Bug-apl] quote-quote should display a blank line
Date: Tue, 27 May 2014 16:37:05 -0500

I just downloaded and installed IBM APL2 on my Windows box.  '' prints a blank line as I have been stating.



On Tue, May 27, 2014 at 3:32 PM, Blake McBride <address@hidden> wrote:
I don't know why it would be hard to rationalize.  Here is your algorithm:

if (printable value) {
    print value
    print cr
}

Here is the algorithm used by all APL's I've used:

if (printable value) {
    print value
}
Print cr


The advantage of the second algorithm is that if you are printing several values, you can see which is missing.  Using your algorithm, null values don't get any display and you can get out of sync with regard to what was printed and which were null.  Clearly the second is better.

I challenge you, as I did in my last email, to show one instance in which a function would have '' but not want it to print.

Blake





On Tue, May 27, 2014 at 3:19 PM, Blake McBride <address@hidden> wrote:
Dear David,

First, I assure you, this is how it works.

I do know of a 0<value> idiom for branching and for nullifying a prior value in a subsequent assignment.  I am unaware of any need for that idiom to prevent printing.  Can you give me one example in a function?

Thanks.

Blake



On Tue, May 27, 2014 at 2:32 PM, David B. Lamkins <address@hidden> wrote:
I find this confusing and counterintuitive.

If displaying an empty vector causes the interpreter to emit a CR, what
then becomes of the 0⍴<value> idiom commonly used to suppress display of
<value>? Wouldn't your output be littered with spurious CRs every time
your program executed such a line?

I spent a half-hour digging through the IBM and ISO references, finding
nothing on the subject of display of empty vectors.

On Tue, 2014-05-27 at 13:04 -0500, Blake McBride wrote:
> a.  Neither an empty vector nor a vector of multiple elements has a CR
> in it.  The system prints the vector, and then prints a CR.  CR gets
> printed either way.
>
>
> b.  I found all these errors while porting my production code which
> ran consistently over IBM APL and several other APL's.  They all print
> a blank line.
>
>
> On Tue, May 27, 2014 at 12:57 PM, David B. Lamkins <address@hidden>
> wrote:
>         How is that so? '' is an empty vector.
>
>         On Mon, 2014-05-26 at 20:30 -0500, Blake McBride wrote:
>         >       ∇test
>         > [1] '1'
>         > [2] ' '
>         > [3] '2'
>         > [4] ''
>         > [5] '3'
>         > [6] ∇
>         >       test
>         > 1
>         >
>         > 2
>         > 3
>         >
>         >
>         >
>         >
>         > There should be a blank line between 2 and 3.
>         >
>         >
>         > Thanks.
>         >
>         >
>         > Blake
>         >
>         >
>
>
>
>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]