|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] quad-PW and text |
Date: | Sun, 25 May 2014 13:43:36 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hi David,
actually ⎕PW works quite differently than its output suggests. Just resetting the print position after \n works for simple text vectors but not for text matrices, mixed values or nested values. My proposal would rather be to use FILE_IO[22] (aka printf()) in your use case: (⊂"hello world\nnext line\n") FILE_IO[22] 1 hello world next line 22 I could also add a "boxing" function to dyadic ⎕CR or to FILE_IO that converts strings containing \n to nested vectors of strings. I believe that the traditional APL format of text matrices is less suitable for longer texts and that nested vectors of strings should be used for that. /// Jürgen On 05/25/2014 03:43 AM, David B. Lamkins wrote: Enhancement request: Can quad-PW be made aware of newlines? Use case: I'd like to dump a text file to the screen using FILEIO[26], which (for a text file) returns a blob of text containing embedded newlines. Emitting a newline to the session display does not reset the print position. The session adds an additional APL wrap (newline plus indent) every quad-PW characters even though the newlines in the text keep the display well withing the quad-PW limits. |
[Prev in Thread] | Current Thread | [Next in Thread] |