From @purdle@@ @ending from gm@il@com  Mon Oct 15 02:19:38 2018
From: @purdle@@ @ending from gm@il@com (Abs Spurdle)
Date: Mon, 15 Oct 2018 13:19:38 +1300
Subject: [Rd] sys.call() inside replacement functions incorrectly returns
 *tmp*
Message-ID: <CAB8pepwA52R9ZKOe7_83BMWzwsQcZ8eKG+wg3ihBL5+Qs5YPOQ@mail.gmail.com>

Kia Ora

Let's say we have:
"myreplacementfunction<-" = function (..., value)
{	call = sys.call ()
	print (as.list (call) )
	0
}

Then we call:
x = 0
myreplacementfunction (x, y, z) = 0

It will return:
[[1]]
`myreplacementfunction<-`

[[2]]
`*tmp*`

[[3]]
y

[[4]]
z

$value
<promise: 0x06fb6968>

There's two problems here.
Firstly, x has to be defined otherwise we get an error message.
Secondly, the first argument is returned as *tmp*.

Both are incorrect.

It should be possible to call the function without defining x.
And it should return x rather than *tmp*.
In other words, replacement function calls should be the same as other
function calls.

Although it gets y and z right.


kind regards
Abs



[Rd] sys.call() inside replacement functions incorrectly returns *tmp*
Abs Spurdle