diff --git a/documentation/tutorials/debugging/InteropDebugging/R/main.r b/documentation/tutorials/debugging/InteropDebugging/R/main.r index bff4979782d79865eb19346a5948be20224ec229..383ea6ece226525c9655b32628a0ae1df3e6de50 100644 --- a/documentation/tutorials/debugging/InteropDebugging/R/main.r +++ b/documentation/tutorials/debugging/InteropDebugging/R/main.r @@ -24,17 +24,17 @@ print("Hello, World! (from file)") print("Creating a Java object in FastR") -clazz <- .fastr.java.class("java.util.Date") -obj <- .fastr.interop.new(clazz, .fastr.interop.toLong(as.integer(Sys.time())*1000)) +clazz <- new.java.class("java.util.Date") +obj <- new.external(clazz, as.external.long(as.integer(Sys.time())*1000)) print(obj$toString()) # add classpath entry to be able to use our class -java.addClasspathEntry("build/classes") -clazz <- .fastr.java.class("com.oracle.truffle.r.JavaMessage") -obj <- .fastr.interop.new(clazz, "Hi there") +java.addToClasspath("build/classes") +clazz <- new.java.class("com.oracle.truffle.r.JavaMessage") +obj <- new.external(clazz, "Hi there") print(obj$getMessage()) JS_MIME_TYPE <- "application/javascript" -.fastr.interop.eval(JS_MIME_TYPE, 'var s = "Hello from Javascript"; print(s)') -.fastr.interop.evalFile("JS/main.js", JS_MIME_TYPE) +eval.external(JS_MIME_TYPE, source='var s = "Hello from Javascript"; print(s)') +eval.external(JS_MIME_TYPE, path="JS/main.js") diff --git a/documentation/tutorials/debugging/tutorial.md b/documentation/tutorials/debugging/tutorial.md index 6fb1eaf747af581308f67e0121c723adb071dac2..505e576ebd4d825add495e8840d250da6cd4829f 100644 --- a/documentation/tutorials/debugging/tutorial.md +++ b/documentation/tutorials/debugging/tutorial.md @@ -139,7 +139,7 @@ During stepping through the R program, you will also step into the Java code. Next, lines 31 to 35 in *R/main.r* instantiate an object of a class in our NetBeans Java project. Before we can use our class *JavaMessage*, we need to add this project to the class path for the Java interoperability. -This is done by statement `java.addClasspathEntry("build/classes")`. +This is done by statement `java.addToClasspath("build/classes")`. You can now also set a breakpoint in the `getMessage()` method and the debugger will halt on this breakpoint if the R expression `obj$getMessage()` is evaluated. Lines 38 and 39 further evaluate code of a different language, namely JavaScript.