From m@ech|er @end|ng |rom @t@t@m@th@ethz@ch  Tue May 21 18:28:58 2019
From: m@ech|er @end|ng |rom @t@t@m@th@ethz@ch (Martin Maechler)
Date: Tue, 21 May 2019 18:28:58 +0200
Subject: [Rd] print.<strorageMode>() not called when autoprinting
In-Reply-To: <CAF8bMcatAtZ_LPWZk3QxVQXS5qHA14_j=_tBvGbbH+m0kBYnAQ@mail.gmail.com>
References: <CAF8bMcatAtZ_LPWZk3QxVQXS5qHA14_j=_tBvGbbH+m0kBYnAQ@mail.gmail.com>
Message-ID: <23780.10058.726995.538115@stat.math.ethz.ch>

>>>>> William Dunlap via R-devel 
>>>>>     on Thu, 16 May 2019 11:56:45 -0700 writes:

    > In R-3.6.0 autoprinting was changed so that print methods for the storage
    > modes are not called when there is no explicit class attribute.   E.g.,

    > % R-3.6.0 --vanilla --quiet
    >> print.function <- function(x, ...) { cat("Function with argument list ");
    > cat(sep="\n    ", head(deparse(args(x)), -1)); invisible(x) }
    >> f <- function(x, ...) { sum( x * seq_along(x) ) }
    >> f
    > function(x, ...) { sum( x * seq_along(x) ) }
    >> print(f)
    > Function with argument list function (x, ...)

    > Previous to R-3.6.0 autoprinting did call such methods
    > % R-3.5.3 --vanilla --quiet
    >> print.function <- function(x, ...) { cat("Function with argument list ");
    > cat(sep="\n    ", head(deparse(args(x)), -1)); invisible(x) }
    >> f <- function(x, ...) { sum( x * seq_along(x) ) }
    >> f
    > Function with argument list function (x, ...)
    >> print(f)
    > Function with argument list function (x, ...)

    > Was this intentional?

No, it was not.  ... and I've been the one committing the wrong change.

... Related to the NEWS entries which start

     "Changes in print.*() ...."

Thank you Bill, for reporting....

It's amazing this has not been detected earlier by anybody.

I think it is *only* for functions, not general
print.<storagemode>() as you were suggesting - right?

Martin



[Rd] print.<strorageMode>() not called when autoprinting
Martin Maechler