From murdoch@dunc@n @end|ng |rom gm@||@com  Tue Aug  2 02:08:53 2022
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Mon, 1 Aug 2022 20:08:53 -0400
Subject: [Rd] Should invisible() get signature x=NULL?
In-Reply-To: <CAD7Bkx-H+-Xe=SFZbBE3Zgw89Dy--uA4nzcQO9U7obzHjSxeHg@mail.gmail.com>
References: <CAD7Bkx-H+-Xe=SFZbBE3Zgw89Dy--uA4nzcQO9U7obzHjSxeHg@mail.gmail.com>
Message-ID: <02ae40ec-4824-7594-131f-b9cea33c8915@gmail.com>

On 01/08/2022 6:27 p.m., Michael Chirico via R-devel wrote:
> I think most experienced R users are familiar with return(invisible())
> being used as shorthand for return(invisible(NULL)).

I'm not sure that's true... the R sources themselves are inconsistent 
about using invisible() vs invisible(NULL).

> However, this NULL default is not documented anywhere -- we have to
> dive into src/main/print.c:do_invisible to source this behavior.
> 
> Is this lack of documentation intentional? Otherwise, should the
> signature be updated to reflect this default?
> 
> invisible <- function(x = NULL) .Primitive("invisible")
> 
> Otherwise, should this default be mentioned in ?invisible ?

But documenting it seems wise.

Duncan Murdoch



[Rd] Should invisible() get signature x=NULL?
Duncan Murdoch