Fork me on GitHub
#clojure-dev
<
2018-11-10
>
gfredericks20:11:28

some old function names and documentation in clojure.core use the word "lib" where you might otherwise expect "ns" -- is that just a historical usage that could be updated, or does it actually mean anything different?

andy.fingerhut20:11:14

Like the doc string for require, I guess? I don't know the answer to your question, though.

gfredericks20:11:44

yeah; and e.g. loaded-libs

Alex Miller (Clojure team)22:11:39

It’s largely historical - some of the docs on the site are same

gfredericks22:11:07

....but it's somewhat a different concept?

gfredericks22:11:37

I think some of the docs seemed to discuss the idea of namespaces having associated resources on the classpath

Alex Miller (Clojure team)22:11:50

I think in general where that older stuff says lib we would now say namespace

Alex Miller (Clojure team)22:11:10

Namespaces are loaded from resources on the classpath

Alex Miller (Clojure team)22:11:21

So that still seems correct?

gfredericks22:11:03

right but other files as well; maybe there's a function or two that could be used to do something like io/resource but where the path is relative to a namespace

Alex Miller (Clojure team)22:11:11

not sure I get what you’re after

gfredericks22:11:35

just the idea that maybe "lib" was originally imagined to be "a source file plus maybe some other associated files"

gfredericks22:11:25

> A 'lib' is a named set of resources in classpath whose contents define a library of Clojure code. that's probably where I got the idea from

Alex Miller (Clojure team)22:11:48

well that case seems to be more what we would now call a library

gfredericks22:11:19

but this is in the docstring for require, which, according to the prior paragraph, "loads libs"

gfredericks22:11:01

> All resources in a lib should be contained in the directory structure under its root directory.

gfredericks22:11:33

but it sounds like this is mostly just in rich's head anymore, which is a good enough answer for me

gfredericks23:11:40

Am I crazy or does clojure create a new classloader for every top-level form it compiles?

andy.fingerhut23:11:56

Those are two separate questions, right? 🙂

gfredericks00:11:28

I used "or", so you can answer either question

gfredericks23:11:15

it looks like the code was designed to only do that for eval calls but got changed to just do it everywhere

schmee23:11:30

where do you see this?