Martin Maechler
1998-Jan-22 08:35 UTC
R feature request: stop(..) should print its caller call
The following shows what I mean:
tst<-function(x)in.tst(x); in.tst<-function(y)stop(paste("y
is",y)); tst(pi)
in R gives
--------------------
Error: y is 3.141593
--------------------
in S-plus gives
----------------------------------------> > Error in in.tst(x): y is 3.14159265358979
Dumped ^^^^^^^^^^^^
----------------------------------------
For locating bugs / problems in functions, it would be tremendously helpful
if R also printed the name of the function from which it is called
(actually the ``call(..)'' rather than just the function name).
Martin Maechler
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To:
r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Kurt Hornik
1998-Jan-22 10:07 UTC
R feature request: stop(..) should print its caller call
>>>>> Martin Maechler writes:> The following shows what I mean: > tst<-function(x)in.tst(x); in.tst<-function(y)stop(paste("y is",y)); tst(pi)> in R gives> -------------------- > Error: y is 3.141593 > --------------------> in S-plus gives> ---------------------------------------- >> > Error in in.tst(x): y is 3.14159265358979 > Dumped ^^^^^^^^^^^^ > ----------------------------------------> For locating bugs / problems in functions, it would be tremendously > helpful if R also printed the name of the function from which it is > called (actually the ``call(..)'' rather than just the function name).Martin, I am not sure. I find it more useful to call traceback() after an error occurred to find out what really happened. -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._