On 7 Oct 2018, at 16:04 , Rui Barradas <ruipbarradas at sapo.pt> wrote:
Hello,
I don't see why you say that the documentation seems to be wrong:
class(args(`+`))
#[1] "function"
args() on a primitive does return a closure. At least in this case it does.
But in this case it doesn't:
[1] "NULL"
Or, for that matter:
Rui Barradas
?s 14:05 de 07/10/2018, Peter Dalgaard escreveu:
There is more "fun" afoot here, but I don't recall what the point may be:
function (e1, e2) .Primitive("+")
The other index operators, "[[", "[<-", "[[<-" are similar
The docs are pretty clear that args() on a primitive should yield a closure, so at least the documentation seems to be wrong.
-pd
On 6 Oct 2018, at 19:26 , Laurent Gautier <lgautier at gmail.com> wrote:
Hi,
A short code example showing the warning might the only thing needed here:
```
NULL
*Warning message:In formals(fun) : argument is not a function*
[1] TRUE
```
Now with an other primitive:
```
[1] "function"
```
Is this a feature ?
Laurent
[[alternative HTML version deleted]]