emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Issue with org-babel-clojure evaluation returning all forms
@ 2017-09-21  2:04 Matthew Stegall
  2017-09-22 23:01 ` Tim Cross
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Stegall @ 2017-09-21  2:04 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

I'm trying to set up babel for use with Clojure according to
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html#org85bc1ec
and
I can evaluate code but when I evaluate a block with multiple forms in it
it outputs all of the form like so

#+begin_src clojure :results value
  (def small-map {:a 2 :b 4 :c 8})
  (:b small-map)
#+end_src

#+RESULTS:
: #'user/small-map4

I'm using cider for the back end as given in the tutorial and I'm not
getting any errors just unwanted input.

I don't think anything in my emacs config should effect this but I can post
if needed.

I'm also using org-plus-contrib as I the default org installation doesn't
allow me to evaluate clojure blocks, saying it can't find slime.

I've used the debugging tools to go through cb-clojure.el and found that
the nrepl-sync-request:eval result dictionary list the output of all of the
form in value without any separator so it may be something with cider, I'm
running the latest version from melpa-stable.

If any other information is needed, let me know and thanks in advance for
any help.

[-- Attachment #2: Type: text/html, Size: 3993 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Issue with org-babel-clojure evaluation returning all forms
  2017-09-21  2:04 Issue with org-babel-clojure evaluation returning all forms Matthew Stegall
@ 2017-09-22 23:01 ` Tim Cross
  0 siblings, 0 replies; 2+ messages in thread
From: Tim Cross @ 2017-09-22 23:01 UTC (permalink / raw)
  To: Matthew Stegall; +Cc: emacs-orgmode


It is quite likely an issue due to changes in cider. Cider from melpa
gets a lot of updates and is a fast moving target.

IMO cider is not the best back end to use with org. You are probably
better off using inf-clojure. The cider back end has a lot of complexity
to support repl driven development which really complicates matters when
your just wanting to get clojure blocks evaluated and results back. The
inf-clojure back end is much simpler and undergoes less change, so is
more stable.

Personally, I'm not using this functionality in org. I found the
complexities of trying to get clojure blocks to work in this way was way
too high once you tried to do anything more than very simple statement
evaluation. I now use a more traditional literate programming approach
where I maintain the code in org files, but tangle the whole file to get
a clj/cljs file, which is what is loaded into the repl. 

regards,

Tim

Matthew Stegall writes:

> I'm trying to set up babel for use with Clojure according to
> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html#org85bc1ec
> and
> I can evaluate code but when I evaluate a block with multiple forms in it
> it outputs all of the form like so
>
> #+begin_src clojure :results value
>   (def small-map {:a 2 :b 4 :c 8})
>   (:b small-map)
> #+end_src
>
> #+RESULTS:
> : #'user/small-map4
>
> I'm using cider for the back end as given in the tutorial and I'm not
> getting any errors just unwanted input.
>
> I don't think anything in my emacs config should effect this but I can post
> if needed.
>
> I'm also using org-plus-contrib as I the default org installation doesn't
> allow me to evaluate clojure blocks, saying it can't find slime.
>
> I've used the debugging tools to go through cb-clojure.el and found that
> the nrepl-sync-request:eval result dictionary list the output of all of the
> form in value without any separator so it may be something with cider, I'm
> running the latest version from melpa-stable.
>
> If any other information is needed, let me know and thanks in advance for
> any help.


-- 
Tim Cross

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-22 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21  2:04 Issue with org-babel-clojure evaluation returning all forms Matthew Stegall
2017-09-22 23:01 ` Tim Cross

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).