Redundant code in 'split.default' in R devel

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Redundant code in 'split.default' in R devel

R devel mailing list
After r75387, function 'split.default' in R devel still has this part that no longer has effect.
    lf <- levels(f)
    y <- vector("list", length(lf))
    names(y) <- lf

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Redundant code in 'split.default' in R devel

Martin Maechler
>>>>> Suharto Anggono via R-devel
>>>>>     on Fri, 5 Oct 2018 17:13:30 +0000 writes:

> After r75387, function 'split.default' in R devel still has this part that no longer has effect.

>     lf <- levels(f)
>     y <- vector("list", length(lf))
>     names(y) <- lf

Indeed  -->   removed now.

Thank you very much, Suharto!
Martin

------- --------

"Exercise" (tongue in cheek) to the reader:

Write a "code walker" (an R function itself) that takes an
argument 'expr', which is an R expression (think of a *body* of a
function 'f')  and is able to  mark e.g.  warn about  such
"dead" code in 'expr' (and hence in function 'f' ...)  --- with
the important underlying assumption that all functions that are
called inside 'f' have "no side effects".

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel