From henrik.bengtsson at gmail.com  Tue Mar 20 22:11:40 2018
From: henrik.bengtsson at gmail.com (Henrik Bengtsson)
Date: Tue, 20 Mar 2018 14:11:40 -0700
Subject: [Rd] WISH: Sys.setlocale() to return value invisibly
Message-ID: <CAFDcVCTagHrsOwbAdF+08mAv5j3Dc6Ou50YC0iUVP+g92YuS2w@mail.gmail.com>

Contrary to, say, Sys.setenv(), Sys.setlocale() returns it's value
visibly.  This means that if you for instance add:

Sys.setlocale("LC_COLLATE", "C")

to your .Rprofile file, it will print:

[1] "C"

at startup. The workaround is to wrap the call in invisible(), but I'd
argue that any "setter" function should return invisibly.

Some more details:

> withVisible(Sys.setlocale("LC_COLLATE", "C"))
$value
[1] "C"

$visible
[1] TRUE

> withVisible(Sys.setenv(FOO = "C"))
$value
[1] TRUE

$visible
[1] FALSE

/Henrik



[Rd] WISH: Sys.setlocale() to return value invisibly
Henrik Bengtsson