[Rd] Change in print.function between R 3.4.1 and R 3.4.0
Martin Maechler
maechler at stat.math.ethz.ch
Thu Jul 20 17:36:50 CEST 2017
>>>>> nicola farina <farinan at gmail.com>
>>>>> on Thu, 20 Jul 2017 16:51:54 +0200 writes:
> Dear all,
> I just installed R 3.4.1 and noticed a change in how user-defined functions
> are printed. A small example:
> string<-"f<-function(x){\n\tx^2\n}"
> cat(string,file="tmp00a.R")
> source("tmp00a.R")
> f
> And this is what I see:
> #R 3.4.0
> function(x){
> x^2
> }
> #R 3.4.1
> function(x){
> \tx^2
> }
> Seems that in 3.4.1 the tab character isn't "rendered". This is rather
> annoying since it becomes very difficult to inspect the source code of user
> defined functions. This behaviour seems to be present just for the tab
> character (\n and \r are displayed correctly).
[..............]
> Thank you for your attention and your incredible work.
Thank you for the flowers.
Believe it or not, I've detected this bug about 8 hours ago, after typing
menu
at the R prompt after receiving a bug report about it.
It came from fixing bug PR#16732 (which was about rendering
Japanese fonts in a function defintion when printing)
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16732
A (probably shortest possible!) symptom of the bug is
that in R <= 3.4.0,
> quote(-"\n")
-"\n"
>
whereas in R 3.4.1 (and the current newer development versions of R)
> quote(-"\n")
-"\\n"
>
Ideally, fixing this (wrong duplication of "\") will not make
bug 16732 resurface.
I expect a bug fix by tomorrow.
If this is a big problem for you, you will have to upgrade to
"R 3.4.1 patched"
during the weekend.
(Downgrading to R 3.4.0 is not a good idea, compared to the above!)
Martin Maechler,
ETH Zurich
> Nicola Farina
> [[alternative HTML version deleted]]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(do learn to post in plain text on R-devel, please)
More information about the R-devel
mailing list