emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ob-clojure should not tangle with inserting (ns ..) line when no


From: Tim Cross
Subject: Re: [O] ob-clojure should not tangle with inserting (ns ..) line when no :ns specified.
Date: Sat, 01 Dec 2018 08:25:22 +1100
User-agent: mu4e 0.9.18; emacs 26.1

stardiviner <address@hidden> writes:

> The ob-clojure tangle will insert ~(ns ..)~ from babel header argument :ns or 
> use defualt ~(ns user)~.
>
>    #+begin_src clojure :eval no :ns "" :tangle 
> "data/code/xunfei-clj-demo/project.clj" :results link :file 
> "data/code/xunfei-clj-demo/project.clj"
>    (defproject xunfei-clj-demo "0.1.0-SNAPSHOT"
>      :description "xunfei-clj demo"
>      :url "http://example.com/FIXME";
>      :license {:name "Eclipse Public License"
>                :url  "http://www.eclipse.org/legal/epl-v10.html"}
>      :dependencies [[org.clojure/clojure "1.9.0"]
>                     [xunfei-clj "0.1.4-SNAPSHOT"]]
>      :resource-paths ["lib/Msc.jar"])
>    #+end_src
>
> In upper case, obviously I don't want insert the ~(ns ..)~ line of code.
>
> I hope the ob-clojure header argument ~:ns~ should detect value like
> "nil", "" (empty string) or something else. Or when ~:ns~ header
> argument is not specified. So that the tangling will not auto insert
> ~(ns ..)~ line.

I think the problem here is that really, project.clj is not a valid
clojure source file. It is really a clojure data file or clojure
snippet (I mean in the sense that you cannot execute it or include it as
a dependency within a clojure program - it is input data for the lein
build tool). If lein was being developed from scratch today, rather than
project.clj, you would probably have project.edn.

The question is, should we allow setting ns to nil/"", preventing
inclusion of a ns line, which would make 'real' clojure source files
invalid just to support this edge case or should we consider an
alternative solution e.g.

- have a 'lein-project' source type which could perhaps provide
  additional support for editing project.clj files (as I suspect lein is
  on the way out - replaced with things like clj or boot)
- try using edn-mode and having support for edn as a valid language
  type. I've never used edn mode and I'm not 100% certain project.clj
  and edn are completely compatible.

It seems to me that the preferred build tool is likely to become clj or
derivatives of clj. I've noticed increasingly longer delays in new lein
releases (the 'reflection' warning has been there for nearly 12 months
now, as has the incorrect classpath warning on some platforms).

In the long-term, I think org would probably benefit from integration
with clj rather than cider for ob-clojure as it is likely to be more
stable and less complex. Using cider has always felt like pushing a
square peg into a round hole to me. 

Tim

--
Tim Cross



reply via email to

[Prev in Thread] Current Thread [Next in Thread]