#clojure logs

2013-11-08

00:01amalloythanks! yeah, i'm taking a look. lots of options to consider at the moment, but at first glance it looks interesting
00:05bitemyappwhat a fun meetup.
00:06bitemyapparohner: hey if you can get amalloy to move to the Yay! that'd be a win for the Clojure community here :)
00:06arohnerYay?
00:06bitemyapparohner: you live in the Yay! Area.
00:06bitemyapps/Yay!/Bay/g
00:06arohnerah.
00:06arohnerkind of. I also 'commute' from Austin
00:06bitemyappI was showing people the ugly guts of some code I'd worked on recently.
00:06bitemyapparohner: really? I didn't know that.
00:07arohneramalloy: where do you live?
00:07bitemyapparohner: how do you like Austin?
00:07arohnerit's great
00:07bitemyappI've been considering Austin as a post-SF option.
00:07amalloyarohner: LA, but i grew up in the bay area
00:07arohnerit's cleaner, quiter, nicer and cheaper than SF. The only thing SF has is a better startup community
00:07bitemyappI don't need the startup community per se, just office space and internet.
00:08bitemyappI do like being able to see my fellow Clojurians though.
00:09arohnermeh. the clojurians are more concentrated at cons than they are locally. even in SF
00:10bitemyappI wish I could go to the conj this year.
00:10bitemyappmaybe I'll make to /West
00:10bitemyappmake it to*
00:11arohnerHas /West's location been announced yet?
00:11jtoyhow can I "undeclare" something?
00:11bitemyappjtoy: what are you doing that needs that?
00:12amalloyyeah, that is super-suspcious, jtoy
00:12jtoyi use declare foo in one ns and then later use defn foo but get an errore that foo is already declared
00:12jtoyi know circular dependency is bad, and i will move it later, sometimes hyou need it though
00:12bitemyappgood lord. fix your :require to use namespaces.
00:13bitemyapp(:require [my.namespace.rocks :as muh-namespace])
00:13bitemyappmuh-namespace/WOOHOO
00:13bitemyapp(defn WOOHOO)
00:13bitemyappjtoy: also better nomenclature is called for.
00:13jtoyi want to override the old foo though
00:13bitemyappjtoy: stop. no. don't.
00:13bitemyappyou're writing code like a meth-addled Ruby user. stop.
00:14bitemyappjtoy: briefly: http://i.imgur.com/TGUbao2.jpg
00:14indigobitemyapp: gem install hairball?
00:14bitemyappindigo: precisely.
00:15bitemyappindigo: I like the Haskell community's way of handling this. anything prefixed with "acme-*" is a Bad Idea (TM)
00:15bitemyappso if you use an acme library, you deserve what you get.
00:15jtoyif its completely bad, clojure wouldnt have added declare
00:15indigohttp://hackage.haskell.org/package/acme-php perfect
00:15bitemyappjtoy: forward declarations don't do what you think.
00:16amalloyjtoy: for one namespace to put things into another namespace is evil
00:16indigoOh ew
00:16jtoymaybe clojure shouldnt have allowed it then?
00:16amalloyalso, clojure is turing-complete, so it allows you to do all sorts of evil things
00:17bitemyappjtoy: you are seriously misapprehending what Clojure provides out of necessity as somehow meaning your cockamamie design anti-pattern is encouraged.
00:17bitemyappjtoy: stop. no. don't. Learn how to write Clojure properly. please.
00:17jtoyfound it: (ns-unmap ns sym)
00:17bitemyappgod fucking
00:17jtoybitemyapp: good
00:17indigobitemyapp: Maybe it's chord ;P
00:17bitemyappjtoy: I'm hoping cosmic rays corrupt your code.
00:17indigojtoy: Are you writing a Starcraft clone
00:17bitemyappthat just enough bits are flipped that CRC can't save you.
00:18amalloyindigo: different guy
00:18bitemyappindigo: I think jtoy actually predates that guy.
00:18indigoAh
00:18indigoHehehe
00:18bitemyappwhich explains why he's been able to figure out how to smash namespaces whereas I think chord was still at, "HOW DO I VECTOR"
00:19jtoywhatever, i write tons of production clojure code
00:19epicheroI don't
00:19bitemyappjtoy: a lot of really dumb people write tons of production PHP too, doesn't make it a good idea.
00:19jtoyhacking is all about using things in ways the system wasnt intended to
00:20bitemyappjtoy: slogans won't save you
00:51scizoDoes anyone know if this is to be expected with core.async: (clojure.core.async/timeout 100) => ClassCastException java.lang.Double cannot be cast to java.lang.Long java.lang.Long.compareTo (Long.java:50)
00:51scizo??
00:51lazybotscizo: Uh, no. Why would you even ask?
01:13firesofmayHi, Is there a way to push a jar on clojars which is 31mb? Its giving me an error saying file too large and limit is 19.5mb. Any idea?
01:21amalloyfiresofmay: putting a 30mb jar on clojars is bonkers
01:22amalloyyou don't include all the dependencies, just your own code
01:24firesofmayamalloy it's a java project that I need to write clojure wrapper for: https://github.com/navaneeth/calabash-ios-java
01:25firesofmayamalloy any idea on how I can get it to include in my clojure project?
01:28firesofmayamalloy I just looked into the jar, he is including all the gems inside of it since he is using jruby to interop with ruby calabash library.
01:28firesofmayamalloy hence the size is so big. :-/
01:29amalloyjust because their project is badly organized doesn't mean yours has to be. find a version of it on maven, or publish it to clojars yourself, and then depend on it
01:30firesofmayamalloy He doesn't have it on maven. And that's what I was trying to do, push their project to clojars.
01:32amalloyi don't know how to help you with a jar packaged in this way
01:36firesofmayamalloy cool thanks.
02:23SegFaultAXOff-topic: I've heard more about grails in the last 2 - 4 weeks than I have... basically ever.
02:24justin_smithpeople still use groovy, wow
02:26SegFaultAXjustin_smith: Seems to be trending up a bit lately as well.
02:27devnmuhoo: oh man!
02:28devnwouldn't it be cool to have karma linked to dollars
02:28justin_smithsad trolls, broke, living under bridges
02:29devnjustin_smith: wha?
02:29justin_smithif karma was linked to dollars
02:29devnoh, haha
02:29lpvbcan I have two keys to the same value in a map
02:29devnthe sad thing is that people would initially tip them
02:29devnbecause that's how trolls work
02:30devnlpvb: to the same value? yes.
02:30justin_smithlpvb: no, the new value kicks out the old one
02:30justin_smitherr
02:30justin_smithdon't mind me, I'm wrong
02:30lpvbdevn: how do I do that
02:30muhoojustin_smith: it's the new economy man.
02:31devnlpvb: {:a 1 :b 1}
02:31devnlpvb: are you asking if it's possible to have: {:a 1 :a 2}?
02:32muhoo,(assoc {:a 1 :b 2} :a 42)
02:32clojurebot{:a 42, :b 2}
02:32lpvbum. more like {:a (SomeObject.) :b (SomeObject.)}
02:32lpvbexcept they refer to the same object
02:32devnso why are you concerned about that?
02:32justin_smith(let [x (Object.)] {:a x :b x})
02:32justin_smith,(let [x (Object.)] {:a x :b x})
02:32clojurebot{:a #<Object java.lang.Object@1eb6bba>, :b #<Object java.lang.Object@1eb6bba>}
02:33justin_smithnotice they have the same identity
02:33devnlpvb: what are you trying to accomplish?
02:33lpvbjust curious
02:34lpvbseems like a layer of indirection to have a binding to x just to get it to bind to :a and :b
02:35lpvbcould I use a macro to create my own syntax
02:35muhoolol @ circleci "You don't? I'd never have guessed from the way you disabled JavaScript! You're probably so far from our target racket we can't even see you from our run-down San Francisco offices."
02:35lpvblike {[:a :b] (Object.)}
02:35justin_smith,((fn [x] (assoc x :b (:a x))) {:a (Object.)})
02:35clojurebot{:b #<Object java.lang.Object@1ce28a>, :a #<Object java.lang.Object@1ce28a>}
02:36justin_smithno need for a macro
02:36justin_smitha function suffices
02:37justin_smithlpvb: that would not be a macro, it would be a fork of the reader
02:37justin_smithmacros obey certain rules about calling position etc.
02:37justin_smithand even reader macros need the #<something> notation
02:37justin_smithso you would need a brand new reader
02:40justin_smith,(get {[:a,:b] :value} [:a :b])
02:40clojurebot:value
02:40justin_smith[:a :b] is already a legal key
02:40lpvbwell not necessarily {}, instead (defmacro multi-key-map [key-matrix vals] ...)
02:40justin_smithlike I said, no need for a macro
02:40justin_smithI did it with a function above, if you notice
02:41justin_smithdon't do a macro when a function suffices
02:41devnor do, and then refactor it
02:41devnor not
02:41justin_smithheh
02:41devnsometimes a macro is fine
02:42devnuse your judgement
02:42justin_smithwhat I'm saying is a macro is hard to develop
02:42justin_smithif you have a working function, and wish you had a new syntax, make a macro
02:42devnso are protocols and types
02:42devnthere are no rules for when to write macros
02:42justin_smithif you want a functionality, then make a function first, make a macro after that
02:42devnjust do what you think is right
02:42justin_smithOK, it's my opinion
02:42devnexactly
02:43justin_smithI've butted my head against too many libraries that were annoying to use because they exposed macros for things but not functions
02:43justin_smithmacros don't compose very nicely
02:43devnlike which ones?
02:43justin_smithcompojure
02:43justin_smithkorma
02:43devnwhy didn't those work for you?
02:43devnyou needed them to compose why?
02:44devndefroutes was too much to handle?
02:44justin_smithlike I said, macros compose poorly
02:44justin_smithnot difficult to handle
02:44justin_smithdifficult to compose with
02:44devnyou are complaining about how something you don't actually need to be composable, isn't composable
02:44justin_smithwe wanted routes to be defined in a db
02:44justin_smithintegrating that with a macro, means oh, now I need to write a macro
02:44justin_smithI do need it to be composible, because I need to extend it
02:45devnso look at the body of the macro and decompose it
02:45devnproblem solved
02:45justin_smithyeah, I could just copy and paste instead of using libraries, sure
02:46devnim not sure i understand
02:46justin_smithI have a db with a page model
02:46justin_smithI want the frontend guy to be able to use the CMS to define the route he needs
02:46justin_smithbecause he knows 0 clojure, but he knows the page that needs to exist
02:47justin_smithnow, if I am using compojure, in order to define a route based on data fro mthe db, I need to write a macro, since defroute is a macro
02:47honzadoes anyone have any ideas about how many client connections a ring-based compojure app can handle?
02:48justin_smithsimilar to how in order to have the first arg to def be coming from a variable, you need to write a macro
02:48devnjustin_smith: the 90% case isn't you
02:48justin_smithright
02:48devnthat's life
02:48devnall the functions you need to build up what defroutes does are there
02:48devnit's not a huge macro
02:48devnit's a convenience macro
02:48devnso what?
02:48justin_smithOK
02:49devnit's 2 lines, literally
02:50justin_smithI'll never say "don't ever use macros", and I hope you don't think that is what I meant
02:51justin_smithbut personally I often find them annoying
02:51devnnah, im just on a one man crusade to try and give macros some press that isn't all doom and gloom all the time
02:51muhoojustin_smith: i call it macro infection.
02:51bitemyappmuhoo: what? @ circleci
02:51bitemyappjustin_smith: composability uber alles and all that.
02:51muhooif you're dealing with somethign that's a macro, you need to write a macro to deal with it
02:51devnheh
02:52muhoothen you need to write macros to deal with that, ad infinitum
02:52devnmuhoo: im sorry, but dude, think about every other language feature
02:52devnif you use transients a lot, you call persistent a lot!
02:52devnit's not a surprise
02:52devni don't see why people harp on that and not other aspects
02:52muhootrue, there are a few other areas where this happens.
02:52devnyou uses a protocol! no you have to implement it!
02:53devnused*
02:53devnnow*
02:53justin_smithdevn: the libraries I try to use don't pass me transients - if they did I would be complaining
02:53muhoobitemyapp: if you visit circleci with noscript on, it gives you a snarky little diatribe and a recruiting pitch :-)
02:53devnjustin_smith: i hear what you're saying, it just, IMO is a personal, stylistic choice
02:53justin_smithif I couldn't use the libraries I want without implementing a big pile of protocols, I would complain about that too
02:53devnjustin_smith: then dont use them
02:53muhoobasically "if you are the kind of person who uses noscript, you'll probably love this product"
02:54devnmeanwhile, everyone else uses compojure
02:54muhooclever
02:54justin_smithdevn: its just that there are a lot of gratuitous macros out there
02:54devnjustin_smith: i hear you man, i really do
02:54muhoobtw, IIRC, there are ways to define routes in compojure without the defroutes macro
02:54muhoobeen a while tho
02:54devnbut either write it better or quit complaining
02:54justin_smithI am sure there are
02:55devnyou can't deny that everything is there in compojure. fork it and turn those macros into fns
02:55muhooin terms of composing routes, so far pedestal looks the most flexible. but i don't quite understand it yet
02:55muhoodevn: have a look. i'm pretty sure you can do it without forking
02:55devnor that.
02:56bitemyappmuhoo: that's pretty funny
02:56justin_smithdevn: since a coworker of mine wrote this, can I keep complaining now? https://github.com/caribou/polaris
02:56bitemyappmuhoo: I thought you were adding the "run-down San Francisco offices" part, that you weren't just makes it bette.r
02:56muhoobitemyapp: yeah, smart dev marketing
02:56justin_smithits a routing lib that doesn't use macros
02:56muhoosoma, fwiw, is not "run down"
02:56devnthank jesus
02:56devnno more macros
02:56devnnow i can sleep at night
02:57muhoo25 years ago soma was "run down".
02:57devnnow it just smells like pee
02:58muhoowait until the rains come. most of SF smells like pee until the rains clean off the streets. couple weeks from now it'll smell nice
02:58muhoobummer about cities in mediterranean climate: no rain from spring until winter.
02:58devnseattle manages to have a big city without a bum pee smell
02:58devnimpressive stuff
02:59muhooseattle last i was there was pretty rainy most of the year. or maybe i was thinking of portland
02:59justin_smithseattle has frequent rain, reinforcing muhoo's point
02:59justin_smithboth
02:59bitemyappmuhoo: I'm conflicted. I work for a fantastic company but I'm practically crawling up the walls to get out of SF.
02:59bitemyappmuhoo: live in Ingleside, work in SOMA.
02:59muhooK/T
02:59devnim thinking about heading out to SF
02:59devnerr...i /am/ heading out to SF
03:00devnjust taking my time about it
03:00devnleases :(
03:01muhoobitemyapp: i think you'd enjoy nyc or boston
03:02muhoodevn: have lots of money before you come here tho.
03:06muhoojustin_smith: also, http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html fyi
03:07devnman, i wish clojure.core didn't have macros in it. it really spoils the whole language.
03:08justin_smithmuhoo: I do know how to use compojure
03:08devnokay, sorry, sorry -- i will quit bringing up macros now
03:08muhoojustin_smith: someone was talkign about using compojure without defroutes macro, i thought it was you, sorry
03:08justin_smithI was
03:08bitemyappmuhoo: I lived in NYC before SF, left quite intentionally.
03:09bitemyappmuhoo: I think I want nature near at hand.
03:09bitemyappmuhoo: I miss bonfires.
03:09justin_smiththe code isn't compojure until you get to defroutes, it is vanilla clojure up to that point
03:09bitemyappthe main problem with compojure, incidentally, is the macros.
03:09bitemyappwrt composability.
03:09bitemyappI need a generic purely functional router and compojure's macros fuck me over.
03:10justin_smithbitemyapp: did you see my link to polaris above?
03:10justin_smithI don't know if it is what you need, but we did put some thought into it
03:10devnbitemyapp: heh, you too?
03:11muhoowell, pedestal, once i can find energy/time to read all its docs and play with it, looks pretty awesome.
03:12devnwhy don't people complain about (defn) in clojure?
03:12justin_smithmuhoo: if I could sell my frontend guys on clojure, pedastal seems like it could be cool
03:12justin_smithdevn: we do complain about people using it as anything but a top level form
03:12justin_smithit isn't meant to compose
03:12muhooi was goign to just use the routing and not mess with teh cljs stuff
03:12muhooit looks pretty modular if i was reading the docs right
03:15devnjustin_smith: how about when-not, cond, lazy-seq, if-not, and, or, if-let, when-let, binding, with-bindings, io!, dotimes, doseq, with-open, forb
03:15devnfor*
03:15devnthe list goes on
03:16devndo you use or? *gasp* -- does it compose!?
03:16muhoo~gentlemen
03:16justin_smithdo I need to say a fifth time that I use macros and I am not saying they shouldn't exist?
03:16clojurebotYou can't fight in here. This is the war room.
03:17devnim just dying, gentles.
03:17devnim sick of hearing people bitch about macros all the time
03:17devnit's negative crap
03:18abaranoskybitemyapp: hey dude, have you seen Frege? What are your thoughts on it?
03:18devnabaranosky: hey dude
03:19abaranoskydevn: hey!
03:19devnhow goes it?
03:19abaranoskygood :)
03:19devnwhat have you been hacking on lately?
03:20bitemyappabaranosky: I've watched it for a few years, not used it yet. I was thinking of recommending it to KirinDave.
03:20bitemyappabaranosky: because his company is using Clojure, but only for the JVM. A number of engineers there are Haskellers.
03:20devnoh man, i wanna meet KirinDave
03:20abaranoskydevn: mostly work, but also I have some side stuff both public and private
03:20bitemyappdevn: he's a nice person, easy to talk to.
03:20devnyeah, he's a midwestern gent
03:20devnwe've chatted on the interwebs here and there
03:21abaranoskymost recent stuff publicly was updating my print-foo library to support a code walking print-debugging macro
03:21bitemyappdevn: I'm from the midwest, maybe that's why I got along with him? :)
03:21devni think there's something to it
03:21devnabaranosky: cool -- i didnt meant to put you on the spot
03:21devni am 99% work mode at the moment
03:21abaranoskybitemyapp: I love Clojure, but Haskell on the JVM could tip myself in favor of it as the Clojure-Java interop is an important part of why I like Clojure so much
03:22devnive been working on some cool stuff, but very busy reading and applying
03:22bitemyappmy output spiked recently, but after I release Simonides and do some misc work such as on Revise, I'll go dark again so I can moonlight on something business related.
03:22bitemyappucb: hi!
03:22abaranoskydevn: I don't mind :)
03:22bitemyappabaranosky: for my part, I've used Haskell and Clojure concurrently, with the bias being on the Clojure side...but I'm losing my patience with not having a type-checking "assistant".
03:22devnbitemyapp: bipolar disorder is what that's called
03:23devnOMG I'm Productiiiiiiiiiiivvvvvvvvveeeeeeeeeeeeeeeeeeeeeeee
03:23abaranoskybitemyapp: I'll play around with Frege and see what I can see there
03:23bitemyappabaranosky: cool. Hopefully I'll get a chance to poke around too. I'm a little *_* of the unicode comp, but we'll see.
03:23ucbbitemyapp: !
03:23bitemyappdevn: well when I say going dark, it's so I can work on something *else*, not so I can stop working.
03:24bitemyappit's just something private as opposed to open-source-able.
03:24abaranoskyyeah, I've got some top-secret ninja-level code project I've been working on for months now.
03:24devnbitemyapp: i have a similar thing at the moment, 3 of them actually :\
03:25devn2 startups and a lib
03:25abaranoskyseems like we should all just team up on our uber-private stuff :P
03:25devnlet's make an org
03:25abaranoskyhehe
03:25bitemyappabaranosky: how interesting is adwords campaign optimization to you? :P
03:25abaranoskywww.closedsource.org
03:25devnbahaha
03:25bitemyappwww.no-cooties-allowed.lel
03:25devnCOSS
03:26abaranoskybitemyapp: honestly... its moot. Literally all my time is taken up right now.
03:26devnCostly Open Source Software
03:26justin_smithabaranosky: parked
03:26abaranoskyparked?
03:26abaranoskywasat mean?
03:26devnhe's referring to the domain name
03:26abaranoskyha
03:26justin_smithhas a default placeholder page on it
03:26bitemyapp...why would frege expect me to have a binary named "java7" on my path?
03:27abaranoskybitemyapp: do you use Emacs for Haskell stuff? Should I etup haskell-mode or is there a more preferred way to work with Haskell?
03:27devnabaranosky: with the lights off
03:27bitemyappabaranosky: I use Emacs for Haskell stuff, yes. haskell-mode + scion were the standard way last I heard.
03:27devnin Yi
03:27bitemyappsome people use EclipseFP supposedly.
03:27devnIs Yi still around?
03:28bitemyappdevn: nah, leksah.
03:28devnah
03:28abaranoskyon another note, I was recommended to checkout Amethyst on OSX, and am enjoying it
03:28devnwhat's that?
03:28abaranoskyit's an XMonad clone for OSX
03:28devnoh dude, i have something you want
03:28devnunless you have it
03:28devndo you have ShadowKiller?
03:29devnit gets rid of those drop shadows between windows
03:29abaranoskydevn: just heard of it yesterday
03:29devnmakes it flat
03:29abaranoskyI tried installing it, but nothing seemed to happen so I gave up :\
03:29abaranoskyI'll try again
03:29devnabaranosky: where'd you find it?
03:29devntheir page where they used to host it is dead
03:29justin_smiththat they chose the name shadowkiller over peterpan tells you something about the developers
03:29abaranoskysame dude who recommended Amethyst over Twitter
03:30devngotcha
03:30bitemyappabaranosky: what? puffnfresh?
03:30abaranoskylemme see, I forgot :(
03:30bitemyapp$99 it's PuffnFresh
03:30devnso i have a ticket to the conj
03:30devni have a flight
03:30devnand i have nowhere to stay
03:30devnnot sure how that's going to work out
03:30devnbut we'll see
03:31abaranosky@malfario - pay up
03:31bitemyappabaranosky: damn.
03:31abaranoskydevn: nice... 6 of us from Staples Innovation Lab (formerly Runa) will be there too
03:31bitemyappabaranosky: you need to follow puffnfresh. Can I offer dinner in lieu of $99? :P
03:32abaranosky:)
03:32abaranoskybitemyapp: already follow puffnfresh
03:34bitemyappabaranosky: you should probably start with the Language doc, here: https://github.com/Frege/frege/releases
03:34bitemyapphttp://www.frege-lang.org/doc/frege/Prelude.html
03:35bitemyappabaranosky: I'm going to just alias *.fr files to haskell-mode for now.
03:35bitemyappI can't do anything about that damn unicode.
03:35abaranoskyI'm going to try to do *anything* with Frege first :)
03:36abaranoskyI know some Haskell but haven't really done much with it in a couple years
03:36bitemyappthe primary point of interest for Frege for Haskellers is that it has the type hierarchy done right.
03:36abaranoskybitemyapp: is there a good link to "get started"?
03:36bitemyappOstensibly: https://github.com/Frege/frege/wiki/Getting-Started
03:36abaranoskybitemyapp: you mean they fixed some of the cruft in the heirarchy?
03:36bitemyappI don't think anything is "good" right now. Dragons yonder and all that.
03:37abaranoskywhich fixes are there?
03:37bitemyappabaranosky: da.
03:37abaranoskyI might like a Clojure-Frege combo, with Clojure for parts that I don't mind breaking a little more often
03:37abaranoskyrofl
03:38bitemyappabaranosky: http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal
03:38bitemyappanything related to this, Frege has supposedly fixed all in one go.
03:38abaranoskyhow'd the interop?
03:38abaranoskyhow's *
03:39bitemyappIt seems to take a similar attitude to Clojure, where it leverages the interop aggressively and makes it seamless but still has its own "thing" going on.
03:39abaranoskycannot complain about that approach in theory
03:39bitemyappthe main caveat I would submit with regards to Frege is that I have *no* idea how you can make purity and laziness efficient on the JVM
03:40bitemyappI'm sure it's possible, but I'm not aware of any "strategies" like what Clojure does that would work in Frege.
03:40bitemyappfor example, you cannot do without TCO for obvious reasons.
03:40bitemyappso your functions have to be abstracted, so far as I'm aware anyway.
03:41bitemyappand possibly that means the JIT won't know how to inline things as nicely?
03:41bitemyappthis is conjecture though.
03:41abaranoskybitemyapp: yep all good questions
03:41bitemyappabaranosky: fuck it, I'm starting #frege
03:41abaranoskylet's do this
03:44TEttingerclojure isn't exactly blazing-fast a lot of the time either. I think the success of languages like clojure and ruby (even pre-JIT ruby) shows that a usable, easy-to-reason-about language can do well even if it isn't C-doing-pointer-arithmetic fast.
03:45TEttingeralthough most clojure code I see IS a lot better written than the little ruby I have seen
03:47abaranoskyRuby!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
03:48nightflyruby...
03:50abaranoskyI'm not the biggest ruby fan, I guess
03:51TEttingerit was my first language, I wrote just a little bit of it
03:51ddellacostabitemyapp: can you tell me more what you meant by "you cannot do without TCO for obvious reasons. so your functions have to be abstracted...?" I'm curious.
03:52TEttingerI really prefer clojure to just about everything else these days
03:53bitemyappddellacosta: Clojure is fast partly because it generates the vanilla JVM bytecode for the invocation of static methods.
03:53justin_smithddellacosta: I think that means that idiomatic Haskell style programming uses recursion extensively, and since the jvm cannot do actuallo TCO, in order to not break the stack you need to implement TCO, which means your functions cannot be normal JVM callable objects, you need a layer that does that transform
03:53ddellacostaRuby is nicer for scripting. Came back to it recently after writing Clojure for more than a year, when writing a git hook, and found my Clojure experience had really changed how I used Ruby--and made it a lot nicer
03:53bitemyappddellacosta: the trade-off is that the JVM static methods are "stackful" and cannot be TCO'd.
03:54ddellacostabitemyapp, justin_smith: gotcha...found this too while I was at it: http://stackoverflow.com/questions/19462314/why-cant-tail-calls-be-optimized-in-jvm-based-lisps
03:54bitemyappddellacosta: you cannot TCO your "functions" unless they are not stackful invokestatic JVM methods. Which means you might not be benefiting from the JVM as much as you'd like.
03:54abaranoskyddellacosta: "Ruby: The Good Parts" :)
03:55ddellacostabitemyapp, justin_smith: thanks, those comments were all helpful. :-)
03:55ddellacostaabaranosky: yeah, there are nice parts to it! It does have some Lisp-y and Smalltalk-y elements, after all.
03:55bitemyappjustin_smith: to say that Haskell users use recursion extensively is an understatement :)
03:55justin_smithtrue
04:01Sonderbladebitemyapp: i think i use recursion less in haskell than other languages, in most circumstances you can use some smart code combinator instead of recursion imho
04:03epicheroGee, a programmer using recursion..
04:09lpvbhow do I define my own types and match against them? say I want a slightly different vector type only different in name and I want a (myvector?) function
04:09lpvbso I can differentiate between normal vectors and myvector
04:10abaranosky`instance?`
04:10justin_smithlpvb: generally with the jvm you are working in terms of classes rather than types, defrecord is a handy way to handle it
04:10lpvb?
04:10justin_smithhttp://clojuredocs.org/clojure_core/clojure.core/defrecord
04:12justin_smithlpvb: the link I just pasted shows how to use defrecord and instance? together
04:12justin_smithalso if you really want to switch behavior based on type, there is defmulti
04:13justin_smithbut I find things easier if I avoid all of these featuers and stick to vanilla datatypes and functions
04:13abaranoskyno need to make a defrecord for a vector type
04:13justin_smithusually at least
04:13abaranoskydefrecords model map-like things
04:13justin_smithyeah
04:13abaranoskybetter to use deftype
04:13lpvbjustin_smith: thanks
04:14justin_smithabaranosky: ok, cool. I had never really found a use for deftype, but I guess that is the usecase
04:15abaranoskyjustin_smith: it'd be especially egregious to make a vector type be map-like
04:15justin_smithabaranosky: I just imagined the vector would be one field in it
04:15justin_smitheven with deftype the vector is a field hiding in it, no?
04:16abaranoskyyeah that's true
04:17abaranoskybut you get other kinds of equality semantics built into defrecords that you probably don't want
04:17justin_smithOK
04:18justin_smithas in structural equality?
04:19abaranoskyNot sure, I don't often need to use either enough to be expert at the idiocincracies of each
04:19justin_smithas a preference, I generally would prefer structural equality and keyword based access of all my fields - and my understanding is that that is what differentiates defrecord from deftype
04:20justin_smithplus default constructors from a map
04:20justin_smithagreed, I usually don't need either, and actually avoid them if I don't need them
04:22justin_smithreally, the pedantic way to make your own vector subclass would likely be to use gen-class with :extends, but that makes iterative development difficult
04:23lpvbsounds like there's not a perfect way to do what I want o.o
04:24ddellacostawhat is the "official" use of bang in regards to side-effect-having functions? In clojurescript, for example, I've been using ! to signify a function that will actually manipulate the DOM. Would this be appropriate? I remember reading someone suggesting that, with regard to the meaning of "!," there are side-effects, and then there are side-effects...
04:24justin_smithmaking new types and dispatching on them is not a normal way to do things in most clojure code I have seen; a lot of us seem to prefer using generic and very general datastructures - fewer types and more functions on them
04:24bitemyappddellacosta: strictly speaking, it has to do with STM.
04:24bitemyappswap! for example.
04:25justin_smithbitemyapp: atoms are STM? I thought they were not.
04:25ddellacostabitemyapp: swap! or reset! make a lot of sense to me; I'm just not sure how to transfer that to a general concept. Seems like I'm doing something similar when I'm setting a class in the DOM, for example
04:26bitemyappddellacosta: I use a more liberal interpretation and use bangs as an impure warning.
04:26justin_smithddellacosta: notice that aset is not aset!
04:26bitemyappjustin_smith: I thought so too but I'm riffing off something tbaldridge said about bang meaning STM-unsafe or something.
04:26lpvbjustin_smith: so you're saying I should dispatch on keywords perhaps? [:contains-data 1 2 3] [:contains-different-data 1 (Object.) 3] ?
04:26ddellacostabitemyapp: yah, I have been doing the same. Just wanted to get a sense of what the consensus is, if any such thing exists in Clojure-land
04:26ddellacostajustin_smith: sorry, what do you mean? re: aset/aset!
04:27justin_smithddellacosta: aset destructively alters a jvm array
04:27justin_smiththere is no aset!
04:27ddellacostajustin_smith: ah, I see what you're saying: even something w/o a ! can be impure
04:27justin_smithbitemyapp: http://clojure.org/concurrent_programming this lists atoms and STM as separate things
04:27bitemyappjustin_smith: I didn't say I disagree
04:27ddellacostajustin_smith: that's exactly why I'm asking, actually--what are the actual (implied) semantics of "!" ?
04:28bitemyappI said the atom functions were marked with bang because they were STM unsafe according to tbaldridge, not because atoms are STM.
04:28justin_smithbitemyapp: and I wasn't intending to argue, just citing a source
04:28bitemyappyou don't need STM to make atomic changes to a single thingy.
04:28ddellacostawhy would we *not* use it with aset--because we know that is java interop, or something? Confusing
04:29ddellacostalpvb: what about core.match or core.typed?
04:29bitemyappI can't believe I'm quoting this
04:29justin_smithI think ! is for things otherwise pure? that is why I thought of aset, because arrays like the dom are never pure
04:29bitemyapp"The names of functions/macros that are not safe in STM transactions should end with an exclamation mark. (i.e. reset!)"
04:29justin_smithI could be wrong
04:29bitemyappplease don't make me do that again.
04:29ddellacostahaha, didn't mean to get you guys going...
04:30bitemyappddellacosta: no no, I'm just whining about having to quote batsov's guide as an explanation of the bang.
04:30justin_smithbitemyapp: quoting what? I am interested
04:30ddellacostabut, this is exactly the problem with "!" I guess. It's not clear. Hrm.
04:30justin_smithddellacosta: not getting going, its something I am as curious about as you are
04:30ddellacostajustin_smith: yeah, I was kinda joking. ;-)
04:30bitemyappddellacosta: it's clear to me. the official meaning is, "don't use in a transaction"
04:30ddellacostabitemyapp: yeah, I guess your point is that it is limited--but you also said that you use it for functions that are impure, generally, no?
04:31lpvbddellacosta: that's not going to work, I don't want to check my whole vector to see if the data is of one type to deal with or another type to deal with differently
04:31bitemyappddellacosta: yes, because I wouldn't want those functions used in STM either, even if it's not strictly impossible.
04:31ddellacostabitemyapp: I do as well. So it seems like informal usage is separate from "official" (such as it is) usage
04:31ddellacostahmm, okay
04:31bitemyapp'ish
04:32bitemyappddellacosta: you're a smart guy, I'm sure you'll do what makes sense for your code.
04:32ddellacostabitemyapp: haha, thanks for your confidence in me. :-)
04:32justin_smithlpvb: maybe more like {:context "foo" :contents [1 2 3]} {:context "bar" :contents [\a \b \c]}
04:33justin_smithbut if types are really what you want, deftype and defstruct are not too difficult to use
04:33ddellacostabitemyapp: but seriously, I'm really just curious if anything exists like a consensus about how to use it. That helps, thanks.
04:33lpvbjustin_smith: can I just attach meta data to a vector instead?
04:34justin_smith,(with-meta [1 2 3] {:context "a"})
04:34clojurebot[1 2 3]
04:34justin_smithmaybe
04:34justin_smithI don't know how well metadata is preserved by various functions
04:34justin_smithyou would probably need to do a lot of bookkeeping to keep reattaching it
04:35justin_smithwheras with a defstruct / deftype it keeps the class that identifies it
04:35ddellacostayeah, metadata seems like it wouldn't necessarily be very reliable. You'd end up re-making your own type system, poorly
04:36justin_smithlpvb: on another level, if the reason you want to differentiate these vectors is what they have in them, you can sometimes do the dispatching on the part of the code that touches the contents
04:37justin_smithand in practice, for me at least, I know what types I am dealing with, or what union of types, because I know where they came from
04:38justin_smithworst case I need to do a postwalk conjing #(class %) into an atom of a set
04:38justin_smithand see what all was in there
04:38justin_smiththen make sure I cover those classes
04:39justin_smithbut I don't know your design, so there could of course be other concerns
04:43justin_smithI'm calling it a night, seeya
05:19smilerI'm having some trouble with clojurescript and source maps (I think). The cljs-references have the wrong path generated. It ends up being something like "http://localhost:8080/home/smiler/src/myproject/target/thebuild-id/myproject/myfile.cljs&quot; and the webserver will ofcourse generate a 404 for that file.
05:19smilerIt should strip "/home/smiler/src/myproject/" away from that path.
05:53WWWestHi all
05:53WWWestdoes anyone have a good link on proper/clean error handling in clojurescript?
05:55WWWestFor example, I remember reading something about exceptions not being caught if they happen in a lazy seq. So... how do you deal with this? What about clean up functions?
06:29clgvWWWest: I expect that this behavior of exception in lazyseq realisation is the same as in clojure
06:29clgvWWWest: but to be able to give you a hint you need to be more specific
07:02Jardahmm
07:02Jardahow can I use clojure.walk in clojurescript?
07:02Jardanow I get [14:02:31.721] TypeError: clojure.walk is undefined @ http://localhost:3000/js/app.js:40045
07:09Jardaoh, I can't use with full path
07:09Jardaneed to refer them in require
08:07bruceadams?
08:36TimMc`cbp: Hmm, what's up?
08:40`cbpTimMc: I though you were gonna ask me something yesterday
08:49TimMcOh, I don't remember that.
08:49TimMcTo the logs!
08:50TimMcRight! You were looking for projects.
08:51`cbpTimMc: yeah!
08:52`cbpTimMc: unfortunately i have to go again! hah
08:52`cbpI'll be back in about 1 hour =p
09:07cemerickdnolen: any idea how to convince GClosure to not inline exported scalars used in function bodies?
09:14noncom|2if, using core.async, i create a (go (loop-recur)) block inside a call to a method of a proxied Java object, enabling the communication of the proxied object via the publicated channel with the rest of the program, creating a (sub) there, what will happen to the sub and the involved channel upon the proxied object being GCed ?
10:07`cbpTimMc: hi, sorry about that. Were you gonna tell me something?
10:26TimMc`cbp: Oh, just curious what sorts of projects you're interested in. Large, small? Collaborations, contributions to existing large projects, or new projects? Libraries, or apps?
10:26dobry-denWWWest: maybe you can collect some ideas from http://swannodette.github.io/2013/08/31/asynchronous-error-handling/
10:27TimMcAnd of course there's always the Swearjure compiler, if you want to do some purely algorithmic useless programming. :-P
10:28`cbpTimMc: heh, anything is good really. As long as I learn something and preferably be productive at the same time
10:29nDuffnoncom|2: I'm not sure I follow the scenario -- how are you proposing to have an object GC'd that you can still reference, without explicit use of weak references?
10:30TimMcOh, well, then not Swearjure.
10:30TimMcI mean you'll learn something about compilers (and Clojure) for sure, but the end result is just a toy for scaring people.
10:30`cbpit does sound really fun though
10:31noncom|2nDuff: well, the object has a method `initialize` which i override with proxy and install the core.async communications to talk with the objects insides. so you are saying that in that case the object won't be GC'd since it is referenced by core.async.. but it is not, it is only that inside the method there is a (go (loop-recur)) thing which influences the objects aggregated properties..
10:32TimMchttps://github.com/timmc/swearjure/blob/master/src/org/timmc/swearjure.clj is the start of it. I probably have more locally. It needs some more designing to make pre-swearjure functions first-class (you need to do a transform on the args to call them properly).
10:32TimMcBut if you want to do something useful, you should probably try to contribute work to an existing email client to make it easy for peopel to use encryption. :-P
10:32noncom|2then i just lose any references to the object from my program, but the go-loop-recur still functions inside the objects method... ?
10:35nDuffnoncom|2: Can you provide a SSCCE?
10:38dobry-den`cbp: If you're interested in Bitcoin, I've been implementing it in Clojure
10:40indigodobry-den: Ooh, that's cool
10:41wedrindeed
10:42`cbpunfortunately ive never been involved with anything related to bitcoin before :P
10:43dobry-densame
10:43noncom|2nDuff: i hope i have properly shown what i am trying to do here: https://www.refheap.com/20602
10:43noncom|2core.async is still ne for me so i might be mistaken somewhere
10:43noncom|2s/ne/new
10:44noncom|2updated the refheap to make the actual call for the init
10:45noncom|2oops, and corrected the reset state form to be valid
10:45noncom|2sorry
10:51dobry-denthough i'm ready for someone to write the O'Reilly book on Datomic.
10:52dobry-denbut instead of an animal on the cover, just hickey's hair
10:52nDuffnoncom|2: Runnable code would be a substantial improvement; the obfuscation you're doing there obscures some important details.
10:56noncom|2nDuff: ok, i will, but some time later, can't do it right now, gotta a task to do..
10:56noncom|2thanks!
10:56noncom|2i will write you when i see you
10:57rkneufeldAlex Robbins, are you here sir?
11:13danielszmulewiczdobry-den: +1 (Hickey's hair on O'reilly cover)
11:18dobry-denTangela
11:22jtoycan i store hiccup code in a file to render?
11:24joegallojtoy: as opposed to?
11:24dobry-denjtoy: yeah, you can read clojure datastructures from a file
11:24joegallo:)
11:24dobry-denbut i dont see the point
11:26dobry-denbeing able to evaluate your template code with the ease in which you can evaluate (+ 1 1) is baller
11:26dobry-denwithin the same file, i mean
11:38devnanyone know if this is documented anywhere?
11:38devn,(class (merge {:c 3 :d 5} (array-map :q 33 :r 99)))
11:38clojurebotclojure.lang.PersistentArrayMap
11:38devn,(class (merge (array-map :q 33 :r 99) {:c 3 :d 5}))
11:38clojurebotclojure.lang.PersistentArrayMap
11:39llasramdevn: What's the confusion?
11:39devnI guess I didn't really know what to expect in this case. Can anyone explain why persistentarraymap wins in both cases?
11:39llasram,(class {:c 3 :d 5})
11:39clojurebotclojure.lang.PersistentArrayMap
11:39devnerr whoops
11:39devnhaha
11:40BobSchackdevn for small hashmaps < 4 I think clojure uses array maps
11:40devnso i guess im concerned about whether or not i lose order guarantees
11:40devnBobSchack: ahhhh
11:40devnso I need a bigger sample to see the real behavior here
11:41danielszmulewiczb
11:41BobSchackdven http://clojure.org/data_structures#Data Structures-ArrayMaps
11:41justin_smith,(class (zipmap (range 3) (range)))
11:41imok20hey everyone! I'm struggling with the best way to get something like this (https://gist.github.com/ihodes/7373834) to work. I'd like to define a bunch of functions from a (rather long) list of lists—not quite sure how to do this with the way clojure resolves defs (i mean, the obvious solution is just writing out the defs for each/having some elisp write it out for each, but that's no fun)
11:41clojurebotclojure.lang.PersistentArrayMap
11:41justin_smith,(class (zipmap (range 30) (range)))
11:41clojurebotclojure.lang.PersistentHashMap
11:42devnah man, bummer
11:42devnim gonna lose order guarantees when i assoc
11:43justin_smithimok20: why not put them all in one data structure and look them up, instead of making a top level definition for each one?
11:44BobSchackdevn you could you use php arrays :) They maintain order
11:44devnbahahaha
11:44imok20justin_smith: that could work, but i'm not a fan of the UX for that. i'm thinking that might be the reasonable thing to do though
11:45devnimok20: so you expect what to come out the other side?
11:46justin_smithimok20: what about instead of defining respond-100 respond-101 ... you define respond, which takes a number and returns the response for that number ((respond 100) ...)
11:46devnyou just want to intern a bunch of vars?
11:46BobSchackdevn https://github.com/flatland/ordered
11:46devn,(intern *ns* 'foo "bar")
11:46clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:47devn#'my.ns/foo
11:47devnfoo => "bar"
11:47devnbut i think justin_smith is giving you good advice, FWIW
11:47imok20justin_smith: I have the same picky objection haha. i guess there's just no way to do it in a way that provides the UX i want without writing out all the defs at the top level.
11:48imok20devn: i want e.g. respond-100, respond-101, … respond-404, …
11:48imok20defined in the ns
11:48Wild_Cat`imok20: how about (respond 100)?
11:48justin_smithWild_Cat`: that was my suggestion he just rejected
11:49devni don't understand what's wrong with that
11:49Wild_Cat`justin_smith: whoops, my bad. I need more coffee.
11:49devnseems like a pretty reasonable "UX"
11:49devnit's damn near the same thing
11:49devnand it's simpler
11:49imok20devn: it's fine, just not what i'd like. i think i'll probably go with the earlier suggestion of a map -> fn lookup
11:49Wild_Cat`well, I can see how you'd lose tab-completion in the REPL, but OTOH if respond is a map and not a function, it's "better"
11:49Wild_Cat`(because now you can print it out)
11:50imok20i wanted to make sure i wasn't missing something obvious, haven't written much clojure for 3 years…
11:50imok20thanks for the help!
11:50Wild_Cat`,(let [respond {100 "Continue" 200 "OK"}] (respond 100))
11:50clojurebot"Continue"
11:51imok20Wild_Cat: that's not what the fn i've posited does
11:51imok20that would be a fine solution for doing that, but not what i'm doing unfortunately
11:51silasdavisum does clojure use multiple cores some of it's library functions by default?
11:51silasdavismultiple threads
11:51silasdavisI should say
11:52silasdavisbecause I'm seeing 600% cpu usage on what I thought was a single-threaded application written in clojure
11:52justin_smithsilasdavis: it should use more than one core if you have them, unless you prevent the jvm from using more than one core
11:52silasdavisI'm just wondering where the other threads are coming from
11:52justin_smithsilasdavis: what kind of app?
11:52dobry-denDoes anybody else use 'hello' instead of \"hello\" in docstrings?
11:53devnimok20: (defmacro defresponse [[code msg]] `(def ~(symbol (str "respond-" code)) ~msg))
11:53devn(defresponse [100 "hello there"])
11:53justin_smithsilasdavis: some things are implicitly threaded, ie. ring makes a new thread for each request
11:53devnthe macro police will sound the sirens, but don't pay any attention -- if you want to do that, that's a way to do it
11:53dobry-deni think i'm going to start using those pretty unicode quotation marks in docstrings
11:53imok20devn: right, but i can't map that across a list of codes/messages and have them all defined at compilation time
11:54imok20can i?
11:54imok20wouldn't that be the same issue of being unable to resolve the symbol if i mapped that as in https://gist.github.com/ihodes/7373834
11:54justin_smithimok20: not with a map, but with a top level doseq you could, maybe
11:54devnimok20: try it :)
11:55justin_smithbut anything but defs at the top level is asking for trouble
11:55imok20my impression was only do was treated specially at the top level
11:55imok20i'll give it a whirl
11:55imok20justin_smith: why do you say that?
11:55justin_smithbecause then loading the ns has side effects
11:56justin_smithit isn't always a problem of course
11:56justin_smithbut it can be a source of trouble
11:56imok20justin_smith: but well-defined side-effects isomorphic to having just defined those fns by hand, right?
11:57justin_smithfrankly I am not 100% certain a doseq is guaranteed to be fully run at ns load time in a clean way - but if all it does is def some vars it could be OK - I really don't know
11:57silasdavisjustin_smith, but things like map, update-in and so on are not right?
11:57justin_smithI do know I have gotten weird bugs by trying to do things other than def at the top level
11:57devnimok20: give it a whirl! :)
11:58silasdavisare the persistent data structure constructors multi-threaded?
11:59dnolenClojureScript 0.0-2024 going out, fixes a regression around source maps
11:59justin_smithI wouldn't put it past the optimizer to realize two forms in your function body do not rely on one another in any way and can thus be done in parallel - but I don't know that clojure actually does that
12:04devndnolen: awesome.
12:08seangrovetechnomancy spreading his propaganda... "there's no reason lein shouldn't have a debugger built-in"
12:09seangroveAll part of his plan to ultimately have the clojure language subsumed into the lein project, and have all copyright assigned to him
12:09devnheh
12:10justin_smithwe are working on a standalone debugger, with a browser based UI, that would connect to and debug other clojure projects from the outside
12:10seangrovejustin_smith: As long as there's an explicit API so other frontends can be built, that seems brilliant
12:11justin_smithwe are using the same dt-thread interface that jvisualvm etc. use
12:11devnimok20: (doseq [[code msg] http-status-codes] (intern *ns* (symbol (str "respond-" code)) msg))
12:11justin_smithI can see about keeping the json api generic
12:12justin_smithbut it is already built on top of a very generic api
12:12justin_smithjust one that doesn't have friendly enough clojure tooling yet (imo)
12:13imok20devn: okay, will try. doseqing over the forms with the macro did not work, i don't think?, I got "nth not supported on this type: Symbol", though the macro itself does work. will try this now
12:15imok20nice, using doseq instead of map works. so do is treated specially at the top level too, i guess? nice
12:15imok20thanks :)
12:15justin_smithmap does nothing if nothing uses its output
12:15devnimok20: y/w
12:15justin_smithso a map at the top level does nothing
12:15imok20justin_smith: not at compile-time
12:16imok20(i guess?)
12:16imok20so yeah, i guess it'd be a total no-op no matter what since it's lazy, too
12:16justin_smiththat's what I am saying: the only reason map evaluates anything at the top level of the repl is the implicit print
12:16justin_smithif you prevent that you see the same behavior
12:17justin_smith,(do (map println (range 10)) nil)
12:17clojurebotnil
12:17justin_smith,(map println (range 10))
12:17clojurebot(0\n1\n2\n3\n4\n5\n6\n7\n8\n9\nnil nil nil nil nil ...)
12:18imok20yeah, which i totally should've caught. living getting back into clojure, though. developing and setting things up is SO much easier now
12:18imok20(and if anyone is curious, the final working solution is: https://gist.github.com/7374418)
12:20devnimok20: welcome back
12:20imok20(well, i added a ! to the end of my def-form)
12:20imok20den: thanks :)
12:20imok20devn *
12:21justin_smithone gotcha with something that clever is that usually in order to check out a definition in some ns, you would expect to find a form declaring that defintion in the ns - so now someone needs to dig a bit deeper to find out how something was defined ("someone" here including editors and things like `source` or `doc` that are used in the repl or by the editor to provide tooling)
12:23imok20justin_smith: true, definitely. and there will be a nice big comment there to help with greping for it. i just can't be bothered to write out a correct defn for each fn; even the status codes and text were all grabbed and formatted by javascript from a w3 web page :) i'm all about the lazy.
12:26justin_smithimok20: but I don't grep to find definitions, I use the source command in the repl
12:26justin_smithand so does my editor
12:27justin_smithsimilar issues for the ability of stack traces to list a line number
12:27justin_smithor even function names I think
12:28seangrovebitemyapp: Seems like DaaS could be done now pretty nicely
12:29seangroveMight be a fun (few) weekend hack sometime if you're up for it
12:29totosHello is there something wrong with my-reverse ? (defn my-reverse [x] (if (nil? (rest x)) (first x) (cons (my-reverse (rest x)) (first x)))) '(1 2 3 4 )
12:30rasmustototos: check out rest vs next
12:31totosrasmusto: oh thanks
12:31rasmustototos: alternatively, you could replace nil? with empty?
12:32totosrasmusto: nice , thanks again :)
12:39muhoowhat libraries, if any, are people using for fsm's in clojure?
12:39justin_smithalso, a destruction like [h & t :as x] avoids the multiple first / rest calls
12:39justin_smith*destructuring
12:41totosjustin_smith: i always forget that in clojure
12:44noncom|2what was the best way to filter [nil nil] pair ot [whatever nil] pairs from a {} ?
12:45justin_smith,(into {} (remove (comp nil? second) {:a 0 :b nil :c 1 :d nil}))
12:45clojurebot{:a 0, :c 1}
12:45justin_smithmaybe?
12:46jtoycan I use hiccup templates in files and render those?
12:46justin_smithnoncom|2: or did you want ,(into {} (filter (comp nil? second) {:a 0 :b nil :c 1 :d nil}))
12:47jtoyi dont see it being used like that
12:47technomancyjtoy: hiccup templates are functions, and functions can go in files
12:47justin_smith,(into {} (filter (comp nil? second) {:a 0 :b nil :c 1 :d nil}))
12:47clojurebot{:b nil, :d nil}
12:47noncom|2wow, the first one !
12:48noncom|2also, afaik a {} only allows for a single key of nil, how do i remove it from a {} if i have say {nil nil :a 1 :b 2} ?
12:48justin_smithnoncom|2: my code was just checking the values, not keys
12:49justin_smithyou could make a version that also checks for the key being nil
12:49noncom|2yes, that is task 1, but checking for keys is task 2 - so i have 2 tasks.. one is solved :)
12:49justin_smith,(dissoc (into {} (remove (comp nil? second) {nil :blarg :a 0 :b nil :c 1 :d nil})) nil)
12:49clojurebot{:a 0, :c 1}
12:49justin_smiththat's what dissoc is for :)
12:50justin_smithbut at that point you probably want to refactor and not do a one liner
12:50noncom|2right. i just wasn't using (comp) uch in my expertise... so that's a good start for it, thanks!
12:50noncom|2s/uch/much
12:50jtoytechnomancy: do i need to do anything special to read in the files or just use eval?
12:50technomancyjtoy: require is the best way
12:51justin_smithnoncom|2: yeah, my main usage of comp is to do deeper inspection of a structure for a predicate
12:51technomancyyou can use load-file if for some reason you don't want the file to have a proper namespace, but there are basically no good reasons to do this
12:51muhoo~fsm
12:51clojurebotTitim gan éirí ort.
12:52justin_smithmuhoo: core.async go blocks generate an fsm behind the scenes
12:52imok20justin_smith: I guess adding metadata while interning it might help some of those?
12:52justin_smithdunno if that helps you at all or not
12:52justin_smithimok20: yeah, it absolutely would
12:52justin_smithimok20: just makes the solution a little more complex
12:53imok20justin_smith: any suggestions as to what is important metadata?
12:53muhoojustin_smith: interesting idea. not sure it'd help for this tho
12:53justin_smithimok20: you can look at what defn generates
12:53muhooi've got a crazy complex login process that has to be managed, with lots of possible states and transitions, and i'd like to keep it relatively organized and maintainable
12:54justin_smithimok20: (source defn) will help with that :)
12:54imok20justin_smith: touché
12:55justin_smithimok20: it uses a local called m to build up the metadata in a let form
12:55justin_smithso you could look at what goes in m
13:00justin_smithlol
13:01carki'm trying to test the sourcemap thing but it looks like lein can't find clojurescript 2024 yet, how long usually until a version shows up on maven ?
13:01devncark: http://build.clojure.org/
13:02devnit looks like it should be out there?
13:02carkcouldn't find it on search.maven.org
13:02seangrovecark: Yeah, not listed on http://search.maven.org/#browse%7C-334501002
13:02devndnolen: might have a better idea
13:02Bronsayeah it takes a while for a release to hit maven
13:02devni have limited experience with maven releases
13:03devncark: in the meantime you could always just grab the source and built it yourself
13:03carkdevn : just like me =)
13:03devnbuild*
13:03devnit's pretty straightforward
13:03carkyep, just asking here in case it's only a matter of minutes
13:03devn*nod*
13:03dnolencark: probably will show in maven central later in the day - ./script/build if you want to install it locally
13:03devnis bootstrap still needed dnolen?
13:04carkdnolen: ah nice i'll try that
13:04carkthanks !
13:04dnolendevn: no
13:04devndnolen: oh. cool. so can that guy get rm'd?
13:04dnolendevn: well not for installing it locally anyway, for dev boostrap still needed
13:05devnoh, that's what i meant -- sorry
13:05devndnolen: what needs work in cljs these days?
13:05dnolendevn: lots of stuff, you can see in JIRA :)
13:06devn:) i'll take a peek
13:06seangroveInteresting recruiter email just showed up: https://gist.github.com/sgrove/7b40265b91948d8f26be
13:07seangrovednolen: Are you in their database? Seems they have a few with more than 5 years of cljs experience :P
13:07devnseangrove: i have a hunch on who sent that :)
13:07seangrovedevn: I don't like to shame though, so I just redacted it ;)
13:08dnolenheh
13:08devnseangrove: interesting post btw on the clojure mailing list
13:08devnapple looking for a clojure contract-to-hire
13:08devni wonder why
13:08technomancyitunes drm =(
13:08muhooyep
13:08devnsad
13:09seangrovedevn: hrm, didn't see that one at all. Interesting stuff.
13:09devnoh, i got you confused
13:09bitemyappseangrove: yes, but I'm still not going to do it. :P
13:09devni was thinking of seancorfield
13:09devnmy bad
13:09muhoothe strong correlation between lucrative and evil is not a new phenomenon, though it remains just as sad.
13:11devnhow do you guys know it's DRM?
13:11muhoosays someone who just realized the bluecoat webproxies on his mobile isp's network can be used to do an MITM attack and sniff ssl traffic
13:12devni know they mentioned itunes, but i guess i dont remember seeing anything about DRM, but i only skimmed it
13:12muhooand probably are, in fact, being used for that
13:12bitemyappo_O
13:12technomancydevn: I haven't actually used itunes, but I'm assuming that's plumbed all the way through the server-side components
13:14TimMcmuhoo: THat's the flip side of compressors, yes.
13:14devnoh, sweet -- datomic pro starter
13:14devnawesome news.
13:15devntime to deploy to heroku with pg
13:15bitemyappdevn: yeah that's what seangrove was talking about.
13:16muhoodevn: i was just going to say that
13:16devnim excited to play with pro on heroku
13:16muhoobut datomic is so resource heavy, both the transactor and the peer, i dunno how it'll work on heroku
13:16devn*shrug* -- it'll be a fun experiment, but yeah you may well be right
13:16devnsome tweaking is probably in order to the default settings
13:16muhooi've had to use 8GB VPS'es for both
13:17muhoothen again, why use pg, dynamodb seems pretty cheap
13:17bitemyappyou could run it on Heroku.
13:17bitemyappjust require tweaking the JVM opts.
13:18muhoothe transactor though?
13:18muhoohmm, could run the transactor on a vps, the backend on dynamo, and various front-ends with peers on heroku
13:18muhoolimit of 2 peers though.
13:20bitemyappif you're good at writing reasonably efficient Clojure code, 2 peers can serve a lot of people.
13:20bitemyappmuhoo: we've got one peer running a data warehouse, for example.
13:29RaynesWikipedia is down. I just became a janitor.
13:29Rayneshttp://xkcd.com/903/
13:30muhooa friend coined the word "googlectual" --> someone who appears smart but is just really fast with the searches
13:34TimMchelp what is a janitor
13:35bitemyappmuhoo: welcome to how I answer 90% of the questions on IRC
13:36DidYouTryGooglebitemyapp: Do you want this name?
13:37bitemyappTimMc: only half.
13:38muhoo$google google
13:38lazybot[Google] http://www.google.com/
13:38seangroveTimMc: Shapeshifter!
13:38bitemyappTimMc: I want that nick to swoop in in an automated fashion whenever somebody asks a Google'able question.
13:38muhoo$google just fucking google it
13:38lazybot[Just Fucking Google It] http://justfuckinggoogleit.com/
13:38TimMcSounds like you want an AI.
13:39seangrovebitemyapp: Why not add a lazybot command, `$google <handle>` that'll respond with a link containing a google query for whatever the handle last said?
13:39muhooseangrove: the #debian bot has something like that
13:39bitemyappseangrove: that's a good idea.
13:39seangrovemuhoo: Damn those debians, always one step ahead.
13:39muhooyou can msg factoids to people to dismiss them efficiently
13:39bitemyappEfficient Dismissal sounds like a metaphor for forced suicide.
13:40bitemyappFall on your sword, sir.
13:40muhoo#debian was quite a bar brawl at one time
13:40TimMcThe best bot I've ever seen was fajita in #apache.
13:40yogthosI guess feudal Japan had efficient dismissal all figured out then :P
13:40TimMcIt was amazing watching people come in and ask a question, get answered by fajita, thank the bot, and leave.
13:41seangrove Wow, that's pretty cool
13:42muhooworks great for projects with lots of peopel asking very repetitive n00b questions
13:42bitemyappmuhoo: I miss those days.
13:42TimMc*nod* I don't know if it would work as well for a programming language channel.
13:42muhoobitemyapp: feudal japan?
13:42bitemyappmuhoo: hahahaha, the IRC bar brawls.
13:42justin_smith~lazy
13:42clojurebotlazy is hard
13:44stuartsierraWhile we're on the subject of bots, some automatic links to http://dev.clojure.org/display/doc/FAQ might be useful. #bash does this to great effect.
13:45muhooone of the nicer bots i've seen was the one in #openwrt, which would post new forum posts or issues and issue-update statuses
13:45bitemyappstuartsierra: that could use expanded, haha.
13:45muhooso bugs got attention lightning fast, and got closed quickly too
13:46TimMcmuhoo: Wouldn't help too much here; only a couple of people actually have the power to address bugs.
13:47TimMcOh, might help on the contribs, I guess.
13:47muhooTimMc: yeah, maybe in #leiningen
13:48technomancyyeah, issue opening announcements would be cool in #leiningen
13:48TimMclazybot, get on it
13:48technomancylazybot has a few github integration features; couldn't be too difficult
13:49muhooit pulls in tentacles, right?
13:49technomancyundoubtedly
13:49logic_progare there any DSLS in clojure for writing code in NativeClient or ASM.js ?
13:49justin_smithnatural language processing that decits that 1) something was expected to happen that did not happen and 2) the person was using map
13:49justin_smith*detects
13:50muhooa laziness alarm
13:52muhoohmm, this is making me curious to see what kibit is like these days
13:54TimMcjustin_smith: println + map or for without dorun or doall
13:54TimMcFollow refheap and gist links too.
13:55justin_smithwell once it is checking out code it doesn't need NLP, it can just slurp it up as edn or something
13:56muhoohuh, kibit hates (->> ...)
13:56justin_smithmake a markov chain bot, and feed it all the best libraries, then just let it generate new code
13:56TimMcIsn't that how you code? That's what I do.
13:57justin_smithbonus, the code that doesn't compile you just use as the body of spam emails
13:57justin_smithno bit wasted
13:57mtpsounds like a plan to me
13:58bitemyappwe use printouts of the non-compiling code to bury the houses of recruiters and trap them inside
13:58bitemyappthen the bonfire starts
13:58seangrovebitemyapp: Might help some people on hn if you post some snippets about your ops experience with datomic
13:59muhoo(:require [million-monkeys "0.1.0"])
13:59seangroveSeems quite a few people are interested
13:59TimMchuh, is the one in clojure automancy> undoubted quickly a couple on few gist new could best links
13:59technomancykibit would be a cool nrepl-discover op if it didn't have bad opinions about when
13:59TimMc^ based on the last page of IRC
14:00seangrovetechnomancy: Please ban jaiiii for spam...
14:00justin_smithtechnomancy: what does kibit think of when?
14:00technomancyseangrove: huh?
14:00seangrovetechnomancy: Just getting private spam msgs :P
14:00technomancyjustin_smith: it thinks single-branch ifs are wrong and should be when instead
14:01muhookibit bitchd at me for (if (do and suggested when, FYI
14:01justin_smiththat's true!
14:01justin_smiththat is exactly what when is for
14:01bitemyappseangrove: I commented.
14:01bitemyappseangrove: if people ask me questions, I'll answer them.
14:01technomancyjustin_smith: http://p.hagelb.org/lies.gif
14:01muhooyeah, but when i wrote the code, i intended there to be an else :-P
14:01justin_smithOK, then what is when for?
14:01TimMc"laziness bugs got attentacles"
14:02muhoo,(doc when)
14:02clojurebot"([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."
14:02technomancyjustin_smith: side-effecting conditionals
14:02justin_smith???
14:02lazybotjustin_smith: Yes, 100% for sure.
14:02justin_smiththe mind boggles
14:02llasramEven lazybot agrees
14:02technomancylazybot: botsnack
14:02lazybottechnomancy: Thanks! Om nom nom!!
14:02technomancyjustin_smith: so you think it's a design bug that if is variadic?
14:02justin_smithno
14:02justin_smithbut I think one branch if is better as when
14:03justin_smithit's more explicit
14:03technomancyit's definitely more explicit
14:03bitemyappseangrove: I don't actually know what aspect of ops with Datomic was unpleasant for you.
14:03technomancyit tells the reader: side effects here; watch out. implicit do.
14:03bitemyappto my mind, the migration story is considerably more painful and that's why I'm working on that toolkit.
14:04muhooso far the only thing kibit complained about other than the single-armed if, is pos? instead of (< 0). i consider that a win.
14:04TimMctechnomancy: So you disagree with using the output of a when as a return value?
14:04bitemyappseangrove: also datomic pro starter isn't redistributable, so DAAS is still a no-go.
14:04bitemyappmuhoo: that's pretty good.
14:05technomancymuhoo: wait it complained about pos?
14:05technomancyTimMc: yes
14:05bitemyappkibit needs a fix sounds like?
14:05muhooit complained about (< 0), suggested pos?
14:05seangrovebitemyapp: That's not distribution though, is it?
14:05bitemyappohhhh
14:05technomancymuhoo: oh, ok
14:05bitemyappseangrove: it's a bit of a dodge to claim otherwise.
14:05bitemyappseangrove: I already have a number of people that hate me, I don't want to add Rich Hickey to that list.
14:05TimMctechnomancy: You'd prefer (if foo (+ foo 5) nil) then?
14:05seangrovebitemyapp: Well, gpl vs agpl I suppose
14:06technomancyTimMc: no, that's silly. nil is unnecessary
14:06justin_smithtechnomancy: the way I have always used when is to distinguish "action or nothing" from "action or alternative" - I have never connected it to side-effecting
14:06TimMcHarrumph.
14:06justin_smithbut I can totally see how it could be seen that way
14:06technomancyjustin_smith: that's a common mistake
14:07technomancyyou don't need a whole new top-level macro to distinguish something as trivial as 1 vs 2 branches when you already have if
14:07muhoo[(pos? ?foo)] looks weird tho in a query
14:07TimMcWe should have a 3-armed if.
14:07justin_smithI don't like single armed ifs because I waste precious seconds trying to verify there really isn't a second condition
14:07technomancyeven elispers (who are notoriously sloppy about imperative code) use when for side-effects
14:07bitemyappTimMc: k-armed bandit.
14:07TimMc(if foo (println "true") (println "false") (println "I reject the boolean binary system"))
14:08muhooTimMc: (defn vishnu [& arms]...)
14:08technomancyanyway, I'm not going to use kibit till it fixes that
14:08justin_smithTimMc: clearly the last would be if foo = FileNotFound
14:08TimMc:-)
14:11bitemyappmuhoo: kibit just cleaned up my code a fair bit.
14:11bitemyappmuhoo: it complained about Halloway's code too, hahahaha
14:11muhooooh, it also caught a (when (not ..)) . nice little lint, that is.
14:12muhoomy yak is completely bald now
14:12justin_smithyaks grow new hair very fast
14:12justin_smithand don't think you can't shave a bald yak
14:13muhoo(defproject yak-nair "0.1.0" ..)
14:13patchworktechnomancy: Is there overhead in the implicit do for 'when?
14:13patchworkWhy should it be avoided?
14:13technomancypatchwork: it's all about communicating intent
14:14muhoomy god you gys are still OCD'ing the when
14:14patchworkmuhoo: I brought it up again
14:14justin_smithINTENT IS VERY IMPORTANT MUHOO
14:14technomancymuhoo: I'm just bitter because I want a linter that doesn't give me bad advice
14:14muhoopatchwork: naughty
14:14muhoowe could go on about juxt for a while
14:14muhoo~juxt
14:14stuartsierra1"implicit do" has no overhead, for what it's worth.
14:14clojurebotjuxt is the bestest option though if it doesn't weird you out
14:15technomancyjuxt is completely uncontroversial in its splendour
14:15bitemyappseangrove: nobody's asked any questions :P
14:15justin_smithjuxt for president
14:15stuartsierra1(WTF is up with my router dropping connections?)
14:15technomancyjuxt has a plan for the economy
14:15justin_smithjuxt for industry
14:15justin_smithjuxt for the dead
14:15technomancy(well, it has N plans, and it's going to apply them all)
14:15muhoojuxt for the hell of it!
14:16stuartsierra1With liberty and juxt for all.
14:16muhoojuxt for shits and giggles
14:16yazirianwhen is not simple. when complects branching and do!
14:16mattmossjuxt do it?
14:16carkdnolen : looks like there's some kind of regression with clojurescript 2024
14:16technomancyyazirian: cond for secretary of state!
14:16bitemyappcark: https://github.com/cark/data.lenses == you?
14:16carkdnolen : compiler loops when compiling an alts! form from core.async
14:17carkbitemyapp: yes
14:17yaziriantechnomancy: need more wood behind fewer ->'s
14:17bitemyappcark: much love <3
14:17carkbitemyapp: didn't know anyone was using it =) glad to have 1 (one) user !
14:17llasramclojurebot: juxt is completely uncontroversial in its splendour
14:17clojurebotAck. Ack.
14:17bitemyapp~juxt
14:17clojurebotjuxt is usually the right answer
14:18carkdnolen: i have a minimal example https://gist.github.com/anonymous/7376057
14:18bitemyappclojurebot: juxt in Haskell is sequence, and is equally magical.
14:18clojurebot'Sea, mhuise.
14:19justin_smithhmm, what about using and instead of a when that is not about side effects
14:20technomancyjustin_smith: using or/and for side-effecty things is super sketchy
14:20technomancyfor exactly the same reason in the other direction
14:20justin_smithno when it ISN'T about side effects
14:21justin_smithwhen for the side effect thigs, and for the non-side-effect
14:21technomancysure, I mean the choice to use or/and means it's about return value; it's gross to do otherwise
14:21Apage43If I use or for side effects is usually (or thing-i-wanted (log "THING BROKE SRY"))
14:21llasramSome of these statements have a "when's on first" vibe going on
14:21justin_smithOK, just trying to be sure I have a more clear idiom for what I used to use "when" for
14:21justin_smithllasram: definitely
14:22dnolencark: looking into it
14:22technomancyllasram: "c.c/when" helps
14:22carkdnolen: thanks !
14:23stuartsierra1`when` is (if condition (do body)) 'nuff said
14:23bitemyappguys. Doesn't merit this much omphalophilia.
14:23patchworkRIP when-for-single-armed-ifs : (
14:23llasramWhen Wen went "when," "when"'s "do" didn't do what When wanted his "do" to do
14:23technomancybuffalo?
14:24llasramA much more versatile word
14:24TimMcnavel-gazing, I think
14:24devn^
14:24technomancybitemyapp: I'm allowed to; it says so on my twitter profile =P
14:24devn"Mommy, how do I be perfect all the time?"
14:24patchworkBetter than omphalophobia, so much unnecessary suffering
14:25TimMcRelatedly, how do folks handle the situation of logging conditions that are checked in an if or when? Here's something moderately gross: https://gist.github.com/timmc/7376199
14:25TimMcIt's annoying to split stuff out into a containing let.
14:26bitemyappTimMc: bindings + AOP
14:26bitemyappif you want maximum evil.
14:27bitemyappWhich I optimize for.
14:27devnheh
14:27technomancyTimMc: doto+prn \m/
14:27justin_smithnot to be confused with doto pr0n
14:28stuartsierra1TimMc: `spy` ?
14:28TimMcNot for debugging, for production logging.
14:28TimMc"I took this branch because..."
14:29bitemyappTimMc: just need a if-logged
14:29bitemyappan if-logged*
14:29llasramWhich parses apart boolean expressions in the conditional?
14:29bitemyappTimMc: so that instead of the check macro, you pass three forms at the top
14:29gfredericksare there any good examples of libs using metadata for not-compiler-stuff?
14:30technomancygfredericks: nrepl-discover!
14:30bitemyappexpr, true-log-message, false-log-message
14:30bitemyappthen true-branch, false-branch.
14:30technomancygfredericks: robert-hooke too
14:30gfrederickstechnomancy: let me back up; metadata on values, not vars/other-references
14:30technomancygfredericks: leiningen test selectors
14:30technomancyoh =(
14:30llasramgfredericks: I use metadata in abracad to annotate data structures with additional Avro-specific information
14:30technomancywho does that
14:30TimMcbitemyapp: In this case there are multiple reason for false.
14:30technomancygfredericks: lein profile merges
14:30gfrederickstechnomancy: I did it in this haystack lib
14:30gfrederickstechnomancy: oh nice
14:31TimMcOh, maybe this is a case for 3-armed if. :-P
14:31bitemyappllasram: you have the most serious-sounding last name I have ever heard.
14:31llasramhaha
14:31bitemyappTimMc: oh, okay.
14:31llasrambitemyapp: Yeah, it may be a bit much. My wife and I are considering alternatives :-)
14:31gfrederickswat what is it? lasram?
14:31gfrederickslaser-arm?
14:31TimMcBockrath-Vandegrift
14:31gfredericksLL Cool. Asram?
14:31llasramgfredericks: Since marriage+hyphenation, yeah
14:32technomancyVandebrock sounds cool
14:32bitemyappllasram: oh, one of those is your wife's name?
14:32gfredericksllasram: marriage+hyphenation is maybe the worst last name I've heard all day
14:32llasramhaha
14:32llasrambitemyapp: Yah
14:32hlshipI spend my life a hotels, etc., explaining that "Lewis" is not my middle name, it's the first word in my last name.
14:33TimMcllasram: Alternatives for a baby name?
14:33justin_smithyou'd think that now that now that we can have spaces in file / directory names this would extend simply to surnames
14:34hlshipI remember an agument w.r.t. name validation with a client years ago. Said spaces were not allow; I grabbed my friend, Todd Van Hoosier, from the next cube as a counterpoint.
14:34TimMcOr just a name change for yourselves?
14:34llasramTimMc: Alternatives for something else to change our last name to. We were lazy and never made the name-change legal, so there's still time to decide to do something else
14:35llasramBut yeah, Vanderbock, or Bockvand are in the running
14:35technomancyhttp://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ <3
14:35bitemyapphlship: this is why when I make a form for names, it's a single unvalidated string field.
14:35bitemyappjust... Name:
14:35llasramI liked the one about the people with the last name "Test"
14:35bitemyappthat's it. I'm not going to try to structure it because it's fucking impossible.
14:36justin_smithvalidation for anything humans attach significance to outside software is just silly
14:36justin_smith*structural validation
14:36TimMcbitemyapp: "How should your name be displayed on our site? ___ How should we address you? ___"
14:36justin_smithyou can of course check that two things are equal, whatever
14:36technomancy"What do you mean we can't name our son after the empty string? it's our favourite data structure!"
14:36bitemyappTimMc: username and name, right thur.
14:36justin_smithlol
14:36TimMcDepends on the site, but yeah.
14:37bitemyapptechnomancy: you see an empty string, Perl users see endless POSSIBILITIES
14:37TimMctechnomancy: Naing my firstborn U+FEFF
14:37TimMc*Naming
14:37bitemyapp"" can mean anything you want to! Postmodern programming!
14:37justin_smithbrb changing my name to #<Object java.lang.Object@243d81d5>
14:37justin_smith
14:37technomancybitemyapp: byte-order-mark hagelberg
14:37hlshipbitmyapp: #37 is one of the primary reasons behind the Obamacare debacle, I suspect. The user facing web site is inconsiquential compared to the work to integrate all the dozens of differents systems and organizations involved.
14:37bitemyapptechnomancy: I wonder how many times I've been reamed by an errant BOM
14:37TimMcYou got BOMed.
14:37dnolencark: oh, what cljsbuild are you using?
14:38hlshipman, my typing is awful today
14:39TimMcbitemyapp: Did NLP for a year or so; BOM everywhere. :-/
14:39carkdnolen: it's 0.3.3 ...
14:39jjidoTimMc: had an issue recently with a file starting with FEFF and containing FFFE
14:39carkdnolen: man i would hate to be bothering you for such silly problem
14:39gfredericksI have a babby in my lap right now; should I rename him before it's too much trouble?
14:39dnolencark: yeah you definitely got to be on 1.0.0-alpha2, but there might still be problem, but please switch and try yourself as well
14:39technomancygfredericks: at least perused the unicode multilingual plane before you do anything rash
14:39TimMcgfredericks: May I recommend something from the third listing from http://birdandmoon.com/naturenames.html ? :-D
14:39llasramgfredericks: Just rename the baby to one of the BOMs
14:39technomancy*peruse
14:40carkdnolen: i'll come back to you in a moment
14:40justin_smithgfredericks: I always say the future is ungooglable names - pick a name that is so search engine optimized that nobody will be able to find anything relevant in a search engine
14:40bitemyappgfredericks: how's programming with a baby in your lap?
14:40justin_smiththink ipad, brittany spears nude, download, local teens, that kind of thing
14:40gfrederickswhat is a BOM
14:40bitemyappgfredericks: better or worse than programming with a cat?
14:40bitemyappgfredericks: byte order mark
14:40dnolencark: k I can confirm it's an issue even w/ latest cljsbuild
14:40gfredericksjustin_smith: okay so maybe PRISM?
14:41justin_smithhttp://en.wikipedia.org/wiki/Byte_order_mark
14:41justin_smithgfredericks: yeah, that is a good baby name
14:41TimMcjustin_smith: Gender-ambiguous names are good too. That confuses gender-aware name-matchers.
14:41technomancyone weird trick fredericks
14:41justin_smithright
14:41llasramTimMc: My firstborn will now be named Hellbender, regardless of gender
14:41TimMcsnrk
14:41gfredericksooh what about naming with typos
14:41justin_smithfree ipad smith
14:41TimMcJhon Smith
14:41gfredericksI suppose that's hard to distinguish from stupid novelty spelings
14:42bitemyappllasram: brilliant. I work with somebody named Alaric.
14:42justin_smithyou could go with a meme that is guaranteed to be unkown and obscure in the future, but still full of irrelevant search results
14:42justin_smithshibe
14:42carkdnolen : indeed same problem with cljsbuild 1.0.0-alpha2, still works in 2014 and not in 2024
14:42TimMcA good first name would be "The", pronounced "tay".
14:42bitemyappmemes were a thing even in 1960: http://upload.wikimedia.org/wikipedia/commons/9/95/MAD-alfie-1960.jpg
14:43gfredericksTimMc: that has all the best attributes of names
14:45dnolencark: I gotta run for a bit, it's very strange and I'm not sure it's not an issue w/ core.async, will probably need tbaldridge's help on this one
14:45carkdnolen: ok, thanks for your help
14:45yazirianIt's pronounced as-WEE-pay!!
14:47hlshipllasram: My friends were going to name their son "Rhys Danger Newman" but chickened out and now regret it (their parents discouraged them from "Danger is his middle name").
14:47carkdnolen: there is definitively something strange with require-macro and core.async, when i :refer alts! i get a warning, i have to refer alt! instead ...
14:48bitemyapphlship: brilliant. What a lost opportunity.
14:48dnolencark: alts! is not a macro
14:48quilehlship: I actually know someone who did give their child the middle name "Danger"
14:48carkdnolen: ah that would be why =)
14:48technomancyI have a friend who changed his last name to Danger
14:49technomancyhe actually uses Clojure
14:49quileha
14:49dnolencark: and you must require it from core.async same for <! >!
14:49gfrederickstechnomancy: I choose to assume you're talking about Tim Dysinger and will now change how I refer to him
14:49technomancygfredericks: not gonna stop you
14:50gfredericksMiddlename Lastname Firstname
14:50gfrederickstrying to figure out the best name to instigate "Who's on first"-like conversations
14:50dnolencark: core.async definitely needs to be updated for 2024 anyhow, it relies on some details that have changes around ns aliases and other things
14:51dnolencark: so you'll have to wait anyhow
14:51carkdnolen: righht, i fixed minimal example, and still does not work. No problem about waiting, was only giving a test run to latest clojurescript
14:51patchworkgfredericks: Just name him when
14:53jemendjahello
14:54TimMcgfredericks: Mymiddlename ...
14:55gfredericks"What's ___ ___"
14:55dnolencemerick: hrm, did you handle the require-macros alias case in your patch?
14:55gfredericksmaybe "What's Your Name"
14:56gfredericksthen when somebody asks you the question you can decide whether to respond with "Yes?" or "Yes it is."
14:56cemerickdnolen: AFAIK, yes. I believe there was either a test case for that, or I added one. Been using :require-macros :as with good results since?
14:56dnolencemerick: seems busted for me if I alias and do ::m/foo
14:58cemerickdnolen: oh, for keyword resolution. Hrm, I might be able to believe that. This is in a REPL, or in general?
14:58dnolencemerick: doesn't work in a source file
14:58TimMcgfredericks: My First Name Has Three Words
14:58cemerickdnolen: file a ticket, assign it to me, I look into it this weekend
15:00TimMc"What's your name?" "My First Name Has Three Words" "Well, what are they?" "My First Name" "Yes, that's what I'm asking..."
15:00dnolencemerick: done
15:02cemerickdnolen: thanks; I have something else for your consideration
15:03cemerickdnolen: right now, ^:export on a definition of a scalar (e.g. `(def ^:export some-value 42)`) doesn't really work; GClosure advanced inlines the value in functions that reference the def, so any external set!'s on that property are effectively no-ops. I have a working patch.
15:04cemerickThis seems like a worthwhile fix/enhancement, but I know you have certain optimization objectives that it _might_ conflict with...
15:05dnolencemerick: seems to that is GClosure bug
15:05dnolenseems to me
15:05cemerickdnolen: I thought it was too, but ^:export currently isn't doing a couple of things it should be. Hashed it out on SO with a GClosure contrib.
15:06cemerickMy patch currently only makes changes to how non-defn symbols are exported, but we may want to apply the same thing to those as well.
15:07cemericke.g., the same problem would occur with a fn that returns an exported fn; the former will always return the same fn, even if the latter's property is set!'d
15:07dnolencemerick: seems like a fine enhancement, we're not going to ^:export anything in core.cljs anyhow
15:07cemerickdnolen: OK, I'll put up a draft patch, add tests once you OK the general approach
15:26Raynesibdknox: ping
15:28danielszmulewicztechnomancy: ping
15:31jjidowhat is GClosure?
15:32RaynesGoogle Closure
15:32Raynes$google google closure
15:32lazybot[Closure Tools — Google Developers] https://developers.google.com/closure/
15:35jjidois it Javascript?
15:37mikerodfrom the REPL can you get a defrecord/deftype/defprotocol to be written to a .class file?
15:37mikerod- so that you could view it
15:39gfredericksRaynes: did you just tell some clojure code to search google for something called "google closure"?
15:45danielszmulewicz`lein uberjar`complains about not finding a dependency only present in the dev profile. I thought `lein uberjar`was excluding dev profile. What gives?
15:51cmiles74I wonder if the issue is that it's compiling, which requires the dependencies from the "dev" profile.
15:53xeqidanielszmulewicz: so its complaining about not finding a dependency you don't expect to be there?
15:54danielszmulewiczxeqi: Yes, I don't expect `lein uberjar`to complain about a development time dependency.
15:54danielszmulewiczxeqi: I must be doing something stupid, though.
15:55danielszmulewiczxeqi: I'm always confused with lein profiles
15:56danielszmulewiczxeqi: Could not locate clojure/tools/namespace/repl__init.class or clojure/tools/namespace/repl.clj on classpath
15:56cmiles74danielszmulewicz: perhaps you accidentally referenced a development time dependency in your code somewhere. Thus at compile time it's reaching out for those functions.
15:57danielszmulewiczxeqi: Yes, might be. I'll check again.
15:59danielszmulewiczcmiles74: Oops, sorry. Should have replied to you.
16:00cmiles74danielszmulewicz: :-P
16:00danielszmulewiczcmiles74: No. Definitely no reference whatsoever. However, `lein clean` fixed the problem.
16:00`cbpbitemyapp: bja never contacted you again? If not and you're busy that's ok. I'll take a stab at it this weekend. Move all the connection stuff inside the agent and some error handling for that right?
16:00danielszmulewiczThat is not good.
16:00justin_smithdanielszmulewicz: I have been seeing more and more of those
16:01justin_smithto the point that I make a ritual of lein clean now
16:01danielszmulewiczjustin_smith: Sad.
16:01justin_smithyeah
16:02technomancydanielszmulewicz: that's why I added profile-level isolation to lein
16:03technomancyso dev-time AOT can't affect deploys
16:03danielszmulewicztechnomancy: That's excellent news. So I should upgrade to what?
16:03technomancyunfortunately it was too invasive for a point-release, so it defaults to being off, but you can (and should) enable it with :target-path "target/%s" in your user profile
16:05danielszmulewiczOK then. And it's available in Leiningen 2?
16:05technomancyyeah
16:07danielszmulewicztechnomancy: :target-path "target/%s" Is this slash percent s? What is the meaning?
16:08technomancydanielszmulewicz: :target-path gets the current profile set spliced in with format
16:08technomancyso when the uberjar profile is active, the target-path will be different from your regular dev target-path
16:08technomancythat way it's impossible to have dev-time classes affect uberjars
16:09danielszmulewiczOK, and to confirm: that goes to system-wide user profile (~/.lein/profiles.clj), yes?
16:10technomancyright, unless you want to make extra sure everyone on the project is also isolating their own hacking too
16:11danielszmulewiczthen you would put it in project.clj?
16:12danielszmulewiczin that second case, I mean
16:12technomancyyeah
16:14danielszmulewicztechnomancy: thanks a lot. I feel bad for complaining, you're so helpful. Leiningen feels sometimes like black magic.
16:15technomancyany time AOT is involved, things get yucky
16:15danielszmulewicztechnomancy: I suppose.
16:15danielszmulewicztechnomancy: tough nut to crack.
16:16technomancyI actually included that profile isolation change in a release, but it broke existing workflows that hard-coded target-path =(
16:16technomancyso it had to be rolled back
16:18llasram*guilty*
16:18llasramWhat do you recommend for not hard-coding the target path?
16:18technomancyllasram: look in the project map if possible
16:18llasramHmm
16:19llasramUnfortunately the part of the meta-build which needs to find the uberjar is written in Ruby
16:20llasramBut -- `lein pprint` maybe?
16:20technomancyyeah, that would work
16:21technomancyI think the output of uberjar also includes the path written to?
16:21technomancyyeah, best to use that
16:22llasramIt does, but that's problematic for me, actually
16:23llasramOh, but maybe has the same problems as running `lein pprint`
16:24llasramYep
16:25llasramI'm building .debs using `fpm` under `fakeroot`. But I can't run `lein` under `fakeroot`. In my meta-build, the uberjar and the .deb building steps are separate `rake` tasks which actually end up running in separate processes
16:26llasramI guess I can stash the path from `lein uberjar` or `lein pprint` in an environment variable or something
16:33bitemyappAny suggestions for how I could clean up this mess of a let body and cond? https://www.refheap.com/20613
16:33bitemyappI'm not really happy with that.
16:34jeI have a project containing both clj and cljs using newest cljs version (0.0-2014). My project depends on a lib, depending on clj-http, depending tools.reader 0.7.7. This makes cljsbuild fail with "Unable to resolve var: reader/*alias-map* in this context" even though the cljs part doesn't use this lib.
16:34jeI can come around this issue by patching clj-http 0.7.8-SNAPSHOT with tools.reader 0.7.10 and but it in my local maven repo, but is there a better other way?
16:35dakroneje: tools.reader is an optional dep for clj-http, you can exclude it
16:35technomancyboy, sure would be cool if you could read safely without an external dependency
16:35technomancy=\
16:36rrcis there any more elegant way to handle this reduction which requires threding the accumulator? I really want to comp the two fns, but they take two args while returning only the accum http://git.io/zdO_OA
16:37dakronetechnomancy: it certainly would, wouldn't it...
16:37dakrone:P
16:38dakrone:)
16:38justin_smithbitemyapp: that may or may not be clearer if you named the (and ...) values that cond is checking in the let
16:39justin_smithdepends if those and conditions actually describe things with reasonable names I guess
16:39rlbIf I want to autogenerate a bunch of sexps but don't want any symbol qualification, is there any better approach than just liberal use of ~'foo?
16:41llasramrlb: Auto-gensyms via e.g. foo# aren't an option?
16:41justin_smith(and many? map? (not coll?)) = map-into-many; (and many (not map?) coll?) = sequential-into-many
16:41justin_smithetc.
16:42rlbllasram: I want to generate, say (let [foo ...] (case ...)) for output to a file, with no namespace qualifications.
16:42rlbi.e. I don't want cloljure.core/let, etc.
16:42rlbclojure.core/let
16:43llasramI think bbloom's backtick will let you do what you want: https://github.com/brandonbloom/backtick
16:43rlbbut I'd also prefer not to have to have (~'let [...] (~'case ...
16:43rlbllasram: ok, thanks -- I'll take a look.
16:45TimMcbitemyapp: core.match on [many? map? coll? one?] with values like [true true false _] :-P
16:45bitemyappjustin_smith: sorta.
16:46bitemyappTimMc: it really does beg pattern matching doesn't it?
16:46TimMcAlmost.
16:46jedakrone: thanks it worked, I didn't know of :exclusions ... now I do :D
16:46bitemyappI think it's a pretty clear case where pattern matching would be a boon.
16:46TimMcOr heck, maybe it does.
16:47bitemyappthe first (and many? map? (not coll?)) would turn into (given: [many? map? coll? one?]) - [true true false _]
16:47TimMcMy suggestion started off as somethign awful where you would assign either a prime or 1 to each conditional and multiply them together, then dispatch on the product.
16:47llasram...
16:47bitemyapp[true false true _] [false false _ true] [false true _ false]
16:47TimMc...but not all conditions were used in each clause, so it actually evolved into something useful-ish.
16:47justin_smithTimMc: assign powers of two and dispatch on the sum
16:47bitemyappjesus christ lol
16:47dakroneje: cool :)
16:48TimMcjustin_smith: That's no better, right?
16:48justin_smithheh, at least with that one you can bit mask if you don't care about one of the conditions
16:48TimMcOh wait, it would actually work...
16:49bitemyappI'm using core.match, not the loony bitmasking solution :P
16:49justin_smithclassic old school C programming
16:49bitemyappbut clever!
16:49TimMcJust give coll? and one? the same prime, since many? is always true for one and false for the other.
16:49llasrambitmasks are the best
16:49danielszmulewiczIn my project, I have a java source file that I compile with `lein compile`and when I run my app with `lein run` or at the repl all is fine. Now I'm trying to do `lein uberjar` and it gives a java.lang.ClassNotFoundException when compiling the clj source file that references the java classes. How can I solve this?
16:50TimMc:-D :-D :-D
16:50justin_smith"I'm code from the '80s"
16:50deechHi all, I'm using core.match and I'm having an issue where code that compiles (and loads) fine when I do `lein repl ...` fails to compile with a `lein compile`.
16:50llasramdanielszmulewicz: Probably not the problem, but FYI Java compiles via the `lein javac` task, not `lein compile`
16:51deechCould this be core.match related or should I look elsewhere?
16:51danielszmulewiczOK, thanks. Will try this too.
16:51llasramdanielszmulewicz: Which version of Leiningen?
16:51danielszmulewiczllasram: 2.3.2
16:52llasramAre you explicitly setting :prep-tasks ?
16:52TimMcjustin_smith: I think this would work: https://www.refheap.com/20615
16:52TimMcYou do have to do masking, still.
16:52danielszmulewiczllasram: No. I should, right?
16:53TimMc...in which case there's no purpose in using 5 for both coll? and one?, but whatever.
16:53llasramdanielszmulewicz: Not unless you have something special. But if you were, and hadn't included `javac`, then you might get the error you're seeing
16:53bitemyappwasn't there a Clojure library that randomly fucked with your code to verify test coverage?
16:53danielszmulewiczI'll try this :prep-tasks ["compile" "javac"]
16:54bitemyappdoes anybody remember the name of that library?
16:54TimMcThere's heckle in Ruby...
16:54llasramdanielszmulewicz: I would actually counter-suggest that :-)
16:54TimMcThat might get you closer in a search.
16:54bbloomrlb: the "template" macro (or template-fn function) in backtick is exactly what you want
16:54llasramdanielszmulewicz: Do try `lein with-profile +uberjar pprint` and check :prep-tasks
16:55bitemyappsadly "heckle Ruby clojure" didn't get me very far.
16:55TimMcbitemyapp: Alo, I feel there's an opportunity in your previous question to use a Karnaugh map macro.
16:55bbloomdnolen: in theory, clojurescript macros could use backtick to resolve symbols against the namespaces var ... i might implement that
16:57TimMcbitemyapp: Previous #clojure discussion: http://clojure-log.n01se.net/date/2012-01-29.html#11:02
16:57dnolenbbloom: hm, backtick is pretty small, wouldn't want to add a dependency but if you wanted to just get that code in ClojureScript sure
16:57bbloomdnolen: oh i wasn't proposing adding a dependency
16:57bitemyappTimMc: I asked because I just did that (sabotaged the code to test the code breaks)
16:57bbloomdnolen: and the reader technically already does this
16:57TimMc...and that points further back in the logs...
16:58bbloomin theory, i could tweak tools.reader & expose it the same was as backtick
16:58dnolenbbloom: yeah was gonna say, perhaps we can get this into tools.reader
16:58danielszmulewiczllasram: Why counter-recommend? Your initial hint did the trick. I Included :prep-task in the uberjar profile and now it works. The java source file was compiled before the clj source files, and I got my standalone jar wich launches fine. Kudos to you.
16:58TimMcApparently abedra is the person to heckle to get a clojur eheckle tool.
16:59llasramdanielszmulewicz: Oh, because the defaults should work just fine. Since they aren't, something else is going on. If you're happy where you are, I'll leave you to it though :-)
17:01TimMc("Saboteur" or similar was the right keyword.)
17:03TimMc`cbp: ^ You should write a Clojure version of Ruby's Heckle, a sabotage-based code coverage tool. Algorithmic, teaches you about Clojure, useful to others.
17:04TimMcThere's your project.
17:04`cbphi TimMc ok
17:05TimMcclojurebot: A good project is a heckle clone for clojure (sabotage-based test-testing tool)
17:05clojurebotYou don't have to tell me twice.
17:06TimMcI'm going to start storing project ideas in clojurebot.
17:06`cbpclojurebot: what is a good project?
17:06clojurebotNo entiendo
17:08danielszmulewiczllasram: You are probably correct. But again, I hardly understand how to drive leiningen in a scenario with both java and clojure source files.
17:10llasramdanielszmulewicz: It should mostly Just Work (tm). You need to set :java-source-paths, but that should be it
17:10llasram(well, and :source-paths, if you want java and clojure as subdirs under `src`, but you get the idea)
17:11TimMcclojurebot: a good project?
17:11clojurebotHuh?
17:11TimMcclojurebot: a good project
17:11clojurebotGabh mo leithscéal?
17:11TimMc:-(
17:11`cbpnice
17:11swarthydanielszmulewicz: I just did that for the first time yesterday, use a java lib in clojure. https://github.com/technomancy/leiningen/blob/stable/doc/MIXED_PROJECTS.md helped me get it
17:11TimMcclojurebot: A good project
17:11clojurebotA good project is a heckle clone for clojure (sabotage-based test-testing tool)
17:11TimMcAww, don't tell me it's case-sensitive...
17:13danielszmulewiczllasram: yes, java-source-paths was set. It's fixed now. And I don't know what the problem was. Yuck feeling.
17:13danielszmulewiczswarthy: Thanks, that's what I should have read in the first place.
17:14swarthydanielszmulewicz: np, its not as complicated as it seems at first. Getting the directories right is the hard part, then it's easy.
17:15danielszmulewiczswarthy: Anything else besides keeping the directories separate, and properly referenced inj :java-source-paths and :source-paths?
17:16seangrovebbloom: Quite a bit of patience you showed on the hn thread
17:16bbloomseangrove: which one?
17:16seangrovebbloom: Any chance you'll end up the new Cognitect dev relations?
17:16bbloomheh, unlikely
17:16seangrovebbloom: Datomic Starter Pro
17:17bbloomi just want more people to build systems w/ rich's ideas in them :-)
17:18seangrovebbloom: Ah, sorry, dev. evangelist, obviously ;)
17:19bbloomif anybody wants to write me a check for schooling fools on the internet, i'll happily cash it
17:19justin_smithdanielszmulewicz: your IRC client sends occasional control characters
17:20seangroveWell, thought it was nice of your to explain things the way you did
17:20justin_smithlike  and  (they show up as ^\ and ^H in my client)
17:20danielszmulewiczjustin_smith: Oh, really? I'm using Colloquy. What are you using?
17:20justin_smitherc / emacs
17:20TimMcI see it in irssi.
17:20danielszmulewiczjustin_smith: Maybe I should too.
17:20justin_smithI saw: "justin_smith: Oh, really? I'm using Colloquy. What are you using?"
17:20justin_smitherr, maybe you don't see the control char when I send it either
17:21danielszmulewiczjustin_smith: No, I don't see it.
17:21justin_smithI saw: "justin_smith: Oh, really? I'm usi^\ng Colloquy. What are you using?"
17:21justin_smithjust odd, I don't know
17:21danielszmulewiczNow I see.
17:21justin_smithI replaced the control char with the way emacs displays it, but as ascii
17:21danielszmulewiczIs it only me?
17:21justin_smithyup
17:22danielszmulewiczwow
17:22llasramWell, and justin_smith
17:22justin_smithwhen I do it intentionally :)
17:22llasramYes :-)
17:22danielszmulewiczllasram: :-)
17:22TimMcHmm, what's the correspondence between the displayed ^H and the actual code?
17:22danielszmulewiczso ERC is the recommended irc mode for Emacs, are there contenders I should examine?
17:23seangrovedanielszmulewicz: irssi, of course
17:23mtprcirc, circe
17:23TimMcOh right, ^H is ASCII 0x08...
17:24danielszmulewiczI can't believe it's a level playing field. Surely there must be some understanding of which is the superior one? (snark)
17:24justin_smithTimMc: emacs says (when I investigate it) " character: C-h (displayed as C-h) (codepoint 8, #o10, #x8)"
17:24justin_smithgood old m-x describe-char
17:25seangrovejustin_smith: Also like M-x what-face
17:25danielszmulewiczWho recommended circe? Last update is 8 years ago.
17:25seangroveDifferent purpose, but found it pretty useful recently for fixing unreadable text that I've put up with for the past four years
17:26TimMchttps://en.wikipedia.org/wiki/Caret_notation
17:26`cbpWell that wouldve definitely come in handy back when i was modding color themes
17:26justin_smithseangrove: describe-face?
17:27seangrovejustin_smith: Also good, but ultimately I just use it with M-x customize-face
17:27seangroveI suppose describe-face has a link right there though, nice.
17:28TimMc^\ is apparently Field Separator
17:29llasramargh, JVM's lack of unsigned integers
17:34TimMcThey're called chars. :-P
17:35llasramhaha
17:35llasramUnfortunately not applicable to my immediate situation
17:35TimMcunsigned shorts
17:36bbloomaren't JVM chars 16 bits?
17:36llasramOh man. I hope someone got K&R to put their signatures on a pair of short pants. Then that person could wear around their K&R signed shorts
17:37dnolencark: figured out what was going on cutting a new CLJS release that will work with core.async now
17:38TimMcbbloom: Yes?
17:38bbloomer dir, you said short, not byte
17:38bbloomignore me
17:38TimMcActually, I can't remember if you can do match on chars in Java.
17:39justin_smith,(+ \a \b) ; will be an error
17:39clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number>
17:40TimMcLooks like if you try to do math on chars, the Java compiler upcasts them implicitly to int.
17:41deech` Hi all, using core.match I'm having an issue where my project fails to
17:41deech` build (with an IndexOutOfBounds Exception) on the first compile but
17:41deech` compiles and works on the second.
17:41deech`
17:41deechCrap.
17:41deech`Sorry.
17:41TimMc...but you can totally do ++ on a char
17:42TimMchttps://www.refheap.com/20617
17:42Morgawrmmm
17:42Morgawr,(every? false? '())
17:42clojurebottrue
17:42Morgawr,(every? true? '())
17:42clojurebottrue
17:42Morgawris this a bug or intended or...?
17:43TimMcIntended.
17:43Morgawrwhat's the rationale behind this?
17:43deechLet me try again. I'm having an issue where some core.match code fails to compile with an IndexOutOfBounds Exception on the first pass but passes on the second and works fine. Has anyone seen this before?
17:43TimMcMorgawr: Can you find a value for which the predicate fails?
17:43deechApologies for the noise before.
17:43justin_smith,(every? even? []) ; Morgawr
17:43clojurebottrue
17:44MorgawrTimMc: by docs "Returns true if (pred x) is logical true for every x in coll, else false." 'pred' is not true for every x because there is no x, I'd say it's ambiguous wording (I get what you're saying though)
17:44justin_smithMorgawr: it is the base case of a recursive function, when handed an empty sequence
17:44Morgawrjustin_smith: that makes sense
17:44Morgawrhow would I elegantly handle the case where the sequence might be empty?
17:44TimMcMorgawr: The predicate is "vacuously satisfied". "For every" is misleading.
17:44MorgawrTimMc: true
17:45MorgawrI just spent 2 hours trying to understand why my code was failing and this was the reason, very frustrating D:
17:45justin_smith(and x (every? pred? x))
17:45justin_smith(and (seq x) (every? pred? x))
17:45justin_smiththat is the semantics you want I think
17:45Morgawrjustin_smith: alright, thanks
17:46TimMcMorgawr: In first-order logic, "For all X, Y is true" is equivalent to "There does not exist an X such that Y is false"
17:46MorgawrTimMc: I hear ya
17:47MorgawrI mean, I understand what you're saying and it makes perfect sense
17:47Morgawrjust that the docs should probably mention this, it can be frustrating
17:48hfaafbhttp://i.imgur.com/782Kl7u.png
17:49justin_smith,(= Double/NaN Double/NaN)
17:49clojurebotfalse
17:49TimMcMorgawr: Base-cases, they're tricky.
17:49MorgawrTimMc: yup
17:52justin_smith,(= Double/NaN)
17:52clojurebottrue
17:52justin_smithanother weird base case
17:52justin_smith(since it is the value that is not = to itself)
17:53TimMcI don't know if I'd call that a base case.
17:53justin_smith(= x) for any x is true
17:53justin_smithbecause it is a base case
17:53justin_smith,(= Double/NaN Double/NaN)
17:53clojurebotfalse
17:53justin_smith,(= Double/NaN)
17:53clojurebottrue
17:53TimMcOh, missed the unary execution.
17:55justin_smithsince = is always true for one arg, as the base case of the recursion
17:55TimMcI'm annoyed that (=) is an error.
17:55TimMc*That* should be the base case.
17:55OscarZhi guys.. how u guys think Clojure is gaining up popularity ?
17:55OscarZits a bit hard to judge
17:56TimMcE_BAD_PARSE
17:56TimMcAre you asking if you think it is, or how it is? :-)
17:57TimMcI keep hearing about it getting used in different places, and the channel has been growing, so those are evidence for growth.
17:57OscarZmaybe you have a good understanding of it as some of you have been on this channel for years.. i guess the activity on this channel is some kind of indicator
17:58muhoowait for the clojure survey results to come in?
17:58muhoohttp://cemerick.com/2013/11/05/2013-state-of-clojure-clojurescript-survey/
17:58TimMc673 nicks now; I think it was at 300-400 a couple years ago.
17:59OscarZmuhoo: thats exactly what i asked for :)
18:00OscarZTimMc: I think thats good :)
18:00Morgawrclojure #1
18:01OscarZwould be interesting to hear from you guys of the good and bad things about Clojure.. whatever it was that you switched from
18:01MorgawrI switched from C haha, pretty big jump
18:01OscarZmost probably coming from Java, C#, python I'd imagine
18:01OscarZmaybe Ruby
18:02TimMcOscarZ: You should search for past years' surveys.
18:02OscarZMorgawr: hehe i guess so
18:04OscarZTimMc: I will surely check those out.. you dont have any personal experiences you'd like to share?
18:06TimMcNot in particular?
18:07OscarZThats ok.. reading up on the surveys.. interesting stuff..
18:08bitemyappseangrove: there, questions are being answered.
18:09bitemyappOscarZ: the only thing I don't like about Clojure is that the type system doesn't do much to help you out. The other 99% I'm happy with.
18:10dnolenClojureScript 0.0-2030 going out, mostly to address core.async issues
18:11tbaldridgebitemyapp: are you really complaining that a dynamic language doesn't provide type safety?
18:12justin_smithgfredericks: fnu lnu http://mobile.nytimes.com/2013/07/15/nyregion/unidentified-defendants-have-bedeviled-courts-for-decades.html
18:13justin_smith"At any given time there can be hundreds of Fnu Lnus in the court system."
18:13seangrovetbaldridge: Just sounded like he was mentioning a piece he misses
18:13seangrovebitemyapp: Nice answer by the way, liked it a lot.
18:13lpvbon https://github.com/daveray/seesaw
18:14lpvbit says replace version with the tag below
18:14lpvbI don't see a version number
18:14OscarZbitemyapp: what kind of problem is it usually in practice? is it that there isnt as nice code completion features in IDE or just that its easy to use objects of the wrong type?
18:14justin_smithlpvb: the version number is in project.clj
18:14justin_smithwhich is on the top level of the project
18:15bitemyapptbaldridge: the world is not enough.
18:15bitemyappOscarZ: 80-90% of the errors I run into and have to spend time resolving could be caught by a proper type system.
18:15bitemyappOscarZ: that's true of most languages though.
18:15lpvbjustin_smith: "1.4.5-SNAPSHOT"
18:16lpvbdo i use the whole string
18:16justin_smithlpvb: yeah
18:16justin_smithalso, you can search clojars.org to see various versions available
18:17justin_smithhttps://clojars.org/seesaw
18:17OscarZim not that familiar with language design.. but couldnt you have kind of optional type system.. you could enforce types on some functions?
18:17tbaldridgeOscarZ: may I welcome you to #clojure, here you will meet bitemyapp a converted Haskell programmer who still pines the loss of his old love.
18:17justin_smithlpvb: that shows "1.4.4" being the most recent actually, that could be the newest actually built nad deployed
18:17lpvbjustin_smith: clojars is where the dependencies come from?
18:17technomancyOscarZ: yes, you can. people are working on it, but it's still a work in progress.
18:18justin_smithlpvb: it is a repository that lein uses by default to find deps, yeah
18:18justin_smithbut you can use others
18:18OscarZtbaldridge: hehe.. im a long time Haskell lurker as well
18:18OscarZfrom the other side of the static/dynamic language spectrum
18:18technomancyOscarZ: you can't have it as nice as HM on the JVM though
18:18lpvbhow about that apache one that maven uses?
18:18tbaldridgeOscarZ: and just to provided the opposite view. I've found that having to think about my program twice is quite annoying. Once to think about how to code it, once more to get it to fit a type system.
18:18lpvbdoes leiningen use that too
18:18bitemyappOscarZ: I use Clojure and Haskell concurrently. It should be noted that I use Clojure, not Haskell, at work.
18:19bitemyappOscarZ: and that I find Clojure very productive. So the truth is more subtle than tbaldridge likes to paint it.
18:19lpvbclojure is my python as Haskell is to C++
18:19bitemyappI end up thinking about my Clojure code at a type level anyway. "Twice" is meaningless. I just want to know what makes sense, what works, what doesn't, and reduce my TTS and TTF
18:19OscarZthats an interesting combination
18:19tbaldridgebitemyapp: hey, someone has to add hyperbole to this channel, might as well be me.
18:20bitemyappTTS: time-to-solution - TTF: time-to-fix
18:20Morgawrmmm.. I have a set like #{:a :b :c} and a map like {:a function :b function :c function :d function} (etc etc), I want to take all the elements in the first set and apply them to a variable x iteratively (like ->) based on their function in the map
18:20bitemyappa compiler that can say something useful about your code and prevent whole classes of errors can improve both of those numbers.
18:21Morgawrso in that case it would be (-> x ((:a map)) ((:b map)) ((:c map)) )
18:21Morgawrhow do I do this elegantly?
18:21justin_smithMorgawr: (map (apply juxt (vals (select-keys function-map key-set))) args)
18:22bitemyappGOD DAMMIT
18:22tbaldridge(inc justin_smith)
18:22lazybot⇒ 10
18:22bitemyappjustin_smith: I nearly had it.
18:22tbaldridgefor use of juxt
18:22Morgawr(inc justin_smith)
18:22lazybot⇒ 11
18:22Morgawrthat's pretty damn great
18:22OscarZif you write a function in clojure.. i guess you almost always have a good understanding of what the input should be... why not some kind of "ad hoc" validation patterns that the compiler could catch ?
18:22Morgawrthanks
18:22bitemyappjustin_smith: is map what he wants? not reduce?
18:22justin_smithhmm
18:22bitemyappOscarZ: well that kinda happens. There's core.typed and there are runtime schema validators.
18:22Morgawryeah probably reduce
18:22justin_smithdepends what he meant by iteratively
18:22Morgawrthey build on top of each other
18:22Morgawrlike ->
18:23bitemyappI was writing the reduce version, and you took the wind out of my sails :(
18:23Morgawrbut yeah, just with that idea you gave me good points to work on, thanks
18:23justin_smithOK, I was close
18:23technomancyOscarZ: you can, but it's nicer when computers can do grunt work for you
18:23bitemyapptechnomancy: you might almost think that was the point of computers...
18:24rasmustocomputers deserve a break sometimes
18:25tbaldridgeOscarZ: if I write a function, and I know what it should be given, why should I have to fit it into the validation pattern of the compiler. Now if I want to change the function, I have to change the validation pattern as well.
18:26bitemyapptbaldridge: have you written code in an ML or Haskell?
18:26benkay,ping
18:26clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ping in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:26tbaldridgebitemyapp: yes
18:26bitemyapptbaldridge: you're painting this picture of whips and chains that just doesn't happen.
18:26S11001001ugh
18:26benkayi'll take it
18:27tbaldridgebitemyapp: I would be interested in a Haskell/ML variant with a sexpr syntax. That's actually one of the worst turnoffs of those languages for me.
18:29bbloomtbaldridge: have you tried Shen? It's kinda in the Haskell/ML family of semantics
18:29bbloomhttp://shenlanguage.org/
18:30imok20does anyone do simple, (cheap?) hosted datomic?
18:30bitemyapptbaldridge: I'd be down for that too.
18:31benkayDaaS
18:32jcrossley3if i have a multi-arity function defined in a protocol, is it possible to define one arity in one map, and a different arity in another map, and then merge them somehow to pass to extend?
18:32OscarZin those Clojure surveys theres exactly the same question I was after "What have been the biggest wins for you in using Clojure?"
18:32OscarZinteresting stuff
18:32tbaldridgeimok20: you should probably read the Datomic Terms-of-Service (http://www.datomic.com/datomic-pro-edition-eula.html)
18:33OscarZI think they should also add "minimalism, simplicity, reduction of cognitive load on irrelevant shit" as an option
18:34imok20tbaldridge: it looks as though it would allow for it, less the "cheap" request
18:34benkayall web-hosted EULAs should be hashed and have a link to previous versions.
18:34Morgawrjustin_smith: ended up using (reduce #(%2 %1) state (vals (select-keys func-map func-keys)))
18:34tbaldridgeimok20: read the Restrictions section, subsection (c) and (d)
18:36imok20tbaldridge: sub subsection (n) in the same subsection seems to indicate otherwise (given the definition for OEM in the Definitions section)
18:36tbaldridgeimok20: the free version does quite a bit, and can be included in OSS projects. And then new Pro Starter version released today is free, and has many of the Pro features while still being free.
18:36tbaldridgeAh yes, you can contact Cognitect and get a OEM license.
18:37imok20tbaldridge: certainly, but I'd just love someone to host datomic similar to how MongoHQ hosts MongoDB or Heroku hosts postgres
18:37tbaldridgeWow, that previous comment was poorly constructed on my part.
18:37imok20just makes things much easier. i'd like to not have to manage an EC2 instance of my own
18:37tbaldridgeyes, that would be nice.
18:37imok20but no one does, i suppose? :(
18:38tbaldridgeimok20: currently, no
18:38technomancyimok20: very risky to build a with that level of vendor lock-in
18:38imok20someone here: do this, i'll be y our first customer
18:38technomancybuild a business
18:39benkaybecause we really need more MongoHQ-type organizations.
18:39benkaythis tradeoff between convenience and quality is rarely actually examined
18:40imok20benkay: maybe so. however, i love to write application code and not manage servers; i don't have the time or interest in managing a db server myself, and when building a small product and testing it out, trying to raise some revenue, etc, having a hosted version is a wonderful thing.
18:42justin_smithMorgawr: nice
18:43benkayimok20: look into Orchestrate.
18:43Morgawrjustin_smith: thanks for using juxt though, I learned about a great function today
18:44Morgawrmy problem is that I keep forgetting about this stuff, I should write these down
18:44OscarZwhats the web development framework focus on clojure ? are there any clearly popular ones atm ? I noticed there is a framework called Pedestal by Rich Hickey & the guys ?
18:44OscarZI did some experimenting on Ring a while back
18:45MorgawrOscarZ: pedestal looked interesting, it seems to be an aggregator of good clojure libraries/middleware for web dev, though I never tried any (not a web dev myself)
18:45justin_smithmany people don't like "frameworks", there are a bunch of different libraries that people combine
18:45justin_smithring, compojure
18:46muhoobenkay: immutable licenses?
18:46imok20benkay: That looks pretty interesting; I'd love to learn more about it. Signed up to their list. Do you know anything more about them?
18:46OscarZThere I first realized the beauty of Clojure... after wrapping up a simple CRUD application I was looking at the code and thinking... "is it all really there?" :D
18:47OscarZMorgawr: ok .. I should probably check that out
18:47justin_smithOscarZ: http://www.luminusweb.net/ luminus combines a nice set of deps
18:47OscarZI also used Datomic database in my testing which was cool too
18:47muhooOscarZ: so far i've had that experience with three languages: scheme, python, and clojure. fun to have a 50-line program that is easy to understand and works.
18:47muhoolike "whoa, really, is that all? that's it?" fun.
18:48OscarZjustin_smith: oh yeah, that sounds familiar too
18:49OscarZDatomic with its Datalog query language was quite amazing too... messy SQL joins could be expressed much more elegantly...
18:50OscarZnot sure if it has some limitations that I dont understand
18:52OscarZbut these guys are onto something.. they have a programming language, a database (kinda) and a web framework, all built on functional programming concepts
18:52OscarZmaybe its the platform of the future :)
18:52muhooTHE FUTURE
18:53muhooOscarZ: anyway, have fun playing around with the stuff. looking at it and forming judgements on it is not as much fun as actually using it
18:55OscarZmuhoo: well.. i wasnt making judgements, just thinking aloud.. they are all cool and exciting technologies
18:56OscarZjust that I know from experience how much momentum the old shitty technologies can have :(
18:59patchworkOkay, clojurescript dom manipulation showdown: domina vs dommy vs enfocus vs singult
18:59patchwork! I can't believe there are already four contenders
18:59patchworkAlthough is that because cljs is still new and a clear winner has not yet emerged?
19:00patchworkAnyway, anyone have thoughts on which is best so far?
19:00patchworkLeaning towards enfocus...
19:01seangrovepatchwork: dommy, without a doubt
19:01seangroveEnlive has its charm though, it's just a very different style
19:01bitemyapp(don't use enlive)
19:03akurilinbitemyapp, Should I not use korma's support for a naming strategy since that functionality is now deprecated in jdbc 0.3 ?
19:03patchworkjdbc naming strategy is deprecated?}
19:04patchworkWhat do you do instead?
19:04akurilinhttps://github.com/clojure/java.jdbc/blob/3d3c402f65eb9db1fca055f1a0fe3d6db0889215/src/main/clojure/clojure/java/jdbc.clj#L1115
19:04akurilinpatchwork, I generally pass transformer functions into query/execute!
19:04akurilinbut now that I'm doing a hybrid with korma, was hoping to get away with that
19:05akurilinin Korma right now you can have a bunch of translators when declaring a table, but I was hoping to get away with that at the DB declaration level
19:05bitemyappI don't have any strong opinions here.
19:06patchworkSo it is being deprecated without some kind of replacement functionality??
19:06lazybotpatchwork: What are you, crazy? Of course not!
19:06patchworklazybot: I wish you actually knew what you were talking about
19:09patchworkprismatic blog is doooooooooooooooown
19:16dnolenhuh with paredit and lispindent SublimeText 2 ain't so bad for basic Clojure coding.
19:20muhoopatchwork: i've played with dommy and domina and prefer dommy
19:21patchworkmuhoo: I was trying to read about it but the site is down : (
19:22patchworkThis project already has domina involved for some reason, but I need to do some templating and domina doesn't have that
19:22patchworkIs it too mad to have domina and dommy on the same page?
19:22patchworkSeems excessive
19:23patchworkAnd on the other hand, singult looks pretty cool: https://github.com/lynaghk/singult
19:30akurilinI guess I was mixing things up a bit. The DB-level naming strategy is just for key names, whereas table-level transform lets you change result set contents.
19:30akurilinin addition to key names
19:31patchworkakurilin: RIght. I use the naming strategy quite a bit
19:31patchworkI am sad to hear it is deprecated
19:31akurilinpatchwork, yeah I'm completely obsessive over the whole underscore to dash translation thing.
19:32akurilinso it's quite convenient for me
19:32patchworkakurilin: For awhile we had underscores for key names and dashes for everything else. It was maddening
19:32patchworkthe naming strategy was a godsend
19:33bitemyappakurilin: I don't mess with any of the names or transform anything.
19:33patchworkbitemyapp: So you freely mix underscores and dashes?
19:34bitemyapppatchwork: using the word "freely" there makes an implication that isn't accurate.
19:34bitemyappMore like, "carefully"
19:34bitemyappspecifically, there's a distinction between what came from the database and what's internal.
19:34patchworkbitemyapp: Right. So you accept the mental load. Are you the only one working on the project?
19:34bitemyappof course...it would be easier to track such things and keep them straight if one had a useful type system...
19:35patchworkI found I was able to keep track of it all, but when anyone else had to use it they suffered
19:35patchworkIt caused suffering
19:35patchworkand Angst
19:36seangrovepatchwork: Why are you explosing datgbase details to the rest of your code?
19:36patchworkseangrove: Not database details, but the maps that came back from queries were used in other places
19:37patchworkAccess to those keys used a different convention than every other name in the system
19:37bitemyapppatchwork: I'm not the only person.
19:37patchworkseangrove: At some point data from the db has to be used somewhere in code
19:38seangrovepatchwork: I don't think we have any sql/db access outside of a few namespaces that provide the interface to get data for the rest of the system. So called "models", but not quite as much.
19:38patchworkseangrove: So at some point you translate those keys into some other structure?
19:38seangrovepatchwork: Yes, external to those namespaces
19:39bitemyappIt's good to see I represent a non-trivial fraction of the support load for Cognitect.
19:39devn`So, I don't have a place to stay for the conj yet.
19:40devn`Not sure what I'm gonna do now. You may see me sleeping in the hotel lobby.
19:40patchworkseangrove: So you just translate them later rather than use the jdbc to translate them for you, in a way (without really knowing the details of what you are working on)
19:40nooniancan i assume that (keys m) and (vals m) will always return keys and vals in the same order for a given map m? i.e. (zipmap (keys m) (vals m)) will always = m?
19:40patchworknoonian: No
19:40noonianlame :p
19:40noonianpatchwork: thanks
19:40bitemyappnoonian: hey
19:41patchworkIn practice they usually do, but clojure maps are semantically unordered
19:41bitemyappnoonian: don't rely on ordering in any form in unordered maps.
19:41noonianbitemyapp: yo
19:41bitemyappnoonian: k? k.
19:41justin_smithpatchwork: but isn't the same map always deterministic?
19:41noonianthats what I thought
19:41justin_smithit's only deterministic when you add or remove a value, no?
19:41patchworkjustin_smith: It is like undefined behavior in C
19:41bitemyappwouldn't seq'ing over the map keep the keys and vals together?
19:41patchworkThe implementation could change at any time
19:42nooniani think the question is really will (seq m) always give the same order for the same m
19:42patchworkand then if you were relying on that behavior your code would be broken
19:43justin_smithpatchwork: so at some point there may exist a clojure version where (zipmap (keys m) (vals m)) is not equal to m
19:43justin_smithbut afaik order is stable until you add or remove values
19:43patchworkjustin_smith: Right… for now
19:43devn`If anyone 'round these parts wants to offset some of the hotel cost or is generous enough to share a room: I'm going to be out late most nights. If that sounds like something you could put up with, let me know.
19:43patchworkBut semantically, it is undefined
19:44patchworkSo it is not something any self-respecting code should depend on
19:44noonianso zipmap is not for dealing with existing maps, but only for creating maps from seqs where you can count on the order
19:44justin_smithnoonian: I think so
19:45noonian(defn keys-and-vals [m] (let [pairs (seq m), ks (map first pairs), vals (map second pairs)] [ks vals]))
19:46justin_smithalso, if you want the keys and the vals you are likely better off doing something like (reduce (fn [[ks vs] [k v]] [(conj ks k) (conj vs v)]) [[][]] mp)
19:46noonianthen zipmap with that lol
19:46devn`So, I realize there's no order guarantee for maps, but in a two element map, for all the tests I've messed with, I'm not getting any ordering issues.
19:46justin_smithmy version only walks the seq once :)
19:46devn`Is it reasonable to expect the order won't be weird for 2 element maps?
19:46nooniandevn`: yeah, but the map implementation will change depending on how large it is i believe
19:46noonianarraymap and treemap iirc
19:47patchworkdevn`: Don't make any assumptions about order in maps
19:47patchworkbecause at some point in the future your code will break and people will die
19:47devn`noonian: *nod* -- i have a huge list of maps that someone else wrote to a file. I could search and replace { -> [ and } -> ], but I was just curious if for 2 element maps I could get away with it, assuming the keys and values are all the same.
19:48metellusyou probably could, but it would be a coincidence
19:49nooniandevn`: well, if you care about the order of the key value pairs in the map i wouldn't, i don't care about order, just that for a given index in keys and vals they would belong to the same key value pair
19:50noonianbut if it works it works :P
19:50devn`yeah, i care about order -- i should just quit beating this issue to death
19:50patchworkdevn`: It may work now, but not in a month
19:50devn`im navel gazing
19:50metellusif you care about order why not use a sorted-map
19:50noonianif it works for you today and you trust it enough, i would do that then re-serialize it as a sequence :P
19:51devn`i just like working with maps before converting it back to CSV. but in any event, someone already posted a link to a flatland project which provides maps with order guarantees
19:51devn`so uhh, ill use that
19:51devn`metellus: because the headers won't match
19:52devn`unless i write them out by hand to match the sorted-map just before coercing maps bac to vecs
19:52devn`anyway, don't mind me, just trying to fit a square peg into a round hole
19:52metellusah
19:52devn`because i really dislike treating csv rows like vectors
19:53devn`i like to zipmap and operate, and then coerce back to proper rows that clojure.data.csv expects
19:53dnolensuper newbie friendly post on ClojureScript http://swannodette.github.io/2013/11/07/clojurescript-101/ using mies
19:53dnolenfeedback welcome
19:53devn`dnolen: I loved your last post
19:53devn`I didn't know about mies
19:53dnolendevn`: just trying to make it easier for people who just want to try it without going through config hell
19:54devn`dnolen: a couple of my coworkers have been tinkering simply because of your last post
19:54dnolendevn`: that's great to hear!
19:55bitemyappdevn`: you don't like destructuring vectors?
19:55bitemyappdevn`: weirdo :)
19:55bitemyappdnolen: is there a "mies" for piggieback/austin?
19:55devn`bitemyapp: there are a TON of columns
19:55bitemyappdevn`: sad-face. Gotcha.
19:56devn`bitemyapp: this is basically just me doing ETL in clojure
19:56dnolenbitemyapp: haven't tried piggieback/austin yet, but there probably should be - Lein templates are really cool
19:56devn`so it's nice to dissoc, assoc, etc. to combine with another giant CSV
19:56devn`but that messes up order
19:57dnolenfeel free to give my post some HN love
19:57bitemyappdnolen: a lot of the pain people have with cljs centers around trying to get the interactive workflow working reliably in piggieback/austin.
19:57bitemyappdnolen: upboated :)
19:57devn`dnolen: one note. even if you don't have mies you can just run the command, right?
19:57dnolenbitemyapp: sure but that's for someone else to solve - I got enough tutorials to write of my own.
19:57dnolendevn`: that is correct
19:57devn`The way you write "you can follow along if..." makes it sound like it's a prerequisite
19:58devn`I think it's good to explain what it is though
19:58dnolendevn`: good point removed
19:58devn`err you don't say "if" you say "by"
19:58devn`i like that you explain what it is though, because otherwise im like: "why does lein mies work?"
19:59justin_smithdevn`:
19:59justin_smith,(->> rand repeatedly (partition 4) (take 20) (map (juxt identity #(apply hash-map %))) (map #(map (comp flatten seq) %)) (map #(apply = %)) set)
19:59clojurebot#{true false}
19:59justin_smithsometimes it works, sometimes not
19:59justin_smithfor two element maps
19:59devn`justin_smith: i've moved on. I'm just lamenting facts of life.
19:59justin_smithok, I was actually surprised to see evidence that even with two elements the ordering would sometimes change
20:00devn`yeah, it was a little surprising to me as well -- i don't recall seeing those things switch order on the REPL ever
20:00noonianthanks dnolen, i'm hoping to dive into core.async shortly in cljs
20:00bitemyappjustin_smith: Science. I like it.
20:01patchworkjustin_smith: For your next experiment, dereference an uninitialized pointer in C
20:01justin_smithsure thing
20:01justin_smithresult: #{crash, nothing, wtf}
20:02patchworkI love undefined behavior
20:02doctorinserenityAre there reasonable ways to print edn with tagged types or should I just not bother with that for now?
20:03justin_smithdoctorinserenity: doesn't every edn input unambiguously result in a single type?
20:04justin_smiththat is to say, when would the reader find any type ambiguity in edn input?
20:04doctorinserenityjustin_smith: edn input works fine, I'm asking about outputting it
20:05justin_smiththe point being the read will be deterministic, so why tag the output?
20:05justin_smithor do you mean tagging in the function producing the output?
20:07dnolennoonian: nows a good time things are getting solid
20:07doctorinserenitysay you want to send some edn to an API using tagged types for convenience
20:08justin_smithan edn reader will always get the same types from the same edn
20:08justin_smithno tagging needed - so you want tagging in the input function that uses the edn, not the edn itself
20:09doctorinserenityjustin_smith: not sure what you're getting at
20:09justin_smithtype tags help functions not dispatch at runtime
20:10justin_smithnothing in the edn file itself will prevent the edn reader from dispatching at runtime
20:10justin_smithbecause it generates multiple types by definition
20:11justin_smith*help methods not dispatch at runtime
20:13bitemyappJust released the first public version of my Datomic migration toolkit: https://github.com/bitemyapp/brambling
20:13justin_smithdoctorinserenity: also, more to the point, edn has no facility for metadata https://github.com/edn-format/edn
20:14doctorinserenityby tags I mean user defined types
20:14doctorinserenitynot metadata
20:14justin_smithoh shit, sorry
20:15doctorinserenityit seems like a nice idea and easy to use as long as you're reading edn
20:15doctorinserenitybut a mess when producing it
20:16bitemyapphttps://news.ycombinator.com/newest I too, have something that I would like upboats for :)
20:16justin_smithdoctorinserenity: java.util.Date prints out a readable edn tag
20:17doctorinserenityjustin_smith: I know
20:17justin_smithso there is likely a way to specify a to-string that is edn readable
20:18akurilinAh, you can't with-redef defn- functions huh?
20:19justin_smithdoctorinserenity: another lead is that pr-str results in the readable forms of things, while str does not
20:20justin_smithdoctorinserenity: and for that, you want to extend the print-dup multi-method for your type
20:20justin_smithI had to do some digging for that one
20:25doctorinserenityjustin_smith: thanks!
20:25justin_smithnp, sorry I misunderstood at first
20:37ToxicFrogWhat in the entire hell is this
20:37ToxicFrogIf I run my program with 'lein run', it works fine
20:38ToxicFrogIf I 'lein uberjar' and then run the jar, the output is truncated
20:38ToxicFrog...but only if I have it output to stdout
20:39ToxicFrogIf I explicitly (.close *out*) it's fine.
20:41Raynesgfredericks: Yes, I did.
20:45xeqiToxicFrog: makes me think you are using a library that doesn't (flush) out when you expect it to
20:46ToxicFrogxeqi: the surprise is that OS doesn't flush on exit()
20:46lpvbseesaw is much easier than my implentation of swing abstraction. I should avoid reinventing the wheel
20:47earlehi
20:53lpvbI need to have an integer scale factor for my gui, so I need a mutable variable to hold the scale factor, how do I do that in clojure?
20:55justin_smithlpvb: you can use an atom and swap! or reset! to update it
20:55ea-why not just make a function to determine scale?
20:55ea-or set! an atom
20:56justin_smithea-: you may be thinking of reset!, set! does not working atoms
20:56justin_smith*work on
20:58ea-yeah reset!
20:58justin_smithI like how talking about atoms makes us seem so excited
21:03akurilinIs there any way I can profile a clojure.test run to see which exact call the system is hanging on?
21:04akurilinAs in, something I'm calling is intermittently taking forever.
21:04amalloyakurilin: if it's hanging, you can use jstack
21:04justin_smithakurilin: you could connect with jdb or cdt to see where it is in the stack
21:05justin_smithamalloy: cool, I did not know about jstack
21:05akurilinTo be accurate, it's something that occasionally takes an extra 10 seconds to run as opposed to 0. I originally thought it was wrap-session running out of entropy, but I'm not so sure now.
21:05akurilinHence I'm thinking profiling rather than an actual debugger, unless I can break at the right time
21:06justin_smithyeah, that does sound like a job for proper profiling
21:06justin_smithjvisualvm is a simple way to do that
21:07akurilinjustin_smith, I'll look into that, thanks.
21:07justin_smithakurilin: the trick with jvisualvm is you may need the process to be open but not running so you can connect and profile a few runs - so your best bet would likely be to run the tests from the repl (start repl; connect and turn on profiling; run tests from the repl a few times)
21:08akurilinjustin_smith, got it, makes sense.
21:21akurilinIs Korma's prepare a reasonable place to convert joda to sql.time?
21:31gfredericksakurilin: you might be able to avoid converting altogether
21:31gfredericksif korma has a protocol or something
21:32akurilingfredericks, something along the lines of cheshire's custom serialization?
21:33gfredericksyeah
21:34gfredericksI've done that with korma before but A) I think it took patching and B) that was a long long time ago
21:41bjain cljs am I allowed to have a namespace with only the ns definition and a defmethod?
21:41bjatrying to figure out why my defmethod doesn't exist in the output js
21:46bjait seems that unless I actually refer to the namespace with just a defmethod in it, it isn't picked up by the cljs compiler
21:46bjahas anyone else encountered this behavior?
21:49amalloybja: you have to require the namespace at some point, or the code won't be loaded at all. in that case there will be no method defined, of course
21:54bjaamalloy: thank you. that makes complete sense when I consider it that way.
21:54muhoois there any special magick required to get source maps in cljs with austin/nrepl stacktraces?
22:07seangrovemuhoo: You mean inside of nrepl.el, or in the browser?
22:15irctchello,
22:16irctcI have a one page webapp written in cljs
22:16irctcand im having performance problems
22:16irctcany advice?
22:16irctcbottleneck is data structiure manipulations for vectors, maps, sets
22:16irctcstructure*
22:17ea-url?
22:17clojurebotsomething
22:17irctconly running locally at the moment
22:18irctcI'm looking for general
22:18irctcclojurescript perf advice
22:20seangroveirctc: Profile, possibly drop down to using native Javascript objects
22:20seangroveProbably don't need to do that, but with such a vague problem, really can't help much
22:20irctcI've identified the actual problem in my case
22:20irctci'm adding data to a large map
22:21irctcI'm looking into using transients
22:21irctcor just dropping into js
22:21dee5Hello, how do I represent the space character?
22:21irctcbut any general pointers would be nice before i get started
22:21irctcon the server i would just stick on type hints and call it a day
22:22dee5nevermind (:
22:23seangroveirctc: Not sure at all, but sounds like it'd be vary useful for the rest of us if you documented your experience
22:27seangroveirctc: Also, are you testing performance with advanced compilation?
22:53akurilinbitemyapp, I think you were saying something about defn- the other day.
22:54akurilinbitemyapp, is it possible to still override a function in a different namespace if it's defined with defn-?
22:54Shiro-IchidaSo, I'm new to Clojure. I installed lein and made a new project. I can run the main with lein run but if I do lein repl it gives me an exception, java.net.ConnectException: Connection timed out: connect
22:55akurilinMore specifically, I'd love to override default-fk-name to be able to support the users -> user_id FK scenario
22:55jared314Shiro-Ichida: what OS?
22:55Shiro-IchidaI looked online and apparently you can increase the timeout, so I tried that, but it didn't seem to do anything.
22:55Shiro-IchidaWindows, installer.
23:20dobry-denI had to yakshave so far back to implement some elliptic curve math that i was watching a 7th grade classroom youtube vid on slope-intercept form
23:21dobry-denscary
23:54gtuckerkelloggtrying out cider, but it seems not to work :(
23:54muhooseangrove: in nrepl.el
23:55muhooakurilin: you could do alter-var-root stuf, i think, but it sounds sketchy and monkey-patchy to me
23:56seangrovegtuckerkellogg: Yeah, it's not ready. I don't know what the idea with the change was, but Cider is rough around the edges. If you're not already very comfortable with nrepl.el, I wouldn't recommend the switch.
23:56gtuckerkelloggi was comfortable with nrepl
23:56gtuckerkelloggbut cider -- which i'm enthusiastic about -- gives me a REPL buffer but no prompt, in the simplest demo context
23:58gtuckerkelloggmy inferior-lisp-buffer is nil
23:58bitemyappakurilin: it's possible to override private vars. Don't.
23:59akurilinbitemyapp, so my option is to fork it?