[R] how does stop() interfere with on.exit()?

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Mon Mar 30 15:32:13 CEST 2009


consider the following example:

    (f = function() on.exit(f()))()
    # error: evaluation nested too deeply

    (f = function() { on.exit(f()); stop() })()
    # error in f():
    # error in f():
    # ... some 100 lines skipped ...
    # error: C stack usage is too close to the limit

why does not the second behave as the first, i.e., report, in one line,
too deep recursion?  the second seems to break the interface by
reporting a condition internal to the implementation, which should not
be visible to the user.

vQ




More information about the R-help mailing list