Displaying 1 result from an estimated 1 matches for "witharg".
Did you mean:
withargs
2000 Nov 22
0
How do you construct a function from a list? (PR#743)
...in 1) junk())
I'm running this in 1.1.1 on Windows, but I tried a Nov 14 development
snapshot, and got the same results.
I think this is a bug in as.function.default, because of these two
examples:
For a function with arguments, as.function undoes as.list:
> options(keep.source=F)
> withargs <- function(x) for (i in 1) junk()
> withargs
function (x)
for (i in 1) junk()
> as.function(as.list(withargs))
function (x)
for (i in 1) junk()
For a function with no arguments, it doesn't:
> noargs <- function() for (i in 1) junk()
> noargs
function ()
for (...