On Wed, 30 Apr 2025 11:15:02 +0200
Ralf Goertz via R-help <r-help@r-project.org> wrote:

> If this is not an error what is its purpose?

>From the point of view of the R syntax, everything is an expression.

One of the uses of return() being an expression is base::callCC(). The
ability to use it inside an expression makes it possible to put it into
a delayed-evaluation object and offer it as a continuation point to
another function.

Admittedly obscure, but sometimes useful.

-- 
Best regards,
Ivan

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to