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/

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to