specifying name in the error message "promise already under evaluation"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

specifying name in the error message "promise already under evaluation"

Scott Kostyshak-2
Consider the following R code:

    abc <- function(x, y = y) {
      x + y
    }
   
    abc(x = 3)

which gives the following error:

    promise already under evaluation: recursive default argument
    reference or earlier problems?

If you google that error, you will find that it usually refers to the
situation given in the example above, although I'm sure the error is
more general and could be triggered in other situations.

I'm trying to think about how to improve the error for the most common
situation that triggers it. One simple way would be to give the name of
the promise. For example, I think that the following would already be an
improvement:

    promise "y" already under evaluation: recursive default argument
    reference or earlier problems?

Any thoughts?

Scott


--
Scott Kostyshak
Assistant Professor of Economics
University of Florida
https://people.clas.ufl.edu/skostyshak/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel