Suharto Anggono Suharto Anggono
2018-Oct-05 17:13 UTC
[Rd] Redundant code in 'split.default' in R devel
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
>>>>> 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) <- lfIndeed --> 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".