From skostyshak at ufl.edu  Mon Sep 18 05:09:58 2017
From: skostyshak at ufl.edu (Scott Kostyshak)
Date: Sun, 17 Sep 2017 23:09:58 -0400
Subject: [Rd] specifying name in the error message "promise already under
 evaluation"
Message-ID: <20170918030958.kq35oarjze4vupxm@steph>

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/



[Rd] specifying name in the error message "promise already under evaluation"
Scott Kostyshak