;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require ob cl-lib] 2) #@34 julia-specific header arguments. (defconst org-babel-header-args:julia '((width . :any) (horizontal . :any) (results (file list vector table scalar verbatim) (raw org html latex code pp wrap) (replace silent append prepend) (output value graphics))) (#$ . 150)) (add-to-list 'org-babel-tangle-lang-exts '("julia" . "jl")) (defvar org-babel-default-header-args:julia nil) #@50 Name of command to use for executing julia code. (custom-declare-variable 'org-babel-julia-command 'inferior-julia-program-name '(#$ . 527) :group 'org-babel :version "24.4" :package-version '(Org . "8.0") :type 'string) (defalias 'org-babel-edit-prep:julia #[(info) "\303\3048\236A\211\205\305\306 \"\205\307 \310\216\311 \312\"*)\207" [info session save-match-data-internal :session 2 string-match "^\\*\\(.+?\\)\\*$" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] org-babel-julia-initiate-session nil] 4]) #@60 Expand BODY according to PARAMS, return the expanded body. (defalias 'org-babel-expand-body:julia #[(body params &optional graphics-file) "\206\304 !\305\306\307\310 !\nC\"\203 \202 )\311#)\207" [graphics-file params body inside org-babel-julia-graphical-output-file mapconcat identity append org-babel-variable-assignments:julia "\n"] 5 (#$ . 1092)]) #@90 Execute a block of julia code. This function is called by `org-babel-execute-src-block'. (defalias 'org-babel-execute:julia #[(body params) "\212\306\236A\307\236A\310\311\236A\"\312\236A\313\236A\314!\315#\316 \n \f\317\232\206>\320\321\236A\f\" \317\232\206K\320\322\236A \"&?\205W. \207" [params result-params result-type session colnames-p rownames-p :result-params :result-type org-babel-julia-initiate-session :session :colnames :rownames org-babel-julia-graphical-output-file org-babel-expand-body:julia org-babel-julia-evaluate "yes" org-babel-pick-name :colname-names :rowname-names graphics-file body full-body result] 9 (#$ . 1460)]) #@72 Prepare SESSION according to the header arguments specified in PARAMS. (defalias 'org-babel-prep-session:julia #[(session params) "\305 \"\306 !\307!\204\310\311\"\210\312 \313\216rq\210\212\314\315\316\n\"\210-*\207" [session params var-lines save-match-data-internal comint-input-filter org-babel-julia-initiate-session org-babel-variable-assignments:julia org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] #[(_input) "\300\207" [nil] 1] mapc #[(var) "\302\210c\210\303\304\305\"\210\306 !\207" [var session 1 comint-send-input nil t org-babel-comint-wait-for-output] 3]] 3 (#$ . 2146)]) #@25 Load BODY into SESSION. (defalias 'org-babel-load-session:julia #[(session body params) "\305 \306\216\307 \n\"r q\210\310\311p!!b\210\312\f!c\210) +\207" [#1=#:wconfig session params buffer body current-window-configuration #[nil "\301!\207" [#1# set-window-configuration] 2] org-babel-prep-session:julia process-mark get-buffer-process org-babel-chomp] 3 (#$ . 2876)]) #@66 Return list of julia statements assigning the block's variables. (defalias 'org-babel-variable-assignments:julia #[(params) "\302!\303\304\303\305\306\307 GS\"\"\")\207" [params vars org-babel--get-vars mapcar #[(pair) "\302@A\303 \236A\304\232\305 \236A\304\232$\207" [pair params org-babel-julia-assign-elisp :colnames "yes" :rownames] 6] #[(i) " 8@\303 8A\304\n\236A8A\305\n\236A8A#B\207" [i vars params org-babel-reassemble-table :colname-names :rowname-names] 7] org-number-sequence 0] 7 (#$ . 3256)]) #@36 Quote field S for export to julia. (defalias 'org-babel-julia-quote-csv-field #[(s) ";\203\301\302\303\304\301\"\305#\301Q\207\306\307\"\207" [s "\"" mapconcat identity split-string "\"\"" format "%S"] 6 (#$ . 3777)]) #@74 Construct julia code assigning the elisp VALUE to a variable named NAME. (defalias 'org-babel-julia-assign-elisp #[(name value colnames-p rownames-p) "<\203\213\306\303\307\310\311\312\"\"\"\306\302\307\310\311\312\"\"\"\313\314!@<\204(C \315\316\317\"\320\216r\fq\210\321\322\"\323\261\210)r\fq\210\324\325\211 \325\326%\210,\327 \330\"A@\331=\204\\\"\203`\332\202a\333#\203j\334\202k\335$%& \nU\203\201\336\337'&#\202\210\336\337'&#.\207\336\340'\341!#\207" [value transition-file min max #1=#:temp-buffer #2=#:temp-file apply mapcar length cl-remove-if-not sequencep org-babel-temp-file "julia-import-" generate-new-buffer " *temp file*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] orgtbl-to-csv (:fmt org-babel-julia-quote-csv-field) "\n" write-region nil 0 org-babel-process-file-name noquote hline "TRUE" "FALSE" "1" "NULL" format "%s = readcsv(\"%s\")" "%s = %s" org-babel-julia-quote-csv-field colnames-p rownames-p row-names header file name] 8 (#$ . 4006)]) #@58 If there is not a current julia process then create one. (defalias 'org-babel-julia-initiate-session #[(session params) "\304\230?\205P\206\f\305\306\301!\205 \205\307\n\236A?\310!\203'\202O\311 \312\216\313\314!\210\315 \210\316\317!\203@\320!\202K;\203I\202K\320 !\210p**\207" [session ess-ask-for-ess-directory params #1=#:wconfig "none" "*julia*" boundp :dir org-babel-comint-buffer-livep current-window-configuration #[nil "\301!\207" [#1# set-window-configuration] 2] require ess julia rename-buffer bufferp buffer-name] 3 (#$ . 5037)]) #@133 Associate julia code buffer with a julia session. Make SESSION be the inferior ESS process associated with the current code buffer. (defalias 'org-babel-julia-associate-session #[(session) "\302\303!!\304 \207" [session ess-local-process-name process-name get-buffer-process ess-make-buffer-current] 3 (#$ . 5611)]) #@59 Name of file to which julia should send graphical output. (defalias 'org-babel-julia-graphical-output-file #[(params) "\301\302\236A\235\205 \303\236A\207" [params "graphics" :result-params :file] 3 (#$ . 5935)]) (defvar org-babel-julia-eoe-indicator "print(\"org_babel_julia_eoe\")") (defvar org-babel-julia-eoe-output "org_babel_julia_eoe") (defvar org-babel-julia-write-object-command "writecsv(\"%s\",%s)") #@30 Evaluate julia code in BODY. (defalias 'org-babel-julia-evaluate #[(session body result-type result-params column-names-p row-names-p) "\203\306 \n \f &\207\307 \n \f %\207" [session body result-type result-params column-names-p row-names-p org-babel-julia-evaluate-session org-babel-julia-evaluate-external-process] 7 (#$ . 6355)]) #@206 Evaluate BODY in external julia process. 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. (defalias 'org-babel-julia-evaluate-external-process #[(body result-type result-params column-names-p row-names-p) "\306\267\202\230\307\310!\311\n\312 \313 \314\"\312\315\f\"#\"\210\316 $\317$\235?\205\215\320$\235\204r\321$\235\204r\322$\235\204r\323$\235\204r\324$\235\204r\325$\235\204r\326$\235\204k\327$\235\204k\330$\235\204k\331$\235\203\211\332$\235\204\211\333\334\335\"%r%q\210\336\216\337 !\210\340 +\202\215\341 \342\")&\")\207\311\n\f\"\207\343\207" [result-type tmp-file org-babel-julia-command org-babel-julia-write-object-command body result-params #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (value 6 output 147)) org-babel-temp-file "julia-" org-babel-eval format org-babel-process-file-name noquote "begin\n%s\nend" org-babel-julia-process-value-result "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1=#:temp-buffer buffer-name kill-buffer] 2] insert-file-contents buffer-string org-babel-import-elisp-from-file (4) nil #2=#:--params #1# column-names-p] 8 (#$ . 6700)]) #@191 Evaluate BODY in SESSION. 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. (defalias 'org-babel-julia-evaluate-session #[(session body result-type result-params column-names-p row-names-p) "\306\267\202G\307\310\311\"r q\210\312\216\313\n!c\210\314\315 !!\316\317\316!\210-\320\321!>\322 >\323?\324>\325\"\326##\210\327@A\330A\235?\205\257\331A\235\204\222\332A\235\204\222\333A\235\204\222\334A\235\204\222\335A\235\204\222\336A\235\204\222\337A\235\204\213\340A\235\204\213\341A\235\204\213\342A\235\203\252\343A\235\204\252\307\310\311\"BrBq\210\344\216\345>!\210\346 +\202\257\347>\350\")C\")\207\351\313\352\353\316\354\355\354\356\357 !\204\311\360\361 \"\210\362 D\363\216r q\210\212\364E\365F\366GBG\316H\367\315p!!b\210`dI\211JI{HJI|\210*\351\313\nKD\370#c\210\371 \210Lb\210\212\372\373M!\316\311#\205 \372N\316\311#)\204-\374\315p!!\210\202\n\367\315p!!b\210Hc\210\375FN\".\"\"\"!\370#\207\316\207" [result-type #1=#:temp-buffer body session ess-eval-visibly-p ess-local-process-name #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (value 6 output 181)) generate-new-buffer " *temp*" t #[nil "\301!\205 \302!\207" [#1# buffer-name kill-buffer] 2] org-babel-chomp process-name get-buffer-process nil ess-eval-buffer org-babel-temp-file "julia-" org-babel-comint-eval-invisibly-and-wait-for-file format org-babel-process-file-name noquote "ans" org-babel-julia-process-value-result "none" "scalar" "verbatim" "html" "code" "pp" "file" "output" "raw" "org" "drawer" "table" #[nil "\301!\205 \302!\207" [#2=#:temp-buffer buffer-name kill-buffer] 2] insert-file-contents buffer-string org-babel-import-elisp-from-file (4) mapconcat butlast delq mapcar #[(line) "G\301V\205\207" [line 0] 2] #[(line) "\301\302\"\203 \303\225\304O\207\207" [line string-match "^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" 1 nil] 3] org-babel-comint-buffer-livep error "Buffer %s does not exist or has no process" match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] #[(_input) "\300\207" [nil] 1] "" #[(text) " P\211\207" [string-buffer text] 2] process-mark "\n" inferior-ess-send-input re-search-forward regexp-quote accept-process-output split-string tmp-file org-babel-julia-write-object-command result-params #3=#:--params #2# column-names-p save-match-data-internal comint-input-filter string-buffer comint-output-filter-functions dangling-text end start org-babel-julia-eoe-indicator comint-last-input-end org-babel-julia-eoe-output comint-prompt-regexp] 14 (#$ . 8084)]) #@104 julia-specific processing of return value. Insert hline if column names in output have been requested. (defalias 'org-babel-julia-process-value-result #[(result column-names-p) "\203\f @\302 ABB\207 \207" [column-names-p result hline] 3 (#$ . 10826)]) (provide 'ob-julia)