Message-ID: <9084527.1033395.1589136408991@mail.yahoo.com>
Date: 2020-05-10T18:46:48Z
From: brodie gaslam
Subject: Minor Infelicity in Printing of Objects Nested in Lists
In-Reply-To: <CAJf4E3rYXEQyjaMx8eC=z8GcExsq+ANj_4yPGtd0+JAeON0fLA@mail.gmail.com>
> On Sunday, May 10, 2020, 12:24:17 PM EDT, Lionel Henry <lionel at rstudio.com> wrote:
>
> The main reason for resetting the tagbuf in `print.default()` and
> other entry points to the print routine is that it is currently not
> reset on exit. Creating a context to reset it on exit to its last
> value might work. This should be done in the entry points rather than
> in print-value-rec though, since callers of the latter might write to
> the tagbuf.
>
> Another solution to this problem is proposed with the first patch in
> https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17610. Maybe I
> should extract this patch into its own entry so the discussion can be
> separate from the other patches.
Ah, looks like the exact same issue, at least the first patch.? I'm not
wed to any particular solution, but I am happy to help test/work on this
if there is interest in addressing this.
Best,
B.
>On 5/10/20, brodie gaslam via R-devel <r-devel at r-project.org> wrote:
>> Currently S3 objects nested in generic vectors cause the tag buffer to be
>> reset.? This feels sub-optimal for those objects that don't have a print
>> method:
>>
>>> list(a=list(b='hello'))
>> $a
>> $a$b???????????????? ### <<<< notice "$a$b"
>> [1] "hello"
>>
>>
>>> list(a=structure(list(b='hello'), class='world'))
>> $a
>> $b?????????????????? ### <<<< notice "$b", not "$a$b"
>> [1] "hello"
>>
>> attr(,"class")
>> [1] "world"