[Rd] Minor Infelicity in Printing of Objects Nested in Lists
brodie gaslam
brod|e@g@@|@m @end|ng |rom y@hoo@com
Sun May 10 20:46:48 CEST 2020
> On Sunday, May 10, 2020, 12:24:17 PM EDT, Lionel Henry <lionel using 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 using 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"
More information about the R-devel
mailing list