#clojure logs

2013-02-09

00:00eggheadhttp://stackoverflow.com/a/3409568 is this anywhere in core?
00:01eggheadthe code reads as something like 'when seq-able lazily seq the sequence s'
00:22dxehwhats a nice clojure tutorial for someone who knows other languages but has not tried _anything_ like clojure syntax wise
00:23eggheadI can recommend https://leanpub.com/fp-oo but it's not freely available
00:24dxeheverything is free on the internet if you look xd
00:34dxehwhats the big difference between clojure & scala?
00:35nightflyOnes a lisp ones not?
00:37dxehi havent actually seen any scala code i dont think i was just assuming it was similar to lisp as well
00:37dxehguess not
00:37nightflysimilar to a lisp != a lisp
00:38nightfly..er (not (eql a-lisp similar-to-a-lisp))
00:39drewcthe type system?
00:41Frozenlockyou mean (not= a-lisp similar-to-a-lisp) :P
00:42dxehis there an eql keyword?
00:42dxehhavent delved into the language much yet just researching it a bit xd
00:42Frozenlockidentical? ?
00:43FrozenlockNote the second question mark...
00:43dxehah
00:53yedican someone who knows korma help me out with this: https://gist.github.com/yedi/4743886
00:53yediit's a very simple starter program and i've included my postgres log
00:55amalloydxeh: i advise trying out 4clojure.com
00:56amalloybut no, scala is not much like clojure. in attempting to improve on java, the languages went in basically opposite directions
00:56amalloy(though really, while i'm not sure about scala, clojure wasn't an attempt to improve java)
00:58eggheadscala is a mix of stuff like haskell/ml/eiffel/java
01:00amalloyyeah, to me scala looks like haskell and java mushed together. but i'm sure there are folks in here with more experience to comment on that
01:02Raynesamalloy: It looks like Haskell, Java, C, Erlang, Python, Ruby, Brainfuck, and every other language mushed together to me.
01:03amalloythat's because you're a prejudiced youngster, Raynes
01:03eggheadclojure reminds me of erlang, lisp, ruby, and java
01:03eggheaderlang just for concurrency semantics tho...
01:03RaynesIt's true.
01:03RaynesThe concurrency has nothing to do with Erlang though.
01:03eggheadthought I like clojure best when it *doesn't* remind me of java
01:04RaynesI mean, you can do actors in Clojure.
01:04RaynesAnd stuff.
01:04eggheads/ght/gh
01:06eggheaderlang has mnesia for in memory store + transactions, kind of like concurrency semantics :)
01:06qzabout scala: pretty old, but it mostly turned out to be true for me - https://gist.github.com/anonymous/1406238
01:06qzespecially sbt rant
01:08dxehmy motivation to learn clojure is so i don't have to write java-like syntax all the time to achieve the same solution xD
01:08dxehthe lisp is a nice change
01:10dxehlol i just got that joke on the 4clojure website amalloy
01:10dxehtook me a couple seconds
01:12callenbotRaynes: Scala has no brainfuck, only INTERCAL
01:12callenbotRaynes: DAT COMEFROM
01:12callenbotRaynes: https://www.youtube.com/watch?v=UX0ue7brUfk
01:13Raynescallenbot: It's really hard to watch Doug Stanhope full screen when you keep pinging me.
01:13RaynesI assure you, your videos of 20 minute long songs are not as amusing as this person.
01:13Raynes:P
01:13yediany korma users think they can help me out: http://stackoverflow.com/questions/14785500/relation-doesnt-exist-error-when-querying-postgresql-with-korma
01:14dxeh(= (list __) '(:a :b :c)) what would the solution be to this? (how are lists formatted in clojure)
01:14Raynes:a :b :c
01:14Raynes&(list :a :b :c)
01:14lazybot⇒ (:a :b :c)
01:19dxeh&((conj '(2 3 4) 1))
01:19lazybotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
01:19dxehok then
01:19dxeh&(conj '(2 3 4) 1)
01:19lazybot⇒ (1 2 3 4)
01:19dxehso is the front of a list in clojure the rightmost element
01:24tomojthe front?
01:24SgeoThe head of a list is the first element
01:24Sgeo,(cons 1 '(2 3 4))
01:25clojurebot(1 2 3 4)
01:25SgeoYou can think of a list as being made of entirely conses
01:25jonasenI can't get checkouts to work with lein-cljsbuild. Has anyone had problems with this?
01:25SgeoAnd the empty list
01:25Sgeo,()
01:25clojurebot()
01:25Sgeo,(cons 1 (cons 2 (cons 3 (cons 4 ()))))
01:25clojurebot(1 2 3 4)
01:26SgeoThat's what a list physically looks like, in theory
01:26dxehwhat is cons a short form of (like the word it represents?) construct?
01:26dxehor consist
01:27Sgeoconstructs, I think
01:27Sgeohttp://en.wikipedia.org/wiki/Cons
01:30callenbotSgeo: caddur hurr hurr
01:30Sgeo?
01:30callenbotSgeo: that's how I pronounce CDR in my head.
01:31callenbotSgeo: caddur
01:31SgeoAh
01:31dxeh,(conj [1 2 3] 4)
01:31clojurebot[1 2 3 4]
01:32dxehso basically ... since those are the same, it would be just bad practice to do (conj [1 2 3 4]) for example
01:32dxehyou could get the same result compiling [1 2 3 4]
01:34Raynescallenbot: I just realized what I said earlier didn't sound like a joke. Just a heads up I was totally kidding. It's fine for you to ping me as much as you like.
01:35yediwhat are the common database wrapper libs in clojure?
01:37Raynesmonger or congomongo for mongodb, clutch for couchdb, korma and/or clojure.java.jdbc or whatever for SQL...
01:38dxehfor networking in clojure do people often just use java libs?
01:38dxehlike nio etc
01:39callenbotRaynes: I hate you.
01:39callenbotRaynes: monger
01:39callenbotRaynes: just don't fuck up updates. If you use something else, report back about it.
01:39Rayneswat
01:39callenbotkidding
01:39RaynesI have no idea what you're saying :P
01:39callenbotRaynes: vodka, sorry.
01:39Rayneslol
01:41dxehhttp://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci the code here, 'lazy-cons', what exactly is the lazy representing in the jvm
01:46technomancyRaynes: probably http://hackingdistributed.com/2013/01/29/mongo-ft/ ?
01:49yedidoes anyone know if it's possible to create tables in korma
01:49callenbotyedi: don't.
01:49callenbotyedi: use a migration library or write your own scripts.
01:50yedilike lobos or something?
01:50callenbotyedi: I'm sure you can find better, but if you like it.
01:50yedii'll look for better
01:54yedidrift seems like the only other optino
01:55callenbotyedi: wrongo
01:55yeditheres migratus and ragtime but they seemed kinda janky
02:05callenbotyedi: all the migration libraries suck, you should write a new one.
02:06yediif only i weren't a complete newb to javascript and managing sql dbs
02:06yediclojure*
02:06callenbotyedi: that's a bad place to be in. Write plain SQL scripts to keep it simple.
02:46yedicallenbot: i guess there's no harm in finding a non clojure migration library
03:13callenbotyedi: use plain SQL scripts
04:05alex_baranoskyanybody there?
04:06ChongLihi
04:07alex_baranoskyhi Chongli
04:07alex_baranoskyare any o fyou planning to be at Clojure/West?
04:08ChongLiI wish, unfortunately not :(
04:08babilenno, way too expensive to fly to the US for that
04:08alex_baranoskyoh, I bet. I'd never fly here for a conference
04:09alex_baranoskyit stinks how US-centric conferences are
04:09babilenWell, Clojure ones at least :)
04:09babilen(apart from euroclojure)
04:09kryftThat would be great if euroclojure were us centric :)
04:10babilenNo it wouldn't -- It would be slightly amusing but at the end of the day increadibly depressing :)
04:10kryftHeh
04:13babilenWill Clojurewest stream sessions? (haven't checked so far)
04:13alex_baranoskydoubt it. I don't think streaming sessions is standard practice
04:14alex_baranoskyusually they show them some months later
04:15babilen*sigh*
04:15babilenSomething that could be learned from conferences such as Fosdem :)
04:17babilenBut then somebody is probably making money with Clojure/West and giving the content away for free is not in the interest. *shrug*
04:17babilen*their interest
04:17alex_baranoskyof course!
04:18alex_baranoskyyou give the content away months after as advertisement for thenext conference
04:18alex_baranoskycan't blame them for that - a lot of money goes into making a conference happen
04:19kryftIf only conferences could be copied and distributed like software ;)
04:19AtKaaZis there a function that already does this? https://www.refheap.com/paste/11115 insert a list of elements inside a (str "prefix" _here_ "suffix")
04:21babilenalex_baranosky, kryft: Well, it really depends on how you organise a conference. There /are/ quite a bunch of conferences that provide live streaming + vivid discussions on IRC during the even (FOSDEM, GUADEC, XYc3, …) -- It looks as if there is no interest in making this happen within the Clojure community though.
04:21babilen(I have no idea who organises Clojure/West and what the intentions for organising it are)
04:22babilen*during the event
04:23alex_baranoskyAtKaaZ: no built-in for that, but there are cleaner implementations than your refheap
04:23AtKaaZalex_baranosky: i agree, thanks; already got rid of partial for starters :D
04:26alex_baranoskyAtKaaZ: does this work? Untested - https://www.refheap.com/paste/11117
04:26alex_baranoskyok tested. works
04:27alex_baranoskyoh, I see you want no spaces in between
04:28alex_baranoskyAtKaaZ: revised to match your requirements: https://www.refheap.com/paste/11118
04:36amalloy~flatten
04:36clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
04:37amalloyjust, you know, for reference. if you solve anything with flatten ever, throw it away and start over or ask alex_baranosky :P
04:37alex_baranoskyflatten is your arch-nemesis! hehe
04:42amalloyflatten is everyone's arch-nemesis. he's the villain out to destroy the world just for fun
05:25AtKaaZhey sorry I was afk, thanks amalloy and alex_baranosky, I'll check the code
05:28AtKaaZI'm happy to learn about join and concat, didn't use them before
05:42alex_baranoskyAtKaaZ: no problem, glad to help
05:59dadaciao
06:00dada!list
06:31manuelpHi everyone! There is someone here that uses cemerick/friend with enlive?
06:35manuelpI'm reading the source code of friend but I haven't found a way to do what I need, yet.
07:56Guest66432what is the deps.js file that my cljs is requesting (get a 404)?
08:05abpGuest66432: https://groups.google.com/forum/#!topic/clojure/_WkdBGPhI-Q/discussion
08:06abpGuest66432: But seems like that should be fixed
08:14Guest66432abp: i saw that, it looked like it shouldnt apply since im using advanced compilation
08:14Guest66432in whitespace i didnt have this issue
08:19Guest66432i dont see the code being minified either which may be part of the issue
08:20hyPiRionGithub down for maintenance? boo
08:21Guest66432trying to use marginalia to generate some docs from my code as well, anyone run into this error java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol ?
08:21Guest66432"lein marg *" is the command im running
08:22Guest66432looks like its coming from hiccup
09:51serpent213hi
09:51serpent213any idea on how to code this more succinctly?
09:51serpent213http://pastebin.com/QQBjG0L8
10:00LajjlaRaynes, do you still love me the most?
10:01ds300Anyone ever have trouble compiling a lein project when overriding a clojure.core func in some other ns? I get a weird nullpointerexception during compilation that goes away when I change the name of the offending function.
10:09xeqimanuelp: did you get enlive + friend working?
10:17abp`serpent213: If you do like this better: https://www.refheap.com/paste/11120
10:26serpent213abp`: good inspiration, thanks! :)
10:38manuelp@xeqi: authentication works, but now I need a way to render some enlive templates differently based on authorization roles. For example: append this link if the logged user has the ::admin role.
10:39manuelpxeqi: I've found the 'authorized?' and 'current-authenticated' fns, but I haven't managed to make them work for me
10:41manuelpxeqi: something like (if (authorized? ::admin (current-authentication)) ...) but I'm having difficulties testing these functions in the repl
10:41manuelpxeqi: thank you FYI
10:43xeqimanuelp: if yo uwant to fake the identiy while playing in a repl you can do something like: (binding [cemerick.friend/*identity* {:username "joe" :roles #{:admin :user}}] ...)
10:44xeqiit sounds like you're headed the right direction with (authorized? role (current-authentication))
10:45tmciverA little off topic but what do people use to validate their markdown before pushing to github?
10:45tmciver\
10:45xeqimanuelp: blah, that bindings not right, hold on
10:46hyPiRiontmciver: I force push until I get it right.
10:46hyPiRionThat's the stupidest way of doing it, btw.
10:46tmciverHa! Yeah, that's what I've been doing. :/
10:47manuelpxeqi: In fact I've already tried something along those lines but without success (friend's 'auth?' fn checks the type)
10:47tmciverI used to use pandoc (http://johnmacfarlane.net/pandoc/try/) but it looks like it's change recently and doesn't display the html.
10:48manuelptmciver: http://jrham.es/instantmark/ ?
10:49manuelptmciver: another one: http://dillinger.io/
10:49tmcivermanuelp: Nice. <3
10:55tmcivermanuelp: Thanks. Seems like the first one (instantmark) doesn't support bulleted lists.
10:56tmciverwait, I take it back. I needed a blank line before the list.
10:57manuelptmciver: you are welcome :)
10:59manuelpxeqi: ok, I'm reading friend's source code and the authentication map is a record.
10:59xeqimanuelp: https://www.refheap.com/paste/11121 ; that binding with provide a identity in the same way workflows do. Then you can test things out in a repl
10:59xeqiblah, I can't type today
11:00tmciverI also just found http://tmpvar.com/markdown.html for markdown preview
11:01manuelpxeqi: You were faster than me :) thank you very much, I appreciate that. I think I'll write a friend mini-guide. Documentation is good for everyone: I consolidate my understanding and at the same time maybe I can spare some newcomer's time.
11:02manuelptmciver: I think nowadays there are a lot of online markdown editors. It's just a matter of finding one that you like. Thank you for the additional link however :)
12:48FrozenlockIs it me or #clojure is becoming more and more quiet in the weekends?
12:50hyPiRionFrozenlock: It's usually like that
12:50hyPiRionPeople aren't at work etc.
12:58AtKaaZhi, is there some function that would return a new map of the same type as the passed map type but empty ?
12:59AtKaaZor is there a function that would empty a map? like (empty thismap) ;returns empty map of same type
12:59jeremyheilerYes
12:59jeremyheiler,(doc empty)
12:59clojurebot"([coll]); Returns an empty collection of the same category as coll, or nil"
13:00AtKaaZoh cool
13:00jeremyheiler,(empty {1 2 3 4})
13:00clojurebot{}
13:00AtKaaZ,(sorted? (empty (sorted-map :b 1 :a 1)))
13:00clojurebottrue
13:00AtKaaZexcellent, thanks jeremyheiler
13:01jeremyheilerNo problem. Also, you generally shouldn't concern yourself with the type of map you're using. For example, small maps are array based, but once they get big enough, they become hash maps.
13:02AtKaaZI understand, it's just that I had some check/:pre/assert somewhere that the map be sorted, and I didn't want to place code that returned sorted map in two places
13:02jeremyheilerahihi, ok
13:03jeremyheilerahihi, ok*
13:03jeremyheilerdamn autocomplete... sorry ahihi
13:03AtKaaZ=)
13:13mdeboardI've got a proprietary, 3d-party SDK that I'd like to integrate with a Clojure project. The SDK is all C source with Java wrapper. How would I go about adding this as a dependency to my project?
13:13jeremyheilermdeboard, Is the Java wrapper in a Maven repository?
13:14mdeboardNo, not as far as I know. I'm using the demo version of the SDK at the moment (evaluating for purchase of license)
13:14mdeboard@ jeremyheiler
13:16jeremyheilerWell, you could install that into your local repository (on your machine) and depend on it from there. Although, I'm not sure what to do about the C code/binary.
13:21mdeboardjeremyheiler: Yeah, thanks anyway though
13:24mdeboardjeremyheiler: I guess my real question is, there's the foo.jar file with all the classes in it. What would I add to project.clj to be able to access those classes?
13:25mdeboardlein relies strictly on maven/clojars eh
13:25modulushmm, maybe this is a stupid question, but i have a .jar file i want to use (it's a java lib). where do i put it so i can access those classes when using line repl?
13:25AtKaaZthis might be relevant to c++ stuff https://github.com/bagucode/clj-native
13:26jeremyheilermdeboard, You could create a .lein-classpath file at the root of your directory, which points to the directory that your jar is in, It hink.
13:26jeremyheilerroot of your project*
13:27mdeboardmodulus: lol, I'm in the midst of that exact question :)
13:27mdeboardjeremyheiler: Thanks, that's a good start point for research
13:27mdeboardmodulus: See jeremyheiler's most recent response to me
13:28modulusyes, i will look around on this
13:31jeremyheilermdeboard, modulus, disclaimer, I've only used .lein-classpath for source files. I don't know if it will work for jar files. I imagine it would, since it's adding to the classpath.
13:31mdeboardyeah makes sense
13:32mdeboardthe contents of the .lein-classpath file is just a path per line? Or should it be a clojure data structure with string members? e.g. '("/path/to/jarfile" "/other/path/to/jarfile")
13:33jeremyheilerPath per line
13:33mdeboardok
13:33modulushmm, but the jar file i'm using is already on one of the dirs on the classpath
13:33modulusbut i do (import 'jcurses) and it doesn't work... i'm probably doing something wrong but i don't know what
13:35mdeboardDoes (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))) include the path you specified?
13:35modulusthe .jar is on the src/project dir which is printed by lein classpath but i'll try that
13:37modulusthe dir where the .jar is gets printed by that form, yes
13:37modulusthough not the .jar itself
13:37AtKaaZshould be the .jar i think, try?
13:38modulusright
13:39mdeboardmodulus: Add `:source-paths ["/path/one/1.jar" "/path/two/2.jar"]` to project.clj
13:39mdeboardthat just worked for me
13:39mdeboardif you're using lein2
13:41modulusthanks, i will try that now
13:41mdeboardand I had to import the class name like it was listed in the jar contents, `(import 'com.callassoftware.pdfEngine.Constants$Transition)` for example
13:42mdeboardwell, by "had to" I mean that it was the first time that worked
13:42modulusi assume the ` is not to be added, right?
13:42mdeboardright
13:42mdeboardI just use that to demarcate source
13:42modulusright
13:42modulusthx
13:46modulusooh shiney, it worked at last.
13:47modulusthanks all for help
13:48mdeboard:D
13:50yediin paredit/emacs is there a keybinding for highlighting the entire form you're currently in, or the form that starts where your cursor is?
13:51yedii don't want to have to C-space and move cursor everytime i want to wrap parentheses around a form
13:52Frozenlockyedi: I really like expand-region.el for this
13:52Frozenlockhttp://emacsrocks.com/e09.html
13:52yedioh sweet, thanks
13:53pimeysI've tried to learn emacs now
13:53pimeysif I turn off evil mode, I'm lost
13:53jeremyheileryedi, M-( wraps parents around the form
13:53jeremyheilerparens*
13:53pimeysstill waiting the one big thing in emacs that converts me, slime might be one but I don't know
13:53jeremyheilerwith paredit, that is
13:54yedijeremyheiler: oh cool, thanks aswell
13:54jeremyheilerpimeys, nrepl was what did it for me
13:54pimeysI'm still very fast with vim and a bit lost even with evil mode in emacs
13:54Frozenlockpimeys: org-mode :)
13:54jeremyheilerI also never tried evil mode, forcing myself to really learn it
13:54pimeysI just cannot live without the command mode
13:55pimeysIt's so superior way to edit text
13:56jeremyheileryedi, i refer to this a lot: http://mumble.net/~campbell/emacs/paredit.html
13:56modulusso, when running lein repl does the cor.clj get run?
13:56jeremyheilermodulus, no
13:56Frozenlockjeremyheiler: I should take this day to finally learn paredit
13:57jeremyheilerFrozenlock, it is so worth it
13:57FrozenlockDoes it work in the repl too?
13:57octagonhello! in cljs + is a macro: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L221. how is it possible to do (apply + [1 2])? i thought it was not possible to take the value of a macro?
13:57Frozenlock(no mode clash, anything?)
13:58jeremyheilerFrozenlock, not by deafult at least. I haven't tried, though. still learning
13:58octagon(the expression (apply + [1 2]) does evaluate to 3, correctly)
14:00yedi(ns skateproj.routes :require [skateproj.db :as db])
14:00yediis there something wrong with this form?
14:01yedii get: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
14:01yediwhen trying to execute it
14:01Frozenlock(ns skateproj.routes (:require [skateproj.db :as db])) Missing a paren?
14:01yedioh right
14:03jeremyheilermodulus, you can specify a namespace to load in :repl-options, though
14:03jeremyheilersee: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L115
14:16mdeboardHm, though I have imported a class successfully I can't access any of the class methods; static fields yes but not methods
14:16jeremyheilerHow are you doing it?
14:18mdeboard`(import '(com.callassoftware.pdfEngine PDFEngine))` then `PDFengine/compare` just to see if it exists. But I also tried (PDFEngine/compare "a" "b") and (. (new PDFEngine) compare), always says field not found
14:18mdeboardThe error I get with (new PDFEngine) is InstantiationError com.callassoftware.pdfEngine.PDFEngine user/eval893 (NO_SOURCE_FILE:1) ... which makes me wonder if it's having issues finding the C source around which that class is wrapped
14:19yedihow do i delete parentheses in paredit? (i couldn't find it in the cheat sheet)
14:19jeremyheilermdeboard, possibly. it's definitely a no-arg constructor?
14:19mdeboardYeah
14:19mdeboard@ noarg
14:20mdeboardfrom Javadocs: "Constructor Detail: PDFEngine\npublic PDFEngine()"
14:20jeremyheileryedi, you can highlight it and C-w it
14:21jeremyheileryedi, but i only do that if they somehow get unbalanced.
14:22yediok, but i can't even delete both parens when deleting just the first paren
14:22yediwhich i though was the normal behavior
14:22jeremyheilermdeboard, not sure where to take it. i assume the binary is on the PATH?
14:22mdeboardNo, it's not, that's my next step
14:23modulushmm, how do i need to organise my code so lien run will run it? i thought i just needed to write it on core.clj?
14:23jeremyheileryedi, so when you delete the open paren, the close paren sticks around? (assuming they are together)
14:24yediwell it won't let me backspace the open paren
14:24jeremyheilermodulus, take a look here: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L103
14:24modulusright, thx
14:24jeremyheilermodulus, np
14:25jeremyheileryedi, it should work if they're right next to each other. even if there is a space between them, it wont let you delete it.
14:25yedii'm sure this a really nooby problem, but i don't get why :name returns null: https://gist.github.com/yedi/4746687
14:26yedijeremyheiler: ah i see, hmm, i guess i just haven't gotten used to the paredit way yet. tanks
14:26jeremyheileryedi, as for your gist, it looks like your function is returning a vector, not a map.
14:26mdeboardHm, I wonder if :native-path could be used to specify location of C binary
14:26yediohh
14:28jeremyheilermdeboard, I just thought that the overtone project might be a good place to look, since I think it uses a native dependency.
14:30mdeboardjeremyheiler: Ah, looks like it wraps the C libs directly with Clj? https://github.com/overtone/overtone/blob/master/src/overtone/sc/machinery/server/native.clj
14:31jeremyheilerinteresting
14:37modulusso i'm too dumb for this language i think ;-)
14:38mdeboardlol
14:38mdeboardIt's an abstraction of another language which is an abstraction of another language
14:38pimeysmodulus: don't say that :D
14:38pimeysjust put more years into programming
14:38modulusclasspath includes c:\clojure\plaything\src - in taht dir there's plaything\core.clj - in project.clj there's :main plaything.core
14:38moduluslein repl tells me plaything\core.clj not on classpath .... confused
14:39Frozenlockmodulus: I prefer to think that I'm too dumb to use any other language... arrays, memory allocation, classes, methods... I can't understand all this stuff.
14:39pimeysalthough I have the same feeling when I start doing something with haskell
14:40pimeysthere's stuff, like functors, for which I cannot find any use
14:40modulusFrozenlock: i can more or less deal with the language, but all the deployment stuff around it is really screwing with my head
14:40pimeysthen I read somebody else's code and they use lots of functors and monads
14:40pimeysalthough I understand what monad is, I have no clue how to use them
14:40Frozenlockmodulus: Yeah. I wonder how everyone did it before leiningen.
14:40moduluspimeys: monad is just way to specify sequential computation or whatever
14:41mdeboardpimeys: Much the same way you'd use a burrito
14:41pimeysof course
14:41pimeysbut then readin some monadic code
14:41pimeys+g
14:41modulusanyway, any clue why lein is lying to me? ;-)
14:41pimeysjust, it's so different
14:41pimeysand then clojure was so easy to start with
14:41jeremyheilermodulus, can you gist your project.clj and main namespace?
14:42jeremyheiler(or refheap ;-)
14:42modulusyeah sure
14:42Frozenlockjeremyheiler: refheap using refheap.el :)
14:42jeremyheilerFrozenlock, oooh, gotta install that
14:43octagonso in cljs, both + and case are macros. however, + in the cljs repl is an actual function and case is not. how does this work?
14:43pimeysthough it has helped me that I use xmonad, so all configuring means to be able to write some haskell
14:43FrozenlockYes you do. You can paste on refheap without ever leaving emacs.
14:44AtKaaZoctagon: you mean clojure with the second cljs
14:44Frozenlockoctagon: Is '+' redefined as a function in another namespace? The macro could have been used locally to bootstrap or something.
14:44FrozenlockKinda like list*
14:44octagonAtKaaZ: i was using himera, but there is a leiningen thing for cljs repl via ajax to the browser too
14:45modulusoh joy, pastebin thinks my code is spam
14:45AtKaaZoctagon: in clojure, + is a fn and case is macro, do you mean that in cljs repl + is a fn also? even though it seems like it's defined as a macro when you linked to it before
14:46octagonAtKaaZ: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L1226
14:46octagonyes it's definitely a macro
14:46modulusjeremyheiler: https://www.refheap.com/paste/11125
14:46Frozenlockoctagon: you just linked to a function
14:48octagonFrozenlock: whoa, you're right, so many tabs. that's interesting: it's defined as a macro here: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L221 and then as a function https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L1226, problem solved!
14:48AtKaaZoctagon: in core.cljs + is a fn and in core.clj + is a macro :O
14:48octagonnow it makes perfect sense!
14:48jeremyheilermodulus, if you have a dumb -main that does nothing, do you get the same error?
14:49AtKaaZcool, cause I don't get it=)
14:49modulusjeremyheiler: trying, sec
14:50AtKaaZoctagon: but in clojure (not cljs) repl it's a fn as well
14:50octagonAtKaaZ: i think the answer is here: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L1231
14:50octagonthe first + in the reduce expr is the macro, the other is the function
14:50moduluscorrect, same error
14:50modulusmain defines as (defn -main [])
14:50octagonerr i mean the other way round
14:51AtKaaZoctagon: ok that makes sense
14:51octagontrixty lil thing there
15:28BodilOoh look, I got a Clojurescript REPL working on Nashorn: https://github.com/bodil/cljs-nashorn
15:29ivancool
16:00fredyri found myself wanting to do this a couple of times: https://www.refheap.com/paste/11126
16:00fredyrany ideas would be much appreciated
16:01yedicallenbot: what do you have against monger?
16:08fredyroh nvm, reduce does the trick obviously
16:12callenbotyedi: absolutely nothing
16:19borkdudehow do I get the body of document in clojurescript?
16:21Frozenlockborkdude: you can make a direct JS call, or use a library like domina
16:21hyPiRionfredyr: do what? add in spaces?
16:21hyPiRion,(let [v [\a \b \c \d]] (assoc v 1 \space 4 \space))
16:21clojurebot[\a \space \c \d \space]
16:22borkdudeFrozenlock I'm trying this (def b (-.body js/document)), what's wrong with it?
16:24yediis enlive the go to for clojure html templating? or are there other contenders?
16:24Frozenlockborkdude: I don't have my repl running, but try typing js/document.body in yours.
16:24borkdudeFrozenlock I'm trying it on himera
16:24hyPiRion,(let [v [\a \b \c \d] poses [1 4]] (apply assoc v (interleave poses (repeat \space))))
16:24cshellyedi: I use enlive, but there's also hiccup
16:24clojurebot[\a \space \c \d \space]
16:24borkdudehttp://himera.herokuapp.com/index.html
16:25borkdudeFrozenlock hmm, yes that works
16:25borkdudeFrozenlock I'm a bit confused then how property access works
16:25cemerickBodil: What's the perf like? I've been using phantomjs exclusively b/c rhino is just _so_ slow.
16:26Frozenlockborkdude: it's .-body, not -.body
16:27fredyrhyPiRion: i fixed it with a reduce
16:27borkdudeah
16:27fredyr(reduce #(assoc %1 %2 \space) my-vec indices)
16:28Bodilcemerick: Haven't really benchmarked it, but it should be closer to Node than Rhino. Startup time is bad, though, but the Nashorn devs promised me that should be fixed in a few weeks. If you want performance, cljs-noderepl is probably a better choice than phantomjs.
16:33cemerickBodil: Is that attributable to the difference between v8 and JavascriptCore?
16:36Bodilcemerick: I only have experience with running JS on other Qt apps, where it's a fair bit slower than V8. Phantom's still on Qt, right?
16:36AtKaaZhi, what does it mean when [f & [silently]] those [] are around silently parameter?
16:37cemerickBodil: no idea
16:37FrozenlockAtKaaZ: Everything after & will be put inside a list. So [silenty] will take the first item from that list.
16:38Bodilcemerick: It was last time I checked, which was admittedly quite a while ago. :)
16:38ordnungswidriglein deps :verify => bad-signature [org.clojure/clojure "1.4.0"]
16:38ordnungswidrigshould I worry?
16:38AtKaaZFrozenlock: that's what I thought first, but it didn't seem to be the case :O I'll retest
16:38Frozenlock,(let [[a & [b]] [1 2]] b)
16:38clojurebot2
16:38yedienlive vs hiccup... ugh choice paralysis will be the death of me
16:39metellus,(let [[a & [b]] [1 2 3 4 5]] b)
16:39clojurebot2
16:39FrozenlockAtKaaZ: However I recently learned that the clojure way is to rather use multiple arities function.
16:39cemerickBodil: based on their build instructions, it does use qt
16:39gfredericksAtKaaZ: it is effectively the same as [f silently] except that the function is relaxed to allow one or more arguments
16:40FrozenlockHrphm... can't find the reference... anyone here have the 'clojure best practice' github wiki?
16:40Bodilcemerick: Then, at a guess, Node would be faster than Phantom. Unless your code needs a DOM...
16:40AtKaaZgfredericks: ohh i see now, it really does get the first element from the rest (after &) so all others are ignored
16:41AtKaaZi take it that's idiomatic clojure to not throw when extra params are in fact ignored
16:42Frozenlockhttps://github.com/bbatsov/clojure-style-guide
16:42AtKaaZthanks
16:42TimMcyedi: They're very different. I'm surprised you're ambivalent.
16:42andyfingerhutI'm taking a stab at writing up some documentation for people new to the read/read-string vulnerabilities, and what they can do about it in Clojure 1.5 and earlier versions.
16:43FrozenlockAtKaaZ: Well it will throw an error if you don't use &.
16:43TimMcandyfingerhut: You want readers?
16:43cemerickBodil: it's mix across different projects. At the moment, I'm just basking in the rhino -> phantom improvement. :-)
16:43andyfingerhutTimMc: Definitely, and correcters when I have something, because I'm sure I'll get some of it wrong.
16:43AtKaaZFrozenlock: true, i was only saying for things like [ f & [silently]] anything other than first after f is ignored silently :D
16:44cemerickrhino + *headed* browser REPL for DOM-related tests :-x
16:44metellus,((fn [&] :a) 1 2 3)
16:44clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: sandbox$eval87$fn>
16:44Frozenlockandyfingerhut: how about "and the read-string will not just read, it will also eval, even if you have a seperate eval function. Be careful not to be #=ed."
16:45cemerickandyfingerhut: you have a paste/gist/etc somewhere?
16:45AtKaaZ,(quote 1 2 3)
16:45clojurebot1
16:45AtKaaZthat's an example :))
16:45andyfingerhutI was going over some of the #clojure IRC logs from a couple of days ago, and learned there about a potential security vulnerability in Clojure 1.4 even if you use read/read-string while *read-eval* is false. It was something involving record literals not being governed by *read-eval*.
16:45AtKaaZ,(var defn 2 3)
16:45clojurebot#'clojure.core/defn
16:45andyfingerhutI'd like to include an example of what kinds of malicious things people could do with that, if they are relatively short, so more people can be aware of it.
16:46hiredman,(type (read-string "`String"))
16:46clojurebotclojure.lang.Cons
16:46andyfingerhutFrozenlock: I'm hoping for something more detailed than that :)
16:46andyfingerhutcemerick: Not yet. Will send out a draft when I have one.
16:47hiredman,(type (read-string "#java.lang.String[Foo]"))
16:47clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.lang.String>
16:47hiredmancauses arbitrary class loading
16:47FrozenlockI still find it mindbogglingly confusing that a 'read' function doesn't just read. (And I don't care if it was how it was done in the CL world)
16:47hiredmanwhich causes static inits to run
16:48TimMcFrozenlock: It feels like there should be a reader, an X-er, and an evaluator. (For some term "X" which I haven't figured out yet.)
16:48ordnungswidrigTimMc: X-er ist not that bad for a name
16:48Frozenlockx-er?
16:48andyfingerhuthiredman: Is there a short example that would make it blindlingly obvious to the slowest observers (e.g. me) how that could be leveraged into a very bad thing like removing files or opening a socket to an arbitrary machine?
16:50TimMcFrozenlock: I have't figured out what the word would be, therefore "X".
16:50andyfingerhuthiredman: assuming a JVM like Oracle 1.6 or 1.7, for example?
16:50TimMcI hope that doesn't stick.
16:50hiredmanandyfingerhut: aot compiled namespaces are class files with a a big static init
16:51TimMchiredman: So you could load a namespace that has side-effecting defs?
16:51TimMcWhat are the consequences?
16:51hiredmanandyfingerhut: I'd have to think about it, it is tricky because you cannot really run code besides static inits and constructors
16:51FrozenlockI understand 'read' and 'eval'. I'm under the impression that there's some kind of 3rd functionality that was included to facilitate interop with he jvm, am I mistaken?
16:52hiredmanyou might be able to do some kind of ddos of file handles?
16:52hiredman,#java.net.Socket["google.com" 80]
16:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.SecurityException: denied>
16:52ordnungswidrighiredman: nice
16:53TimMcGiant allocations, maybe>
16:53hiredmanwell that would work if it was not being read inside clojurebot's sandbox
16:53hiredman(the socket thing)
16:53TimMc,#java.util.ArrayList[1e10]
16:53clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No matching ctor found for class java.util.ArrayList>
16:54xeqiI hear FileOutputStream makes files blank
16:54Frozenlockhiredman: even with *read-eval* to false?
16:54hiredmanthere is that
16:55TimMcI'd like to see read-edn split out as a separate library that old code can bring in as backporting.
16:55TimMcs/old code/code reliant on 1.4/
16:55xeqi+1 TimMc
16:55ordnungswidrigTimMc: try 1e9
16:55andyfingerhuthiredman: Confirmed that with Clojure 1.4 your example causes the socket to open even when *read-eval* is bound to false. Thanks. I also like the ArrayList one.
16:56TimMcordnungswidrig: Oh, was that a Long?
16:56ordnungswidriga digit to moch
16:56andyfingerhutI also tried it on Clojure 1.5 latest master as of an hour ago, and it throws an exception about "Record construction syntax can only be used when *read-eval* == true", so that is an improvement.
16:57TimMcOh, good to hear!
16:58andyfingerhutI'm not sure which commit changed that, but I may try to track it down.
16:59xeqiandyfingerhut: there is an email disclosing this by Cosmin Stejerean in the read-eval thread
16:59xeqiI think rhickey mentioned when he fixed it
17:00TimMcOMG, Integer/getInteger -- I hate that so much.
17:00andyfingerhutDoes anyone know off-hand what settings of the various *print-<foo>* vars, and which print-related Clojure functions, will restrict themselves to output that clojure.edn/read can handle?
17:01TimMcandyfingerhut: None, I think, since regexes aren't in EDN.
17:02andyfingerhutTimMc: So regexes are an exception which I will list. I'd like to list others, but if the "good data types" list is much shorter than the "bad data types" list, I'd like to give the shorter list.
17:05TimMc&(apropos "*print-")
17:05lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
17:05TimMc&(use 'clojure.repl)
17:05lazybot⇒ nil
17:05TimMc&(apropos "*print-")
17:05lazybot⇒ (*print-radix* *print-miser-width* *print-pprint-dispatch* *print-suppress-namespaces* *print-right-margin* *print-pretty* *print-base* *print-level* *print-length* *print-dup* *print-readably* *print-meta*)
17:05TimMcI think only *print-dup* and *print-readably* are relevant here.
17:07andyfingerhut*print-level* should be nil, or large enough to avoid taking effect.
17:07andyfingerhutFor many Clojure data types, one can have *print-dup* false and still round-trip via print then clojure.edn/read, correct?
17:12hiredmanandyfingerhut: prn, yes
17:26jodaroso
17:26jodaroi'm a windows idiot
17:27jodaroi'm trying to read a directory thats a .lnk
17:27jodarowith clojure.java.io/file
17:27jodarobut
17:27jodarono bueno
17:54yedihow can i reload project.clj from emacs/nrepl?
17:54yedii keep getting defproject doesn't exist errors
17:55aaelonyA call like (clojure.xml/parse "http://search.twitter.com/search.atom?&amp;q=clojure&quot;) will parse an xml web service, but what if I first need to stuff an api-key into the Header. Is this possible to do with clojure.xml/parse ? How can I add a header?
17:55yedii've been restarting emacs to get around it
17:56ivanjodaro: .lnk-following is really an explorer.exe feature, though it can be done if you really want it
17:56ivanyou can also have real symlinks on Windows if you really want them
17:57jodaroivan: thanks. i'll look into that
17:57amalloyyedi: don't restart emacs, restart your nrepl session
17:57amalloychanges to project.clj can't impact already-running processes
17:57ordnungswidrigdoes lein.el work?
17:57ivandefault settings require elevation to create a symlink, and you can't change the destination's folderness without recreating it
17:58amalloyordnungswidrig: probably not; i've never heard of it
17:58ordnungswidrighttps://github.com/technomancy/lein.el.git
18:00amalloyneat
18:01jodaroooohh
18:01jodaroi need that
18:02AtKaaZ,'``````'1
18:02AtKaaZ&```````'1
18:02clojurebotExecution Timed Out
18:03AtKaaZshould be stack overflow:)
18:03ivanI get "Invalid method Code length 594054 in class file user$eval3047" after a few seconds
18:03AtKaaZon the first one
18:04ivanah, yes
18:05ivanthe output of this makes Emacs' word-wrapping unhappy
18:05AtKaaZI could use some word-wrapping in ccw repl
18:08FrozenlockCan a clojure program add files itself into the resources directory once it has been uberjared?
18:08warzis there a way to specify a string without having to escape back slashes? like, in C# for example you can do @"c:\users\foo"
18:09AtKaaZFrozenlock: probably would work if the .jar wouldn't be locked when running
18:09FrozenlockHmm... well then, I'll just spit it in the (System/getProperty "user.home") directory
18:10amalloyFrozenlock: the resources *directory*, of course. but not the entry in the jar file; java runs with jars opened read-only
18:10AtKaaZah, I assumed that is inside the .jar for some reason
18:11Frozenlockamalloy: bummer. Yet I'm sure there's a whole lot of reason why it's better this way.
18:12amalloyyes
18:15yediam i getting this error because templates/hello-dress.html can't be found? https://gist.github.com/yedi/4747527
18:16AtKaaZi blame idiomatic clojure coding :)
18:21holohi
18:21cshellhi
18:23holois there some lein plugin to scan for unused forms declared in the ns?
18:24holoi'm doing some heavy refactoring, and it is time consuming to manually scan them
18:25cshellholo: if you use require :as you can see them pretty easily
18:27hyPiRionholo: There's always Slamhound
18:27hyPiRionhttps://github.com/technomancy/slamhound
18:27holocshell hi! as referenced in http://dev.clojure.org/display/design/Library+Coding+Standards -> "Be explicit and minimalist about dependencies on other packages. (Prefer the :only option to use and require)" which i agree with, except that for this situation is not being an advantage
18:29holo"Slamhound rips your ns form apart and reconstructs it. No Dutch surgeon required." haha .. thanks hyPiRion
18:29yediany help: https://gist.github.com/yedi/4747527#file-gistfile1-txt-L10
18:32holoyedi, are you getting the database env?
18:33yediholo: huh?
18:35holoyedi, aren't you using a db? usually i get nullpointerexception when i forget to load the environment variable. just a wild guess
18:36yediholo: ah, i don't believe that is it. the call to the deftemplate macro doesn't touch the db
18:37tomojwhy don't symbols resolve at read time?
18:37Frozenlock,(quote [1 2] [3 4])
18:37clojurebot[1 2]
18:38tomojso that macro writers can do crazy stuff?
18:38tomojoh, no
18:39tomojthere would just be no way not to get resolution like there is for keywords
18:40holoyedi, skateproj.routes really has that name in the filesystem?
18:41holoi mean skateproj/routes
18:41yedisrc/skateproj/routes.clj
18:42yedioh
18:42yedithe templates/dress-page-html is stored in top level directory
18:43yediso templates is on the same level as project.clj
18:43holooh..
18:43yedii updated the gist: https://gist.github.com/yedi/4747527
18:44yediso... the file is being found yet i still get the NPE (and research shows that generally NPE means enlive can't find the resource html file)
18:45holoyedi, i think you should store it in the path for the resources
18:47yediis there an easy way to add directories to the class path
18:48yedii'm using lein
18:48yedilooks like resource-path might do it
18:51holoyedi, if you put inside the existing resources path, can't you use a relative path for the file?
18:52yediholo: sorry i don't follow
18:54holoyedi, don't worry, it's probably my english. if say, your resources path is /resources/ and you put the file in /resources/templates/ , then you can try (html/deftemplate dress-page "templates/dress-page.html"
18:55yediholo: ah right, that's what imma attempt to do
18:57yediamalloy: so i tried your tip of reloading nrepl instead of restarting emacs, but then i just started getting namespace not found errors after nrepl restarted
18:57yedithis occurs even when evaluating the ns form...
19:18FrozenlockIs there a way to make sure a namespace has some functions already loaded? Something like (with-refer some-ns (load-file "my-clj-file"))
19:19arohnerFrozenlock: you mean like require?
19:21FrozenlockYes, but from outside the file loaded. Load this file, and make sure those functions are available for it.
19:22FrozenlockHmm.. I could make a with-require macro... (with-require (load-file))
19:27callenbotalright, I've made a huge mistake
19:27callenbotI switched away from noir cookies and it's not working.
19:27callenbotI'm trying to use vanilla Ring sessions with an encrypted cookie store..
19:28FrozenlockYou moved away from noir or noir-lib?
19:28callenbotlib-noir
19:28Frozenlocker, lib-noir :p
19:28callenbotI haven't completely moved way, but I'm trying to.
19:28callenbotI can't get these stateless sessions working though
19:28abp`callenbot: How so?
19:29callenbotI don't think the sessions are surviving across a redirect. I'm not sure though.
19:29callenbotI'm using Ring redirect an assoc'ing the :session though
19:30callenbotdoes anyone know of a particularly good example of how to use Ring sessions?
19:30callenbotI didn't find anything compelling or that seems to work.
19:34abp`callenbot: When do you assoc on :session?
19:35callenbotI'll just pasta.
19:35abp`callenbot: Sure
19:36callenbotabp`: https://www.refheap.com/paste/11133
19:36callenbotabp`: what am I fucking up?
19:40abp`callenbot: compojure.handler/site already does wrap-session. Try passing {:session options} to site
19:40callenbotabp`: thanks
19:41technomancyordnungswidrig, amalloy: lein.el doesn't really work yet unless the emacs instance doesn't have a project-level nrepl session
19:41technomancyI haven't adapted it to support a lein nrepl session and a regular one at the same time
19:41callenbotabp`: made the change, still not working.
19:41abp`callenbot: Don't know if that's all, but first thing standing out.
19:44abp`callenbot: Everything else looks good I think. Is your session-data in resp when printing from login-page handler?
19:45sritchiehey -- are any of you guys running multi-module projects with leiningen?
19:46callenbotabp`: I just got it working now
19:46abp`callenbot: Ok. What was the problem?
19:46callenbotabp`: I had to put (site ...) after some user middleware.
19:48abp`callenbot: Oh sure.. To have access to the session.
19:54yedihow exactly would i go about composing templates in enlive?
19:55callenbotyedi: a few points of order
19:55callenbotyedi: 1. don't
19:56callenbotyedi: 2. use something else
19:56callenbotyedi: 3. reserve enlive for scraping
19:56abp`Rescue him!
19:56Raynesyedi: A few points of order
19:57Raynesyedi: 1. Ignore callenbot.
19:57Raynesyedi: 2. Use laser because I wrote it and I'm pretty great.
19:57callenbotyedi: 1. laser is cool, clabango is better.
19:57callenbotyedi: 2. I'm a bot, don't listen to me
19:57callenbotyedi: 3. Black metal is awesome.
19:57Raynesyedi: 3. Use fragments, pass them to other fragments, and pass it to a document. Etc. They're just functions. They compose normally.
19:57yedicallenbot: i like the idea of having my designer have access to the html
19:57Raynes:p
19:57yediRaynes: i'll check out laser
19:57callenbotyedi: good thing Clabango lets you do that.
19:58callenbotyedi: look at Clabango. Give it a shot.
19:58callenbotyedi: https://github.com/bitemyapp/neubite/blob/master/src/neubite/templates/base.html
19:58callenbotyedi: https://github.com/bitemyapp/neubite/blob/master/src/neubite/templates/index.html
20:00yedilooks like what django uses
20:00yediand that's not exactly the html... though it might be good enough
20:02callenbotRaynes: bot: 1 Raynes: 0
20:03abp`*clapclap*
20:03yedihaven't chosen clabango yet =p
20:04abp`I just use hiccup.
20:04yedibut thanks guys, adding clabango and laser to my list of templating options will have a profound effect on the choice paralysis i was feeling earlier
20:04callenbotyedi: it's okay, you will.
20:04S11001001(inc Raynes: bot: 1 Raynes:)
20:04lazybot⇒ 1
20:04abp`Bootstrap is my designer.
20:04abp`Formative builds my forms.
20:04callenbotabp`: he needs to work with a designer, like I do.
20:04callenbotyedi: I can make it easy. Just use clabango.
20:07yediraynes:
20:07Raynesyedi:
20:09yediraynes: this line: "But darn it, we don't want all of our p to be omg. Let's only change the ones with the meow class!" possibly doesn't fit the code: (laser/document (laser/parse html) (laser/class= "meow") (laser/content "omg"))
20:09yediwon't that make all elements with the class meow have "omg"
20:09yediand not just <p>
20:11gfrederickswhistling (partition 5 1 (cycle major-scale)) is more difficult than I thought it was
20:45callenbotyedi: hey
20:45yedisup
20:46callenbotyedi: use Clabango.
21:00Raynescallenbot: hey
21:00Raynescallenbot: Walk off a balcony.
21:01callenbotRaynes: bots can't walk
21:01callenbotRaynes: I'll take a flying leap with you in LA though :D
21:02Raynes:p
21:06amalloyyedi: presumably Raynes's tutorial is assuming that you haven't written non-p elements with class=meow
21:08Raynesyedi: amalloy is correct.
21:09yediok
21:11cshellIf I have a vector that has alternating key and value (ie. [:a "a" :b "b]) what would be the right function to use to update the :b key? So I'd return [:a "a" :b "c"]
21:11cshell?
21:14callenbotwhen does Clojure 1.5 go stable?
21:14callenbotI'd like to stop using my dissoc-in shim.
21:17amalloycshell: use a better data structure than that :P
21:17cshellamalloy: that's actually a good idea
21:17cshellamalloy: I must be tired
21:18cshellamalloy: thanks :)
21:33gfredericksclojure.java.jdbc/with-connection is deprecated?
21:34amalloycallenbot: your statement seems to imply that clojure 1.5 contains dissoc-in
21:36callenbotamalloy: wait wait, it doesn't?
21:37amalloythe function is just as confusing as it would have been in 1.0; i can't think why you thought it was being added
21:37amalloywhat does (dissoc-in {} [:a :b :c]) return?
21:37callenbotan empty map
21:38callenbotan untouched empty map.
21:38amalloyand why not {:a {:b {}}}?
21:38callenbotbecause the original assumption was invalid.
21:38callenbotso best to leave it untouched.
21:38callenbotthe key path is speculative.
21:38callenbotit's just saying, "remove if it's there, but don't sweat it if it's not"
21:39callenbotamalloy: I see nothing confusing about that.
21:46ivan&(clojure.pprint/pprint 1)
21:46lazybot⇒ 1 nil
21:46ivan&(clojure.pprint/pprint (range 40))
21:46lazybotjava.security.AccessControlException: access denied (java.util.PropertyPermission line.separator read)
22:07mdeboardWhat does the last part of this error message correlate to? PDFEngineException com.callassoftware.pdfEngine.PDFEngine.throwIfError (:-1)
22:07mdeboardThe (:-1)
22:07mdeboardI caught the exception, the actual error message is an empty string. Is it the exit code of the fn or what
22:13TimMcLine number? :-P
22:13mdeboardThat's as reasonable as anything I could think of (nothing)
22:14lynaghkdnolen: ping
22:15mdeboardI'm kind of at my rope's end trying to implement this JNI wrapper class
22:17TimMc&:-1
22:17lazybot⇒ :-1
22:18TimMcMaybe it's an emoticon.
22:18mdeboardlol.
22:18mdeboard"Just got out of the shower and smirking"?
22:18TimMcImpudent stack traces.
22:19mdeboardThe stack trace == nil
22:24TimMcRight, it's failing to wrap the exception.
22:25TimMcI hate that so much.
22:25TimMcI mean, with event-driven programming, there's at least an excuse to lose the trace.
22:25mdeboardAt least this way I get to laugh about it https://gist.github.com/mattdeboard/c1f11be5e11f096a6840
22:26mdeboardWhen you say "it's failing", what's "it"
22:26TimMcWhatever is catching and then throwing.
22:27TimMc"throwIfError"
22:27mdeboardFailing to wrap the exception how? I'm not good with computer
22:27TimMc.printStackTrace always returns nil, by the way
22:27amalloyTimMc, mdeboard: (:-1) is a nil source file, line -1
22:27mdeboardoh, really
22:27mdeboardweird.
22:27mdeboardI have no idea what that means.
22:27TimMcmdeboard: Is this in the repl? Try (pst).
22:27mdeboardI mean, I know what nil means, but.
22:28TimMcThrowable.printStackTrace has a return type of void == returns null == nil
22:28mdeboardThat did return some stack trace, cool
22:28mdeboardalso, oh.
22:29TimMcI thought you meant that it was catching some error, discarding it, and throwing a new one in its place.
22:30callenbotis there a way to show private contribution activity on github?
22:30mdeboardps is a proxy so maybe that's why it's saying (:-1)
22:30mdeboardcallenbot: No
22:31callenbotmdeboard: balls.
22:31mdeboardyeah
22:32callenbotmdeboard: I'm up there with isaacs if you include my private activity. How disappointing.
23:03dnolenlynaghk: pong
23:05lynaghkdnolen: hey dude
23:05dnolenlynaghk: wassup?
23:05lynaghkI'm looking through the new unifier stuff, it's pretty rad
23:05dnolenlynaghk: yay!
23:05lynaghkhad a few questions for you, but I think I've resolved most of them
23:06dnolenlynaghk: cool, I'm pretty happy w/ the changes
23:06lynaghkdnolen: one I haven't, though: if two records use unify-with-pmap* as their implementation for IUnifyWithRecord, then they should behave symmetrically
23:06lynaghkright?
23:06clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
23:07dnolenlynaghk: hrm, that seems weird that a record would use unify-with-pmap* for their implementation of IUnifyWithRecord
23:07lynaghkdnolen: I'm doing it to ensure that things only unify with records of the same class
23:09lynaghkdnolen: but my question is: (unify [#my.A{:a 1} #my.A{:a '?a :b 2}]) should give the same result with the vector reversed, no?
23:09dnolenlynaghk: well it should fail
23:09dnolenregardless of order
23:10dnolenthat different records should not unify isn't something I had considered - it should probably be handled
23:10dnolen"had not considered"
23:10lynaghkwhy should it fail?
23:11dnolenlynaghk: those records have different key value pairs
23:12lynaghkdnolen: but if they're implementing unify-with-pmap?
23:12dnolenlynaghk: not a good idea IMO
23:12dnolenlynaghk: partial map unification breaks associativity of unification
23:12dnolener
23:12dnolensorry
23:12dnolentransitivity
23:13lynaghkdnolen: yeah, that has been my biggest concern.
23:13dnolenlynaghk: not worth it
23:13dnolenlynaghk: partial map unification is only ok if the the thing that allows partial map unification is not "storable"
23:14dnolenrecords are "storable"
23:14dnolenit's for this reason that partial maps can no longer be bound to logic vars
23:15lynaghkdnolen: hmm. I'll see if I can figure out a nice way to do my rewrites without having all of the classes act like partial maps.
23:16dnolenlynaghk: so featurec is a constraint, so perhaps you can move those kinds of things into :when?
23:16lynaghkdnolen: yeah, that's exactly what I'm thinking
23:16trofguys, a small question, now that i've only started learning clojure, when i finish with the 4clojure tasks, do any of you have any projects where the additional pair of coding hands would be useful? i've been programming java for somewhile
23:17dnolenlynaghk: one issue, pointed out by hiredman, is that featurec should allow nested maps which it currently does not
23:17trofi mean, for free, for fun
23:17lynaghkdnolen: oh shit, I hadn't actually seen featurec.
23:18lynaghkdnolen: it looks like exactly what I'm trying to put together myself.
23:18dnolenlynaghk: yes featurec does what partial map unification did, but more sanely.
23:18amalloytrof: the usual answer to that question is: instead of asking for anyone who wants something, find a project *you* want to see improved, and improve it
23:18trofuhm, ok
23:19amalloyeveryone turns out happier that way, generally
23:20amalloyfor example, if you've been enjoying 4clojure: what's a cool feature we could add? you could use that to learn web programming in clojure, if you're into that
23:20lynaghkdnolen: is it possible to use featurec with the simple unifier?
23:20amalloybut currently nobody works on it for months at a time, so it's not like we're in need of an extra pair of hands; it would just be if you find it fun
23:21lynaghkdnolen: it doesn't look like it.
23:21dnolenlynaghk: #(featurec % ...) doesn't work?
23:21trofi understand, thank you
23:22lynaghkdnolen: doh.
23:23lynaghkdnolen: yeah, that works.
23:24lynaghkdnolen: I'm going to need some time to stew on all of this and try my hand at some complex matches/rewrites. It all looks very promising, though---I'm jazzed =)
23:25dnolenlynaghk: sweet, let me know how it goes - more than happy to improve it
23:26lynaghkdnolen: cool, thanks. I'll update https://gist.github.com/lynaghk/4004131, hopefully making it a ton shorter.
23:28lynaghkdnolen: would you mind if I factored out the implementation of IUnifyTerms for maps into a unify-with-map* fn?
23:29dnolenlynaghk: go for it - send me a link to the changes so I can review before you push
23:29lynaghkdnolen: that way I can make records that only unify with other records of the same type without copy/pasting the implementation
23:29dnolenlynaghk: yes
23:29lynaghkokay. I'll put'em on my fork.
23:30dnolenlynaghk: sounds good
23:34lynaghkdnolen: https://github.com/lynaghk/core.logic/commit/388bcd865b4abe5837b96ba741c960c1a80bd3fe
23:41zerokarmaleftsteev: just noticed you're in #nixos
23:41zerokarmaleftyes, the package manager
23:56yediis there really no way to reuse forms across different templates in enlive? how could people use it for templating then?