bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Print width


From: Juergen Sauermann
Subject: Re: [Bug-apl] Print width
Date: Wed, 29 Jan 2014 12:48:07 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Kacper,

I see. I have changed back to the old ⎕PW behavior and made 79 the
default ⎕PW value. SVN version 113.

/// Jürgen

On 01/28/2014 08:55 PM, Kacper Gutowski wrote:
On 2014-01-28 14:23:01, Juergen Sauermann wrote:
that was on purpose because the default ⎕PW is 80 and on some
80 column terminals this causes an extra empty line to be printed.
If there are terminals like that, wouldn't it be easier to just initialize
⎕PW to 79 while keeping relation between this value and way wrapping occurs
the same as in other systems?  It's a bit annoying when you have some
pretty-printing functions that read value of ⎕PW to decide how to format
output.

Anyway, it's not that easy as width being ⎕PW-1.  When printing mixed
arrays X such that (⎕PW-1)=¯1↑⍴⍕X, i.e. ones that should fill the whole
line but not wrap, they sometimes get wrapped too.

       ⎕PW←30
       (⎕PW-1)⍴'X'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
       10|⍳⎕PW÷2
1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
       1,(⎕PW-3)⍴'X'
1 XXXXXXXXXXXXXXXXXXXXXXXXXXX
       1,⍨(⎕PW-3)⍴'X'            ⍝ Last element wrapped for no reason?
XXXXXXXXXXXXXXXXXXXXXXXXXXX
       1
       ⍕1,⍨(⎕PW-3)⍴'X'           ⍝ See? No reason at all.
XXXXXXXXXXXXXXXXXXXXXXXXXXX 1
       'X',1,(⎕PW-5)⍴'X'         ⍝ ⋆Two⋆ lines printed.
X 1 XXXXXXXXXXXXXXXXXXXXXXXXX
⍕'X',1,(⎕PW-5)⍴'X' ⍝ Single line as expected.
X 1 XXXXXXXXXXXXXXXXXXXXXXXXX

Especially take a look at the last example.  There is exactly nothing to
wrap but additional line still appears.

-k





reply via email to

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