Lepetere / clarango

A Clojure Driver for ArangoDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rename collection/load to cload or claload (including unload)

edlich opened this issue · comments

There should not be a message like:
WARNING: load already refers to: #'clojure/load in namespace: clarango.collection
Line:
https://github.com/edlich/clarango/blob/master/src/clarango/collection.clj#L93

Let's call it cload or claload.
What do you think?
Will you change or shall I pull request?

I don't think this is a real problem right now. Let's wait until somebody complains about it because he really uses this method in a project and it's a problem.

In a lot of other Clojure drivers that I checked out there are lots of methods which also have the same name as Clojure core methods.

Also I wouldn't call it cload or claload because all the other API methods have "decent" names, without a Clarango prefix. But if you can think of another "decent" name instead of load, then let me know. I couldn't think of one so far.

I think this is causing my REPL in Cursive (IntelliJ IDEA 12) to break (removing the :require [clarango.collection :as coll] solves the problem).

WARNING: load already refers to: #'clojure.core/load in namespace: clarango.collection, being replaced by: #'clarango.collection/load
Exception in thread "main" java.lang.NullPointerException, compiling:(home.clj:1:1)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3558)
    at clojure.lang.Compiler.compile1(Compiler.java:7226)
    at clojure.lang.Compiler.compile1(Compiler.java:7216)
    at clojure.lang.Compiler.compile(Compiler.java:7292)
    at clojure.lang.RT.compile(RT.java:398)
    at clojure.lang.RT.load(RT.java:438)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5066.invoke(core.clj:5641)
    at clojure.core$load.doInvoke(core.clj:5640)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5446)
    at clojure.core$compile$fn__5071.invoke(core.clj:5652)
    at clojure.core$compile.invoke(core.clj:5651)
    at user$eval11.invoke(form-init7259459689588058835.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6703)
    at clojure.lang.Compiler.eval(Compiler.java:6692)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.Compiler.loadFile(Compiler.java:7086)
    at clojure.main$load_script.invoke(main.clj:274)
    at clojure.main$init_opt.invoke(main.clj:279)
    at clojure.main$initialize.invoke(main.clj:307)
    at clojure.main$null_opt.invoke(main.clj:342)
    at clojure.main$main.doInvoke(main.clj:420)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NullPointerException
    at clojure.lang.Compiler$ObjExpr.emitVar(Compiler.java:4944)
    at clojure.lang.Compiler$DefExpr.emit(Compiler.java:437)
    at clojure.lang.Compiler.compile1(Compiler.java:7225)
    at clojure.lang.Compiler.compile(Compiler.java:7292)
    at clojure.lang.RT.compile(RT.java:398)
    at clojure.lang.RT.load(RT.java:438)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5066.invoke(core.clj:5641)
    at clojure.core$load.doInvoke(core.clj:5640)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5446)
    at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
    at clojure.core$load_lib.doInvoke(core.clj:5485)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$load_libs.doInvoke(core.clj:5524)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$require.doInvoke(core.clj:5607)
    at clojure.lang.RestFn.invoke(RestFn.java:551)
    at soundcloj.routes.home$loading__4958__auto__.invoke(home.clj:1)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3553)
    ... 32 more

Can you import other methods from this namespace without the error?
(:use [clarango.collection :only [... methods you want to use...]])

I see, thanks. Right now I don't even need the entire namespace. I was just having that error while trying the samples in a test application, but still I think it would be nice to avoid a conflict with clojure.core functions.

Mh I see. Yes you are right, I guess we should find another name for this function in the next version of Clarango. But so far I couldn't think of a better one than 'load'. Any ideas?

Mh I see. Yes you are right, I guess we should find another name for this
function in the next version of Clarango. But so far I couldn't think of a
better one than 'load'. Any ideas?

get.

So heissen die anderen ja auch.
Gruß
Stefan

Viele Grüße / with best compliments
Prof. Dr. Stefan Edlich

Beuth Hochschule für Technik, FB VI
Email: edlich@gmail.com (GChat / Hangout)
Skype: sedlich
Tel.: 01577-189.42.16
http://edlich.de

Will be resolved in the next Clarango version 0.5. load will be renamed to load-mem. unload will be renamed to unload-mem.