#clojure logs

2014-03-31

00:10chareamalloy so whats the point of the map in the context of :exists?
00:11amalloywho knows? i don't understand the liberator context
00:12chareamalloy: so you don't use liberator?
00:12chareamalloy you saying that liberator is a substandard clojure web library
00:21myguidingstarhi all, how do I access an object in memory when I only know its id? For instance, (str (repeat 3 "Hello ")) => "clojure.lang.LazySeq@e878644d" So how do I get back that lazy sequence, give its unique id?
00:22tmcivermyguidingstar: you can't. You would have had to capture it in a local or something.
00:23myguidingstartmciver, I'm just curious. I know it's a bit advanced ;> thanks
00:23tmcivermyguidingstar: that print representation just encodes the type along with some ID that probably is some kind of memory location.
00:26tmcivermyguidingstar: you can print clojure objects in such a way that they can be read back in again (see print-dup) but that's not what you're talking about there.
00:28myguidingstaryeah, I know that. I use str just to show the id
00:29myguidingstarI meant how to access that memory location
00:30tmcivermyguidingstar: ah yes, I didn't read your question carefully enough.
00:32amalloymyguidingstar: you can't
00:33myguidingstarthanks amalloy tmciver I'm just curious
00:33amalloyalso, that's not an id, it's the object's hashCode (which, by default, is related to the memory address, but not by any means a 1-to-1 mapping)
00:34myguidingstara ha, that's clear to me now
00:44vimuser2Hey there, was curious how do you guys handle passing data to over-ridden methods for a subclass, where you need to pass data to a function but can't call the function directly?
00:45vimuser2Adding a getter/setter seems meh, would be interesting to use a channel
00:46vimuser2(specifically, i need to pass some data to paintComponent method for jpanel)
00:49amalloyi don't understand the question. paintComponent just takes a Graphics object, right? what would it mean to pass something else to that? perhaps you could give a more specific example
00:49vimuser2well technically if i read from a channel the value is removed, and it's possible for the panel needing to be repainted without me explicitly saying so… so maybe adding a property to store state to the class makes sense for this scenario unfortnuately <_<
00:50vimuser2amalloy: alright, will do. I basically got a bunch of nodes I want to draw with connections. I only really need to draw everything once, until I envoke some function to redraw everything.
00:51vimuser2amalloy: So, basically i got a hash map of nodes with connectors, external to my instance created with proxy
00:53vimuser2So more or less, when JPanel.paintComponent(g) is called, i would like to somehow draw all these connections. and rather not have some global ref. pointing to the nodes and connections, if that makes sense...
00:56TravisDvimuser2: You might want to check out the seesaw library. It exposes a more idiomatic clojure interface to javax.swing
00:57vimuser2TravisD: hm, alright. i was trying to more or less do this as a challenge for myself, but maybe I can study the source and get a few hints
01:00TravisDvimuser2: Unless you're looking for a java interop challenge, it seems like one library is as good as another. It's still an interesting (and challenging) problem to automatically draw pleasing graphs
01:04vimuser2yeah heh. i mean my code to create the nodes and whatnot is functional, but this interop stuff is a bit of a challenge like you said.
01:05vimuser2just curious, is there any soft of weird thing where it can hold 2 values (defaults are nil), but when 2 values are set it automatically fires another function?
01:05vimuser2seems more or less like a event or something heh
01:09vimuser2but yeah, that wouldn't necessarily work for me anyways since the graphic object shouldn't be held on to. anyways thanks for the input, I'm done flooding the channel =)
02:33luxbockI installed YourKit profiler and I'm not looking at the results of the Method List that was recorded during CPU profiling
02:34luxbockthe most time is spent in clojure.lang.RT.seqFrom(Object)
02:34luxbockam I correct in interpreting that this means that I could perhaps find spots where I can optimize the code by avoiding my arrays getting turned into seqs?
02:36luxbockhttps://gist.github.com/luxbock/da22767ef16af6ebc5dc
02:36luxbockhere is the code in question, with the last file being the one I'm profiling for further improvements
02:58amalloyluxbock: seqFrom just delegates to other code. you want to look through the stacktraces emanating from seqFrom to see what sequences are taking a long time to build, and/or who's asking for a lot of sequences
03:09luxbockwhat does clojure.core$every_QMARK_ do?
03:22plaeremans@andyf_ thanks!
03:32luxbockfound two ways two tweak the algorithm that gave me a 10x speed improvement, so now I'm only 10x behind the Java version
04:56aztakhi all! Here's a newbie question for you all -> Which book on Clojure should I buy? :) I know Scala and FP reasonably well, but I've never really been exposed to LISP before.
05:00clgvaztak: often recommended: Clojure Programming
05:04aztakclgv: thanks for the pointer. Will look it up!
05:07aztakclgv: any thoughts on 'Joy of Clojure'?
05:07AeroNotixaztak: I feel it's more in-depth than Clojure Programming
05:07clgvaztak: it's great but maybe not suited as first clojure book
05:10clgvaztak: my reading path was "Programming Clojure (1st Edition)" -> "Joy of Clojure"
05:11aztakthanks guys. Should probably get both of them then.
05:11aztakclgv: how does "Programming Clojure" compare to "Clojure Programming"?
05:12clgvaztak: "Programmign Clojure" has older roots but is available as second edition already
05:13clgvaztak: hard to say without comparing them in detail
06:26aztakThere. Just ordered 'Programming Clojure, 2nd ed' :)
07:36oskarthhow do you guys usually rename a leiningen project? (including all the references in files)
07:39ambrosebsI avoid namespace prefixes, do the `git mv` commands, then use git status to build up a project-wide search/replace.
07:39ambrosebsWorked a treat moving around 70 namespaces in core.typed
07:39ambrosebsyou might guess I'm not in an IDE ;)
07:40hyPiRionoskarth: `find test -name '*.clj' -print0 | xargs -0 sed -i.bak -e 's/old-ns-prefix/new-ns-prefix/'` in root directory
07:40hyPiRionthat one should work on both mac and linux
07:41ambrosebsalso consider if you have dashes in your namespaces, they are converted to underscores in :imports
07:42ambrosebsI realise now you were talking about simply renaming the prefixes.
07:43oskarththanks :)
07:44oskarthOne thing that's missing is the folders, but I can do it at the second stage
07:44oskarthas a*
07:45hyPiRionoskarth: yeah, that's a bit more involved, but I tend to do that manually
07:45hyPiRionIt's not like I rename projects every say, so I've not bothered to set up a script for it
07:45hyPiRion*day
07:45hyPiRionHrm...
07:46hyPiRionSounds sorta like something you could write a Lein plugin for.
07:46oskarthlein rename foo bar would indeed be nice
07:48noncomwhat's the best way to convert java.util.List to a [] ?
07:49ambrosebsnoncom: a vector?
07:49noncomyeah, a list into a vector
07:49ambrosebsnoncom: try into
07:49ambrosebsto just (vector lst)
07:49ambrosebs)or
07:49hyPiRionI think (vec my-list) should work too
07:50ambrosebsyes not vector
07:50noncomso (into), (vec) are aware of how to treat java collections?
07:50gfredericksyeah
07:50noncomcool, thank you
07:50gfredericksthanks to the java.util.Collection interface or something
07:50hyPiRionnoncom: yeah. I think most of the Clojure functions works on seqs, and Collection is seqable
07:51hyPiRion,(seq (doto (java.util.ArrayList.) (.add 1) (.add 2) (.add 3)))
07:51clojurebot(1 2 3)
07:51hyPiRion,(map inc (doto (java.util.ArrayList.) (.add 1) (.add 2) (.add 3)))
07:51clojurebot(2 3 4)
07:51gfredericks,(apply concat (repeatedly 10000 #(java.util.ArrayList.)))
07:51clojurebot()
07:53noncomreally cool
09:02dokyhello can anybody help me how to return value from inside of loop like return value ? a try it this way
09:02doky(let [xx (vec nil)]
09:02doky (doseq [kv @clients]
09:02doky (if (= "first" (:room-id (val kv)))
09:02doky (conj xx (:user-id (val kv)))))
09:02doky (println xx))
09:02dokythe better would be instead of var xx, return only data like: (into [] (:user-id (val kv)))
09:02dokythe better would be instead of var xx, return only data like: (into [] (:user-id (val kv)))
09:02dokybut both returns nil :/
09:04llasramdoky: (a) better to use a paste service (such as refheap.com) for any code longer than 1 line
09:04dokyok sorry for that
09:05llasram(b) what your code appears to be attempting to do is build a vector via mutation
09:05llasramBut the Clojure default datastructures are all immutable
09:06dokyso here it is: http://pastebin.com/2kxwvzR0
09:06dokyand so how to get the vector of these items ?
09:07llasramIs @clients a map?
09:07dokyyes
09:07llasramsomething like (map :room-id (vals @clients)) will give you a sequence of the :room-id's
09:08llasramBut you want... the :user-id where the :room-id is "first"?
09:08llasramSo you chain operations -- (->> @clients vals (filter #(= "first" (:room-id %))) (map :user-id))
09:08dokyyes
09:09dokythanks i will try it :)
09:10llasramBut make sure you understand why the way you were trying to do it didn't work
09:10dokywoow, that's great
09:12dokyi know that data are immutable but i don't understand why i did't worked if i put it that way:
09:12doky (into [] (:user-id (val kv)))
09:12dokyso it didn't create a new anonymous vector ?
09:17arr-eeHi guys. I have a problem with dynamically creating tests (or named functions, even): I can’t figure how to resolve (?) the symbol for the function name. Here’s the gist: https://gist.github.com/arr-ee/9892004
09:26llasramdoky: If you have that form inside of the `doseq` you're still doing pretty much the same thing
09:27dokyok i see and thanks for help :)
09:28llasramarr-ee: Because macros act at macro-expansion time on their literal arguments -- in this case, the literal symbol `tname`
09:30arr-ee@llasram: yeah, I was thinking that way, but hoped I was wrong. And that means I won’t be able to do what I wanted to, right?
09:31llasramYes/no. There's always `eval`, but fighting against the language like that suggests you are doing something uncommon and potentially unnecessary
09:32llasramWhat's your ultimate goal here?
09:32arr-eeYeah, eval is a bit too much
09:34arr-eeI have a list of maps like {:scope :a, :method :b}, and I want to generate tests for those that basically call a function with that :method value as an argument
09:34arr-eeThing is, different :scope's require different env set-ups, so I wanted to move those to the tests’ metas to be able to use selectors
09:36arr-eeand also test names based on those :method values, because there’s a lot of them (about a hundred), so shoving them into one test wasn’t looking great
09:37llasramAre all the :scopes known ahead of time?
09:37arr-eehowever, since I know all :scope values and they are quite limited, I’ll go hardcoded defs + generated assertions way, I guess. Thanks anyway, I’ve learned something new :)
09:37arr-eeyeah, they are, and they aren’t changing a lot
09:38llasramYou could have one `deftest` per `:scope` which runs all the tests for that scope
09:41arr-eeyes, I guess I’ll do it that way + easier to do setup/teardown
09:42llasramarr-ee: Alternatively -- where does this vector of maps come from? Is it inline in this test code?
09:42llasramActually, doesn't matter
09:42llasramYou could write a macro which accepts that map as a literal and defines all the necessary `deftest` forms
09:43llasramThen either call the macro with the map (if already a literal), or `eval` invoking the macro with the map from elsewhere
09:44llasramBecause you need the selectors as metadata to work with existing tools, I think this qualifies as a case of actually doing something uncommon :-)
09:44llasrams,map as a literal,vector as a literal, etc
09:44arr-eeI’m not sure anyone from my team will appreciate that :)
09:45llasramOh?
09:45arr-eedeftest per scope should work, I seriously doubt it will change anytime soon anyway.
09:45llasramkk
09:45arr-eellasram: thanks!
09:52antris_There's a competition where you can code a race car bot using Clojure :) https://helloworldopen.com/
09:52antris_They opened the signups today
10:39bodie_anyone played with overtone?
10:41ddellacostabodie_: you know, I've been meaning to. I used to spend a lot of time with SuperCollider...
10:43nathanicin particular i liked hooking overtone up to things like http://hexler.net/software/touchosc
10:46greg`simple made easy where can i download?
10:47technomancygreg`: if you're asking for help violating copyright then please get lost
10:47technomancy(but if not then don't get lost.)
10:48bodie_ddellacosta, neato :) I just got set up with the Emacs Live bundle from Overtone
10:48bodie_it's really, really nice so far, if a little bloaty
10:48benmossdoes anyone know of a way with clojure.data.json to avoid parsing nested JSON
10:48greg`sorry i didnt know it was copyright
10:49greg`havent been on the clojure community before but thats not a great advert
10:49greg`simple made easy is a talk by richard hickey on the infoq website
10:50bodie_unwillingness to help you break copyright is a bad advert for a community?
10:50bodie_O_o
10:50greg`is it copyright?
10:50ddellacostawoah let's relax here folks
10:50bodie_LET'S FIGHT
10:50AnderkentI prefer moveleft to copyright, prevents duplication
10:51greg`well if i can stream it , it cant be copyright since it gets copied to my machine first to be played
10:51ddellacostagreg`: http://www.infoq.com/presentations/Simple-Made-Easy
10:51greg`thanks ddellacosta. nice to know there are some nice clojurians
10:52greg`wont be back in a hurry
10:52ddellacostagreg`: most Clojurians are nice, don't get the wrong idea. And I suspect technomancy was just joking around, 'cause he's quite nice.
10:52bodie_i've never heard of moveleft
10:52technomancygreg`: sorry, there's a book called "Clojure made easy" that I thought you were talking about
10:53technomancymy bad
10:53greg`ah ok, well thanks
10:53bodie_also.... he did say "if you're not, please don't get lost" =P which I thought was quite nice
10:53dselphgreg`: ddellacosta: Agreed - technomancy is one of the nicest folks you'd ever meet
10:53greg`bodie: ....i guess :-\
10:53bodie_the butthz are strong with this one
10:54greg`k l8r
10:54bodie_that guy was an ass imo
10:54bodie_I'm a total newcomer and you guys have always been awesome
10:55ddellacostabodie_: well, it
10:55ddellacostad'oh
10:55bodie_dat return key
10:55Anderkentthe internet: where sometimes some people take the thing you typed as something else than what you ment.
10:55ddellacostabodie_: it's always good to give folks the benefit of the doubt methinks
10:55ddellacostabodie_: yah, haha
10:55Anderkentshocking :)
10:55ddellacostaAnderkent: heh. ;-)
10:56bodie_Anderkent, the difference therefore is in how you respond, meaning the responsibility lies on the individual ;)
10:59technomancywe used to have people looking for pirated ebooks come by every so often, but I haven't noticed it as much recently
11:01tmciverThat's because technomancy puts 'em in their place. :)
11:02ddellacostatechnomancy: seriously? Clojure books in particular?
11:09technomancyddellacosta: I don't think they expected the authors to hang out on irc
11:10AimHereI just want a pirated copy of clojure
11:10teslanickIt's lines like the above that makes me wish there were an @Horse_Clojure some days.
11:12winkI thought it was about a talk
11:15Guest77325http://www.marketglory.com/strategygame/galahad1st for online gamers, if you didn't already, use this link to register on MerkatGlory: a free2play financial strategy game where virtual currency can be converted into real money. It starts out slow but in time you can turn a good profit that is if you have the necessary patience to grow a little bit every day :P
11:21philthI'll never play marketglory, thanks spammer. MeerkatGlory however...
12:11mikerodhmm
12:12mikerod,(clojure.java.io/writer (clojure.java.io/writer "filename.txt"))
12:12clojurebot#<SecurityException java.lang.SecurityException: denied>
12:13mikerodI have noticed that a File will open a FileOutputStream with clojure.java.io . I do not believe this is safe when encoding is a concern. Then I noticed that an OutputStream with the `writer` fn would wrap it in an OutputStreamWriter
12:14mikerodSo would this be the typical path to getting an OutputStreamWriter from a file?
12:14mikerodit is sort of odd looking to call `writer` twice :P
12:14mikerodI know I could just Java interop of course.
12:21clgvmikerod: you can specify the encoding via optional parameters
12:23mikerodclgv: yes, that too
12:23mikerodclgv: I meant to actually get the OSWriter
12:24mikerodSince the File alone would just get me a FileOutputStream
12:26hiredmanmikerod: streams, outpunt and input, operate at the level of unencoded bytes, if you care about encoding you should use readers and writers
12:29simon_Hello, I have a list of PGobjects like so (#<PGobject dev> #<PGobject live> ... )
12:29simon_I can call getValue on it by doing "(.getValue (first myList))"
12:29simon_But I cannot map .getValue over the list
12:29simon_I get CompilerException java.lang.RuntimeException: Unable to resolve symbol: .getValue in this context,
12:30xeqi,(doc mem-fn)
12:30nopromptdnolen_: what's the status on the new cljs version?
12:30clojurebotTitim gan éirí ort.
12:30nathanicsimon_: http://clojuredocs.org/clojure_core/clojure.core/memfn
12:30dnolen_noprompt: I pushed it out on Wednesday
12:30dnolen_2197
12:30simon_noprompt: great, thanks!
12:30nopromptdnolen_: ah, cool, the README still says 2173.
12:31nopromptdnolen_: haven't read the ML in a bit.
12:31TravisDAh, that is so much better than making anonymous function wrappers
12:31dnolen_noprompt: thx for pointing that out, fixed
12:33nopromptdnolen_: thanks!
12:33TravisDI mean, it is the same thing, but it looks nicer
12:38michaniskincemerick: is the key in the repositories map passed to resolve-dependencies! significant? or can the key be any string?
12:38cemerickmichaniskin: sorry, where?
12:39michaniskincemerick: https://github.com/cemerick/pomegranate/blob/master/src/main/clojure/cemerick/pomegranate/aether.clj#L639
12:39michaniskincemerick: the "name" there
12:39cemerickmichaniskin: yeah, any string AFAIK; corresponds to "targets" in lein tasks, but no real constraints
12:40michaniskincemerick: thanks!
12:40xeqimichaniskin: I believe it is best to try and use "standard" names, as Aether may pull in further name/repo settings for transative deps
12:41michaniskinxeqi: you mean aether itself adds new repositories?
12:41michaniskinxeqi: and what would be a "standard" name? i've been using the url.
12:42xeqimichaniskin: if a pom includes new repositories it will add them to make sure you can download any transative deps
12:43xeqimichaniskin: I really mean just don't go defining central as someother name, I'm not sure if it will cause problems but it seems like a bad idea
12:44michaniskinxeqi: i see. this whole thing seems like a bad idea :)
12:45michaniskinbut we go to war with the ideas we have
12:49ambrosebsBronsa: how do I get a line number from a :def expr?
12:50ambrosebsnot having much luck
12:53cemerickdnolen_: shouldn't e.g. (om/allow-reads @cursor) work in render? (Trying to do some thrash-debugging here.)
12:53Bronsaambrosebs: (-> (analyze '(def x 1) (empty-env)) :meta :form :line) ;;=> 1
12:53dnolen_cemerick: that combination doesn't really make sense. if you deref you don't need to bother with allow-reads
12:53ambrosebsBronsa: ah!
12:54cemerickdnolen_: and yet, "Cannot deref cursor during render phase: [object Object]"
12:54bodie_to anyone who's really experienced with Clojure: what are some pitfalls / do you feel in the end that it's been worth it? or would you have gone a different route if you were in the shoes of a newcomer?
12:54dnolen_cemerick: what are you trying to do?
12:55Bronsaambrosebs: you really want to just do (-> the-node :env :line) though
12:55ambrosebsBronsa: do I have to write my own pass for that?
12:55dnolen_cemerick: if you need to get at the value, om.core/value works
12:55Bronsaambrosebs: no, it already works
12:56Bronsaambrosebs: the env will have :line/:column/:file when available
12:56cemerickdnolen_: OK, om/value worked. Was just wanting to pump verbose-mode console prints. Not really clear on why deref'ing is frowned upon…?
12:56Bronsaambrosebs: note that :file will not be there when not available, instead of defaulting to "NO_SOURCE"
12:57dnolen_cemerick: because deref'ing can give you something inconsistent
12:58ambrosebsBronsa: I only see :ns, :context and :file in some of my :def :env's.
12:58ambrosebsBronsa: the :line is still in :meta tho
12:59ambrosebsanyway g2g
13:01stuartsierrabodie_: I was biased toward lisp when I started with closure more than five years ago. But I feel it has been totally worthwhile.
13:01stuartsierra*clojure
13:02technomancybodie_: you're not going to get anyone in this channel who didn't think it was worth it
13:02technomancyhttps://en.wikipedia.org/wiki/Survivorship_bias
13:02bodie_lol!
13:03bodie_hmm, that's not necessarily applicable, since some people may be stuck with a large and unwieldy codebase that they have to maintain professionally, for example
13:04bodie_I don't think everyone who has 15 years of Java or C++ experience thinks they're ideal languages
13:04bodie_(though you could probably make a case for it with C++)
13:04technomancythat's true
13:04bodie_stuartsierra, thanks for the input. can you elaborate on what you experience has been like? do you use it professionally?
13:05technomancythough in that case you would wonder if people would fail to speak up because they don't want to get into a huge argument right now with all the pro-clojure people in the channel
13:05bodie_lol
13:05bodie_some people like a healthy debate ;)
13:05pdk[13:01] <bodie_> I don't think everyone who has 15 years of Java or C++ experience thinks they're ideal languages
13:06pdkive seen some koolaid drinkers
13:06cemerickdnolen_: That reply makes me want to throw 20 questions at you, but I will restrain myself. Thanks for the `value` workaround.
13:06stuartsierrabodie_: Yes, I work for Relevance/Cognitect, where we use Clojure professionally every day. I've done a lot of blogging and conference talks about the experience: they're easy to find online.
13:07bodie_:) cool!
13:07dnolen_cemerick: the rendering loop is async, you only want to render consistent snapshots - I've provided loop holes but we're going to error out if you try to do obviously bad things.
13:07cemerickbodie_: search for "why clojure sucks", for one treatment.
13:07bodie_pdk -- i meant not all people think it's ideal, not "all people think it's not ideal"
13:08bodie_thanks cemerick
13:08stuartsierraIn fact, nearly all the talks from past Clojure conferences are online somewhere. Lots of those include practical experience reports.
13:08TEttingerbodie_: it's been worth it, but I would not use clojure for games. which is mostly what I do. for certain tasks clojure is vastly more effective in my experience
13:08bodie_what do you like to use for games? C++?
13:08Anderkentbodie_: We've went with clojure over java for a web service a year or two ago, been pretty happy with it
13:08technomancyinteresting experiment would be to ask in #scala for stories of people who tried clojure and gave up, and ask vice-versa in here =)
13:09stuartsierraThat would be interesting.
13:09bodie_hehehe
13:09bodie_Hmm, I did ask the latter half already. it was good.
13:10rootexall answers will lead you to haskell :)
13:10bodie_how about Typed Clojure? anyone play with that much?
13:10TEttingerbodie_: I got further in C# than Clojure in about the same time, despite having better libs in Clojure/Java-land. C# was easier to port certain algorithms to and I didn't have the same issues with optimization seeming necessary when it turns out I was optimizing the wrong places
13:11bodie_I see
13:11TEttingerhowever for other things I can churn out a clojure "script" in a few minutes that does what would take me an hour in C#
13:11bodie_I don't get much out of C#
13:12Raynesconch has so many stars
13:12bodie_but that's a good thing to bring up
13:12technomancythere are the obvious things clojure is bad for, like fast-launching scripts, low-memory environments, and C FFI.
13:12alpheusI'm having trouble getting OAUTH2 with Google working. I'm just trying the ddellacosta/friend-oauth2-examples for google oauth2.
13:12alpheusAfter the 302 redirect from Google to the callback URI (with a state and code that look good) I try to access the /authlink, which should work but I get a 403.
13:12alpheusThe HTTP headers and the ring request maps all look reasonable to me. What should I look at next?
13:12alpheus
13:13rootextechnomancy: wish we had a clojure in c :)
13:13technomancyrootex: I just wish we had C libraries on a nicer runtime
13:14bodie_there's a compiler for clojure -> gambit which compiles to C
13:14gtrakC# has a pretty good FFI, no?
13:15technomancyOCaml has good C FFI, but it gets that by representing its own strings the same way C does
13:15technomancywhich is really not so great
13:15rootextechnomancy: a clojure in C is more realistic :)
13:15technomancytrade-offs are a thing
13:15bodie_technomancy, wouldn't you say that a lot of the memory and speed issues around Clojure are able to be optimized away with some work via type hinting?
13:15TEttingergtrak: depends? SWIG seems to work but I haven't gotten very far
13:15bodie_or is that an illusion I've acquired?
13:15SegFaultAXStrings in Erlang are also pretty dicey.
13:15Raynestechnomancy: You mean to tell me I can't run my Clojure on my toaster?
13:16RaynesSegFaultAX: You bean binary lists :P
13:16Raynesmean*
13:16SegFaultAXRaynes: Exactly.
13:16TEttingerbodie_: speed issues yes, memory not so much
13:16koalallamatechnomancy: I was reading Clojure Programming the other night and saw a link to one of your libs/tools
13:16SegFaultAXkoalallama: Probably lein.
13:16bodie_right, type hinting wouldn't solve that issue, but wouldn't proper tco?
13:16technomancybodie_: type hinting solves a very small subset of speed issues.
13:16koalallamatechnomancy: just thought you should know that you are famous in my eyes
13:17bodie_I suppose I meant "tools like type hinting and recur"
13:17technomancybodie_: granted they are often severe speed issues, but they're not all that common
13:17bodie_hmm
13:17technomancykoalallama: haha cool
13:17SegFaultAXtechnomancy: It might be a small subset, but that subset can dramatically impact your performance.
13:17bodie_SegFaultAX, good point - I was actually considering elixir as an option against clojure
13:18justin_smithbodie_: I think it really depends on what aspect of performance needs improving - startup time? throughput in tight loops? RAM usage?
13:18SegFaultAXReflection ain't free, afterall.
13:18justin_smith(by RAM usage I mean more cache performance)
13:18koalallamaSegFaultAX: nope, it was something else. I'll have to check. It was in the footnotes around pp480ish
13:18SegFaultAXbodie_: I actually enjoy Erlang's syntax because I'm a weirdo. Elixir is also beautiful, though.
13:18bodie_I don't know enough about Clojure's pitfalls to know to ask a question specifically enough to answer your question, justin_smith :)
13:18SegFaultAXkoalallama: Well it's certainly his most famous library since it's the de facto project manager for Clojure.
13:19bodie_Erlang does have beautiful syntax.
13:19bodie_I am not very productive with it however.
13:19justin_smithbodie_: each of those issues have different answers, and some contradict one another :)
13:19SegFaultAXbodie_: I don't know if I would call it beautiful necessarily. Using `,` and `.` to separate/terminate statements can be quite tedious during refactoring.
13:20koalallamaSegFaultAX: I know :)
13:20bodie_cemerick, I'm really enjoying this "what sucks about clojure" talk :) good pointer
13:20cemerickbodie_: :-) It's a bit old, but isn't dated, if that makes sense.
13:20technomancySegFaultAX: the separator nonsense is realyl my only complaint about the syntax too
13:21bodie_sure. I think the test of time is a good thing.
13:21SegFaultAXtechnomancy: Yea. But frankly, the annoyance of using `,` and `.` is offset dramatically by Erlang's pervasive pattern matching.
13:22SegFaultAXOh man it makes me fuzzy inside just thinking about it.
13:22bodie_Erlang has some pretty damn nifty features.
13:22technomancyI wonder if you could solve the ,/. problem with something paredit-like
13:22SegFaultAXPerhaps.
13:23SegFaultAXBut even JA thinks Elixir's syntax is pretty sweet (though it doesn't actually hide enough of the warts according to him, while still introducing its own)
13:23technomancyadding |> helps a lot
13:23SegFaultAXYes! Pipe syntax is /sweet/!
13:30meliponehelp! I was storing hash codes and after switching to clojure 1.6, my hash codes are no longer valid! I was able to retrieve them after backtracking to 1.5 but what's going on?
13:30rasmustomelipone: there was a hash collision bug in 1.5 and earlier
13:31llasrammelipone: By "storing hash codes" you mean caching hashes, or e.g. storing them in a database?
13:31meliponejeez! how can I convert?
13:32meliponellasram: I was storing them in a hash-map
13:32oskarthWhat's the idiomatic way to get a resource from an API with a jsonblob in its body using clj-http? Right now I'm parsing it using cheshire (another dependency) like this: (parse-string (:body resp))
13:32meliponellasram: and I was writing the hash-map out so it's like a database
13:32dakroneoskarth: you can use {:as :json} in clj-http to get back a clojure map from json strings automatically if you like
13:32TravisDmelipone: If you have the original objects, you could rebuild the hash map
13:33meliponeTravisD: I am not sure I have the original objects...
13:34TravisDmelipone: Can't you get them by calling keys and vals on the map?
13:34oskarthdakrone: oh! I tried it before but realized I had two maps instead of dakrone one, now it works. Thanks :)
13:34dakroneoskarth: you're welcome :)
13:35TravisDmelipone: (You could, for example, do that with clojure 1.5 and dump the values to file somehow)
13:37meliponeTravisD: the vals are not just the translation of the keys
13:39bodie_cemerick -- 28 minute delorean joke is hilarious
13:39bodie_i know you stole it, but i got a good laugh
13:40TravisDmelipone: I'm not sure that I understand the problem. If you need the key-value pairs you could just call seq on the map, no?
13:41mikeroddoes Clojure have any libraries for seq'ing through jar files?
13:41meliponeTravisD: but I am going to get a hash value for the key and I don't know what it maps to
13:41mikerodanalogous perhaps to file-seq
13:42mikerodI guess it doesn't always make sense...
13:42TravisDmelipone: Ah, I see. That seems like a troubling situation
13:42meliponeTravisD: I guess I'll figure it out somehow ... but jeez ...
13:44TravisDmelipone: So, presumably you only care about keys that appear as hashes of objects that are somehow produced in your application. You could reimplement the old hash function and then build a new map in clojure 1.6. If you don't find a given key in the new map, look it up in the old map using the 1.5 hash function. If it's there, move it over, otherwise add it to the 1.6 hash. or something.
13:45TravisDI'll stop speculating and flooding now though :)
13:53koonchun#rust
14:00DaReaper5Hey all, how can I convert a java.util.Date to org.joda.time.ReadableInstant ?
14:00justin_smithhttps://github.com/clj-time/clj-time DaReaper5: clj-time is a wrapper around joda stuff
14:01justin_smithI have found it very reliable and easy to use
14:01DaReaper5justin_smith: yupp, already using it
14:01amalloyhttp://stackoverflow.com/questions/5137666/how-to-convert-a-java-date-to-a-readableinstant-for-joda-time-inside-a-jsp
14:01DaReaper5justin_smith: is there a method inthere for an easy conversion
14:01amalloythird google result for org.joda.time.ReadableInstant
14:02DaReaper5amalloy: yes but that is in java... i guess ill remind myself what the equivalent clojure code is
14:03justin_smithDaReaper5: I think the clj-time type that it creates implements ReadableInstant
14:03justin_smithanything that returns a DateTime
14:07xperaRaynes: I've enjoyed Laser! I'm having some trouble with how hickory and quoin handle HTML entities though
14:07xperaI wonder if David Santiago is in here? https://github.com/davidsantiago/hickory/issues/16
14:15amalloyxpera: dsantiag_ is probably dsantiago's answering machine
14:16dsantiag_I do not know why it won't let me change my nick back.
14:16amalloydsantiag_: you're probably in another channel that's banned dsantiago
14:16amalloyleave that one, then you can change nicks
14:17dsantiagoNo idea why I'd be banned in #git. Haven't spoken in there for ages.
14:17amalloyhey, that happened to me too
14:17amalloyi forget why
14:17xperadsantiago: thanks for finding me
14:17dsantiagoI was just replying to you.
14:17amalloy#git has weird rules
14:17technomancysome channels ban for constant nick changes
14:18Bronsa:/
14:18technomancylike if you keep adding and removing _away
14:18xperadsantiago: I wrote up some things here https://github.com/davidsantiago/hickory/issues/16 would like to hear what you think
14:18dsantiagoxpera: Yep, that is what I am replying to.
14:18dsantiagoGimme a min.
14:19xperathanks. this is part of a larger saga too about Jetty and HTML entities: http://stackoverflow.com/questions/22752678
14:22justin_smithxpera: a hack would be a substitution map on the enlive output that turns the utf8 characters into proper html escaped entities
14:24xperajustin_smith: yes, that would be a good hack! my goal would be to understand Jetty well enough to tell it to behave as expected
14:24justin_smithfair enough, that part I can't help with :)
14:26xperaright :) maybe some ring or pedestal folks know some Jetty content type / unicode tricks
14:28marcuscreohey benkay, how' life?
14:29justin_smithxpera: https://issues.apache.org/jira/browse/SOLR-2381 maybe a bug in that jetty version?
14:29justin_smithJAVA_OPTIONS+=("-Dfile.encoding=UTF-8") <- another page suggests adding this to bin/jetty.sh
14:30xperajustin_smith: thanks a bunch. i'll try that.
14:32xperajustin_smith: this was what you saw? http://stackoverflow.com/questions/4214111/jetty-character-encoding-issue
14:33justin_smithyeah, I should have shared that too
14:36tvachonarg, anyone else having trouble with clojars? I can't even get lein to run https://gist.github.com/travis/9899061
14:36tvachonand https://clojars.org/ is just failing to load
14:36justin_smithoh ouch!
14:37justin_smithhttp://www.downforeveryoneorjustme.com/clojars.org
14:37rasmustoits down for me
14:37justin_smith"It's just you. http://clojars.org is up." - clojars does not load for me either though
14:39amalloyxeqi: ^
14:39coventryIs there a clojure.core function f for which (= ((f inc dec) [0 0]) [1 -1])?
14:40amalloycoventry: no, but https://github.com/flatland/useful/blob/develop/src/flatland/useful/fn.clj#L94
14:40coventryThanks.
14:41amalloyout of curiosity, what did you want it for, coventry? mapping one function over a map's keys and another over its values is the only use that's obvious to me
14:41coventryThat's exactly what I wanted it for.
14:42RaynesIt's scary how Clojure ceases to exist when clojars goes down :P
14:43justin_smiththere should really be mirrors
14:43justin_smithand some kind of mirror friendly option in lein
14:43tvachonwell, don't think it's quite that bad, I restarted my network interface and it's behaving better, I suspect something got crazy in my stack
14:43tvachonthough I definitely wouldn't have (can't?) download required deps
14:43coventryIs there any way to tell lein not to check for updates?
14:44justin_smithtvachon: if so it is crazy in my stack too
14:44amalloylein -o <whatever>
14:44tvachonah
14:44tvachonwell at least I'm not nuts
14:45xperajustin_smith: hooray. I will buy you a beer sometime.
14:45amalloy(which, incidentally, i discovered by running `lein help`)
14:46justin_smithxpera: glad it worked
14:46xperajustin_smith: i'll update my chef-jetty chef recipe and share that soon
14:46dokyhello is it possible to pass items of list on-by-one to function ? http://pastebin.com/F67qiYn5
14:46amalloydoky: apply
14:47coventryamalloy: "lein -o help"? :-) "lein help" is hanging for me. I suppose I should have changed my cwd.
14:47amalloyhaha
14:47amalloyouch
14:48amalloyoh. or map? i hadn't read your paste, doky
14:48justin_smithyeah, he wants map
14:48dokywill it work with apply, will tried it but maybe i did there any mistake in syntax or something like that
14:48rasmusto,(map (fn [n] {:what "hi" :who n}) ["bob" "tom"])
14:48clojurebot({:what "hi", :who "bob"} {:what "hi", :who "tom"})
14:48xperaif anyone wants to get Jetty 9 to work, this is what I use: https://github.com/bluemont/chef-jetty/commit/5796e2c660efe036c81238f86352e9de6b611a54
14:49justin_smithnice
14:49dokywoow thanks :)
14:49rasmustodoky: understanding "map" is the path to enlightenment
14:50ptcekrasmusto: and reduce :)
14:50doky:D i will remember
14:50justin_smithrasmusto: the map is not the territory! map only shows where the path is :)
14:50oskarthIs there (a) a collection of everything clojurebot has evaluated or (b) a nice downloadable archive of chat logs for #clojure?
14:51amalloyoskarth: devn has such a project
14:52amalloyyeah, https://github.com/devn/getclojure
14:52oskarthamalloy: this one? http://getclojure.com/search?q=iterate+AND+range&amp;num=0 thanks
14:52oskarthcoo
14:52oskarthcool* :)
15:03hlshipis anyone else seeing clojars.org as down? Can't even ping it right now.
15:03rasmustoyessir
15:03tvachonyep
15:03amalloyhlship: yes. we've raised the bat-signal for xeqi
15:03hlshipglad its not just me
15:03hlshipwas having wierd DNS issues last week
15:04trptcolinhttp://status.linode.com/
15:05amalloyah, thanks trptcolin
15:08startlingI'd like to call some clojure code from some java code in the same package. It's apparently not sufficient to say :aot [whatever] -- I still get "cannot find symbol" where I try to import whatever in java. What else needs to be done?
15:08hiredmanstartling: lein runs the clojure compiler after javac
15:08startlinghiredman: ah, well.
15:09xperadsantiago: thanks for your help. I'd also be curious if I'm off-base about reflection.
15:09startlingIs this kind of thing possible at all without using clojure.lang.RT?
15:09trptcolinnp
15:09amalloystartling: it's easier to, rather than AOTing the clojure code, have java call into an ordinary clojure function via RT
15:10hiredmanstartling: https://github.com/sonian/Greenmail is my go to example of java and clojure in one project
15:10amalloystarting in clojure 1.6 there's a somewhat more java-friendly API than RT, in clojure.java.api.Clojure, iirc
15:10startlinghiredman, thanks, I'll take a look
15:10hiredmanstartling: if you look at the com.icegreen.greenmail.util.Greenmail class you can see using RT to get vars and using vars to require namespaces and call functions
15:12gtrakstartling: it's pretty tiny: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/java/api/Clojure.java
15:15seancorfieldstartling: FWIW, at World Singles we load all our Clojure into our main app using clojure.lang.RT (we haven't switched to the new API yet) and it works really well
15:16seancorfieldyou just need to have the project src on your classpath - and the various JARs you rely on (which is the fun part)
15:16oskarthdakrone: another question. I'm trying to translate a curl post request to clj-http. This is what my body looks like when I use :debug in clj-http "name=test+name&email=test+email&address%5Bcountry_code%5D=DE<etc>" and here's what it looks like in curl: "name=Sterling Archer&email=your@test.email.com&address[line1]=Pr<etc>". The curl one is working, and the
15:16oskarthclj-http is not. What's wrong here? %5B and %5D correspond to [ and ], but not sure if that's picked up properly.
15:17seancorfieldMuch depends on how your Java code is set up and how much control you have over it (in terms of whether it needs to just interact with a Java-like class or whether you can write all the interop from scratch)
15:19justin_smithoskarth: I think an embedded map that looks like {:address {:country_code "DE"} ...} should do what you want iirc
15:19oskarthjustin_smith: that's what it looks like right now
15:20justin_smithoh
15:20oskarthand somehow it's translating it correctly, since I didn't put the [ and ] in there
15:20oskarthbut still not all the way, and all I get from the server is a 400
15:20justin_smithexcept it is escaping the [ and ], so I am guessing a misbehaving abstraction layer
15:21oskarthyeah indeed. Trying to use the plaintext string right now instead but getting some other error :p
15:34upwardindexCan some kind of deadlock happen in http-kit when compared to jetty? (sometimes my server stops responding and it only happens since i switched from one to the other)
15:36justin_smithupwardindex: perhaps you had some operations in your handler that are not compatible with http-kit's more pervasive async
15:36justin_smithlike in jetty you can assume each request has exactly one thread it runs in, start to finish
15:36justin_smithin http-kit this is not the case
15:36justin_smith(which can mess with things like dynamic vars that are thread specific)
15:36abakeryeeehah, clojars is back up
15:47upwardindexjustin_smith: Yes, I’m most probably doing something http-kit does not like. Any idea what it does not like? The doc page isn’t quite explicit about stuff I shouldn’t do
15:47justin_smithare you using any dynamic vars?
15:47justin_smithany thread-local stuff in general?
15:49upwardindexjustin_smith: no dynamic vars, just atoms and hmmm is “locking” thread local?
15:50justin_smithwhat are the chances that you are trying to alter the atom in multiple threads? would retries be better than failing? if so switch atoms to refs
15:51justin_smith*I think
15:51upwardindexSo basically, I shouldn’t use atoms with http-kit?
15:51upwardindexThat’s a pretty huge deal
15:51justin_smithlet me check something...
15:52AeroNotixDid something just go tit's up with Clojars?
15:52justin_smithyeah, it has been weird today
15:52AeroNotixgreat :)
15:52xeqiAeroNotix: linode has been having problems with it's atlanta data center
15:53AeroNotixI have a huge deploy planned :) Sigh. This is what I get for not pushing for private repos harder.
15:53AeroNotixxeqi: roger
15:53xeqifunnily enough, when I talked to people about clojars as point of failure at c/w no one cared cause it was always up :p
15:54xeqimaybe I should move talking to fastly as a possible cdn higher on my task list
15:54AeroNotixc/w?
15:54AeroNotixclojurewest?
15:56xeqiAeroNotix: yep
15:58xeqiAeroNotix: what would you use as a private repo?
15:59AeroNotixxeqi: we're currently ramping up our Archiva usage
15:59AeroNotixFrom what I can tell, you can mirror other stuff
16:00xeqiAeroNotix: yep, should be able to mirror. Easy for someone to admin?
16:00AeroNotixxeqi: one of our ops guys didn't say it was perfect, but it's not overly annoying
16:00AeroNotixhe said he found some pieces "snowflakes" which he means that they do some non-standard stuff.
16:00AeroNotixThat's all I know
16:00AeroNotixbut from my perspective, it's all rainbows
16:04ivanI'm really sad because I can't put metadata on a keyword
16:05dsjkljin your opinion what does i hope to see you again mean if said by one of the interviewers at the end of a job interview?
16:05hfaafbs/he hopes to see you again
16:06petronI'm doing a intro to Clojure talk to a bunch of university students. Is it okay if I use the Clojure logo on my slides? (which are based on Rich Hickey's "Clojure for Java Programmers" talk, with credit).
16:08dsjkljbut would you say that would be because he is worried i reject a possible offer or because he does not know if they will make one?
16:09ianeslickNo, it means he enjoyed the conversation and hopes the rest of the process goes well and that you come back / get an offer.
16:09ianeslickPersonal statement of support, says little about the process itself.
16:09zspencerWhat is the human word for `()?
16:09zspencerIt's inside of a macro
16:10ianeslickempty list
16:10zspencerI thought that was '()
16:11seancorfield,`()
16:11clojurebot()
16:11seancorfield,()
16:11clojurebot()
16:11seancorfield,'()
16:11clojurebot()
16:11seancorfield:)
16:11hiredman,()
16:11clojurebot()
16:12hiredman(you don't need to quote the empty list in clojure as in some other lisps)
16:12seancorfieldthe point I was making
16:12zspencerFor reference: http://www.amazon.com/Chemex-6-Cup-Classic-Series-Coffee/dp/B0000YWF5E%3FSubscriptionId%3DAKIAILSHYYTFIVPWUY6Q%26tag%3Dduckduckgo-d-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0000YWF5E
16:12zspencereerm that's the other paste bin
16:12zspencerhttps://github.com/ptaoussanis/carmine#connections
16:12hiredmanseancorfield: ah, I missed the unquoted one
16:13trptcolini like the first link better (not that the second one’s bad)
16:13zspencerlol
16:13zspencerI really need to figure out macros for reals instead of just kind of assuming how they work
16:13seancorfieldah, you're just asking about syntax quote in general zspencer ?
16:13brehautzspencer: a good paste error though
16:14zspencerSo I can intuit that the & body bit is "My arguments are code" and the ~@body is "put the code here!"
16:15zspencerSo the macro isn't actually calling car/wcar?
16:16seancorfieldperhaps macroexpand will help you here? that way you can see exactly what a macro expands to...
16:16zspencerAgg te
16:16zspencerAhh yes. That would be handy
16:16seancorfieldthe macro transforms code to code
16:16seancorfieldbut macros can include evaluated expressions as well as quoted (code) expressions
16:17zspencerSo the list it returns is actually the code it executes
16:19seancorfieldMacros are expanded, then the resulting code is evaluated.
16:19seancorfieldNot sure what your "it" refers to.
16:20seancorfieldThe list the macro returns is actually the code Clojure executes perhaps?
16:20zspencerthe it being `(car/wcar server1-conn ~@body)
16:21seancorfieldif you have (wcar* :foo 42), it will expand to (car/wcar server1-conn :foo 42)
16:21seancorfieldthen that expanded code will be evaluated (if the original (wcar* :foo 42) form would have been evaluated)
16:22zspencerGot it
16:22zspencerso if (wcar* (inc 1)) it'd become (car/wcar server1-conn (inc 1))
16:23seancorfieldnote that car/wcar is also a macro https://github.com/ptaoussanis/carmine/blob/master/src/taoensso/carmine.clj#L17
16:23seancorfieldright, the code is transformed first, evaluated second
16:23seancorfieldbut (car/wcar server1-conn (inc 1)) will also macro-expand before evaluation
16:25zspencerso when do dynamics come into play with bindings?
16:25zspencererm macro expansions*
16:25tuftanyone using immutant?
16:25seancorfielddynamic variables and bindings happen when code is evaluated
16:26zspencerSo they should play nicely with macro expansions
16:26coventryIt's worth having a look at some of the macros in the later parts of clojure.core. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4111
16:26seancorfieldmost macros expand to code, some macros cause some evaluation to happen as part of the expansion
16:26seancorfieldbut dynamic variables are frowned on in Clojure these days
16:26seancorfield(in general)
16:26zspencerI'm beginning to see why :-p
16:27tcrawleytuft: come see us in #immutant if you have any immutant-specific questions
16:32rasmustois there a way I can get something in clojure.tools.trace to inspect the values in a let binding?
16:35coventryrasmusto: There is trace-forms, but that's only informative on error.
16:35gtrakrasmusto: http://blog.gaz-jones.com/2012/02/04/debug_let.html ?
16:35gtrakwe have something similar in our codebase
16:37rasmustogtrak: ok, i'll give it a shot
16:37rasmustocoventry: that actually might work for now, since I do have an error
16:38rasmustocoventry: er, I guess it doesn't dig into the body of the function, just reports back what the top-level was called with
16:39gtrakrasmusto: what we use I think is actually this def-let thingy: http://www.learningclojure.com/2010/09/astonishing-macro-of-narayan-singhal.html
16:40coventryrasmusto: That sounds more like deftrace. trace-forms will give you a stack of the forms executed.
16:41rasmustocoventry: I can use trace-forms on a (let [a 1 b nil] (first a))
16:41rasmustoand it'll error out and give me the bindings
16:41rasmustobut if I call it on a form with a call to a function in it, it doesn't dig deeper
16:42rasmustogtrak: doesn't that have the risk of clobbering other global vars?
16:42coventryOh, you mean it doesn't tell you the return value. Yeah.
16:43gtrakrasmusto: yes, sometimes it's more trouble than it's worth.
16:43rasmustowell, it tells me that (foo 3) failed
16:43rasmustobut it doesn't dig deeper and tell me that the (let [a (first 1)]) inside of 'foo failed
16:47coventryLooking inside of 'foo seems like a different problem than inspecting the values in a let binding, more like providing inspection for all frames in the stack trace.
16:47amalloyrasmusto: it couldn't do that without recompiling foo
16:47rasmustoamalloy: ah, ok.
16:47amalloy(and, therefore, recompiling every function in your entire codebase that foo might need to call, etc)
16:48coventryIf you're looking for a debugger, schmetterling is nice.
16:48rasmustosounds like I should go on that route
16:49rasmustocoventry: https://github.com/prismofeverything/schmetterling this one?
16:49coventryYeah.
16:51rasmustoseems a bit heavy for what i'm doing, maybe that's just me
16:55coventryPerhaps I should pick up troncle again. That was fun.
16:58rasmustowent back to _ (println blah) :(
16:59rasmustofound my bug though, so there's that.
17:15mercwithamouthdoes anyone have a compojure project on github I can take a look at?
17:15mercwithamouthor can point me to a small one?
17:17mercwithamouthgot one
17:22rasmustomercwithamouth: there's `lein new compojure` iirc
17:26cYmen_Hm...I am calling (js/alert (nodes (by-class "foo"))) with domina
17:26cYmen_and there are clearly tags with "foo" class in the src
17:26cYmen_but I get null back
17:26cYmen_any ideas what I might be doing wrong?
17:27cYmen_I'm doing this in a <script> tag but it should probably be attached to a document.ready..maybe that's the problem?
17:30brehautif your script tag is at the end of the document your code can see all the existing nodes
17:30brehautif its in the head then you will need to use a load or ready handler
17:31cYmen_Okay so just before </html>?
17:31brehauti think before </body> from memory
17:32coventrycYmen_: If you think it might be something like that, you might be able to try domina.nodes(domina.by_class("foo")) in the console after you've verified that the nodes are present. (Not sure whether that trick'll work with a protocol method.)
17:33cYmen_brehaut: seems not to help, maybe it's something else after all
17:33cYmen_coventry: I'll try
17:33cYmen_wait..what console? :)
17:33cYmen_you mean a brepl?
17:34coventryI assumed you didn't have a brepl because you're using js/alert to explore this, and getting a brepl going is a big hairy yak. :-)
17:34cYmen_coventry: indeed
17:35cYmen_So where else can I input stuff?
17:36cYmen_Sorry, I haven't done any webdev in 10 years or so :p
17:36cYmen_I'm using firefox btw
17:37coventryI meant the javascript console. I think you can start the js console in ff from Tools -> Web Developer -> Web Console.
17:37coventry(At least on OS X.)
17:37cYmen_hehe
17:37cYmen_I have that open but don't know here to input anything >_<
17:38coventryThere's a little ">>" at the bottom of mine which accepts input.
17:39cYmen_hm...
17:39cYmen_I get [object Object]
17:39brehautcongratulations you have nearly anything ;)
17:39cYmen_and if I alert that I do not get null
17:39brehaut(but not nothing)
17:40cYmen_so apparently the problem is somehow with the order of execution and dom creation
17:40cYmen_now where do I call this damn script :)
17:40coventrySounds like you've verified the hypothesis.
17:42cYmen_alriiight
17:43cYmen_A little searching turned up this:
17:43cYmen_(defn on-doc-ready [] (aset js/document "onreadystatechange" init))
17:43cYmen_(on-doc-ready)
17:43cYmen_Which is exactly what the old javascript code did and seems to work.
17:45coventryHmm, I wonder why we don't need that.
17:46brehauti dont know much about cljs, but aset lets you set object properties O_O
17:46coventryAh, we use (set! (.-onload js/window) setup!*)) which is similar I guess.
17:46cYmen_What's the * for?
17:47brehautcoventry: phew
17:49coventrycYmen_: It's a minor change from setup! which turns off some reporting functionality we'll want in production.
17:50cYmen_ah :)
17:54cYmen_well, thanks for your help guys
17:57coventryNP. BTW, (js/console.log (pr-str obj)) tends to be a lot easier to go review than js/alert.
17:58amalloycoventry: is js/console.log really guaranteed to work? i see people use it all the time, when it seems like the only form that the compiler would guarantee works is (.log js/console)
17:59coventryI don't know, it may be bad practice. Hasn't bitten me yet.
18:02bbloomamalloy: it was even more permissive before & we broke some ppl, but i forget the details
18:02bbloomhasn't changed for quite some time, probably safe to rely on it at this point
18:04dnolen_amalloy: it is guaranteed to work actually, as far as I can tell intentionally
18:05dnolen_amalloy: an exception for js/foo as far as I can tell
18:06hiredmanguaranteed as much as anything in js is
18:31charedoes the web dev setup in clojure have a way to avoid having to restart the webserver everytime i make a small change to the code, so i don't have to rerun lein compile and lein ring server
18:31gtrakchare: there's tons of ways to do this, simplest is lein-ring automatically reloads your namespaces
18:32chareits setup to already auto recompile and reload?
18:32gtrakyes, seems that way
18:32gtrakthough I never use this feature
18:33gtrakchare: you might have to be careful though, if you're not indirecting through a var in your handler, it's possible that old versions of code will still be live.
18:33Raynesgtrak: Are you saying that lein ring reload is a substandard lein-ring feature?
18:33gtrakRaynes: I eval.
18:34gtrakI don't let other eval for me.
18:34gtrakothers*
18:34charegtrak i don't understand what yo mean by var
18:34gtrakchare: depends on how you define your ring handler, somewhere you're passing something into a servlet or the jetty adapter directly, I forget what lein-ring expects.
18:35cbp~var
18:35clojurebotvar is Passing xyz is passing its value around, #'xyz is short for (var xyz), passes a reference to xyz around. Whenever a reference is dereferenced, the current value is returned. It allows you do do things like dynamically updating code in the repl, change your ring routes, etc.
18:35justin_smithchare: #'handler points to the var (so it updates if you change the def) handler points to the value of the var, so does not update
18:35gtrakchare: I'm not sure of the implications to whatever you put in your project map, but that's how the impl probably works.
18:35technomancyRaynes: haha
18:35akachare: alternatively you could do explicit reloading in repl (for example http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded )
18:36programmancerI'm having some issues with datomic. Being completely new to it, I'm assuming I'm just not using it right: http://pastebin.com/yhwe5XZ2
18:36gtrakor just suck it up and eval everything manually :-)
18:36programmancerIf anyone has some tips I'd be very happy.
18:36Raynestechnomancy: Totally unoriginal.
18:36gtrakwell, through some cider-hotkeys.
18:36RaynesIt was someone else's idea ;)
18:36gtrakunderstand how the compiler works..
18:37amalloyRaynes: are you saying lein-ring is totally unoriginal?
18:37akajust blindly sucking it up can't always be good
18:37RaynesYes.
18:38hiredmanprogrammancer: midje is terrible, is likely our problem
18:38hiredmanprogrammancer: your
18:38programmancerOh.
18:38koreth_What's wrong with midje?
18:38programmancerWhat do you suggest instead, then?
18:38akait's hard to pronounce first off
18:38hiredmanprogrammancer: you aren't calling the function in the gist either
18:39gtrakaka: it gets better
18:39hiredmanoh, I guess you are
18:39hiredmanprogrammancer: I like to use clojure.test
18:39coventryprogrammancer: Do you get the same error if you call (add-card test-card) in the repl?
18:39hiredmankoreth_: lots
18:39programmancerLet's see, coventry.
18:39amalloyprogrammancer: it looks like midje is trying to do some bizarro fiddling with metadata or something
18:42akagtrak: you sound like my uncle
18:42programmancerhiredman, coventry, amalloy: everything works just well in the REPL.
18:42programmancerI suppose that settles my issue; don't use Midje.
18:42gtraki might use something like 'component' on a future large project, but it's probably too much hassle to refactor the current one, and not really necessary for small ones.
18:42amalloygtrak: large projects start out small
18:42hiredmanprogrammancer: see if you still get the error if you dump the datomic results in to a clojure hash set
18:43gtrakamalloy: well, for the next thing that's intended to be a large project, I should say.
18:43hiredman(into #{} whatever)
18:43gtrakdoesn't really happen to me very often :-)
18:43akaI'm converting a small project to component right now...
18:43programmancerI can't seem to reproduce the error at all in the REPL.
18:44programmancerEverything works like a charm there.
18:44hiredmansounds like typical midje wonkiness
18:44programmancerI suppose it's time to rewrite the tests for clojure.test.
18:44programmancerAre there other good testing libraries out there?
18:44programmancerclojure.test is certainly good enough, but some of the stuff Midje added was rather handy.
18:44brehautgenerative testing
18:45amalloyclojure.test.check is fun if you don't mind relearning how to think about tests
18:45programmancerYeah, I actually saw that on the clojure Github repo.
18:45amalloyie, basically what brehaut just said
18:45programmancerIt looked very interesting.
18:46brehautprogrammancer: theres a great talk on generative testing from clojure/west 2014 by john hughes though he uses erlang
18:46programmancerThere's no "known wonkiness" with that?
18:46brehautprogrammancer: http://www.youtube.com/watch?v=zi0rHwfiX1Q
18:47amalloyprogrammancer: clojure's mocking support is...okay. midje goes kinda crazy adding more. it's better to build support for swappable implementations to begin with, eg with stuartsierra's component idea; and at that point clojure.test is fine - you don't really need any features more complicated than assert
18:47programmancerThanks, brehaut. I'll queue that up for tomorrow (Danish time is approaching bed time)
18:47akawonkiness is the worst
18:47koreth_The hard part with generative testing (sometimes prohibitively hard, IMO) is that you need to be able to programmatically specify what the correct output is. Sometimes that's easy and sometimes you practically end up doing a second implementation of the code under test.
18:47amalloyare all the clojure/west talks up already?
18:48stuartsierraamalloy: yes, Clojure on YouTube
18:48rasmustodanish time is the best time
18:48amalloystuartsierra: sweet. it's amazing they got this done so fast
18:49ianeslick|onvacaamalloy: it was done same day this time!
18:49bbloomamalloy: the videos were up within like ~12 hours, it was crazy
18:49stuartsierraamalloy: We paid $$$ to get same-day service from the videographers.
18:49brehautamalloy: some were up hours after the talk happened. its amazing
18:49brehautbloody lag
18:50amalloyyeah, i heard about some of the videos being up right away, but couldn't believe they were *all* up so decided it must be going up like one per day (even that would have been unbelievably fast)
18:50programmancerI now feel all kinds of excited about generative testing. I think I may have a regular addiction to new libraries.
18:50amalloykudos to everyone involved
18:51programmancerNot that generative testing is really a library.
18:51stuartsierraThanks due to Lynn Grogan and Alex Miller.
18:51brehautkoreth_: the hard part about non-generative testing is that its useless ;)
18:52akaI'm loving the clojure west talk videos.
18:52koreth_brehaut: That's quite a bold claim. Even John Hughes disagreed with that in his post-talk Q&A.
18:52bbloomkoreth_: his disagreement was kinda funny/subtle though...
18:52brehautkoreth_: note emoticons
18:53bbloomhe discussed a serialize/deserialize round-trip property and suggested that you could have that property while still being entirely useless
18:53bbloomsuggesting that you need some example tests just to constraint the program to actually do something useful while preserving the round trip prperty
18:54bbloomone big example with all the possible interesting serializable/deserializable entities would be sufficient to constrain the code to do something useful, then generative testing could do all the rest of the work from there
18:54rootexstuartsierra: does having the questions included in the videos cost more?
18:54bodie_anyone comfy with CIDER?
18:55brehaut~anyone
18:55clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
18:55stuartsierrarootex: I don't understand the question.
18:55bodie_I'm trying to do a substring history search in an attached repl.
18:55rasmustostuartsierra: I think he's talking about the Q&A after each session
18:55nopromptis anyone else seeing "ERROR: JSC_PARSE_ERROR. Parse error. syntax error at ..." with the newest version of cljs.
18:55bodie_however, every search I do matches against ^<search term>, so I'm not able to do substrings.
18:56bodie_example: "(definst foo ... " is a previously entered repl command.
18:56bodie_I want to do a reverse search on "efin" and match that entry.
18:57bodie_however, that's obviously not a clojure question, nor even an emacs question -- it's a plugin included in Emacs Live, which I guess is popular with some Clojure users.
18:57stuartsierraI had no part in actually hiring videographers, and I haven't watched the videos yet. I assume Q&A was included, but not all the talks had time for it. We ask speakers to repeat questions from the audience, but they often forget.
18:57bodie_so I wondered if anyone was familiar with that and willing to answer a somewhat verbose question before I dumped in here :)
18:57rasmustoThe talks that I watched ended with the applause, right before the q&a
18:59stuartsierraMore discussion about the Clojure/West videos https://groups.google.com/d/topic/clojure/NKrU3m-4HEo/discussion
19:00technomancyI remember some incredibly entitled whining about the schedule last time
19:00technomancynice to see they should be shut up this time
19:01bohfordlol whining??
19:01lazybotbohford: What are you, crazy? Of course not!
19:01rootexstuartsierra: yeah, what rasmusto said, I only watched 3 and they were cut off just before the Q&As
19:01brehautrootex: one of them i saw didnt cut off so its not a policy. i wonder if the presenters didnt all repeat questions or something making the Q+A useless on video?
19:02stuartsierraCould have been. Again, I don't know anything. :)
19:03stuartsierraQ&A at a talk tends to be pretty useless anyway. :)
19:03brehaut“its not so much a question as a statement…”
19:04amalloybrehaut: most of the presenters were pretty good about repeating the question. the only one i remember who wasn't was the keynote
19:05brehautamalloy: look at that; unfounded guessing turns out to be false
19:05amalloyi for one would never have guessed that
19:31perplexaA boy and a girl were sitting in a Java programming class together. He reached over and grabbed her breast. She said "Hey, that's private". He looked confused and said "I thought we were in the same class"
19:31brehautstay classy perplexa
19:31perplexa:)
19:33S11001001perplexa: No.
19:34antonvhi all
19:34bohfordyikes
19:34gtrak(dec perplexa)
19:34lazybot⇒ -1
19:35rasmusto,(pos? -1)
19:35clojurebotfalse
19:35antonvwhen code of the same namespace is distributed over several .clj source files, do you use (ns ... (require ...)) in every source file?
19:35S11001001antonv: absolutely
19:35rasmustoantonv: yep
19:35antonvthis means you must copy/paste dependency list in every file?
19:35gtrakantonv: wat? each clj file should be a separate namespace unless you know what you're doing.
19:35perplexawhat the heck is wrong with you guys :P
19:35S11001001antonv: the alternative is "spaghetti loading" and it's seriously confusing to read.
19:36justin_smithassumed you mean (ns ... (:require ...))
19:36perplexa(dec gtrak)
19:36lazybot⇒ 6
19:36perplexa;)
19:36rasmusto:use is really only OK for test namespaces and the like, where there's a 1:1 mapping
19:36technomancyperplexa: we're not like ... twelve?
19:36S11001001perplexa: As technomancy says.
19:36perplexaso humor is now an age thing, i see
19:36antonvgtrak: yes, that's what I assumed as alternative
19:36gtrakjust because some things are possible, it does not mean they should be done :-)
19:37S11001001antonv: as for the dependencies, I think if you're separating out functionality, then your files will work out to need very different sets of :requirements.
19:37antonvgtrak: well I often use one nanespase for whole the system
19:38turbofail"humor"
19:39brehaut(inc gtrak)
19:39lazybot⇒ 7
19:40coventryIs it really so bad to make actual-namespace.clj a series (load "file.clj")s like clojure.core does, if actual-namespace.clj would be unmanageably huge? Keeping the (ns) forms straight across the different files sounds potentially just as confusing.
19:40S11001001coventry: Yeah, it's so bad.
19:40amalloycoventry: putting the same code into N different files doesn't make it less unmanageably huge in any magical way
19:40antonvS11001001: well, yes, separate functionality pieces placed in these different files have different dependencies
19:40technomancycoventry: plus it breaks slamhound
19:41antonvbut as the dependencies are bound to namespace, and I wanted to use the same namespace...
19:41coventrytechnomancy: OK, that's compelling. :-)
19:41amalloytechnomancy, always keeping the big picture in mind
19:42technomancyI like to think of it as imperative vs declarative, though in fact require is still fairly imperative
19:42akawhoa gorilla repl is neat
19:42S11001001antonv: If you wish to present to your library's clients a convenience "everything" namespace, there are other approaches; under these, one-namespace-per-file is still preferred.
19:42coventry"One namespace for the whole system" sounds like the core problem here.
19:43antonvOK, guys, thanks for confirming
19:45antonvAlthoug, to ensure. Is it impossible to specify files load order in project.clj?
19:45antonvThen in the first file I would have (ns ... (require ...)) and in all the dependent files (in-ns ...)
19:46CapitalSigmahi all
19:46cbpCapitalSigma: hi
19:48amalloyantonv: files aren't loaded unless you ask for them
19:48amalloywhen you (require 'foo.core), the file foo/core.clj is loaded
19:48amalloyif it loads other files, that's its responsibility
19:50antonvamalloy: ah... thanks
19:51antonvamalloy: so I can say (ns foo (require depA debB)) in one file and (ns foo (require depC)) in another file...
19:51amalloyi guess? i mean, i'm not thrilled with this whole multi-file namespace, but obviously that is a thing you can do
19:51akurilinQuick question: those of you running serving SPAs from your ring apps, how do you handle templating in the .js assets? Do you build a middleware that checks if the request is for a .js file and then you just pass the file through something like Selmer with a basic map of common interpolations?
19:52antonvamalloy: on the other hand require loads files using namespace to resource mapping, based on naming convention...
19:52coventryantonv: If you want everything in one ns for ease of loading / repl access or something, you can do something like this: https://github.com/coventry/troncle/blob/master/src/troncle/traces.clj#L174
19:52antonvamalloy: so I will have problems loading code from my files, because namespace doesn't correspond to fill name...
19:53coventryantonv: ... and that way, you can use namespaces as intended elsewhere in your project.
19:53antonvcoventry: thanks for the link. No, I want namespace not for repl, but for easier coding....
19:54coventryantonv: Pretty sure you'll find that's a false economy as you go on.
19:54antonvcoventry: it's not economy, just a habbit
19:55antonvI just came from Common Lisp, it is usually done that way there and it is supported by system definition facility
19:55amalloycoventry: that doesn't look like a very good implementation, fwiw. try putting the following into troncle.traces: (let [x 1] (defn foo [] x))
19:55antonvBut I see now that leingen and clojure do not support this
19:55antonvOK
19:55antonvanother quick question
19:56antonvnevermind
19:56amalloyif you use intern instead of eval/def, you avoid the problem
19:57coventryThanks, amalloy. Good point.
19:57amalloyalso, coventry, while i'm in there: (swap! a (constantly x)) is just (reset! a x)
19:58antonvstill, quick question
19:58coventryYeah, I've learned that one since I wrote it.
19:58antonvI see the default in clojure is to create public functions
19:58CapitalSigmai'm learning clojure and i have a potentially stupid question -- what's the point of having both a cons and conj operation? is either optimized for a particular situation?
19:58antonvand only with special sign (the minus) the functions become private
19:58rasmustoCapitalSigma: conj is collection-agnostic
19:59amalloyCapitalSigma: cons always builds a linked list, conj adds to an existing collection based on its type
20:00rasmusto,(conj #{} 'a)
20:00clojurebot#{a}
20:00CapitalSigmaokay. is cons essentially a relic from lisp, then? i can't imagine why i would want to use a linked-list only function over a polymorphic one
20:00rasmusto,(cons 'a #{})
20:00clojurebot(a)
20:00hiredman,(doc cons)
20:00clojurebot"([x seq]); Returns a new seq where x is the first element and seq is the rest."
20:01hiredman(doesn't say anything about linked lists)
20:01cbpcons is for building seqs
20:01antonvdo you guys care to hide design public/private interfaces between all these namespaces?
20:01amalloyCapitalSigma: because linked lists are amazing
20:01technomancyantonv: metadata is one good way
20:01amalloyyou can build them and traverse them lazily, and they're cheap to put together
20:01hiredman~private
20:01clojurebotnot even once
20:01amalloy(inc clojurebot)
20:01lazybot⇒ 39
20:02bbloomwe need a word for "not private, but not promised"
20:02CapitalSigmaah, okay. the result of cons is guaranteed to be lazy? (sorry if this is basic -- i'm a former scheme-er going through the clojure koans)
20:02technomancybbloom: ^:internal is what I use
20:02cbpCapitalSigma: no you need to wrap it inside lazy-seq
20:02amalloythat's a good point, hiredman. i guess it's not really a whole linked list, it's like one node prepended to something that knows how to act like a list (ie, a seq)
20:02bbloomtechnomancy: but that has some java/c#-ish meaning
20:03bbloomCapitalSigma: clojure has interfaces/protocols for sequences. clojure.lang.Cons, clojure.lang.PersistentList, etc implement the clojure.lang.Seq interface, which has first/rest
20:03bbloomCapitalSigma: ... and so does clojure.lang.LazySeq
20:04CapitalSigmaokay. i'll start digging through the documentation then -- thank you
20:04bbloom~seqs
20:04clojurebotseqs is http://www.brainonfire.net/files/seqs-and-colls/main.html
20:04bbloomCapitalSigma: ^^ good reference
20:05CapitalSigmacool, thanks
20:06cbpCapitalSigma: (defn my-range [start] (lazy-seq (cons start (my-range (inc start))))) ; for an example
20:09antonvtechnomancy: hiredman: bbloom: I mean private as defn- does
20:09bbloomantonv: yeah, hiredman was suggesting not to bother
20:10bbloomantonv: technomancy and i were discussing the desire for "still private, but labeled as not part of the promised api"
20:10bbloomer i mean "still public, but..."
20:10technomancyantonv: the important thing is not that you prevent people from using your vars, but that you communicate that they're not part of a stable interface
20:11bbloomwell said
20:11technomancyso the difference between ^:private and ^:internal is not all that important
20:11technomancy(defn- is shorthand for ^:private)
20:13antonvtechnomancy: by private I mean not visible in the user namespace, after you clojure.core/refere the my namespace
20:14amalloyright, he's telling you not to care so much about that, antonv
20:14amalloyor suggesting it, anyway
20:14antonvOK
20:14antonvthanks
20:36akurilinDoes anyone know of an article/blog post/whatever out there explining the various options one has when wanting to share code across a few lein projects? It's my understanding that there's a sliding scale of how complex this can be made, from actually including the sources directly in each project to turning the shared code into separate .jar s
21:07brehautis nashorn going to be viable target for cljs in the future?
21:08hiredmanis it not one now?
21:08brehautwell, i dont know if anyone has pointed cljs at it yet
21:08brehauti guess thats what i really meant though isnt it
21:08chareso to get something of the effect of rails asset pipeline i do what in clojure?
21:23devnUncaught Error: No protocol method ReadPort.take! defined for type number: 23 hrm
21:23devnthis is core.async and cljs -- what am i doing wrong here i wonder?
21:25eggheadsounds like you are trying to: (<! 23)
21:27devnegghead: https://gist.github.com/devn/af570b702f68d31da704
21:28devnim taking this basically verbatim from http://swannodette.github.io/2013/07/12/communicating-sequential-processes/
21:29eggheadya nothing in that gist looks wrong
21:29devnI have a couple of go blocks putting onto c, and then i have a go block taking from c and logging
21:33amalloydevn: that error message looks like it's produced by code other than the code in your gist, really
21:37devnstrange business
21:38devnbecause that's it verbatim, no foolin'
21:39amalloyrestart your repl, restart your machine, reinstall your OS?
21:41arrdemamalloy: better zero your hard disk first
21:41arrdemamalloy: just to make sure no state persists
21:41RaynesBest to just replace it.
21:41arrdembetter nuke from orbit... it's the only way to be sure
21:41RaynesPotentially shift to an alternate universe as well.
21:41RaynesTo make sure all the bits are properly flipped.
21:42RaynesM-x butterfly only does one at a time.
21:42arrdemRaynes: I mean... the number of atoms in the universe is finite so we can just compute the inverse universe in O(N) time, right?
21:42arrdembetter. we can do O(1)!
21:47Frozenlockseancorfield: You mentioned wanting to do some massive changes to congomongo on the mailing list. Is this still planed? Should I wait a new version before starting something new on it?
21:51S11001001Raynes: thanks to you mentioning that, I took another look at M-x butterfly, to find that if you answer no to the confirmation, it sends you to the cartoon. Convenient built-in bookmark for that particular xkcd entry.
21:54brunovRaynes: hey. Thanks for Ororo, I've been using it these past days
21:54Raynes:D
21:55brunovkiller name
21:55brunovI added async support via httpkit in a fork, let me know if you'd be interested in such a change.
21:56RaynesI saw! Just hadn't gotten around to checking it out
21:56brunovyeah, I know how it goes. No rush.
21:56Raynesbrunov: So could you give me an elevator pitch of what this gains ororo?
21:56RaynesI'm unclear on what 'added async support' means
21:57brunovSure. So, with httpkit's asynchronous support, you don't block the caller whenever you do an HTTP request.
21:57brunovThe function returns a promise
21:57RaynesCan't you just call an existing Ororo function wrapped in a promise? :P
21:58RaynesI'm assuming that's too easy
21:59brunovyou could, but you'd have to manage the threads where those promises will have to be fulfilled though, right?
22:02brunovthe word is delivered, not fulfilled, hopefully the point came across though
22:02ivandang I can't unquote-splice one form into a key and value in a map
22:03Raynesbrunov: Do you by chance have an example that would demonstrate the issue?
22:03RaynesSorry if I'm being thick.
22:03ivanwell actually I can if I'm unquote-splicing an even number of things
22:03brunovNo, it's ok. And it's probably overkill for casual usage, since WUnderground's API is heavily throttled.
22:04brunovThere is no actual issue.
22:04brunovIt just so happens I just started a project that will leave our team to use one of the paid plans with higher limits
22:05RaynesWell if your team needs this feature then clearly it is important!
22:05brunovHaha, I wouldn't say 'need'.
22:05brunovWe 'need' food :)
22:05brunovwe don't 'need' async support in Ororo ;)
22:06brunovbasically I'm trying ot avoid blocking a full OS thread per concurrent call if I ever need to have, say, hundreds of concurrent pending requests
22:06brunovBtw, this is way harder to justify than I though.
22:06brunovthought, even
22:06S11001001brunov: maybe you could use the Norwegian Meteorological Institute's feed? http://api.met.no/#english :)
22:06RaynesI can't recommend anything except for wunderground.
22:06RaynesThey sent me swag for this library.
22:06brunovhahaha
22:07brunovS11001001: interesting, but I'm going to go with Raynes. It's pretty hard to beat their over 45k personal weather stations
22:07brunovwe're talking full world saturation here
22:07brunovto the moon, etc.
22:07Raynes$weather the moon
22:07Raynes$conditions the moon
22:07lazybotLast Updated on March 31, 11:00 PM BRT; Clear; Dewpoint: 77 F (25 C); Precipitation today: 0.00 in (0.0 mm); Temperature: 79 F (26 C); Windchill: NA; Wind speed: 0mph; Wind gust: 0mph; URL: http://www.wunderground.com/global/stations/82579.html.
22:07Rayneso_o
22:08RaynesDidn't see that coming.
22:08brunovhaha
22:08RaynesSo the moon is in Brazil I see.
22:08RaynesExciting.
22:08Raynes(funfact: lazybot's conditions plugin is so smart it does not account for spaces in place names)
22:10brunovwho needs spaces
22:23Foxboron25 celsius on the moon?
22:23FoxboronWell boys, summer have to arrive the moon at one point
22:23Foxboronat the moon*
22:44rootexwhat is the meaning of doing #_defn ?
22:44rootexerr #_(defn ...
22:44brehaut#_ skipps the next form
22:44brehautwhile reading
22:45rootexoh ok
22:45brehaut,[:a #_ :b :c]
22:45clojurebot[:a :c]
22:45brehaut,[:a (comment :b) :c]
22:45clojurebot[:a nil :c]
22:46rootexyeah, forgot about that comment thing
22:47rootex'form-level' comment
22:49charehow is apply implemented?
22:51amalloychare: from clojure's point of view it's a language primitive, one that you couldn't implement without already having apply. are you interested in how it's implemented deep in the java guts of the compiler?
22:51rootexchare: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L619
22:51chareamalloy does that mean it counts as a special form?
22:51amalloyno, it's an actual function that you can pass to other functions
22:52amalloykinda like +. it's a function, but it's also a primitive
22:52charerootex does that mean applyTo is the one thats a primitive
22:52rootexamalloy: what about clojure.core/apply ?
22:53amalloythat's the function we're discussing, rootex. i mean, yes, obviously from one point of view that's a function implemented in clojure. but really it's just delegating to some java stuff
22:53charewhat is applyTo?
22:54amalloychare: when you define a function, with fn or defn or whatever, that creates an implementation of the java interface clojure.lang.IFn
22:54amalloya method of that interface is applyTo
22:54amalloywhich says "someone is trying to call this function, here is a list of the args they want to pass"
22:55amalloyso fn and defn implement applyTo for you in a way that dispatches to the right arity of your function, binds the appropriate variables, etcv
23:00rootexamalloy: is that a performance optimization? the multiple arities in the definition of apply
23:01amalloyyeah. clojure.core is full of nonsense like that
23:01rootexk
23:05rootexamalloy: so functions compile down to classes?
23:07rootexsince you said fn or defn implements IFn
23:08rootexit most create a class to implement its methods
23:08amalloyi mean, this is the jvm. everything is a class at some point
23:10rootexamalloy: yeah, was wondering if each function has a class of its own or if they are all under some class per namespace or something
23:10amalloyeach fn form compliles to a new class, with a method for each arity it supports. every fn object is an instantiation of that class
23:11rootexthanks
23:20arrdemanyone want an Atom code? I don't have a use for mine...
23:21rootexarrdem: you requested one?
23:22arrdemrootex: I expected them to not be reatarded and have a Linux build
23:22rootex:)
23:25gwzhey, is it possible to check in a if statement that a type is cons, is there anything like (if (cons? item)...
23:28amalloygwz: seq?
23:28gwzyes
23:31todd__there is not a lot of chatting here
23:56charehow do i use a namespace a second on repl after changing the code