I'd like to run some code through a binary via stdin and paste the output. The language is foma, is there a fast way for that or do I have to write my own definition? I've tried http://sprunge.us/DjOV, but that gives me a if: Wrong type argument: stringp, (:colname-names)
.
If foma could be run an a file (rather than STDIN), then simply evaluating the following function definition should work. This will write body
to a temporary file, call foma
on that file and return the output (collected from STDOUT).
(defun org-babel-execute:foma (body params)
"Execute a block of Foma code with org-babel."
(message "executing Foma source code block")
(org-babel-eval "foma" body))
If foma
insists on taking input through STDIN, then you could replace foma
above with something like foma-helper
where foma-helper
is a shell script holding something like
#!/bin/sh
cat $1|foma
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With