[?] Adding my own function to clojure.core namespace

2018-02-24 Thread Philos Kim
Is there any way to add my own function to clojure.core namespace? Because I want to use that function globally without 'require' or 'use'. Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: [?] Adding my own function to clojure.core namespace

2018-02-24 Thread Mikhail Gusarov
Hello Philos, It's no different to adding a function to any other namespace: % clj Clojure 1.9.0 user=> (ns clojure.core) nil clojure.core=> (defn foobar [x] (str "foobar " x)) #'clojure.core/foobar clojure.core=> (ns user) nil user=> (foobar "12") "foobar 12" user=> foobar #object[clojure.core$f

Re: [?] Adding my own function to clojure.core namespace

2018-02-24 Thread Andy Fingerhut
I would echo the question "is it truly a good idea?" You can do it, but typing a single :require clause in an ns form once, and then copying and pasting to other places that you use functions defined in that namespace, is likely to be less time-consuming in the long run. Andy On Sat, Feb 24, 201

Re: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Philos Kim
Thanks both of you! I know it is not desirable but it is sometimes needed, especially in my case. For example , I wrote debux ( https://github.com/philoskim/debux )  library. I want to use it only in development, not in production. If I 'require' debux in source code to use it in development, I

Re: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Mikhail Gusarov
Hello Philos, > For example , I wrote debux ( https://github.com/philoskim/debux )  > library. I want to use it only in development, not in production. If I > 'require' debux in source code to use it in development, I have to > remove it in the source code manually in production. Do you intend

Re: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread James Reeves
On 25 February 2018 at 12:01, Philos Kim wrote: > I know it is not desirable but it is sometimes needed, especially in my > case. > > For example , I wrote debux ( https://github.com/philoskim/debux )  > library. I want to use it only in development, not in production. If I > 'require' debux in s

Re: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Philos Kim
I have another question. Debux library supports ClojureScript as well. Similarly, I want to add my own function or macro to cljs.core as in Clojure. Can I use the same strategy in ClojureScript as in Clojure if I use it in the ClojureScript source code, not in REPL? -- You received this messa

Re: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Gary Fredericks
For clojure (not cljs, yet) I proxy all the dev utilities I might want to use in a namespace called `.` so I can refer to it everywhere no matter what the local namespace setup is: https://github.com/gfredericks/dot-slash-2 On Sunday, February 25, 2018 at 11:45:41 AM UTC-6, Philos Kim wrote: >

Re: [?] Adding my own function to clojure.core namespace

2018-02-27 Thread Colin Fleming
On 25 February 2018 at 23:42, Gary Fredericks wrote: > For clojure (not cljs, yet) I proxy all the dev utilities I might want to > use in a namespace called `.` so I can refer to it everywhere no matter > what the local namespace setup is: https://github.com/ > gfredericks/dot-slash-2 > Note tha

Re: [?] Adding my own function to clojure.core namespace

2018-02-27 Thread Kurt Harriger
You might also have a look at a library called vinyasa > https://github.com/ardumont/vinyasa > You can can add it to your lein profile to copy functions into clojure.core and prefix them. The prefix makes it very clear that these are not part of standard clojure.core. (inject 'clojure.cor