Fork me on GitHub
#beginners
<
2016-10-18
>
eggsyntax02:10:11

@neurogoo CIDER does do that, in that when you create a new clj/s file from CIDER it’ll have the namespace declaration at the top. But honestly, ns declaration is so low-ceremony that I wouldn’t really care at all if that CIDER feature disappeared. I’d start by just putting your files in src/myprojectname, and then your ns declaration is just (ns myprojectname.filename-without-suffix) eg file src/foo/bar.clj would have (ns foo.bar)

eggsyntax02:10:33

There’s not an enforced 1-to-1 relationship between files and namespaces, but 99+% of the time you’ll find that it’s one-file/one-namespace.

madstap02:10:26

Unless that feature is in the newest cider, I'm pretty sure that's actually clj-refactor

eggsyntax03:10:18

@madstap that may be. I’ve always had both together, so I’ve never noticed what’s part of which.

madstap03:10:43

Yeah, I noticed it the other day when clj-refactor refused to work on my machine

neurogoo05:10:36

Thanks, I will try that clj-refactor

dominicm09:10:17

@eggsyntax Are you sure about the 1:1 relationship not being valid? I thought that when you did a require, clojure looked for the file corresponding to the namespace on the classpath?

alexmiller12:10:12

It does but you can load other files in the context of that namespace

alexmiller12:10:01

clojure.core is split up over a bunch of files

alexmiller12:10:20

You can also create multiple namespaces within one file

alexmiller12:10:07

But both of those are uncommon

keatondunsford16:10:04

@chokheli Hey dude. 🙂 I’m college-age too. I think a channel just got started up for Python in here. Apparently Clojure can interop with Python via Jython (Python for the JVM). I’d be super down to work with you to try and create wrappers for TensorFlow and all the other great machine learning / data-analysis Python libraries. I’ll definitely be needing to use those soon for a cool project of mine. 🙂

josh_tackett19:10:00

does (keys . . . ) preserver order?

donaldball19:10:15

It does not present the keys in insertion order

donaldball19:10:37

It does present the keys in a reliable order, for a given map

dominicm19:10:01

@alexmiller https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj I don't see where it's split up? Or are you referring to namespaces like clojure.core.data? Basically — can you give me an example, because I don't understand and it sounds useful 😛

dominicm19:10:41

Sorry, I found it.

alexmiller19:10:44

Just grep for load in there - you will see that a bunch of additional files are loaded

dominicm19:10:24

I hadn't considered this as a option for this, interesting!