Function: org-babel-julia-assign-elisp

org-babel-julia-assign-elisp is a byte-compiled function defined in ob-julia.el.gz.

Signature

(org-babel-julia-assign-elisp NAME VALUE)

Documentation

Construct julia code assigning the elisp VALUE to a variable named NAME.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-julia.el.gz
(defun org-babel-julia-assign-elisp (name value)
  "Construct julia code assigning the elisp VALUE to a variable named NAME."
  (if (listp value)
      (let* ((lengths (mapcar #'length (cl-remove-if-not #'sequencep value)))
             (max (if lengths (apply #'max lengths) 0))
             (min (if lengths (apply #'min lengths) 0)))
        ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
        (unless (listp (car value)) (setq value (list value)))
        (let ((file (orgtbl-to-csv
                     value
                     '( :fmt org-babel-julia-quote-csv-field
                        :with-special-rows nil))))
          (if (= max min)
              (format "%s = begin
    using CSV
    CSV.read(\"%s\")
end" name file)
            (format "%s = begin
    using CSV
    CSV.read(\"%s\")
end"
                    name file))))
    (format "%s = %s" name (org-babel-julia-quote-csv-field value))))