scalaLazy: Lazily Execute Functions on a Scala Bridge

View source: R/scalaLazy.R

scalaLazyR Documentation

Lazily Execute Functions on a Scala Bridge

Description

Lazily Execute Functions on a Scala Bridge

Usage

scalaLazy(functions, bridge = scalaFindBridge())

Arguments

functions

A single function or list of functions. Each function takes a Scala bridge as its only argument. These functions are called immediately after the next time the bridge is connected. These functions are where setup code should go, like global imports, objects, classes, methods, etc. For example, it might equal function(s) { s + 'import scala.util.Random' }. Note the use of the declaration operator + instead of the operators * or ^.

bridge

A Scala bridge from the scala function.

Value

Returns NULL, invisibly.

See Also

scalaFindBridge

Examples


s <- scala()
scalaLazy(function(s) { s + 'import scala.util.Random' })
s$.new_Random()$nextDouble()
close(s)



rscala documentation built on Aug. 15, 2023, 9:07 a.m.