Function: org-babel-lua-var-to-lua

org-babel-lua-var-to-lua is a byte-compiled function defined in ob-lua.el.gz.

Signature

(org-babel-lua-var-to-lua VAR)

Documentation

Convert an Emacs Lisp value to a Lua variable.

Convert an Emacs Lisp value, VAR, into a string of Lua source code specifying a variable of the same value.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-lua.el.gz
(defun org-babel-lua-var-to-lua (var)
  "Convert an Emacs Lisp value to a Lua variable.
Convert an Emacs Lisp value, VAR, into a string of Lua source code
specifying a variable of the same value."
  (if (listp var)
      (if (and (= 1 (length var)) (not (listp (car var))))
          (org-babel-lua-var-to-lua (car var))
        (if (and
             (= 2 (length var))
             (not (listp (car var))))
            (concat
             (substring-no-properties (car var))
             "="
             (org-babel-lua-var-to-lua (cdr var)))
          (concat "{" (mapconcat #'org-babel-lua-var-to-lua var ", ") "}")))
    (if (eq var 'hline)
        org-babel-lua-hline-to
      (format
       (if (and (stringp var) (string-match "[\n\r]" var)) "[=[%s]=]" "%S")
       (if (stringp var) (substring-no-properties var) var)))))