#clojure logs

2013-08-02

00:04mullrI'm having trouble with lein-cljsbuild and crossovers and would greatly appreciate another pair of eyes of somebody has a moment. I'm trying to use a clojure library in clojurescript; I'm fairly certain it's all valid clojurescript code, but I've done something wrong with the macro setup. The code and error at hand is here: https://www.refheap.com/17097
00:06tolstoymullr: Does the file end in .cljs?
00:06mullrMy own source file does, yes.
00:08amalloymullr: the/parsatron isn't a valid namespace name
00:08amalloyyou mean the.parsatron
00:12mullramalloy: right you are. Fixing that require gives me a whole mess of "undeclared Var" warnings. Even when using crossovers, do you need to separate the macros into another file?
00:13amalloy*shrug*
00:13mullr:) ok, thanks
01:09clj_newb_2345on a high level, in enlive, wahat is the relation of a snippet / a template ?
01:10brehautclj_newb_2345: basically a template is a snippet that outputs a seq of strings, whereas a snippet returns a structured document fragment
02:22futilei half want to buy typednil.com
02:22futilebecause computer science is kind of idiotic sometimes
04:09futilewhich json lib is best?
04:10supersymi like cheshire
04:10futileok
04:11futiletried data.json?
04:11supersymbarely
04:11supersymhavent needed it much
04:12futileah
04:12futilethx
04:13xsynI've also been using chesire
04:17futilethis line takes a really long time: (use 'lamina.core 'aleph.tcp 'gloss.core)
04:17futilei spose nothing i can do about that
04:20futilejust made my alert pop up from Clojure.. https://github.com/sdegutis/dotfiles/blob/master/home/zephyros/src/zephyros/core.clj
04:20futileyay
04:30laurentpetitHello
04:46supersymbonjour
04:49endousupersym: Salut
05:28laurentpetitbien le bonjour :)
05:29laurentpetitclgv: hello
05:29clgvlaurentpetit: good morning
05:29clgvlaurentpetit: I tried the beta on wednesday evening
05:30clgvlaurentpetit: the auto-identation when editing seemed fine in a 10min test. but the REPL behaved pretty weird
05:30laurentpetitclgv: it had some interesting bugs, hadn't it ? :-) I've fixed some more yesterday, as well as added support for "raise over" (alt + r)
05:30laurentpetithmm
05:31laurentpetitclgv: maybe I haven't tested enough in the REPL. I've fixed issues with paredit commands interactions recently, maybe this helps
05:31laurentpetitclgv: what do you mean by "behaved pretty weird" ?
05:32clgv laurentpetit: when defining a function in REPL, I got the feedback output that the symbol is defined more than 10 times ...
05:32jonasenJohn Carmack discussing functional programming, haskell and lisp: http://www.youtube.com/watch?v=1PhArSujR_A#t=02m05s
05:32jonasenvery interesting IMO
05:32clgvsimilarly for an exception in that case
05:32laurentpetitclgv: ?
05:33clgvlaurentpetit: (defn f [x] (+ x x)) -> Output: #'user/f \n #'user/f \n #'user/f \n #'user/f \n #'user/f \n #'user/f \n #'user/f \n #'user/f \n #'user/f \n
05:33laurentpetitoh, real weird indeed :)
05:33clgv"\n" is only used to show newlines of the repl window
05:34clgvyou updated the beta release?
05:34clgvI could check if it is still present
05:35laurentpetityeah I updated late yesterday's evening
05:36laurentpetitclgv: I fixed a fair amount of issues, refactored the code base (more in paredit.clj, less in Eclipse), added unit tests, etc.
05:37clgvlaurentpetit: is there a link for standalone versions of the beta releases?
05:38laurentpetityeah
05:38laurentpetiteach build creates an update site, and 5 standalone versions. You find the individual builds and update sites, per branch, per travis build, as such:
05:39laurentpetithttp://updatesite.ccw-ide.org/branch/<branch-name>/<branch-name>-travis<padded-travis-build-number>-git<git-commit-sha1>/
05:39laurentpetite.g. for the latest build, the update site is:
05:39laurentpetithttp://updatesite.ccw-ide.org/branch/master/master-travis000120-git7f18a374a4a23e167295614c94fba12282186f3f/
05:40laurentpetitand you find the products in a subdirectory:
05:40laurentpetithttp://updatesite.ccw-ide.org/branch/master/master-travis000120-git7f18a374a4a23e167295614c94fba12282186f3f/products/
05:41laurentpetitin the "beta" software update site, I then just use the existing "redirect" feature of eclipse software update sites which points to the several individual build-commit updatesites
05:41laurentpetitI have updated the "beta" software update site, look :
05:41clgvoh ok. I tried to navigate beta to find the standalone
05:41laurentpetithttp://updatesite.ccw-ide.org/beta/compositeContent.xml
05:42laurentpetit"beta" update site is a "composite" update site: it references other update sites it is composed of
05:42laurentpetitsame for stable
05:43clgvok. so always checking for newest master then^^
05:43laurentpetit"beta" is only updated manually. So when you use beta, you only get what I've reviewed.
05:44laurentpetitIf you want the bleeding edge from master, simply point to http://updatesite.ccw-ide.org/branch/master
05:44laurentpetitIt's also a composite repository. Each new build of the master branch updates it with the latest build
05:44laurentpetitBut I don't recommend following master. It may be broken. it's fully automated.
05:45laurentpetitI recommend beta
06:02hyPiRionhum.
06:02hyPiRionhttp://en.wikipedia.org/wiki/Marshalling_(computer_science)
06:02hyPiRion[Marshalling] simplifies complex communication, using custom/complex objects to communicate instead of primitives.
06:10ucballegedly, yes.
06:38clgvlaurentpetit: oh the ccw products have no top level folder in the archive...
06:41clgvlaurentpetit: ok. the REPL bug does not occur on the latest master product...
06:55gavrigiven a list, how do I find the most frequent element in it?
06:56gavri"frequencies" gives me a map mapping each unique element to its frequency in the list
06:56gavribut I'm at a loss for how to pick the key from this map that has the highest value
06:56gavriI mean, I could do it iteratively
06:56gavribut I'm trying to do it the clojure way
06:59ucbgavri: if it's a map you can use sort-by
06:59ucb,(doc sort-by)
06:59clojurebot"([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator. If coll is a Java array, it will be modified. To avoid this, sort a copy of the array."
07:00gavriif I call min or max after the sort, would it skip the sort?
07:00gavriI guess I'm asking if clojure is lazy in this case
07:00Anderkentno need to sort it if you only need to extract the max value. Just do reduce-kv on the frequencies
07:01gavrithanks, Anderkent
07:01ucbreduce was going to be my next suggestion :)
07:03Anderkentactualyl it's a little less verbose with reduce than reduce-kv
07:03Anderkent&(reduce (fn find-most-frequent [[old-k old-v :as old] [k v :as new]] (if (> v old-v) new old)) (frequencies [:a :a :b :b :b :b :c :d :e :f]))
07:03lazybot⇒ [:b 4]
07:03Anderkentstill a bit on the long side, but w/e :P
07:04ucbheh
07:04Anderkent(there's probably some composition of basic functions you could use instead of the (fn ..) but it's not coming to me right now
07:14supersymSLF4J: Class path contains multiple SLF4J bindings.
07:14supersymanyone know how I can fix that? log4j is driving me nuts
07:15supersym"The warning emitted by SLF4J is just that, a warning." no its not...it breaks my build :S
07:18supersymremoval of log4j fixed it :P
07:22gavrithanks, Anderkent and ucb
07:22ucbyw
07:27TEttinger,(let [freqs (frequencies [:a :a :b :b :b :b :c :d :e :f])] ((max (keys freqs)) freqs)
07:28clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
07:28TEttinger,(let [freqs (frequencies [:a :a :b :b :b :b :c :d :e :f])] ((max (keys freqs)) freqs))
07:28clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.APersistentMap$KeySeq cannot be cast to clojure.lang.IFn>
07:28TEttingerhm
07:28laurentpetitclgv: yeah, sorry no top level, that's the way maven tycho does things. I also find it weird, and will definitely try again to fix this
07:29laurentpetitclgv: re. REPL bug : (whee)
07:29hyPiRionTEttinger: (max (keys freqs)) ?
07:29clgvlaurentpetit: I hope the REPL bug is not specific to my home env. otherwise I need to clean that mess up^^
07:29TEttingerhyPiRion, I think I had keys and vals reversed
07:30clgvlaurentpetit: back from lunch right now? ;)
07:30hyPiRionTEttinger: still, ##(max [1 2]) is not what you want :)
07:30lazybot⇒ [1 2]
07:31hyPiRion,(let [freqs (frequencies [:a :a :b :b :b :b :c :d :e :f])] (apply max-key val freqs))
07:31clojurebot[:b 4]
07:31TEttingerright thanks
07:31iartarisidoes anyone know if it's possible to "mock" several interactions in the same expectation using the "expectations" library?
07:31TEttingergavri: take a look at hyPiRion's implementation
07:32laurentpetitclgv: plain right :)
07:33clgvlaurentpetit: in our departement we got to launch early at 11:30 ;)
07:33laurentpetitclgv: so, how does the autoshift feature look to you? "weird" ? "interesting"? "wouldn't have noticed"?
07:33gavrihyPiRion and TEttinger, thanks
07:33hyPiRionno problem
07:34TEttingernp
07:34clgvlaurentpetit: I definitely noticed it. is it intended not to work with SHIFT+TAB?
07:35clgvlaurentpetit: try SHIFT+TAB, TAB, SHIFT+TAB, TAB, ....
07:36laurentpetitclgv: the way I've "plugged" autoshift "misses" some editing commands
07:36laurentpetiteg it also does not notice suppr (as opposed to backspace) or Paste
07:37laurentpetitI'll have to improve that
07:37clgvah ok. so that's a temporary limitation
07:38laurentpetitclgv: yeah
07:39clgvlaurentpetit: another thought: I'd love to have something like seesaw for eclipse' SWT
07:39clgvlaurentpetit: what about you?
07:39laurentpetitclgv: are you doing a lot of SWT / Eclipse based development?
07:39laurentpetitclgv: yeah, me too. I've even made some false starts in this area.
07:40clgvlaurentpetit: no I tried a few dialogues but stayed with swing Swing+seesaw
07:41clgvlaurentpetit: most of the time I build only small visualizations with some interaction for param selection or such...
07:42laurentpetitclgv: I've started an experimental swt support in the lein branch, which is used to display the "generic lein launcher" popup:
07:42laurentpetithttps://github.com/laurentpetit/ccw/blob/lein/ccw.core/src/clj/ccw/util/swt.clj
07:43laurentpetita thin clojure-like wrapper over FormLayout
07:43gavritrying to figure out how 'apply' works. it seems to work here like 'fold', but the documentation for apply makes it out to be a function that represents function application :-/
07:43hyPiRiongavri: (apply f x y z) is more or less like (f x y z)
07:44clgvlaurentpetit: maybe we need a student project about extending seesaw semantics to swt - should be possible right?
07:44laurentpetitclgv: you create your widget tree with a mix of pure data structure representations and objects, then pass it to a function which will "reify" it into widgets
07:44hyPiRiongavri: wait no, I am just joking
07:44hyPiRiongavri: (apply f [x y z]) is more or less like (f x y z). (I forgot the list/vector)
07:45gavrilike apply in JS then?
07:45hyPiRionalmost, I believe
07:45TEttinger,(+ [1 2 3]) ; doesn't work
07:45clojurebot#<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number>
07:45hyPiRion(apply f a [x y z]) => (f a x y z), (apply f a b c [x y z]) => (f a b c x y z)
07:45TEttinger,(apply + [1 2 3]) ; treats the sequence as args
07:45clojurebot6
07:45laurentpetitclgv: maybe we could directly jump to using core.async :)
07:45gavrik, got it
07:46clgvlaurentpetit: hard context switch in this discussion? ;)
07:46gavriso the 'reduce' part is in max-key, I guess
07:46jtoyi have map with 28k keys in it , I then run dissoc on it with about 200 keys, it is taking 10 of minutes to complete, i know the map is kind of large, but still, shouldnt this be near instance as these are maps and not arrays?
07:48gavrigot it. read up on max-key
07:48gavrithanks, everyone
07:49gavrijust curious about why max-key only compares numbers as mentioned here http://clojuredocs.org/clojure_core/clojure.core/max-key
07:49gavriwhy couldn't it be a generic method that uses the 'less than' function?
07:50gavrigeneric function, I mean
07:51gavrialso, another dumb question. why doesn't max-key accept a list instead of a variable list of arguments? is that the recommended way to create functions in clojure?
07:53babilenjtoy: running it on a transient might speed things up.
07:53TEttingergavri: variable lists of arguments become a seq IIRC. like when you have (fn [& args] (str (first args) (second args)))
07:53hyPiRiongavri: well, that number may be derived from a comparator. As to why it's a variable list of arguments, I have no idea. It doesn't make much sense to me either.
07:54babilenjtoy: You would then, naturally, have to run dissoc!
07:55hyPiRionjtoy: I just checked it here, generating AND dissocing took less than 0.1 seconds.
07:55TEttingergavri, the example here shows why it needs to be a number, and how you can still use max-key on things that aren't numbers. http://clojuredocs.org/clojure_core/clojure.core/max-key
07:56TEttingerit's (k x) that needs to be a number, not x, is the important thing
07:57hyPiRion,(let [m [{:foo "beta"} {:foo "gamma"} {:foo "alpha"}]] (apply max-key (comp comparator :foo) m))
07:57clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$comparator$fn__4295 cannot be cast to java.lang.Number>
07:58hyPiRionoh dang. hurm.
07:58jtoyhyPiRion: I am narrowing down the specific piece of code , i havent done performance issues, not sure if there is a better way than hrowing in println everywhere
07:58jtoyyeah, the dissoc seems fine
07:59TEttingerhyPiRion, it seems that max-key doesn't use any 2-arg function
07:59TEttingerso compare wouldn't work
08:00TEttingerI mean, it's silly but
08:00hyPiRionTEttinger: yeah, I realized that. Just wondered how you'd get the maximal value based upon some comparator function
08:00hyPiRion(realized that in hindsight, mind you)
08:00TEttinger,(let [m [{:foo "beta"} {:foo "gamma"} {:foo "alpha"}]] (apply max-key #(read-string (str "36r"(:foo %))) m))
08:00clojurebot{:foo "gamma"}
08:01TEttingerthat's a fluke for now
08:02hyPiRionIt's not always possible, nor practical, to convert "elements" to numbers.
08:08TEttinger,(let [m [{:foo "beta"} {:foo "grammar"} {:foo "zalpha"}]] (apply max-key #(read-string (clojure.string/replace (format "36r%-10s" (:foo %)) " " "0")) m))
08:08clojurebot{:foo "zalpha"}
08:09TEttingerz is max, it goes first
08:09TEttinger,(let [m [{:foo "zeta"} {:foo "grammar"} {:foo "zalpha"}]] (apply max-key #(read-string (clojure.string/replace (format "36r%-10s" (:foo %)) " " "0")) m))
08:09clojurebot{:foo "zeta"}
08:09TEttingerze goes before za nice
08:09TEttingererr
08:09TEttingerafter, since this is max
08:10TEttingerthis is the most hackish code I've written in a while
08:10jtoyhyPiRion: It seems the apply map is really slow, are there any quick things I can do to speed this up: (apply * (map #(- 1 (/ % all_klass_docs_count) ) (vals (apply dissoc big-hash-map documents))))
08:11hyPiRionjtoy: aha
08:11hyPiRionyeah, wrap % in a double
08:12hyPiRionyou're generating very large fractions
08:12TEttinger(double %)
08:12hyPiRion,(reduce * (map / (range 1 30)))
08:12clojurebot1/8841761993739701954543616000000
08:12hyPiRion,(reduce * (map / (range 1 100)))
08:12clojurebot1/933262154439441526816992388562667004907159682643816214685929638952175999932299156089414639761565182862536979208272237582511852109168640000000000000000000000
08:12hyPiRionetc
08:12TEttinger,(reduce * (map / (range 1.0 100.0)))
08:13clojurebot1.071510288125466E-156
08:13jtoyok, im testing that now
08:13jtoywow, that makes it nearly instantaneuos
08:13hyPiRionit should be blazingly fast compared to the fractions
08:13hyPiRionyeah
08:13TEttingerhyPiRion, you're on fire today!
08:13TEttingernice work
08:13jtoyhyPiRion: extremely appreciate it, had no idea how to deal with that
08:14ro_stgosh, what did i miss?
08:14TEttingerro_st, hyPiRion solved a bunch of challenging problems people asked
08:14ro_stnice!
08:15TEttingerI wrote some code that sorts words...
08:15ro_sthey, so, what does everyone use in lieu of clojuredocs.org now that it's 2 versions old?
08:15TEttingerclojuredocs.org
08:15hyPiRionjtoy: no problem. I've been there myself with the fractions. They seem innocent at first, but they really turn nasty when multiplying.
08:15TEttingerit's still the best
08:15ro_stthat's a pity. i wonder why it hasnt been updated?
08:15jtoyro_st: tht annoys me, its because its comes on for 1st item on google
08:17hyPiRionThe main problem is probably the fact that clojuredocs.org is... a Ruby on Rails project. Clojure developers prefer to contribute to Clojure projects, I guess.
08:17TEttingerhttps://github.com/zk/clojuredocs
08:17hyPiRionAlso, speaking for myself, I don't know Ruby and don't currently have a need for it.
08:17ro_st:-o
08:18hyPiRion(I got Clojure!)
08:18ro_stdidn't know that!
09:07winkI would suppose the amount of ruby/rails knowledge needed pales in comparison to the work/knowledge needed to get the content for 1.5 in there
09:08winkthat said, I'd gladly help if we could field some plan how to update :) (i.e. find out what needs to be done first)
09:09puredangerThere was a lot of discussion about it at last years conj but there is a fair bit of work to do apparently
09:10puredangerI cant remember the guy that was working on it but he pops up occasionally
09:11puredangerHe has all the raw data and was working on whether and how to support multi versions
09:12tbaldridgepuredanger: yeah I talked to him at the last conj...he works for sonian, I know some people who work there. I'll see if I can dig up his name
09:15mdrogalisSpeaking of which, is there a timeline set for when the c
09:15mdrogalisConj speakers get picked?*
09:15puredangertbaldridge: Thx would like to be in touch with him
09:16puredangermdrogalis: It is in work, not sure when it will be done
09:16mdrogalispuredanger: Ok :)
09:16puredangerHoping soonish but everyone is busy
09:17mdrogalisSame problem everywhere. Vacation season.
09:18puredangerBtw, jira and confluence login are working again
09:19mdrogalisI wonder why the DNS change made it hiccup.
09:20stuartsierraChanged IP addresses and firewall rules on the auth server.
09:20mdrogalisThat'll do it.
09:32ToBeReplacedtbaldridge: would you be willing to elaborate on the differences between rpc and data in the google group thread?
09:33tbaldridgeToBeReplaced: sure, give me a sec
09:35logicalguyHi, anybody running clojure on a Gentoo machine?
09:35ToBeReplacedtbaldrige: at your leisure, of course -- i'm not sure i'm totally with you on what the better alternatives are to RPC, so i'd find it very helpful
09:36winklogicalguy: is there a problem? :)
09:36logicalguyclojure fails to emerge on my Gentoo machine because it cannot find a file named libcups.so.2
09:36tbaldridgeToBeReplaced: are you familiar with Joe Armstrong's thesis? (he's one of the creators of Erlang)
09:37mdrogalistbaldridge & ToBeReplaced: Gooood paper. Worth multiple reads.
09:38winklogicalguy: hm, got no gentoo vm flyin round, but that's a bit odd
09:38ToBeReplacedyes
09:39winklogicalguy: short of a failed packaging I suppose you'd find better help in a gentoo channel, sounds like dependency problem (java) to me
09:39logicalguyI did a search on my second machine, there is a libcups.so.2 in /usr/lib32 which is part of the emul-linux-x86-baselibs package, and another one in /usr/lib64 which belongs to CUPS. I'm wondering which package I need to install?
09:40ToBeReplacedtbaldridge: mdrogalis: i wouldn't say that I fully grokked it, need to reread when i have many hours to spare
09:40logicalguyyes, maybe I should ask there, wink. Thanks.
09:41mdrogalisToBeReplaced: Fortunately it's not as long as it looks, since the last 100 pages are references. :)
10:08ToBeReplacedtbaldridge: thanks :)
10:08chrisrossiI'm trying to understand some behavior with clojure.test.
10:09chrisrossiI have a test defined that uses with-redefs-fn to redefine a function that sleeps for timing purposes to be a noop during unit testing.
10:09chrisrossiWhat I'm observing is my test gets executed twice, once with the redefinition, once without.
10:09chrisrossiDeos this sound familiar to anyone?
10:09chrisrossis/Deos/Does/
10:12stuartsierrachrisrossi: Are you calling one `deftest` function inside another?
10:12chrisrossino.
10:13stuartsierraThen I have nothing, I'm afraid.
10:13chrisrossiactually, i do have this macro that i cargo culted that might be the culprit. with-private-fns
10:14chrisrossii'll get rid of that and see if that fixes it.
10:16chrisrossinope same behavior.
10:16chrisrossiBasic structure is:
10:17chrisrossi(with-redefs-fn ...
10:17chrisrossi (deftest ...
10:17chrisrossi (testing ...)))
10:17stuartsierraYou can't wrap `deftest` like that.
10:18chrisrossiah, ok.
10:18chrisrossiswap levels of with-redefs-fn and deftest then.
10:19chrisrossiwell, only runs once now, but the redef doesn't work. ;)
10:27chrisrossiok, figured that one out, too. with-redefs-fn takes a fn not a body. ;)
10:27chrisrossithanks for the help.
10:29mdrogalisstuartsierra: Curious: Why is it invoked twice with an outter with-defs?
10:29stuartsierramdrogalis: no idea
10:30mdrogalis:P
10:30chrisrossiundefined behavior is undefined.
10:30stuartsierrachrisrossi: There's a macro `with-redefs` that takes a body.
10:31chrisrossiah, ok.
10:31senorflor(inc 41)
10:31lazybot⇒ 1
10:32mdrogalisAhhh. I just had someone tell me that MongoDB is functional and Lispy because its represented as maps. Orthogonal is the word I'm looking to respond with, I think..
10:32chrisrossihmm, with-redefs takes it back to not working again...
10:32senorflorfoiled again.
10:43ToBeReplacedwhat is the advantage of using core.contracts' defconstrainedfn over a {:pre [] :post} map?
10:55residentsummer1 hello
10:55residentsummer1who can tell me, what does this mean?
10:55residentsummer1CompilerException clojure.lang.ArityException: Wrong number of args (-1) passed to: db$eval3064$unhex, compiling:(sandbox/db.clj:65:9)
10:56residentsummer1how args number can be negative?!
10:56residentsummer1Yes, I'm messing with macros
10:56Anderkentresidentsummer1: that's a bug in the compiler. I can explain how it happens, if you like, but basically you're not passing enough args to macroes
10:57residentsummer1I'll give you some definitions of my macros
10:57AnderkentI remember debugging it once before so if I can dig out my old chat logs I can find that
10:57Anderkentbut basically
10:57residentsummer1 (defmacro unhex [fs]
10:57residentsummer1 `(apply-sqlfn :UNHEX ~hexable ~fs))
10:57residentsummer1 (defmacro my-where [q spec]
10:57residentsummer1 (let [unhexed (unhex spec)]
10:57residentsummer1 (println unhexed)
10:57residentsummer1 `(where ~q ~unhexed)))
10:58residentsummer1compiler complains about line with "let"
10:59Anderkentresidentsummer1: http://clojure-log.n01se.net/date/2013-05-31.html , ctrl+f 'ArityException'
10:59residentsummer1Thanks! I'll look into it
11:00Anderkentbasically because of double macroexpansion the compiler is 'correcting' for the count of args to a macro twice
11:00Anderkent(correcting i.e. substracting 2 from actually provided, because each macro is provided 2 default args that are hidden from the programmer)
11:00Anderkentbut because it does it twice instead of just once, it gives you -1 instead of 1
11:00residentsummer1uh-oh
11:00residentsummer1that's bad :(
11:01Anderkentit's just an error message bug
11:01Anderkentwhat's ~hexable in your code?
11:01residentsummer1it's vector of keys
11:02residentsummer1somewhere upper there is a "let" that defines it
11:03Anderkentright. Nesting defs in other structures is bad practice in general, you'd be better off doing (def :^private hexable [something]) or just taking it as arg. But I suppose that's unrelated
11:03Anderkentcan you post your code to refheap so that I could run it locally and try to debug it?
11:04residentsummer1So, is it a bug in my code, or I just triggered incorrect behaviour of compiler?
11:04residentsummer1no probs
11:04Anderkentyeah, there *is* a bug, the bug in compiler is just in counting args for the error message
11:05AnderkentI'd expect the apply-sqlfn to be slightly wrong
11:06residentsummer1I guess it's totally wrong :) (that what i think, when I look at this macro)
11:10residentsummer1Anderkent: here it is https://www.refheap.com/17152
11:11residentsummer1Anderkent: there are some unrelated stuff, also (api- and db-keys)
11:13futilewhy does `lein run` say "No :main namespace specified in project.clj." when i have ":main foobar.core" in project.clj?
11:13gworley3i have a question that isn't clojure specific, but could apply to any functional programming language. as i get deeper into using clojure, i'm running into some limitation on my knowledge of functional design patterns since all the lisp programming i did was in college before i had experience as a software engineer. i have functions that all seem to receive the same several arguments to pass around "global" state. none of these values ch
11:13gworley3during execution, though, but are set at runtime. since it's annoying to have to go through and change every one of these functions when i need to add new variable to track in the "global" state, what's the usual way you guys would handle this to avoid having to constantly modify code just to pass around another variable that only a few functions actually need?
11:14futilegworley3: i would just (def) them at the top level of the file
11:14futileassuming all the fns are in one file
11:14tolstoygworley3: Use a map instead?
11:14futiledef'ing global state is appropriate for never-changing configs
11:14futileyeah, and put it in a map
11:15gworley3futile: that would work, except these are set based on user set values at start time
11:16gworley3tolstoy: so is it normal to pass around a map to all your functions for that purpose to keep track of state?
11:16gworley3i just want to try to follow the normal design pattern here rather than reinventing the wheel
11:16tolstoygworley3: I think so. I do a lot of (defn make-state [] {:conn this :blah that})
11:17futilegworley3: you can change the def in your entry-point (main) function
11:17futilevar-alter-root! or something
11:17futile,var-alter-root!
11:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: var-alter-root! in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:17tolstoyThen (defn some-fn [state param1 p2] (assoc state :blah (new val))).
11:17futile,(doc alter-root-var!)
11:17clojurebotexcusez-moi
11:18tolstoygworley3: I've seen that pattern in a lot of libs.
11:18ystaelfutile: it's alter-var-root! but often i use a ref or atom instead
11:18racyclegworley3: Check out this excellent talk by Stuart Sierra http://www.infoq.com/presentations/Clojure-Large-scale-patterns-techniques
11:18gworley3racycle: okay, will do
11:18futileystael: that makes sense for data that will change, but for immutable data this seems better
11:18futileimo
11:19futileso, anyone know about this lein problem?
11:19ystaelfutile: paste your project.clj?
11:20futilehttps://www.refheap.com/17153
11:20futilere ystael
11:20gworley3tolstoy: futile: thanks. i think i'll take a crack at passing around a map to keep track of this state
11:21tolstoygworley3: I think there's some semantics to the idea.
11:21residentsummer1futile: according to example project.clj
11:21tolstoygworley3: For instance, with a database, you pass "the database" around as a param. (The fact that it's really a connection spec, or connection object, is just impl details.)
11:21residentsummer1futile:;; The -main function in this namespace will be run at launch
11:21residentsummer1  ;; (either via `lein run` or from an uberjar). It should be variadic:
11:21residentsummer1  ;;
11:21residentsummer1  ;; (ns my.service.runner
11:21residentsummer1  ;; (:gen-class))
11:21residentsummer1  ;;
11:21residentsummer1  ;; (defn -main
11:21residentsummer1  ;; "Application entry point"
11:21residentsummer1  ;; [& args]
11:21residentsummer1  ;; (comment Do app initialization here))
11:21residentsummer1  :main my.service.runner
11:22futileWHOA
11:22residentsummer1futile: here is the link https://github.com/technomancy/leiningen/blob/master/sample.project.clj
11:22futilei have zephyros.core namespace in src/zephyros/core.clj which has a -main function
11:22futileso i meet those criteria
11:22residentsummer1a lot of interesting stuff there
11:22residentsummer1hm
11:23IamDrowsyfutile: are you sure you running lein inside the project folder?
11:23ystaelfutile: and - super dumb question - leiningen has the right idea about what your source path is?
11:23tbaldridgednolen: ping
11:23dnolentbaldridge: pong
11:23futileIamDrowsy: yes
11:23futileystael: as long as it defaults to src/, yes
11:23futileits this: https://github.com/sdegutis/dotfiles/tree/master/home/zephyros
11:23futileim in that dir, and i run `lein run`
11:23tbaldridgednolen: for this core.async bug with &env. Am I correct in assuming that you only test the existence of the key? Do you actually use the value?
11:24residentsummer1futile: and the last try, does adding :gen-class helps?
11:24futileoh now it works, but only if i add :main to project.clj
11:24dnolenwell use the value in the sense of use the local in the expanded code
11:24futilethanks guys
11:24futilesweet i just controlled my mac windows using clojure
11:25residentsummer1futile: wow!
11:25tbaldridgednolen: right, so in CLJ the value would be a instance of LocalVariable (or whatever class the compiler uses). Do you do anything with that value, or just assert that it exists in env?
11:25residentsummer1futile: how did you do that?
11:25futileresidentsummer1: are you on mac?
11:25residentsummer1yep
11:25futilehere:
11:25futilehttps://github.com/sdegutis/zephyros
11:25futilethe version on HEAD is controlled via a small TCP language
11:26futilelang described here: https://github.com/sdegutis/zephyros/issues/14#issuecomment-21966253
11:26futileexample app here: https://github.com/sdegutis/dotfiles/blob/master/home/zephyros/src/zephyros/core.clj
11:26residentsummer1now I use slate with home-made js config
11:26futileresidentsummer1: oh, can you help me make a node.js client for zeph?
11:27residentsummer1thanks for that! I'll try it out!
11:27futileresidentsummer1: the stable version of Zeph comes with built-in JS/CoffeeScript support, if you wanna try tat out
11:27dnolentbaldridge: what do you mean by "do anything" ?
11:27futile*that
11:27residentsummer1I'm afraid I'm not a js guru, used it only because it was the only option :(
11:28futileresidentsummer1: the latest stable version also has Ruby 2.0 support
11:28futileresidentsummer1: and HEAD has preliminary Go (and soon Clojure) support
11:28tbaldridgednolen: Well here's the deal, I can make (get &env 'x) return :a-value, but I can't really go and generate an instance of clojure.lang.Compiler.LocalBinding, is that going to be enough?
11:28tbaldridgeI can make your example test pass, I just can't fully duplicate the behavior of the compiler.
11:29residentsummer1futile: from all the languages on the gh page I now python, js (a lil bit) and learning clojure
11:30residentsummer1oh, and lil lua, because of awesome-wm
11:31futileresidentsummer1: ah then maybe you can help me port this to python :)
11:31futileresidentsummer1: i was struggling to make a tcp client in twisted
11:31futileresidentsummer1: if you're interested in helping (short or long term), feel free to come to #zephyros
11:33residentsummer1futile: ok, I'll can invest some spare time, cos i'm tired of cmd-tabbing :)
11:33futile:)
11:39futileHow do you create a string from a sequence of Integers?
11:40IamDrowsy,(apply str [1 2 3 4 5])
11:40clojurebot"12345"
11:40futileOh, I need to convert the ints to Character first
11:40futileoops :)
11:40residentsummer(clojure.string/join " " [1 2 3])
11:41IamDrowsy,(apply str (map char [97 98 99]))
11:41clojurebot"abc"
11:41IamDrowsylike this?
11:42futileIamDrowsy: yep
11:42futilethat worked, thanks
11:42IamDrowsynp :)
11:42futilei had (apply str ...) at first, but wondering why it was just ints
11:42futileheh
11:42futilei think i need clojure.async now
11:42futileanyone have good experience with it?
11:43bhaumanfutile: what do you need it for?
11:43bhaumanfutile: sorry missed the earlier part of the convo
11:44futileto coordinate a background-thread listener with a foreground function call that needs to return a value fetched in the background
11:45futilein Ruby i used a queue
11:45bhaumanyeah core.async will work.
11:45futilein Go i used a channel and a goroutine
11:45zerokarmaleftfutile, IamDrowsy: reduce will be faster for large seqs
11:45futilezerokarmaleft: i dont have seqs longer than, say, 100 chars
11:45zerokarmaleft,(dotimes [i 4] (time (apply str (range 1e4))))
11:45clojurebot"Elapsed time: 17.552416 msecs"\n"Elapsed time: 4.039793 msecs"\n"Elapsed time: 4.487624 msecs"\n"Elapsed time: 10.171103 msecs"\n
11:45futilegenerally
11:45mdrogalisAha. I understand core.async now. So cool. :D
11:45zerokarmaleft,(dotimes [i 4] (time (reduce str (range 1e4))))
11:45clojurebot"Elapsed time: 297.796355 msecs"\n"Elapsed time: 270.507669 msecs"\n"Elapsed time: 262.986148 msecs"\n"Elapsed time: 287.415497 msecs"\n
11:46zerokarmalefter, hmm
11:46futilezerokarmaleft: lol
11:46chrisrossiso, if i use a potentially infinitely long lazy sequence as the body of a ring response, can i reasonably expect the server to "do the right thing" wrt memory?
11:46timvishe`did clojure.contrib.seq/positions go anywhere when contrib was deprecated?
11:47futileis clojure.lang.PersistentQueue thread-safe?
11:47futileif it blocks on reads and is thread-safe, it might be precisely what i need
11:48tbaldridgePersistentQueue is persistent
11:48bhaumanfutile: I think the answer to that is yes.
11:48tbaldridgeadding to the queue creates a new queue
11:48futileoh right
11:48futilethat makes sense
11:48futileworking in ruby threw me off
11:49tbaldridgefutile: take a look at Java's ConcurrentBlockingQueue. According to Rich "I didn't write my own queue, because the Java one is good enough, use it, it's good"
11:49futile:)
11:49futilethanks!
11:49futilenever knew about ConcurrentBlockingQueue
11:49futile(clojure is my first experience with java)
11:49tbaldridgeor look at core.async if you want more go-like stuff :-P
11:50futilemeh, i can make do with BlockingQueue
11:50mdrogalistbaldridge: Would it be obnoxious to open a dev thread or Jira ticket about the perception problem we discussed on Google? It does seem like a legitimate short coming of Clojure's transactions.
11:50futileplus core.async isnt ready yet
11:50futileaccording to readme :(
11:50futileplus i want few dependencies for this
11:50mdrogalisfutile: It's pretty much ready.
11:50mgaarechrisrossi: what is the right thing in that case? arbitrarily truncate the seq?
11:50bhaumanfutile: and it's just plain fun
11:50chrisrossinot hold the already streamed out head in memory.
11:50tbaldridgefutile: yeah, that's more just the old docs issue. The API is so small that if we change something it won't matter much.
11:51futilewell hmm
11:51futileare there any tutorials on it?
11:51futilethe readme has no code in it
11:51futileso im scared
11:51futilenor wiki
11:51tbaldridgemdrogalis: yeah, open it as a future request, or better yet, join the clojure-dev mailinglist and startup a topic.
11:51bhaumanfutile: there is a walk through
11:51mdrogalisfutile: https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj
11:51futilewoot thanks
11:51mdrogalisI just did it. It's not so bad :)
11:51futilemdrogalis: thx
11:51mdrogalistbaldridge: I'll do the former. ^^
11:52futiledo chans have to be closed before they're garbage-collected?
11:52futileor can i just throw it away?
11:52tbaldridgejust throw away.
11:52futileassuming the client is done with it
11:52mdrogalisNope, GC will pick it off
11:52futilesweet
11:52ToBeReplacednothing wrong with java.util.concurrent.LinkedBlockingQueue though... just gotta type-hint sometimes
11:52mdrogalisToBeReplaced: You asked about core.contracts earlier. Still interested in that kind of thing?
11:52ToBeReplacedyeah sorry i got dc'd
11:52bhaumanfutile: I have a bunch of links to resources at the bottom of my post http://rigsomelight.com/2013/07/18/clojurescript-core-async-todos.html
11:53futileok, thanks
11:53tbaldridgefutile: agreed, it's a question of what you want to do with threads. A ton of cheap "blocking" threads, go with core.async. Just a queue to shove stuff into, use the Java classes
11:53mdrogalisToBeReplaced: My replacement for that kind of thing. https://github.com/MichaelDrogalis/dire
11:53ToBeReplacedjust saw the library; had been using pre/post maps
11:53mgaarechrisrossi: could always test it and see... make a handler that does (iterate inc 1) and see what happens
11:53chrisrossiyeah, i'll wind up testing. just wondering if anyone already knew the answer.
11:53ToBeReplacedman i'm in erlang land today aren't i?
11:54futiletbaldridge: i want to emulate this:
11:54futilehttps://github.com/sdegutis/zephyros/blob/master/libs/zephyros.rb#L20-L74
11:54mdrogalisYeah I guess so, heh.
11:54futilethe parts that touch @queues
11:54mdrogalisToBeReplaced: It's very easy to use though.
11:55tbaldridgefutile: yeah the JVM classes are fine for that. If you ever find yourself needing >50 threads or so, look at core.async
11:55futilethanks
11:57mdrogalisToBeReplaced: In any case, the major shift is a complete decoupling of pre/post conditions from what they test. core.contracts & :pre/post don't do that.
11:59mgaarechrisrossi: I just glanced at the source, and it looks like that's something that would be determined by the underlying server. ring just passes the body as is without realizing it if it's a lazy seq
11:59ToBeReplacedmdrogalis: i don't understand what you mean
12:00chrisrossimgaare: yeah, i figured that. there might some (unwritten) contract that server follows, though.
12:00chrisrossior differences from one to the other.
12:00racyclebhauman: that blog post is awesome. Thanks for that link.
12:00mdrogalisToBeReplaced: https://gist.github.com/MichaelDrogalis/6140936
12:00bhaumanracycle: your welcome :)
12:01mdrogalisadd-one knows absolutely nothing about its preconditions
12:02ToBeReplacedmdrogalis: oh, i see... what are the advantages of that? I feel like I want add-one to know about its preconditions
12:02zerokarmaleftfutile: ah, apply str uses a StringBuilder internally, that explains the difference there
12:02futilezerokarmaleft: is that special-cased on the apply fn?
12:02futilethat would seem dirty
12:03mdrogalisToBeReplaced: Keep the logic away from the input validation. Additionally, you can move around those calls to with-preconditions! I regularly have dev and debug builds where I import those calls, but I leave them out in prod.
12:04mdrogalisI do the same with logging. Keep it off during my automated tests, standard out for dev, and log box for prod. You can do that when they're decoupled to that extent.
12:04zerokarmaleftfutile: special-cased on str https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L514
12:04futilezerokarmaleft: thats ok then :)
12:05zerokarmaleftindeed
12:06dnolentbaldridge: yes that will be enough, we just need to know if the symbol we have is in &env, note for CLJS (:locals &env)
12:07mdrogalisOk, time to attend the end of a hackathon. See you guys later.
12:08ToBeReplacedmdrogalis: thanks
12:09tbaldridgednolen: k thanks. I have a CLJ fix done, I'm working on the CLJS version now.
12:17eggheadlesson learned: don't put work inside a go block
12:17Anderkent,(let [a (apply str (range 1e4))] (count a))
12:17clojurebot38890
12:18residentsummerguys, can anybody tell me, what's wrong with the last macro here https://www.refheap.com/17152?
12:18eggheadis `thread` from core.async a suitable replacement for `future` ?
12:18residentsummerit gaves me ArityException clojure.lang.ArityException: Wrong number of args (-1) passed to: db$eval3114$unhex
12:32Anderkentresidentsummer: why are you doing unhex at compilation time? that definitely looks weird. don't you want (defmacro my-where [q s]ec) `(where ~q (unhex ~spec))) ?
12:42konrIs there an 'undef' functions that frees a symbol from its definition?
12:43residentsummerAnderkent: Seems that I've overcomplicated this
12:44residentsummerMy initial thought was "if it's known what to transform at compile time, why not to do so?"
12:45justin_smithresidentsummer: with what you were doing, it was being transformed at the moment the macro was defined
12:45justin_smiththe input does not exist yet
12:45residentsummerah...
12:45Anderkentkonr: ns-unmap or something like that
12:46justin_smithinside `() it is defined at the time of macro invocation - which is likely compile time
12:46konrAnderkent: thanks!
12:46residentsummeram I right, thinking that outer macros are processed first?
12:47residentsummerso I wanted to get output of #'unhex before supplying it to where (because it's a macro, too)
12:50justin_smithresidentsummer: https://www.refheap.com/17158
12:50justin_smiththat demonstrates the order
12:51residentsummerjustin_smith: So, I was right on that
12:52justin_smithyeah
12:52Anderkentresidentsummer: then you need to do something like `(let [unhexed# (unhex stuff)] (where ...))
12:52Anderkentbut the unhexing should still happen within the 1
12:52Anderkent*`
12:53justin_smithunless unhex generates the code to be executed (which of course it doesn't)
12:57residentsummerAnderkent: i'll try your suggestion
13:08seangroveIs there a way to nrepl-jack-in using the lein production profile?
13:09technomancyseangrove: no, but there's an open ticket discussing it
13:10seangroveThanks technomancy
13:10technomancynp. you can always start a repl session and M-x nrepl into it
13:12poppingtonic.join #eff
13:12poppingtonicsorry
13:16residentsummerAnderkent: it's not quite what I'm trying to get… But enough of that for today
13:16residentsummerThanks everyone
13:21cemerickseangrove: at that point, it's probably simpler to just have your app start an nREPL endpoint itself, and connect to it
13:36gtrakanyone know of any pre-existing ring/compojure 'forward' middleware?
13:36mgaaregtrak: forward as in redirect?
13:37gtrakredirect, without the redirect, change the request, run it back through the handler
13:37justin_smithgtrak: just have a branch in the request handler that recurs?
13:38gtrakyes.. just wondering if there's a pre-built solution, aware of compojure contexts and such :-)
13:38mgaareI'm not aware of an extant middleware to do that
13:39justin_smithor put the forwarding request rewriter at the top of the handler, and that's done (unless a forward should in turn be able to forward)
13:39mgaareactually it'd be a little tricky to write this as a middleware
13:40justin_smithmgaare: if it took the handler itself as an arg I don't think it would be tricky at all
13:40gtrakhopefully one forward is enough :-)
13:40mgaareor rather the usage would be tricky, because you'd need to have it pretty much at the top of the stack.
13:41mgaarejustin_smith: the tricky part of it is that it could have unfortunate interactions with other middlwares. wrap-params reads the request body, which is mutable and can only be read once
13:41futileis there such a thing as a queue where push/pop work per key (like a Map)?
13:41futileand where q.pop(1) wont block q.pop(2)?
13:42justin_smithfutile: a map where every val is a queue?
13:42futilethats what i have right now
13:42futilebut it means i have to remove the queue from the map when im done with it
13:46dnolentbaldridge: did you see this? http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/
13:50futilewat!?
13:50clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
13:51futileits august already?
13:51futilei thought it was may or june
13:58tbaldridgednolen: just read it, spot on!
14:00soulmananyone familiar with xml zipping?
14:02soulmanI want to process an eclipse .classpath file but (zx/xml-> zipper :classpath) just returns an empty list
14:03soulmanclasspath is the root element in the .classpath file
14:04soulman(zx/xml-> zipper) returns the content BTW
14:06squidzi have a mysqlservice which returns json from a database query with php. What would be the easiest way to get my service to return EDN instead of json
14:07justin_smithsquidz: if you want the php layer to remain, cheshire, if you want to replace it, clojure.java.jdbc
14:08justin_smithif you want to replace the mysql - datomic :)
14:08scapehah
14:09rainerschuster:D
14:09squidzI can't replace the mysql unfortunately. So you are suggesting converting the json to edn? Isn\t there a way with php to send edn instead of json?
14:10weihow would you write this function, update-vec? https://gist.github.com/yayitswei/6141890
14:10justin_smithsquidz: a quick google finds this https://github.com/igorw/edn/blob/master/src/encoder.php
14:10scapewhy not use json?
14:11hiredmanwei: gross, use a map
14:12justin_smithwei: I would use (group-by :id args)
14:14weifor various reasons i need it in vector format. so convert to map using group-by, then convert back?
14:14justin_smiththat would be the easy way I think
14:14weicool, thanks
14:14hiredmanwei: you almost certainly don't need it in a vector format
14:14hiredmandon't convert that is just gross
14:15hiredmanwhen you have associative data, and do associative operations, why would you structure the data to fight against that?
14:15weii'm displaying it as a list
14:15jcrossley3soulman: try xml1->
14:16hiredmanwei: so?
14:16kmicuso?
14:17weigood point, i'll consider it
14:17squidzjustin_smith: I am using clojurescript. I don't believe I can use chesire with it right?
14:18justin_smithsquidz: hmm - not sure
14:19justin_smithif you are in clojurescript using json via interop should be very easy, no?
14:20clj_newb_2345anyone know of a good set of minimalist css style foiels for showing source code? (I'm outputing stuff with enlive, but want a good css style sheet for the source code)
14:23juhu_chapaHi guys!
14:25chronnojuhu_chapa: Hi!
14:27juhu_chapaHow would be a macro that returns: (. Integer valueOf "42") when called with: (int-macro Integer valueOf "42")
14:27juhu_chapa?
14:29justin_smith(defmacro int-macro [& args] `(. ~@args)) would trivially match your case
14:30juhu_chapajustin_smith: really nice, i am just learning macros. thank you!
14:30juhu_chapachronno: Hi!
14:31seangrovesquidz: Just use goog.json/parse and friends
14:32justin_smithjuhu_chapa: I don't know if that is really what you want, it just happens to expand to what you want for the example input
14:34seangrovejustin_smith is a constraint-based reverse-lookup table for function/macros definitions
14:34justin_smithI would see (defmacro int-macro [& args] `(. Integer ~@args)) being slightly more useful, then the call would look like (int-macro valueOf "42")
14:34justin_smithseangrove: lol
14:35juhu_chapajustin_smith: how now would be the macro when: (int-macro Integer (valueOf "0") (valueOf "1")) -> (. Integer valueOf "0") (. Integer valueOf "1")?
14:36seangrovejuhu_chapa: What are you trying to do?
14:38justin_smithjuhu_chapa: echoing seangrove's question, and that has a completely different structure from the other input, so it needs a different macro (or function) to process it
14:40kohyamawei: I commented your gist.
14:44juhu_chapaseangrove: I am trying to write apache camel java dsl in clojure. for example: (from "uri") (to "uri) written in clojure would be (. this (from "uri)) (. this (to "uri"))
14:44juhu_chapaI think the task would be easier with macros
14:45hiredmanjuhu_chapa: I think you would be better descibing the pipeline as a datastructure, and have a function that takes the datastructure and does all the method calling
14:46justin_smith(inc hiredman)
14:46lazybot⇒ 22
14:47dnolenjonasen: ping
14:47wei(inc hiredman)
14:47lazybot⇒ 23
14:47wei(inc justin_smith)
14:47lazybot⇒ 5
14:48juhu_chapahiredman: (inc :all)
14:48konris EDN pronounced 'Eden' or 'Ee Dee Ann'?
14:49matthavenerkonr: eden
14:49technomancyI pronounce it like "edna" but withaut the A
14:50stuartsierraI pronounce it "Gladys."
14:54gdevI need some examples of edn in action
14:54gdevFor some reason that isn't part of the documentation
14:55RaynesI pronounce it Jennifer.
14:55hiredmanit is a serialized data format, there is no action
14:55hiredmanlike, all you can do is read it or write it
14:56gdevhiredman, gotcha thanks
15:00gfrederickshiredman just wrote a very short "EDN In Action"
15:01hiredmanEDN Inaction
15:02gdevsnark as a service
15:04pjstadigsnarka sas er vice
15:05rasmustopjstadig: sounds like my job description
15:10DomKMIn ClojureScript, is it possible to define a protocol in terms of another protocol? For example, I'd like to create a protocol that can be satisfied by implementing function-foo AND satisfying the IFn protocol.
15:13dnolenDomKM: it's not possible in ClojureScript or Clojure
15:16DomKMdnolen: Oh well, thanks for answering. Is there a standard way of dealing with something like that? Or, is there a way to create an object that implements a protocol and delegates all methods not belonging to that protocol to another object?
15:17MacCoasterhi guys, I'm trying to parse some xml that was input from a POST using Noir, but i keep getting MalformedURLException
15:17MacCoasteri've even tried to do url-decode
15:17MacCoasterbut doesnt seem to work
15:18MacCoasteram i doing it wrong by simply doing (xml/parse xmlstring)
15:18dnolenDomKM: you can do delegation easily with protocols, just compose
15:18bhaumanDomKM: I normally just forward the calls
15:19dnolenDomKM: instance A can't handle protocol P0, but protocol P0 has a default case asking if A has something which can handle protocol P0, and it calls that instead.
15:19MacCoasteroh the string argument is an URI
15:19MacCoasteri can't read, nevermind
15:19dnolenDomKM: so this means that A must at least implement the ability to provide something that can handle P0
15:20DomKMdnolen: Even if you don't know the specific methods in advance? The use case is creating a function that takes an object and a function and returns an object that implements IFn and invokes the supplied function but delegates all other calls to the object.
15:26troydlHowdy. Is there a way to break elements out of a list to use each element as a separate argument to another function? In order to do something like this (average (range 5))
15:26ystaeltroydl: you mean 'apply' ?
15:26futiletroydl: like this?
15:26futile,(reduce + (range 5))
15:26clojurebot10
15:27futileno hold on thats not it.
15:27futiletroydl: what are you trying to do?
15:28troydlWell I was just messing around in a clojure book playing with the & extra argument for functions and I was wondering if I could pass in a list of args somehow
15:29futiletroydl: yes, apply.
15:29troydlEssentially, break the elements out of a list all at once
15:29futile,(apply max [1 2 3])
15:29clojurebot3
15:29dnolenDomKM: ok, yeah you can't do that elegantly yet - we need a proposal called specify to be implemented first. no need for protocol on protocols to do that.
15:29futile,(max 1 2 3)
15:29clojurebot3
15:29futiletroydl: see those two examples.
15:29troydlOh, nice
15:29mgaareapply is a massively useful function ;)
15:29futileyes
15:29troydlPerfect, thank you
15:30DomKMdnolen: Ah, okay. Yeah I saw the specify discussion ClojureScript confluence site but didn't entirely understand it.
15:30DomKMdnolen: Thanks for your help.
15:31dnolenDomKM: IFn is more or less an illusion, if you want instances to work as fns in that way set! call and apply properties on the thing you have.
15:31dnolenDomKM: this is in fact how specify! will probably work, specify would require that the object be cloneable
15:37jonasendnolen: pong
15:37dnolenjonasen: re inst ticket, so I'm not totally following your comments on the ticket. did you or did you not fix the tests?
15:39jonasendnolen: for CLJS-454? No I did not. but I think they're buggy
15:39upwardindexI've seen people exclude the clojure of their dependencies in their leon file, why do people do that?
15:40dnolenjonasen: so I don't understand how they are buggy because I didn't find your comments particularly clear
15:40jonasenthey don't follow the #inst spec
15:40dnolenjonasen: so are the core_test.cljs tests good and the reader ones buggy?
15:40dnolenor the other way around?
15:41jonasenthe reader_tests are bad. Because they don't follow the spec
15:41dnolenjonasen: and they don't follow the spec ... because of how they handle padding?
15:41jonasenAt least the clojure reader can't read the generated data
15:41DomKMdnolen: Oh, interesting. I'll look into that. Thanks.
15:41jonasen,#inst "2007-1-1"
15:41clojurebot#<RuntimeException java.lang.RuntimeException: Unrecognized date/time syntax: 2007-1-1>
15:42dnolenjonasen: but what is buggy about the tests? how it generates the strings?
15:42jonasenthe clojure reader requires #inst "2007-01-01"
15:42dnolenjonasen: does the reader need to be fixed? do the tests need to be fixed?
15:43jonasendnolen: yes, and If you fix that then they are exactly the same as in core_tests. All 7000 of them
15:43jonasenthe tests needs fixing. (But that's not really what the original issue is about)
15:44dnolenjonasen: I don't see how those tests are the same ... one tests the client side reader, the other date printing
15:44dnolencore_tests.cljs = date printing test, core_reader.cljs = date reading test
15:45jonasendnolen: ah, sorry. You're correct
15:45dnolenjonasen: ok, this why I didn't understand anything you were saying on the ticket :)
15:45jonasenbut the reader_tests still need fixing
15:45jonasendnolen: heh
15:45dnolenjonasen: sure, if those get fixed I'll review the patch more closely and apply.
15:46jonasenI'll fix the tests then.
15:46dnolenjonasen: thx
15:46upwardindexWhat happens if I have more than one version of clojure in my dependencies tree?
15:46jonasendnolen: sorry for the confusion
15:48xeqiupwardindex: it chooses the version with the least depth in the tree, provided none of the dependencies use a version range
15:48xeqido you have a link to a project.clj that excludes clojure?
15:54jonasendnolen: It's pretty easy to speed up the reader with ~30% by optimizing the StringPushbackReader. Would you accept such a patch?
15:54jonasenhttps://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L18
15:55dnolenjonasen: that would be awesome, though separate enhancement ticket + patch please
15:55jonasendnolen: ok
15:56dnolenjonasen: are you thinking about just switching to ^:mutable fields?
15:56jonasendnolen: and js array for the buffer
15:56dnolenjonasen: excellent
15:57jonasendnolen: https://www.refheap.com/17161
15:58upwardindexxeqi: ok so nothing bad happens, yes i've seen many projects excluding the clojure of their dependencies but can't figure out why
15:58rebcabin'(take 3 (range 3 9 0))
15:59dnolenjonasen: nice, though, small nit, just use alength
15:59rebcabinfunny that unit tests in clojure source show this as returning '(3 3 3)
15:59jonasendnolen: ok
16:00rebcabinline 951 of https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/sequences.clj
16:00LauJensenGood evening. I've used Tomcat for a while to host a few servlet apps and Im looking for an alternative which easily lets me host several webapps on the same java instance. Any suggestions?
16:00rebcabinbut my implementation definitely returns ()
16:00rebcabinas does try-clojure
16:03gfredericks,(take 3 (range 3 9 0))
16:03clojurebot()
16:04gfredericksrebcabin: what unit tests have (3 3 3)?
16:06modern_major_genI have a Hiccup question in clojure... I'm trying to embed an image in an e-mail, I was generating the html like this
16:06modern_major_gen(hiccup/html [:html
16:06modern_major_gen [:body
16:06modern_major_gen [:h2 "Title"]
16:06modern_major_gen [:img {:src (str "data:image/jpg;base64," chartstr)}]
16:06modern_major_gen ]])
16:06rebcabinI wonder how builds pass when unit tests require (take 3 (range 3 9 0)) to produce '(3 3 3) but the implementation produces ()?
16:06modern_major_genthis seems to work great except I get <html><body><h2>Aggregate Ratings</h2><img src=\"..
16:06rebcabin,(take 3 (range 9 3 0))
16:06clojurebot(9 9 9)
16:06modern_major_geni.e. the img tag has the " escaped out
16:06rebcabinworks in the other direction :)
16:07rebcabinI guess the co-range operator works :-P
16:07SegFaultAXmodern_major_gen: Y u post in channel?
16:07modern_major_genI'm sorry I thought this was a channel for clojure help, my aplogies SegFaultAX
16:08SegFaultAXmodern_major_gen: It is, but gist multiline paste.
16:08hiredmanrebcabin: the head of master can have different behavior from clojure releases that tend to be months older than the head of master
16:08SegFaultAXOh, post. I meant paste
16:08SegFaultAX:)
16:08rebcabinhiredman: I see!
16:09rebcabinhiredman: good show then
16:09hiredmanrebcabin: check the source for your specific version, and check out and build master and check the behavior there
16:09rebcabinyes, will do .. all is clear now
16:10tsantosAnyone have a clue why goog.ui evaluates as nil in the ClojureScript REPL? goog.dom evaluates to an object but not goog.ui.
16:10hiredmanhttps://github.com/clojure/clojure/commit/950487fa67243271d522b389d6ea1aad70429474
16:12modern_major_genhiccup/clojure problem I'm stuck on https://gist.github.com/philipsdoctor/6142922 any input greatly appreciated
16:13dnolentsantos: goog.ui isn't really a namespace with anything (functions) in it
16:14dnolentsantos: you have to require a specific class
16:14tsantosdnolen: anything in goog.ui fails, like goog.ui.Select
16:14dnolentsantos: what does you require look like?
16:16tsantosdnolen: [goog.ui :as gui]
16:16dnolentsantos: yes that won't work
16:17dnolentsantos: goog.ui only provides classes not real namespaces and you can't alias
16:17dnolentsantos: we do have :import, sadly it doesn't quite follow the Clojure import syntax, would like a patch for that if possible.
16:18tsantosdnolen: so what's the prescribed way to reference classes in goog.ui?
16:18noncomi know that the question may be strange, but i find myself repeatedly coming back to it: why is it when I create a new Leiningen project, the default ns is called "core"? Usually I feel that it is one of the fartherst nss which I may call "core" in my app?
16:18dnolentsantos: (:require [goog.ui.Foo]), or (:import goog.ui.Foo)
16:19tsantosdnolen: ah! thanks.
16:19noncomi mean, it could be "main" or something, but rarely it is a core for the app
16:20arohnerdidn't the compiler used to check for invalid arity on function calls? why did that go away?
16:21arohner,(fn [] (map))
16:21clojurebot#<sandbox$eval29$fn__30 sandbox$eval29$fn__30@d29790>
16:21tbaldridge,(map)
16:21clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$map>
16:21arohner&(fn [] (map))
16:21lazybot⇒ #<sandbox11278$eval63597$fn__63598 sandbox11278$eval63597$fn__63598@e785d7>
16:25arohner, (fn [] (map))
16:25clojurebot#<sandbox$eval173$fn__174 sandbox$eval173$fn__174@147e8ed>
16:25arohnerdidn't the compiler used to throw on invalid arity for that? Why did that change?
16:26tbaldridgeno, it's always been throw on dispatch
16:26tbaldridge,(fn [] (:foo))
16:26clojurebot#<sandbox$eval203$fn__204 sandbox$eval203$fn__204@11f8255>
16:27bbloomcljs does have some arity warnings
16:28arohnerI've shipped a few bugs to production because of that recently. What are my options for improving that?
16:29tbaldridgebetter tests?
16:29noncomarohner: (map) in (fn [] (map)) is not evaluated until runtime. for options i would take tests.
16:29noncomor automated code analysis (if you want an additional game)
16:29maharjwhy does the compilation of clojure code end with Caused by: java.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;
16:29maharjIt does not tell you anything :)
16:30noncommaharj: what is you IDE?
16:30arohnertbaldridge: I run circleci.com :-). I have tests, but not everything is easy to test, and this is something that could be automated
16:30maharjIf I do lein compile it's fine
16:30maharjnoncom: I'm using vimclojure
16:31arohnerI use typed clojure for some parts of our codebase, but it's somewhat heavyweight for existing code
16:31noncommaharj: well, never used vim.. but in counterclockwise there is a button which can show more details on an exception if they are available (the stack trace i mean)
16:31maharjyeah, I'm getting the stack trace
16:31technomancymaharj: usually that comes from AOT'd class files that were compiled using an old clojure version
16:31maharjbut it does not tell me anything that's reasonable
16:32maharjtechnomancy: okay.. do I need to specify the clojure version "1.5.1" in somewhere else than project.clj?
16:33technomancymaharj: you should, but whether that will fix the problem depends on where the bad .class files are coming from
16:33noncomarohner: funny with tests, yeah :D i think that you could write a library which would check for such errors on startup (or when run on a file-structure of a project)
16:33maharjtechnomancy: is there a way to tell?
16:33maharjthis occurs just one in a while
16:34arohnernoncom: k. I'm going to play with tools.analyzer, see what I can do
16:34maharjnormally when I screw things up somehow (parens, invalid macrodefs etc..)
16:34jonasendnolen: added CLJS-454-patch2.diff which fixes the tests. I'll create the reader perf ticket+patch tomorrow.
16:34dnolenjonasen: thx!
16:34technomancymaharj: you can check all the clojure jar files on `lein classpath` for .class files; if there are some then it might not be your fault but a problem with dependencies
16:34technomancymaharj: if it's correlated with compiler exceptions it's probably a vimclojure bug
16:35noncomarohner: maybe you will even become a hero who introduced a code-editing-time checks for clojure code correctness :)
16:36maharjtechnomancy: Okay. Sounds fair. So basically I'd need to switch to Fireplace or something that is actively developed?
16:37technomancymaharj: you'd have to ask someone more familiar with vim; sorry
16:37maharjI just got back to Clojure so I've not yet up to speed with the current development tools...
16:37technomancybut fireplace is probably a good idea anyway
16:38maharjyeah, I know vim isn't exactly the tool of the trade in lisp circles, but I gave up emacs 10 years ago for vim and I'm not in the mood to switch back again :)
16:38technomancynothing[1] wrong with vim
16:38technomancy[1] - except vimscript
16:38maharjyeah, you can say that again...
16:38technomancyI probably will
16:38technomancy=)
16:38maharj:)
16:39maharjBut thanks, So I'll be shaving the Yak once again for a couple of days :D
16:39maharjIt was just like Haskell.. I wanted to do something with it and wound up doing updates for a whole evening... and then never got back to it :D
16:40maharjThat's why I think it would be a good idea to decide already what I want to do... but there are so many problems in the world and so many suitable tools.
16:45lenovo`hello
16:53stuartsierra1Is Tim McCormack here?
16:54stuartsierra1How about Andy Fingerhut or John Stoneham?
16:55stuartsierra1I just pushed fixes for DJSON-9 and DJSON-11, wanted to know if they fix the reported problems.
16:56weiis there a clojure/clojurescript version of @the_string.html_safe? basically changing newlines to <br> but escaping out html entities
16:59gfredericksTimMc: ping ^
17:00noncomwei: idk but why not use the native one?
17:02weiwhat's the native one? the example I gave was from Rails
17:15clj_newb_2345is there a way to put a span element into a :content field in css? (context: I'm trying to figure out how numbered lines of code works; I have a clss which I'm using ":before" on to insert the line number. However, I want to insert more than just plain text. I would like to insert an actual span element.
17:15clj_newb_2345thus, I want a :content field to conttain a span element. Unfortunately, it's displaying the HTML code rather than interpreting it and generaring a span element
17:16TimMcstuartsierra1: Surprisingly, yes.
17:17TimMcMy shell server is down, but you caught me online.
17:17stuartsierra1:)
17:17clj_newb_2345hmm
17:17clj_newb_2345wrong channel
17:17clj_newb_2345this is not #css
17:17stuartsierra1TimMc: Does this solve your reported problem in DJSON-9: https://github.com/clojure/data.json/commit/64f7d311bb5e8a5a6032ad071c675b4c257dc3fc
17:18technomancyTooManyFerengiException
17:18stuartsierra1technomancy: That would be vastly more interesting.
17:18pjstadigtechnomancy: i would patch that issue
17:22TimMcstuartsierra1: I think that fixes it, yes. Can't check right now, but the included test looks good. Why "separator", though?
17:22stuartsierra1TimMc: Didn't know what else to call it.
17:22stuartsierra1"special-separators" seemed too long.
17:23stuartsierra1And the characters in question are "\u2028 - Line separator" and "\u2029 - Paragraph separator."
17:25TimMc:tricky-little-bastards
17:25stuartsierra1heh
17:25ztellmancore.async question: put! throws on a closed channel, but >! doesn't appear to; is this intentional?
17:25stuartsierra1:those-things
17:27TimMcHuh, my description on DJSON-9 looks like it is missing a couple characters near "viz".
17:27TimMcI wonder if that's a typo or a markup problem.
17:28stuartsierra1JIRAAAAA!
17:30ztellmandnolen bbloom, if you're around, can I pick your brains re: core.async?
17:30TimMcSomething like :js-eval-compat for the option and :js-compat-escape for the character "class". But it's not really important, since it's a default no one needs to worry about.
17:31TimMc..and it's documented. ♥
17:31stuartsierra1I'll think about alternate names, maybe something with "js" in it would be good.
17:32stuartsierra1TimMc: By the way, did you actually encounter this bug or is the patch meant to be preventative?
17:34TimMcstuartsierra1: Actually encountered it.
17:34stuartsierra1ok
17:35stuartsierra1wow
17:35stuartsierra1Who's evil enough to insert U+2028 into a string?
17:35TimMcIt's not really a bug in DJSON, of course.
17:36TimMcSomeone who wants to force an NLP tool to declare a sentence boundary, if I recall correctly.
17:36stuartsierra1Ha!
17:36TimMcAnd then various JSON parsers *cough* ExtJS *cough* freak out when they see it, even though it's valid.
17:37poppingtonicwhat's the (currently) best clojure http client?
17:37weipoppingtonic: http-kit
17:37poppingtonicchecking it out. ty
17:37weior you could try clj-http
17:39clj_newb_2345are there any video tutorials of pedestal
17:39seangroveYeah, both have been pretty pleasant to use
17:39rkneufeldclj_newb_2345: not yet, but we're hoping to do one some time.
17:39clj_newb_2345I feel like this is one of the few pieces of software where I need a bit more hand holding to understand.
17:39clj_newb_2345rkneufeld: you should put up a kickstarter. I'd donate a few packets of ramen noodles
17:40rkneufeldclj_newb_2345: That'd be a ton of fun–we just need the bandwidth to actually be able to deliver. Clojure Cookbook is taking up most of my time right now.
17:41clj_newb_2345rkneufeld: hmm, is the book open sourced https://github.com/clojure-cookbook/clojure-cookbook ?
17:41rkneufeldYep
17:42clj_newb_2345rkneufeld: dumb question, how can I read the book without reading the raw asiidoc?
17:42clj_newb_2345is there a way to generate an html or pdf from that github?
17:42dnolenztellman: what's up?
17:43rkneufeldYou can with the asciidoc program, but it looks like ass. We need to rig up the output from the O'Reilly process to be displayed somewhere (Not even Luke or I can build locally, we have to do it in the Atlas system they have.)
17:44ztellmandnolen: let's say I have a function that returns a periodic stream of messages, by looping inside a go block, reading from a timeout channel, and then writing to the output channel
17:44ztellmanthen someone closes the output channel, because they don't need it anymore
17:44ztellmanhow will I ever know?
17:44ztellmanI'll just keep on looping and no-oping forever
17:45clj_newb_2345rkneufeld: noted, thanks!
17:45ztellmanthere doesn't seem to be a closed? predicate, or any way of knowing that my enqueue fizzled
17:45ztellmanam I missing something?
17:46amalloyztellman: don't channels send a nil when they're closed? you could read something like (alts! timeout-channel output-channel), and if it's nil the output was closed
17:46clj_newb_2345What are people using for generating css from clojure? cssgen, clj-style, gaka, or something else? Note, I want to generate CSS, not do css-style selectors, thus not enlive
17:46ztellmanamalloy: right, but this is from the producer's side
17:46amalloyi know
17:46ztellmanI'd need to send a message from the consumer to the producer to stop
17:46ztellmanright?
17:46clojurebotEqual Rights for Functional Objects is Baker's paper on equality and why it's impossible to define sensible equality in the presence of mutable data structures: http://www.pipeline.com/~hbaker1/ObjectIdentity.html
17:46technomancyclojurebot: botsnack
17:46clojurebotThanks! Can I have chocolate next time
17:47ztellmanI can't consume my own messages, that's for someone else
17:47amalloyztellman: i don't have a lot of experience with core.async, but my understanding from podcasts/etc was that when the consumer closes a channel, the producer would (if it reads the channel) see a nil
17:48ztellmanI feel like there's something fundamental I'm not getting here, but why would the producer ever read the channel?
17:48seangroveztellman: I'm with you so far, curious about this as well
17:48seangroveBut why are consumers closing the channel?
17:49amalloyso that it can see that the channel has closed. it wouldn't ever see any other messages aside from the channel-closed message, right?
17:49dnolenztellman: it seems weird to me that you would close the output channel yourself
17:49amalloysince put is "blocking", you would never be able to enqueue a message until the real consumer is there to read it, and so the only message that's ever in the channel for you to read will be a channel-closed message
17:49ztellmandnolen: if the stream from the producer is unbounded, then I might want it to stop sometime
17:49hiredmanztellman: there has been some discussion of a closed? predicate on the ml if you haven't seen it
17:50ztellmanhiredman: I haven't, that would address this, I think
17:50dnolenztellman: but if no one has a ref to it it will get collected anyway - if you need to clean up resources you need to consider that the channel in question may need to do a lot of cleaning up anyway
17:50hiredmanamalloy: it sounds like you are assuming a "producer" and a "consumer" are passing messages back and forth to each other over a single channel, which seems very odd
17:51dnolenztellman: so the producer should provide two things - the channel to consume, and channel to communicate a kill signal
17:51amalloyhiredman: i guess i'm out of my core.async depth
17:51hiredmanamalloy: well just replace "channel" with "queue"
17:51ztellmandnolen: really? that seems wasteful, since all I need to know is if the channel's been closed
17:52ztellmanto be fair, that's more or less what I did (in this case just created an atom that the consumer can mark when it's done)
17:52ztellmanbut it seems weird and indirect to me
17:52zerokarmaleftztellman: talks.golang.org/2012/concurrency.slide#37
17:53zerokarmaleftrob pike's example pretty much mirrors what dnolen suggests
17:53dnolenztellman: yeah I think what you're suggesting sounds like an anti-pattern, my understanding is that closed? will introduce race conditions, the pattern I've described seems to avoid that.
17:54ztellmandnolen: why would there be race conditions?
17:54ztellmanin either case I may be enqueueing into a closed channel
17:54bbloomztellman: im here too now
17:54ztellmanbbloom: if you scroll back far enough, you can see my original question
17:55ztellmanbut it's basically about how to signal a producer to stop
17:55ztellmansince they can't tell if they're enqueueing into a closed channel
17:55bbloomztellman: the lack of predicates & other channel-state-inspection functions is intentional to avoid race conditions
17:56ztellmanbbloom: I get that if you check closed? and then enqueue that it may have been closed after you check
17:56technomancyclojurebot: chocolate is <reply>actually I decided I prefer botsnacks after all.
17:56clojurebotAck. Ack.
17:56ztellmanbut I don't see how creating a "stop" channel gets around that
17:57bbloom"someone" closing a channel doesn't make sense
17:57Raynesztellman: http://i.imgur.com/1N74Drm.jpg Have a transparent butterfly with which to lighten your day.
17:57bbloomclose is a control signal from a producer
17:57bbloomit's not a resource management operation, you don't need to call it. and nobody should call it but the "owner" of the writing port
17:57ztellmanwhat if downstream there's nowhere for the messages to go?
17:58bbloomztellman: in go, if you have a receive-only channel, you CAN'T close it. it's a type error
17:58bbloomyou need to have an extra channel for communication & use multiplexing
17:58ztellmanok, fair enough
17:59ztellmanmy intuition for CSP is horribly underdeveloped, thanks for the help, dnolen zerokarmaleft bbloom
17:59ztellmanand thank you for the butterfly, Raynes
18:00bbloomztellman: in general, the broken intuition is to use channels in more places in your app and to use fewer channels per place
18:00bbloomztellman: instead, use channels less frequently, but don't be afraid to create a handful of them for various needs
18:00bbloomit's totally ok to have TWO parties communicating with 2,3, or 4 or so channels. or even to have them send channels back and forth to each other wrapped up in containers
18:02bbloomit's rare that you put a channel on a channel directly, but it's very common to put a channel in a "connection" or "request" object, then put that object on the channel
18:04stuartsierra1bbloom: Are you getting those intuitions from Go language docs?
18:04zerokarmaleftseems weird in that pattern that you can send a completely arbitrary message on the "stop/quit" channel b/c the producer discards it
18:05bbloomstuartsierra1: i've done a non-trivial amount of socket programming
18:05bbloomstuartsierra1: plus golang videos/docs/tinkering
18:05stuartsierra1ah
18:05bbloomzerokarmaleft: *shrug* lots of the go examples just sick a 1 on the channel
18:05bbloomstick*
18:06zerokarmaleftthough I suppose finer-grained control could be had with explicit control messages if needed
18:06bbloomsend :quit and then (assert (= msg :quit)) if you want to feel better :-)
18:06stuartsierra1Stick that in your channel and queue on it.
18:07bbloomreading the go std libs is a great way to see some common patterns
18:07bbloomcheck out their http or rpc libs
18:07stuartsierra1cool
18:07zerokarmalefthmm, good idea
18:10bbloomthis is a cool read too: http://doc.cat-v.org/bell_labs/concurrent_window_system/
18:12zerokarmaleftI've read that, I've started on Hoare's CSP book in my free time
18:12akurilinI put together a simple standard deviation function as an example of a variadic fn (which I haven't written many of before). Could tell me if I could be doing this fairly idiomatically, or if I could do something better? http://pastebin.com/dK3fUCXq
18:14akurilin*I'm doing this, not "could" be
18:24amalloyakurilin: why is this variadic at all? it makes way more sense to have it accept a list
18:26sorenmacbethanybody good with calling clojure from java land? I'm getting "call to unfound fn" errors calling into a reified instance which I've instantiated from a java class. shouldn't a reified object capture the fns called from inside it?
18:29TimMcA reasonable expectation, but you may need to require the namespace first using RT.
18:31ztellmanbbloom: if you're still around, I'd be interested to hear your thoughts on https://github.com/ztellman/narrator/blob/master/src/narrator/query.clj#L136
18:31eggheadare there any examples of exposing a clojure namespace through a java class? I know datomic does this but it's not too easy to see their source
18:31bbloomztellman: 1 sec
18:31ztellmanbbloom: not entirely self-explanatory, but I think you can ignore all the bits that aren't prefixed with a/
18:32amalloyakurilin: that's also not a very good algorithm for std dev of a large list, since it has to hold the whole thing in memory at once
18:34bbloomztellman: ok rewind, what are you trying to do?
18:34bbloomthat's a lot of code for me to fail at reviewing :-)
18:34ztellmanbbloom: haha, yeah, sorry
18:35ztellmanbasically, this takes something that describes a descriptor of a streaming analysis you'd like to do, plus a stream
18:35ztellmanand returns a a stream representing the output of the analysis
18:36ztellmanso in this case, it takes a channel, feeds the messages into the "operator", and periodically receives a "flush" signal that means it should emit a value into the output stream
18:36TimMcHow do I tell lein-deploy to not try to sign a release?
18:37bbloomztellman: why bother with this flush loop? why not just multiplex on a timeout & flush when it gets a message, then create a new timeout and loop?
18:37akurilinamalloy, true, I wasn't expecting large numbers, you're right.
18:37akurilinamalloy, aren't a lot of math operations in clj variadic by default for convenience? I was trying to model after +
18:38akurilinor the advice in this post: http://stackoverflow.com/questions/7823516/why-are-many-clojure-functions-variadic
18:38amalloyakurilin: nobody's ever going to type (std-dev a b c d e f g), they're going to have a list of things like (std-dev xs)
18:38ztellmanbbloom: hmm, I seem to recall rejecting that, but now I can't remember why
18:38ztellmanso I'm going to assume it was for no good reason
18:38amalloywhereas (+ x 5) is much more common
18:39akurilinamalloy, so would you say that being variadic here buys you no extra flexibility?
18:40ztellmanakurilin: not that you necessarily need it, but here's an implementation of streaming variance: https://github.com/ztellman/lamina/blob/perf/src/lamina/stats/variance.clj
18:40amalloyakurilin: variadic never impact flexibility, it's just a tradeoff of which calling scenario will be more convenient
18:40akurilinamalloy, got it.
18:40akurilinztellman, thanks, will check it out!
18:41amalloyif your function is variadic, then calling it on a list of things will be annoying, (apply f some-list) instead of just (f some-list); if it's not variadic, then calling it on a couple of fixed args is annoying: (f [a b c]) instead of (f a b c)
18:41akurilinbtw, I might have asked that before, but is it poor tone to cram a bunch of steps into the let form?
18:41akurilinand then just return the last binding inside of the let
18:41amalloyfor +, (+ a b) is pretty common, so it's made convenient; for std-dev, nobody will ever do that, so make the thing they actually will do convenient
18:41akurilinamalloy, gotcha, makes total sense.
18:54sorenmacbethTimMc: I'm doing this to load the namespace which contains the reify: https://gist.github.com/sorenmacbeth/72499f3b2a5f13012576
18:55sorenmacbethTimMc: The problem occurs when I have functions from other namespaces which I've (:required) inside of the namespace that I've loaded
18:55sorenmacbethinside the reify that is
18:56sorenmacbeth(reify Whatever ([this stuff things] (other-namespace/function-which-throws-unbound-fn stuff)))
18:56LauJensenIm seeing an issue where lein2.0 is not picking up the ~/.lein/profiles.clj user profile, has anyone come across that before, specifically on windows 8 ?
19:04sorenmacbeththe other thing I guess is important to mention is that it works fine locally (in a single thread), but breaking in a distributed environment
19:28hiredmansorenmacbeth: I recommend not eating exceptions like that
19:43andrewshawcareHi, I had a question about lisp syntax...
19:44andrewshawcareIs there any reason why whitespace cannot define prefix notation? So instead of this:
19:44andrewshawcare(foo
19:44andrewshawcare 1
19:44andrewshawcare 2
19:44andrewshawcare 3
19:44andrewshawcare)
19:44andrewshawcarewe could write this:
19:44andrewshawcarefoo
19:44andrewshawcare 1
19:44andrewshawcare 2
19:44andrewshawcare 3
19:45danlarkinfirst of all, quit spamming the channel
19:45andrewshawcareThat's how my client handles multiple lines, sorry.
19:45danlarkinsecond, congrats on being the 5 billionth person to come up with that idea
19:45andrewshawcareI don't user IRC often.
19:45andrewshawcare*use
19:45danlarkinit isn't very good if you really think about it
19:45andrewshawcareWhy?
19:45clojurebotwhy not?
19:46danlarkinbecause why would you want it?
19:46danlarkinwhat possible advantage does it offer
19:46andrewshawcareTo eliminate unnecessary syntax, possibly.
19:46dnolenandrewshawcare: people ask this all the time - usually if they haven't used Lisp for very long - spend some time w/ macros and you'll see why.
19:48andrewshawcareWhich allows for greater readability.
19:48danlarkinexcept it doesn't
19:49andrewshawcareCare to offer a reason why?
19:50danlarkinyou offering an opinion on clojure's readability is like me offering an opinion on fine wine
19:50doc_brownpersonally, i cant tell the difference between good wine and bad wine
19:50dnolenandrewshawcare: you could ask us or read up on it look at Dylan. if you aren't the first person to have the idea there's probably challenges involved in making it work in an acceptable fashion.
19:51andrewshawcareNo, I don't think I'm making a subjective argument. Less to understand is less to understand. If we inherently use whitespace to organize our code already, it would seem that the braces would be redundant.
19:52dnolenandrewshawcare: look you have some opinions, come back when you've read about why it hasn't worked. It's also worth looking at Julia, which seems to have advanced the state of the art a bit (could be wrong about that).
19:52danlarkinthey aren't redundant though, and for you to say they are suggests you don't really know clojure well enough to speak on the matter
19:53danlarkinwhich isn't to say you should abandon critical thinking, that's very valuable
19:53andrewshawcareI know they define a special type of list, one with the function to be invoked as the first item in the list.
19:53danlarkinit just so happens that you're mistaken here
19:53andrewshawcareAnd list literals are defined with '(), is that correct?
19:55andrewshawcareDid I make a mistake with my last two statements?
19:56danlarkinno, but it's not like you're going to convince anyone here
19:56danlarkindnolen suggested some reading you could do
19:57danlarkinthere's really nothing left to talk about
19:57noto2andrewshawcare, clojure has () for list, calling first arg if not 'quoted, [] for vectors, {} for maps... the braces help with legibility in most cases. having to indent every function call would fit like 10 columns of code on the screen
19:59TEttingeras an example, clojure could have (fn [coll] (map inc coll))
19:59TEttingerinc is a function, and if this proposed syntax treats functions specially, then that code breaks
20:00TEttingeror at least become much harder to read, because it makes indented coll fail and non-indented coll (which looks weird) work
20:00andrewshawcareOkay, so then you could write that as:
20:00andrewshawcarefn
20:00andrewshawcare [coll]
20:00andrewshawcare map
20:00TEttingerno
20:00andrewshawcare inc
20:00andrewshawcare coll
20:00andrewshawcareOr extend coll out further if inc is a function, sorry.
20:00andrewshawcareBut actually, no.
20:00andrewshawcareSince it's not being invoked.
20:01TEttingerok, you definitely haven't programmed in clojure.
20:01andrewshawcareIt's an argument to map
20:01TEttingeryou should try it first
20:01dnolenandrewshawcare: if you're going to show code please use a pasting service, don't paste in channel
20:01TEttingeralsom that's 5 lines for a one-liner, total waste of space
20:02SegFaultAXTEttinger: It's lisp. Everything is a one-liner. :)
20:02andrewshawcareYou could also write your groceries on one line...
20:02SegFaultAX(Without doing syntax gymnastics)
20:02andrewshawcareHumans read in an F pattern
20:02andrewshawcareTop down, left to right (or possibly, right to left)
20:03SegFaultAXI like to write my programs as simple universal transformations.
20:03TEttingerwell ##(count "(fn [coll] (map inc coll))") characters vs. 5 lines, and barring a truly massive screen you can't fit a large function on one screen, prohibiting readability
20:03lazybot⇒ 26
20:03SegFaultAXIn other words, my program is a single function that takes the current state of the universe and produces the next state.
20:03TEttingerSegFaultAX, continuation passing style?
20:04soulman_SegFaultAX, with map it works on multiverses too
20:04soulman_;-)
20:04SegFaultAXsoulman_: That's the spirit!
20:04TEttingerhere, let me find a real-world example, andrewshawcare
20:05andrewshawcareAnd PS, sorry in advance for my IRC etiquette, I'm brand new to this and I'm sure I'm not doing some things correctly.
20:05TimMcandrewshawcare: Regardless of whether this is a good or bad idea, you owe it to yourself and others to at least research the history of this topic, as suggested.
20:05SegFaultAX"If you want to make an apple pie from scratch, you must first invent the universe" - Abraham Lincoln
20:06andrewshawcareHow do I directly reference someone? Is there a prefix character?
20:06SegFaultAXandrewshawcare: Just type the first few letters of their nick and press the tab key.
20:06andrewshawcareSegFaultAX: Ah, thanks.
20:06TimMc~paste
20:06clojurebotpaste is https://refheap.com/
20:07TimMc^ there's a pastebin you can use, too
20:07andrewshawcareTimMc: Awesome, thanks.
20:07SegFaultAXTimMc: You're a pastebin.
20:08TimMcYour *face* is a pastebin.
20:08andrewshawcarehttps://www.refheap.com/17172
20:08andrewshawcareWhere inc might be a function, but like any variable, is just a variable in this context (since it isn't being invoked).
20:08SegFaultAXTimMc: Nuh uhh!!
20:09malynandrewshawcare: I don't use it, but clarity has already worked this out: https://github.com/one-more-minute/clarity/
20:10andrewshawcaremalyn: Ah, beautiful! Thanks.
20:10malynandrewshawcare: Let's be careful with the "beautiful" word there... ;)
20:10andrewshawcaremalyn: Fine, gorgeous.
20:12TimMcandrewshawcare: You're going to find a lot of pushback from the community. There are very good reasons for people preferring the s-expression syntax, which you will come to understand as you learn more about code-is-data.
20:13TimMcI guess what I'm saying is, you're not going to convince anyone with arguments that a beginner is capable of making.
20:13soulman_TimMc, yeah, that's it
20:13andrewshawcareLogical fallacies.
20:13soulman_TimMc, macros forever ;-)
20:13TEttingerhttp://pastebin.com/W3L6Le5N vs. http://pastebin.com/UVjFaDGN
20:14TimMcThis is not an appeal to tradition, it's an appeal to learning about something before you try to change it.
20:14technomancyTimMc: http://epicureandealmaker.blogspot.com/2012/03/chesterton-fence.html
20:14andrewshawcarehttps://yourlogicalfallacyis.com/the-fallacy-fallacy
20:15justin_smithTimMc: no, clearly nobody who uses clojure has tried a non-homoiconic language, and if we actually tried it we would be converted
20:16technomancy«It is extremely probable that we have overlooked some whole aspect of the question, if something set up by human beings like ourselves seems to be entirely meaningless and mysterious. There are reformers who get over this difficulty by assuming that all their fathers were fools; but if that be so, we can only say that folly appears to be a hereditary disease.»
20:16TimMcandrewshawcare: Linking to fallacy descriptions is not a conversation.
20:17hiredmanwho wants to have this conversation?
20:17TimMctechnomancy: That's some pretty good writing there.
20:17technomancyhiredman: I've already linked to Chesterton; it can only go downhill from here
20:18andrewshawcareI did stop and think, and deferred to the community. I was met with ridicule.
20:18hiredmanI've had the poor guy on ignore for half an hour already and from here you look like a bunch of people yelling at an empty chair
20:18andrewshawcare"You're a beginner" "You clearly haven't programmed in clojure"
20:18technomancyclojurebot: Chesterton's fence is http://epicureandealmaker.blogspot.com/2012/03/chesterton-fence.html
20:18clojurebotIk begrijp
20:18technomancy^ surely will come in handy in the future
20:18TimMchiredman: Use the -replies feature if your client has it. (irssi does)
20:20hiredman*shrug*
20:20TimMcSomething I've wanted for a bit is a plugin that just greys out ignored lines instead of hiding them.
20:21TimMcIt would be useful for temporarily shutting out conversations.
20:21clojurebotexcusez-moi
20:21TimMcor clojurebot
20:21justin_smithI wonder if people show up on #c and argue for garbage collection and tagged types as language level features?
20:21andrewshawcareI appreciate the help, I had one person provide me with a library that seemed to implement exactly what I asked, and some who would rather cast dispersion on someone 's character rather than help them.
20:22andrewshawcareI'm new to clojure, I'm going to say things that aren't correct.
20:23technomancyjustin_smith: dare you to join #scala and ask "type systems... hm. seems like a lot of work, doesn't it? is it really worth it?"
20:24justin_smithandrewshawcare: speaking for myself it is less about the strict correctness and more about my own preferences in language design - if clojure was what you described (using indentation to carry structural information) I would be on some other channel talking about a language that wasn't like that
20:27TimMc...and gone.
20:31seangroveScala is one-indexed?
20:31seangroveInteresting, always thought that was a bad idea
20:32seangroveI guess just for tuples though
20:36soulman__Haskell has whitespace conveying semantics
20:36soulman__I hate that since I woked with make.
20:41TEttingerI feel kinda bad that he thought I was mocking him, but his idea was definitely, almost verifiably bad for clojure. Getting macros to insert at the right indentation levels would be a hassle, for one, the lack of putting any meaning in horizontal space is another
20:42TEttingerah, and clarity doesn't remove all brackets either
20:51joe`exit
21:46dnolenmore fun w/ core.async, 100000 DOM updates http://swannodette.github.io/2013/08/02/100000-dom-updates/
21:46dnolenneat that core.async trivially allows you to express batched rendering
21:58gfredericksit does?
22:03aidalgolWhat did I do wrong here? http://paste.debian.net/22307/ It seems to be saying that an integer is not an integer.
22:05dnolengfredericks: yes you send render updates to a channel which is looping on timeout
22:08gfredericksdnolen: I just don't see how that batches anything; something to do with buffered channels?
22:08dnolengfredericks: the queue is batching updates
22:09gfredericksaidalgol: ##(even? nil)
22:09lazybotjava.lang.IllegalArgumentException: Argument must be an integer:
22:09gfredericksoh I missed the phrase "which is looping on timeout" somehow
22:10aidalgolgfredericks: Oh, right. At the end of the list. :P
22:10gfredericksyep
22:17TimMcTEttinger3: I think he was already feeling mocked by the time you joined the conversation, and in any case he did not seem to be up for a productive conversation.
22:23isaacbwclojure doesn't have any sugar for argument type overloading, right?
22:26soulman__multimethods
22:27soulman__defmulti and defmethod
22:27soulman__that's more sugar than most other languages. ;-)
22:30ThatOneGuycan I define a macro that uses ->?
22:30gfredericksThatOneGuy: yes
22:30ThatOneGuyso (defmacro awesome [lawl] (-> lawl something something))
22:30gfredericks-> itself is a macro that uses ->
22:30isaacbwsoulman__: oh man, awesome
22:31gfredericksThatOneGuy: that code is technically allowable yes
22:31john2xwat
22:31ThatOneGuywell I'm trying to compact some zipper traversal code
22:32ThatOneGuyin my zipper, z/down, z/down z/right, z/down z/right z/right, all stand for something so I would like to make macros that expand to them so I can just (-> zip short-macro-1 shorter-macro-2) and it will expand out correctly
22:32dnolen100,000 go blocks in ClojureScript (edge of what's possible :) http://swannodette.github.io/2013/08/02/100000-processes/
22:34jtoyare there any libraries for if i want to operate on clojure objects but all form disk so i dont have to store them in memory?
22:34jtoyand do calculations on the collections
22:45ThatOneGuysorry I closed my laptop. why do I need a backtick for (defmacro shorter-macro1 [forms] (-> forms z/down z/right)) ?
22:47mattmoss,(+ 1 2)
22:47clojurebot3
22:47mattmoss,`(+ 1 2)
22:47clojurebot(clojure.core/+ 1 2)
22:48ThatOneGuybut if im using -> wouldn't it just expand anyways?
22:48ThatOneGuy,'(-> forms z/down z/right)
22:48clojurebot(-> forms z/down z/right)
22:49mattmoss,(-> forms z/down z/right)
22:49clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: z, compiling:(NO_SOURCE_PATH:0:0)>
22:49mattmossOr were you asking tick vs. backtick rather than nothing vs. backtick?
22:49ThatOneGuy,(require 'clojure.zip :as z)
22:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: z in this context, compiling:(NO_SOURCE_PATH:0:0)>
22:49ThatOneGuy,(require '[clojure.zip :as z])
22:49clojurebotnil
22:50ThatOneGuy,(defmacro shorter-macro1 [forms] (-> forms z/down z/right))
22:50clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:50mattmossCan't do that w/clojurebot.
22:51amalloyThatOneGuy: without the `, the -> gets expanded at compile-time, leading to the macroexpander attempting to do down+right while expanding the macro, rather than working on the zipper in your expanded code
22:53mattmossThatOneGuy: you also don't need macros here.
22:53mattmoss(def short-op (comp z/down z/right z/right))
22:54ThatOneGuyok, so when: (-> zip z/down z/right shorter-macro1) =expands to=> (-> (z/right (z/down zip)) z/down z/right)
22:55ThatOneGuybut comp is a function, and really all I'm doing is renaming a series of functions, so I think a macro would be better, no?
22:55mattmossGenerally, no.
22:55amalloyThatOneGuy: there's really no excuse for that function to be a macro
22:56ThatOneGuyaren't macros expanded at compile/read time?
22:57mgaareyes
22:58ThatOneGuyand this is a simple rename of z/down (comp) z/right -> better-name; I'd rather not have the overhead of a function just for this. I am going to be traversing this zipper'd datastructure a lot in the following code so I'd like to reduce any overhead
22:58mattmossThatOneGuy: Ask yourself.... why is that important? why do you need it expanded?
22:58mattmossOverhead of a comp isn't an issue when most everything you're doing isn't macros.
22:59mgaareThatOneGuy: speaking of overhead, if it's a function the jvm will be able to more easily jit
22:59ThatOneGuyand it can't jit a ->?
23:00mgaareit'll have to do that in every place you use the macro, rather than just the one function
23:00amalloyThatOneGuy: you are lightyears away from the conclusion that you need to inline this function for performance
23:01ThatOneGuyOk, I'll go with the prettier version :P But just out of curiousity, (-> zip z/down z/right (-> z/down z/right z/right)) expands to a single set of nested forms?
23:01amalloytry it and see
23:02ThatOneGuy:) have to get used to the repl again. its been a while since I've written clojure. I write C# at my day job
23:02mattmoss,macroexpand
23:02clojurebot#<core$macroexpand clojure.core$macroexpand@159715d>
23:03mattmoss,(macroexpand '(-> zip z/down z/right (-> z/down z/right z/right)))
23:03clojurebot(z/right (clojure.core/-> (clojure.core/-> (clojure.core/-> (clojure.core/-> zip z/down) z/right) z/down) z/right))
23:03ThatOneGuyuser> (macroexpand (-> [] z/down z/right (-> z/down z/right)))
23:03ThatOneGuyIndexOutOfBoundsException clojure.lang.PersistentVector.arrayFor (PersistentVector.java:107)
23:04mattmoss,(macroexpand '(-> [] z/down z/right (-> z/down z/right)))
23:04clojurebot(z/right (clojure.core/-> (clojure.core/-> (clojure.core/-> [] z/down) z/right) z/down))
23:04mattmossI think there's a macroexpand-all, but I forgot which namespace it's in.
23:05mattmoss,(clojure.walk/macroexpand '(-> [] z/down z/right (-> z/down z/right)))
23:05clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>
23:05mattmoss,(clojure.walk/macroexpand-all '(-> [] z/down z/right (-> z/down z/right)))
23:05clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>
23:05ThatOneGuy,(doc macroexpand)
23:05clojurebot"([form]); Repeatedly calls macroexpand-1 on form until it no longer represents a macro form, then returns it. Note neither macroexpand-1 nor macroexpand expand macros in subforms."
23:06amalloy&(do (require 'clojure.walk) (clojure.walk/macroexpand-all '(-> [] z/down z/right (-> z/down z/right))))
23:06lazybot⇒ (z/right (z/down (z/right (z/down []))))
23:06mattmossthanks, amalloy
23:07ThatOneGuythanks.
23:07ThatOneGuyso final version: (defn DSL-name [loc] (-> loc z/down z/right))
23:08mattmossAnother way: (def DSL-name (comp z/down z/right))
23:09mattmossoops, ... (comp z/right z/down)
23:09mattmossBad brain. Bad!
23:10ThatOneGuymight as well restrict the args so it fits with the zipper DSL
23:11mattmossThe (comp ...) version will be the same, since z/down (first part of comp) only takes the one arg.
23:11jimrthyI want to busy-loop poll a socket until it closes (state reset...so I have to be single-threaded by now); is there anything more idiomatic than loop/recur?
23:11mattmossIt'll work out the same, but your final version does name it explicitly, which is comforting for some.
23:13mattmossAlso: "when to use macros": http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/
23:13ThatOneGuy,(doc comp)
23:13clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
23:14ThatOneGuyyeah var-args
23:17mattmossSure, the comp is, but z/down is not, so (DSL-name arg1 arg2) will fail whether you are explicit or point-free.
23:17aidalgolWhy does (cons 'foo 'bar) throw a hissy fit?
23:18aidalgolIn elisp and scheme, I get (foo . bar)
23:18mattmoss,(cons 'foo 'bar)
23:18clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
23:18mattmossBecause the 2nd arg is not a sequence as cons expects.
23:18mattmoss,(doc cons)
23:18clojurebot"([x seq]); Returns a new seq where x is the first element and seq is the rest."
23:18aidalgolRight, so to be more direct, why is cons different in clojure?
23:20mattmossSorry, can't help you there. Someone more versed in the design will have to attend.
23:21amalloyaidalgol: clojure doesn't have cons cells, it has sequences. so consing onto something that is not sequential is an error
23:21jimrthyI'm not an expert, but I think the goal was to distance themselves from the ancient lisp roots.
23:21aidalgolah
23:21mattmoss,(conj nil 'foo 'bar)
23:21clojurebot(bar foo)
23:21mattmosshmm
23:21aidalgol,doc conj
23:21clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0:0)>
23:21mattmoss,(doc conj)
23:21clojurebot"([coll x] [coll x & xs]); conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). The 'addition' may happen at different 'places' depending on the concrete type."
23:22aidalgoloops...
23:22mgaare,(cons 'foo '(bar))
23:22clojurebot(foo bar)
23:37futilei notice my clojure code is much closer to actual intent than my code in any other language
23:38futilei.. i cant explain it
23:41mischovdon't try. it's... futile
23:42futile:)
23:42futilebtw it occurred to me recently that #clojure is an awesome channel full of very smart, mature, helpful people
23:42futilethank you all.
23:43futileits a pleasant community to be in
23:44mischovAnd there I had to go and make a joke right before you said it. There goes the maturity! I second the full of very smart, helpful people, though.
23:44mischovPeople have been great about fielding my sometimes really dumb questions.
23:44jimrthyIt's an unpleasant statement about my character that my first inclination was to /fart in futile's general direction
23:45futileeven so, very mature channel
23:45jimrthy(not that I'm much more than a lurker, at best)
23:45futileits easier to see when you step outside the community for a moment.
23:49futileim also way excited to be able to control my OS X windows via clojure
23:50jimrthy@futile: You're absolutely correct. The people on here are generally quite amazing.
23:50jimrthyAnd, yeah. That's *way* cool!
23:50futile:)