bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Print width


From: Kacper Gutowski
Subject: Re: [Bug-apl] Print width
Date: Tue, 28 Jan 2014 20:55:55 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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]