From @nto|ne@|@br| @end|ng |rom gm@||@com  Wed Sep  2 20:29:53 2020
From: @nto|ne@|@br| @end|ng |rom gm@||@com (Antoine Fabri)
Date: Wed, 2 Sep 2020 20:29:53 +0200
Subject: [Rd] sys.call() 's srcref doesn't match the language
Message-ID: <CAEKh8uj_2n00yYaaqqV6wH9th5eNebDzDFXe-yrVE9Hgqt8b2A@mail.gmail.com>

Dear R-devel,

I found this behavior disturbing, if `1 + f()` is called, `sys.call()`
called inside of `f` will return a quoted `f()` with a "srcref" that prints
"1 + f()".

I don't know which one is good but I don't think they can be correct at the
same time.

Here's a reproducible example:

f <- function(){
  sc <- sys.call()
  print(sc)
  attr(sc, "srcref") <- NULL
  print(sc)
  1
}
f2 <- function() {
  1 + f()
}
f()
#> f()
#> f()
#> [1] 1
f2()
#> 1 + f()
#> f()
#> [1] 2

Best,

Antoine

	[[alternative HTML version deleted]]



[Rd] sys.call() 's srcref doesn't match the language
Antoine Fabri