Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

local.return

Macro-like functions


Description

In an mlocal function, local.return should be used whenever return is called, wrapped inside the return call around the return arguments.

Usage

local.return(...) # Don't use it like this!
# Correct usage: return( local.return( ...))

Arguments

...

named and unnamed list, handled the same way as return before R 1.8, or as returnList

Author(s)

Mark Bravington

See Also

Examples

ffin <- function( nlocal=sys.parent()) mlocal( return( local.return( a)))
ffout <- function( a) ffin()
ffout( 3) # 3
# whereas:
ffin <- function( nlocal=sys.parent()) mlocal( return( a))
ffout( 3) # NULL; "return" alone doesn't work

mvbutils

Workspace Organization, Code and Documentation Editing, Package Prep and Editing, Etc

v2.8.232
GPL (>= 2)
Authors
Mark V. Bravington <mark.bravington@csiro.au>
Initial release
2018-12-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.