local.return: Macro-like functions

Description Usage Arguments Author(s) See Also Examples

Description

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

Usage

1
2
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

mlocal

Examples

1
2
3
4
5
6
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


Search within the mvbutils package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.