Function: org-babel-groovy-evaluate

org-babel-groovy-evaluate is a byte-compiled function defined in ob-groovy.el.gz.

Signature

(org-babel-groovy-evaluate SESSION BODY &optional RESULT-TYPE RESULT-PARAMS)

Documentation

Evaluate BODY in external Groovy process.

SESSION must be nil as sessions are not yet supported. If RESULT-TYPE equals output then return standard output as a string. If RESULT-TYPE equals value then return the value of the last statement in BODY as elisp.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-groovy.el.gz
(defun org-babel-groovy-evaluate
    (session body &optional result-type result-params)
  "Evaluate BODY in external Groovy process.
SESSION must be nil as sessions are not yet supported.
If RESULT-TYPE equals `output' then return standard output as a string.
If RESULT-TYPE equals `value' then return the value of the last statement
in BODY as elisp."
  (when session (error "Sessions are not (yet) supported for Groovy"))
  (pcase result-type
    (`output
     (let ((src-file (org-babel-temp-file "groovy_")))
       (progn (with-temp-file src-file (insert body))
              (org-babel-eval
               (concat org-babel-groovy-command " " src-file) ""))))
    (`value
     (let* ((src-file (org-babel-temp-file "groovy_"))
            (wrapper (format org-babel-groovy-wrapper-method body)))
       (with-temp-file src-file (insert wrapper))
       (let ((raw (org-babel-eval
                   (concat org-babel-groovy-command " " src-file) "")))
         (org-babel-result-cond result-params
	   raw
           (org-babel-script-escape raw)))))))