From murdoch@dunc@n @end|ng |rom gm@||@com  Wed Nov 13 01:16:55 2019
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Tue, 12 Nov 2019 19:16:55 -0500
Subject: [Rd] calls with comment attribute
In-Reply-To: <CAF8bMcZcPwUZsoC_sg3SpUm2PeGentV0DcKQRdN8JtYb5K_Scw@mail.gmail.com>
References: <CAF8bMcZcPwUZsoC_sg3SpUm2PeGentV0DcKQRdN8JtYb5K_Scw@mail.gmail.com>
Message-ID: <5bd1a88a-646b-33b3-7107-ca8ee0b3ab90@gmail.com>

On 12/11/2019 5:01 p.m., William Dunlap via R-devel wrote:
> In general R doesn't print the "comment" attribute of an object
>     > structure(1:3, comment=c("a comment", "another comment"))
>     [1] 1 2 3
> but if the object is a call it prints it in an unusual format
>     > structure(quote(func(arg)), comment=c("a comment", "another comment"))
>     a comment
>     another comment
>     func(arg)
> 
> What is the rationale for the special treatment of calls?

It was there in revision 2 of src/main/deparse.c in 1997.  (For those 
unfamiliar with R history:  the current revision of R is 77405.  That 
particular file has been revised 248 times since rev 2.)

I suspect either nobody has noticed it before, or nobody had the nerve 
to touch it.

Duncan Murdoch



[Rd] calls with comment attribute
Duncan Murdoch