Browse Source

Babel: add results value support to Scala

* lisp/ob-scala.el (org-babel-scala-wrapper-method): Use a Scala
block enclosing the submitted code.

The string representing an well formed block was not an Scala code. I
put the string from the user into an block, surrounded by an call to
replace the default output stream.

TINYCHANGE
Caio Tiago Oliveira 12 năm trước cách đây
mục cha
commit
de7766f4b0
1 tập tin đã thay đổi với 10 bổ sung2 xóa
  1. 10 2
      lisp/ob-scala.el

+ 10 - 2
lisp/ob-scala.el

@@ -72,9 +72,17 @@ Emacs-lisp table, otherwise return the results as a string."
 
 
 
 
 (defvar org-babel-scala-wrapper-method
 (defvar org-babel-scala-wrapper-method
-  "(
+
+"var str_result :String = null;
+
+Console.withOut(new java.io.OutputStream() {def write(b: Int){
+}}) {
+  str_result = {
 %s
 %s
-) asString print
+  }.toString
+}
+
+print(str_result)
 ")
 ")