Fork me on GitHub

i have a project.clj and made a simple indentation fix to the compiler options and now it's not outputting anything—neither the compiled file nor any errors or warnings. anyone mind taking a look, i'm sure it's some stupid mistake:


(i tried undoing about 30 times and testing each one and none of the undo steps work either now)


oh, it isn't recompiling if out/main.js already exists, even though my compiler flags have changed. that's strange behavior


no, that is normal


all build systems work off file change date


So say I want to take a vector of vectors, turn the first vector into keys, and map each of the remaining vectors to those keys as new vector containing maps?


When I type it out, it feels like the code just wrote itself, lol. The reality is not as close. 😄


I am really struggling due to not having a good understanding of java Files and various types of streams (like ZipInputStream), when they are like files and when they are not. Can anyone recommend a good read on this?


for example, I’m confused by the fact that this doesn’t create a file on disk ( “hey”)


(spit “file.txt” “hey”) works 😄


does that function need 2 args?


(doc spit) to find out simple_smile


well, I’m actually trying not to write to disk but this was me giving up, deciding to write to disk, and failing


@jeremyraines: the docs give a hint that a object is created. Typically in java you can’t just do something, you have to set up a bunch of objects and then call methods on them.


That as an intuition might help the process


The docs for does not say it creates a file, as much as it returns one?


but clojure has some wrappers in the case of spit/slurp


You might have to apply whatever function saves it to disk? If thats what you meant


I am trying to go through the contents of a zip file and do something with each one. I can get the entries, but I can’t coerce them into files


it fails at line 5, because it can’t find a file at that path, but it says it expects a File object, and I don’t know what is different between what it expects and what (io/file “foo”) creates, b/c it looks like a object to me


can you not call (.toString (ZipEntry. “zip-file-part-00”)) ?


and manipulate the string?


maybe? That kind of circles back to my original question of trying to step back and get some overall understanding of this. i.e. how do files, streams, strings relate, when do I have to close them, when do they get written to disk, etc


but the specific help is definitely appreciated as well


@jswart the working parts of that gist are cribbed right from that answer already simple_smile


that should help build some familiarity with file IO


thanks, I’ll definitely read that


I’m working right now but you can ping me personally if you get really stuck and I’ll answer when I can


Thats a great book


Mostly because of Kanye using a Slap Chop. Also I learned some Clojure.


here’s a working version. Still don’t understand 100% but definitely learned a few things:


Om also same story.


"Nobody should start to undertake a large project. You start with a small trivial project, and you should never expect it to get large. If you do, you'll just overdesign and generally think it is more important than it likely is at that stage. Or worse, you might be scared away by the sheer size of the work you envision. So start small, and think about the details. Don't think about some big picture and fancy design. If it doesn't solve some fairly immediate need, it's almost certainly over-designed. And don't expect people to jump in and help you. That's not how these things work. You need to get something half-way useful first, and then others will say "hey, that almost works for me", and they'll get involved in the project.” - Linus Torvalds


Something that I spent an hour banging my head against the wall about: filtering vector a based on applying a function to vector b. in case any of my fellow clojure noobs have similar issues:


Hi everyone!… I have a question related to namespace’s compilation order. In namespace A I have a Record definition and in file B I have a Protocol definition. File B import Record from file A and then extend it (implement the protocol). However, when I try to compile my project I get the following error: java.lang.ClassNotFoundException: scv2backend.component.redis.Redis, compiling:(scv2backend/models/auth.clj:1:1). So, if I am right, file B is being compiled first. Then, I found that if I require file A from file B (while importing the Record too) everything works ok (no compilation error). Why does it happens?, why doesn’t importing a class/record force a different compilation order?


@prokaktus: Unreliable how? In maintenance?


@lucaska: yeah. If core maintainer just burned out or decided to switch his priorities, what will happen with project.


I guess that depends on how interested someone is in taking it on.


I've just come up with several arguments for and against this idea in the time it took me to type the original but I'd like to see what others think of it. If fear of project abandonment is a major barrier to clojure library adoption then maybe braveclojure (as an example, looking at the opensource page right now) could add some notion of maintainer succession (and a corresponding call for successor-maintainers) to its open source directory?


I saw one library (the Taxi selenium webdriver) that seemed to have been gapped in terms of maintainers even though it looked overall like it was a great project. If it turns out that Clj libraries need only a couple major contributors at any given time (which is what those graphs might indicate) then relying on minor contributors to step up might be more risky as the whole team might actually vanish all at once. Maybe explicit succession plans are useful so when life/work/busses take the maintainer away from the project there's someone with at least the nod to go ahead. edit to add: of course downside, might discourage more even distribution of contributions, and of course how invested is the next-up guy/gal if they're not already committing code, etc.