#clojure logs

2013-01-15

00:20tomojhttp://www.infoworld.com/d/application-development/functional-programming-step-backward-205105
00:20yogthostomoj: yeah saw that, not very convincing I must say :)
00:20yogthostomoj: it's like an english speaker complaining french is hard to read after studying it for a week
00:23yogthosfirst red flag is in the second paragraph where he says "looping is performed with recursion", when in reality explicit recursion is quite rare as that's what higher order functions are for
00:23yogthosalso it's hard to swallow the argument that declarative style is harder to understand than imperative where you mix what and how together
00:25TimMc"The syntax of functional programming just isn't readable at a glance."
00:25TimMcAnd then he gives Erlang and Haskell examples. *yawn*
00:26yogthosand I don't see what's unreadable about the erlang one specifically
00:26yogthosit kind of tells you what it's doing
00:26yogthosalso amusing is the lack of the imperative counterpart :P
00:26yogthosbecause that's would be so much more readable :)
00:28TimMcyogthos: Readability comes down to idioms.
00:28yogthosTimMc: it's also highly dependent on what you're experienced with
00:28TimMcIt's similar to the differeing phonotactics of various languages.
00:30TimMcyogthos: Well... to the extent that a Java programmer isn't experienced with Erlang idioms, sure.
00:30TimMcI don't know that different Java sources are going to vary too much on average.
00:31yogthosTimMc: when somebody knows java and they look at python, ruby, c#, etc. they really can apply most of what they know, and just have to learn a new concept here and there and some syntax sugar
00:31yogthosTimMc: when you switch to fp, you actually have to learn new ways to structure code and approach problems, and that's what people find frustrating
00:31bbloomthe biggest issue is that there is a lack of good functional code bases to go study
00:31yogthosbbloom: that doesn't help either
00:31SegFaultAXAs an Erlang programmer, I can confidently say that Erlang has a generally unusual syntax.
00:31bbloomlearning how to structure functional code is reaaally really hard
00:31bbloomjust like learning how to structure object oriented code is really hard
00:31yogthosexactly
00:32bbloombut you can go read Id's game engines, or take a look at a large java project
00:32bbloomand get a feel for what big systems look like
00:32bbloomand how they play together
00:32yogthosbut if you've had years of experience with imperative/oo you forget that you had to learn and internalize all that at some point
00:32bbloomyeah exactly
00:32bbloomalso, it further doesnt help that functional programming has traditionally had a weak model for state/identity/whatever
00:32yogthosand then people think the language is inherently more difficult because they have trouble learning it
00:32bbloomnot saying clojure invented it; haskell has had TVar and MVar and whatnot forever
00:33yogthosclojure is definitely more accessible in that regard though :)
00:33bbloomjust saying that it's one of those things that takes time to bake into the collective conscious
00:33yogthosyup
00:33yogthosand I find part of it is ego too, if I've been coding for years and I'm an expert why is this stuff hard
00:33bbloomoh yeah, for sure
00:33tomoj"I find both claims equally doubtful."
00:33bbloomyou feel REALLY DUMB
00:33bbloomnow i just assume that i AM really dumb
00:33tomojis that a clever way to say "I have no clue." but sound smart?
00:34yogthosand getting past the hump tends to weed out a lot of people unfortunately
00:34bbloomand actively seek the enlighten moments
00:34bbloomi also think that there is a category of applications, like databases or game engines, or user interfaces
00:34bbloomthat are traditionally friendly to the object oriented model
00:34bbloomhell, objects were practically invented for the sole purpose of simulation
00:34yogthosI'm not sure I agree with the databases :P
00:35yogthosthey map terribly to oo, hence the orm messes :)
00:35bbloomsorry, databases != functional tho, more imperitive
00:35bbloomexecute this command, execute that command
00:35bbloomsure, sql is "declarative" but there are lots of other types of databases
00:35yogthosbut they do tend to be immutable and atomic :)
00:35TimMcclojurebot: ORM?
00:35clojurebotObject-Relational Mappers are the Vietnam of computer science.
00:35yogthosyeah that's true
00:36yogthoshehe
00:36yogthosbut even with something like document oriented dbs, my experience is very favorable when it comes to fp
00:36bbloomi now look at some old code that i was once very proud of and i'm like SHOCKED at how fragile it feels
00:36yogthoshehe
00:36yogthosyeah old code is almost always a big disappointment :P
00:37bbloomthere was a point where i was writing c# and i was very careful to make all the right ReadOnlyCollections and whatnot and make sure i didn't leak a mutable value from a property with a getter, but no setter
00:37yogthosI often have those "why did I write" that moments ;)
00:37yogthosI find state management without persistent data structures is very hard
00:38yogthosyour options are pass by value or pass by reference
00:38yogthosand pass by value tends to be expensive
00:38bbloomi'm finally getting the hang of it "in the large" i'd say
00:38yogthoswith persistent data structures you only pay the price proportional to the size of the change
00:39yogthosto me that's really the biggest advantage hands down
00:39bbloomanother really big issue is that ALL THE LIBRARIES OUT THERE are mutable
00:39yogthosyup
00:39bbloomyou need turtles (almost) all the way
00:39yogthosit's very difficult to make any sorts of guarantees
00:39yogthosI liked that idea that fp is essentially SOA all the way to function level
00:40yogthosif you already buy into doing it at high level why would you do something different at low level
00:40yogthoseach function is a service, they communicate over a common protocol which is the data structures
00:40bbloomi like to think of my code in terms of procedures, functions, processes, and systems
00:40yogthosand when I call a function I don't need to know what happens inside it
00:40bbloomwhich correspond to sequences, trees, DAGs, and graphs respectively :-P
00:40yogthosI just get a value back and it's mine to do with as I like :)
00:41bbloomi think each level of thing has different trade offs
00:41yogthosyeah thinking in terms of data transformations is definitely the way to go ;)
00:42yogthosI mean most problems are take some data here transform it and put it there
00:42bbloomright, but down one level from there is the algorithm/proceedure/strategy
00:42yogthosyup
00:42bbloomand one level up from there is forking/joining sequence of steps all arranged together
00:42bbloomand then a level up from THAT is the big ol' loop around the state of the universe
00:43yogthosknowing how to get that data from a to b properly and efficiently takes skill :)
00:43bbloomluckily, it's getting easier because more people are trying it and writing about it
00:43yogthosyup
00:44yogthosI also find for a lot of people it's concrete examples that resonate the best
00:44yogthoslike here's a web app in 5 minutes, can you do that with your jsf/spring/hibernate monstrosity? :)
00:44bbloombut even if you see an example, you can't do it yourself until you internalize the mechanisms
00:45yogthosI've had much better success with that approach than explaining the fine details of state isolation :)
00:45yogthoswell once people get curious and the problem set is limited to a small domain it gets easier
00:45bbloomthe real problem is that people want to make THINGS
00:45bbloomand most THINGS do STUFF
00:45yogthoshehe
00:45bbloombut the real hard part is that DO word
00:46yogthosyeah that gets ingrained over the years
00:46RaynesYou guys talk too much.
00:46bbloombecause it's really not obvious how to think about DOING in a functional world
00:46yogthosRaynes: heya :)
00:46tomojRaynes: is lazybot's example.policy only safe for private channels?
00:46yogthosRaynes: btw did a new release for lib-noir, bumped version for cheshire to the latest and added some tests :)
00:47yogthosbbloom: was rereading this the other day and had a chuckle :) http://steve-yegge.blogspot.ca/2006/03/execution-in-kingdom-of-nouns.html
00:47bbloomoh yeah
00:47yogthosI find what's worse is that people often get distracted from the actual problem they're solving with oo
00:48Raynestomoj: It's the safe thing.
00:48Raynestomoj: You're just granting your own code permission to run with the sandbox turned on.
00:48Raynesyogthos: I saw.
00:48yogthosthey start building their hierarchies and interfaces, and abstract classes, and they forget what the problem actually was :)
00:48Raynesyogthos: I keep an eye on what goes on. If I don't say anything, it means I approve.
00:48yogthosRaynes: excellent :P
00:49bbloomRaynes: i'll just wait until you're gone to say a bunch of stuff that would upset you :-)
00:49yogthosRaynes: I also gave a grace period on merging it in, figured if you'd object it would be sooner than later :P
00:49yogthoshehe
00:49Raynesyogthos: This is true. But the important thing is that the pull requests give me notifications whereas I wouldn't know if you just randomly pushed something to master. It's more of an easy way to tell me "Yo, look at this."
00:49yogthosbbloom: but yeah I think web apps are a really good domain for people to get feet wet in fp
00:50yogthosRaynes: yup :)
00:50bbloomyogthos: to some extent, but they generally require communicating with external services that are stateful
00:51bbloomyogthos: but that's why i tell people that their first little clj app should have exactly one atom :-)
00:51yogthosbbloom: haha good rule
00:52yogthosbbloom: lol I felt dirty the other day showing somebody how to use an atom for accumulator :P
00:52yogthosI started explaining how to reduce recursively and then noticed the glazed over look :P
00:52bbloomeh, sometimes convenient works
00:52bbloomi've done it :-P
00:53yogthosyup, it's like this thing is not performance critical in any way just use an atom
00:53yogthosI still feel dirty any time I do :P
00:53yogthosthe haskell habits die hard
00:54yogthoswhen I started learning fp I made it into a game of figuring out how to do something without using stateful things :)
00:54yogthosinstead of frustrating it quickly turned into rewarding
00:57tomojRaynes: I see, thanks.
00:57Raynestomoj: AllPermission can sound scary, but I assure you is is harmless. :)
00:58tomojhmm.. getting `java.security.AccessControlException: access denied ("java.util.PropertyPermission" "net.spy.log.LoggerImpl" "read")`
00:58tomojneed to customize clojail?
01:09tomojI added that to .java.policy, but I'm guessing it's in the wrong place, since I put it in the same place as AllPermission
01:13GooderHi, in query-replace-regex, how can replace them globally? Now I type '!', it just replace these after cursors.
01:15tmciverGooder: if you want all regexs replaced, use replace-regexp
01:16samratI'm trying to write tests and `lein run` works fine but running the test seems to give me a EOF error. my core-test: https://www.refheap.com/paste/8643
01:17samratI can't figure out why I'm getting an EOF, because the program actually just works fine and the tests don't seem to have any missing parens either
01:19Goodertmciver: thanks, although it is not convenient.
02:06ro_stanyone using lein run with their ring apps have a way to do zero-downtime restarts?
02:06ro_stperhaps spinning up a new process and somehow switching ports once it's up?
02:09ejacksonro_st: reverse proxy ?
02:10ro_stwe already do that
02:10ro_stwith apache
02:10ro_sti'm hoping we can do it without having to change ports in the apache config
02:12ejacksonhow about when you start an ring app, before you bring up the jetty/whetever you make an HTTP call on the port that any servers listening will hear and shut down ?
02:12ejacksoni haven't done this, its just a thought
02:13ejacksonits async though, so you couldn't guarantee it would work. If the server has shut down its HTTP it can't tell you so
02:13ejacksonover http anyway.
02:13danierouxro_st: I would symlink my current deployment to somewhere where the main Apache config can just include the symlinked config. An apache reload would then work with the new config.
02:13ejacksonperhaps over nrepl ?
02:13danierouxIt also allows a previous config to lie around and get back into the action
02:13ejacksondanieroux: thats quite cool
02:14ejacksonme idea seems too complicated.
02:15ro_stthanks for the ideas, guys
02:15danierouxIt would mean that you will have two instances of ring running concurrently, so that app would need to do fancy footwork to not talk to the wrong version of the data. But that's under your control :)
02:16ro_stthis is in the context of a load balanced ec2 cluster, so we're going to see how far we get by lifting new nodes with pallet and taking down the old ones on a rolling restart basis
02:17ro_stif that takes too long, then we'll investigate process fiddling options
02:17ejacksonthere must be some literature in the continuous deployment space ?
02:17ejacksonmaybe immutant/pallet lists have ideas
02:17ro_styup. we don't use wars or jars, though. and most java deployment solutions assume that
02:18ejacksonyeah, I used to just push wars to tomcat and it would take care of it
02:19ro_stya. we're using loose files on disk.
02:19ro_stdevelopment = staging = production. only env vars change from location to location, which can include uris to services
02:20ejacksonro_st: perhaps the solution is bulk up your process ?
02:20ejacksonmaking wars was pretty easy last time i tried
02:21ro_stwe're definitely going to investigate and compare wars to loose files
02:21ro_stloose files makes nrepling in and reloading from disk possible, though
02:22ejacksonyeah
02:25ro_staside from the startup time (which can be mitigated with a two-jvms-with-port-switching process), i don't know that wars or jars provide any value
02:25ro_stwe already lein check everything on our build server prior to deploy
02:25ejacksonwell, you can get your build server to deploy straight to the tomcat which will auto restart
02:26ejacksonso you solve the question you initially asked. I think.
02:26ejacksondunno if its zero downtime though
02:26ejacksonbut anyway, there will exists such a solution in javaland somewhere, i'd bet.
02:26ro_stit's not zero :-)
02:28headshotnasty stuff like ehcache, session replication, clustering
02:28p_lafaik some servers can reload applications without restart
02:29headshottomcat/jetty/jboss can re-start an app without restarting the server
02:29ro_string sessions and datomic peer cache are in memcached, all other data in datomic, and rabbitmq for queuing. so the actual web app is 100% share-nothing
02:29p_land well, WAR is there to do "component" like dropping of apps into server
02:30p_lro_st: it's about restarting the whole VM, which can on a big system be pretty.... big
02:30ro_styeah
02:30p_lespecially if you have multiple smaller applications instead of one humongous app
02:31p_lso you can "swap" the part without incurring penalty of losing all the hotspot optimalizations or reloading various objects etc.
02:31p_lbecause you only reload one smaller WAR (a "sub" app, let's say, in a big system)
02:33ro_stinteresting, i didn't know it was modular like that
02:35p_lwell, that's what a short look suggests. That is, if you structure your system as multiple smaller applications (each in a war), you can do like that
02:35p_lwhile sharing the load of JVM
03:08mae_how do i type annotate array of something
03:08mae_like array of string
03:10maehow can i type annotate array of String
03:10maeString[] makes it choke
03:18echo-areamae: ^"[Ljava.lang.String;"
03:19maethx
03:35juxovecI asked yesterday but didn't found a way out of my problem with parsing of large X(HT)ML file. There's question on Stack Overflow http://stackoverflow.com/questions/14333637/how-can-i-lazily-parse-big-xhtml-file-in-clojure
03:38ro_stjuxovec: you need a streaming xml parser
03:39juxovecI know SAX in other languages
03:39ro_sthttp://nakkaya.com/2009/10/10/processing-xml-with-clojure/
03:39ro_stboom
03:39ro_stfirst hit in google for "streaming xml parser clojure"
04:24tomoj&(map {} [1 2 3] [4 5 6])
04:24lazybot⇒ (4 5 6)
04:42ro_stwhat does {} do when used as a fn?
04:43echo-area`get'
04:43ro_st&{{} 1 [1 2 3])
04:43lazybotjava.lang.RuntimeException: Unmatched delimiter: )
04:43ro_st&({} 1 [1 2 3])
04:43lazybot⇒ [1 2 3]
05:50gravhowdy
05:50gravHow does (String. byteArray "UTF-8") work?
05:50gravThere doesn't seem to be a java.util.String constructor that takes a byte array and a string
05:51gravwoops, there is ...
05:52Ember-indeed there is
05:52gravsometimes it helps just asking ;-)
06:06augustlare there any commonly used HTTP routing libraries out there other than compojure?
06:06augustlwould like something more aware of things like content types, method not allowed, etc
06:06p_lhmmm... I seem to recall one
06:07augustlI guess this is what most people call REST nowadays :)
06:08p_lfound
06:09p_lhttps://github.com/cmiles74/bishop https://github.com/banjiewen/Clothesline https://github.com/malcolmsparks/plugboard
06:10p_lthe first one is the one I knew about, the other two were linked as "similar"
06:10DrPheltRighthttp://clojure-liberator.github.com/
06:11augustlhttp://clojure-liberator.github.com/
06:11augustlah yeah :)
06:11p_lclojure-liberator is in a way followup on plugboard, afaik
06:11p_lanyway, look into WebMachine for inspiration :)
06:11p_lthey actually implemented HTTP :P
06:11Ember-does liberator provide support for real REST?
06:12augustlliberator looks very nice
06:12Ember-meaning, it allows describing the API via HTML
06:12p_lEmber-: ...
06:12augustlEmber-: who does.. Even the wikipedia article messes up REST :)
06:12p_lthat's not REST
06:12Ember-without you having to write that HTML yourself
06:12Ember-p_l: wrong, what I described is REST
06:12augustl"REST has emerged as a predominant Web service design model." wikipedia says
06:12Ember-but 90% of the world things otherwise
06:12augustlat least the article has a "multiple issues" box at the top
06:13p_lEmber-: no. That's some custom documentation generated on top. REST is the flow based on HTTP state machine
06:13p_lHTML serving is an *example* of such
06:13Ember-but Roy Fieldling thinks it's like what I said and since it's mr Fieldling who _invented_ REST I'm kinda like thinking he is correct
06:13Ember-no offense
06:13Ember-REST is about resources
06:13Ember-and that's it
06:13Ember-if you're using it in any other way then you're building a RPC
06:13p_lEmber-: and HTTP's fsm. And HTML is jusst one kind of resource on it.
06:14Ember-totally fine, do a RPC if it's what you need
06:14Ember-but please don't call it REST...
06:14p_lincluding auto-generated documentation in HTML served when you get apropriate content-type isn't required
06:14SgeoWhat do Clojure people think about continuation-based web frameworks?
06:14Ember-http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
06:14augustlliberator = massive thumbs up, what a well defined project
06:15augustlEmber-: you've lost that fight :P Ref the wikipedia article
06:15alexbaranoskyany of you using LIberator?
06:15Ember-augustl: not really. I'm not even trying to do that battle :P
06:15augustlEmber-: hypermedia is a better word, now that REST has been translated to mean HTTP
06:15Ember-just bringing this think up to make people a bit wiser
06:16augustlalexbaranosky: I'm about to
06:16Ember-think = thing
06:16alexbaranoskyaugustl: cool, am I correct in it being a thin wrapper over Compojure for expressing restful routes?
06:17p_lEmber-: ... none of those include requirement for HTML
06:17augustlalexbaranosky: no, it's an implementation of the entire HTTP flowchart
06:17augustlalexbaranosky: so you'll get 403 method not allowed, not 404, when you PUT to a path you didn't define a PUT for, etc
06:17p_l"Hypertext does not need to be HTML on a browser."
06:18p_lI feel old in such discussions -_-;
06:18Ember-indeed, in that I do agree
06:18alexbaranoskyaugustl: neat. It is built on top of Compojure though too right?
06:18p_lEmber-: yes, but you stated that as requirement for REST :)
06:18Ember-but in the web world it's HTML which is the de facto hypertext format
06:18augustlalexbaranosky: no, you need to use your own routing library
06:18augustlalexbaranosky: i.e. (ANY "/foo" (call-liberator-here ...))
06:18Ember-and no, not requirement for REST. Requirement for a REST library
06:18Ember-sure, pass me that data via XML and I'm happy too
06:19p_lEmber-: HTML is just one type of resource that can be delivered by REST
06:19p_lREST library shouldn't deal with resource spec
06:19Ember-indeed, but it should provide a mechanism to generate that spec
06:19p_lnope
06:19Ember-well, let's agree to disagree?
06:19Ember-and call it even
06:20augustlalexbaranosky: .. or so it seems :) Just been reading about it for a couple of minutes
06:22SgeoSo, no one cares about frameworks that are anti-REST?
06:23Ember-anti-rest?
06:23Ember-you mean stuff like soap when talking about webservices?
06:23Ember-soap is so blergh, hope I never ever have to touch that stuff again
06:23SgeoI mean as in the URLs aren't necessarily meaningful
06:23Sgeohttp://en.wikipedia.org/wiki/Seaside_(software)
06:24p_lSgeo: I cared a bit, but I don't think you'll find a lot of support for them in stuff running on JVM ;)
06:24p_lAlso, SOAP can be useful (just stay away from the god-damned RPC mode)
06:24p_lit's just... not necessary for majority of "public" apis out there
06:25Ember-haven't heard of Seaside before, gotta check it out
06:25SgeoIt's Smalltalk though, which in my opinion is a great environment and IDE but not so nice language
06:26Sgeo(Still better than Ruby)
06:26p_lthe difference with REST and SOAP is that SOAP didn't have nerdfights on keeping it "pure" :)
06:26scottjunfortunately the best seaside app (and one of the most impressive web apps I've ever used), Dabble DB, was closed when Twitter acquired them.
06:32augustlwill kittens die if I name a Clojure project "com.domainname.thing"?
06:35augustlthe name of the product/client is a domain name, so it's tempting :)
06:35clgvaugustl: probably
06:35augustldomainname.com-thing vs com.domainname.thing
06:36clgvwhat exatly do you want to name? the group-id and artifact-id?
06:36augustlclgv: I'm embarassed to admit that after 6 months of working with clojure I don't really know the difference..
06:37clgvaugustl: in leiningen you specify [group-id/artifact-id version]
06:38augustlclgv: ah
06:38augustlseems most clojure libs only has one of them
06:38clgvthen the artifact-id is the group-id as well
06:38augustlthere's org.clojure/clojure, and com.datomic/datomic-free, but also just "ring"
06:38augustlI see
06:42Sgeo...Java ecosystem stuff, isn't it?
06:43clgvSgeo: what do you mean?
06:43Sgeoartifact-id group-id etc
06:43p_lSgeo: maven ecosystem, actually
06:43SgeoMaven is a Javaish thing, isn't it?
06:43clgvhm well, I think it makes sense to have groups.
06:44p_lyes. Oh so javaish
06:44p_lbloated, with XML that makes you puke
06:44p_lso, yes, Javaish
07:14augustlhmm, it seems liberator is more focused on implementing the http spec than documenting itself and generally being convenient to use :)
07:22augustlhas anyone here used liberator to build an API?
07:24simonhanyone have any experience with postgres on heroku with korma? i've seen john hume's post on the korma group (http://bit.ly/VHzxpV) but it's failing to compile on deployment. i'm guessing tis is the aot compilation problem (http://bit.ly/ZSDOFh)
07:27simonhthe problem is splitting the DATABASE_URL btw. in john's example the db-uri is defd but there is no url to split at that point
07:52augustlseems to me that the examples from the liberator git repo doesn't describe a whole lot of real-world scenarios
07:53augustlfor example, a PUT to /myresource/:id. How do you ensure a 404 via checking the database for that id?
07:57cemerickclojure.math.combinatorics has a (comment) form before its ns decl; how does this ever work? https://github.com/clojure/math.combinatorics/blob/master/src/main/clojure/clojure/math/combinatorics.clj#L7
07:58silasdavisCould anyone suggest a good way of mainting inline documentation - ideally that I could auto-generated human-readable html documentation from - for a restful API built with http://clojure-liberator.github.com and compojure?
07:58silasdavismaintaining*
07:59augustlsilasdavis: oh hey, I was just asking whether anyone in here ever built something with liberator and had some tips to share :)
07:59augustlsilasdavis: is it open source?
08:00silasdavisah well I'm afraid I'm right at the beginning of it
08:01augustlI see
08:01augustltrying to figure out how you avoid double processing on validation, and avoiding double database fetch for :resource-exists?
08:02silasdavisyes it will be open source - it is messaging system for free text messages (like twitter), but based on a social graph of various relay/broadcast type relations
08:02silasdavisuses mongodb and neo4j
08:03silasdavisthe base is quite generic but the application layers on top are support peer-to-peer and peer-to-clinician support in maternity units
08:03silasdavisaugustl: I'm afraid I'm also new to clojure - but could memoize help?
08:03augustlwell, I could use a thread local variable, but that's not very functional now is it :)
08:04augustlgenerally, I find the DSL of liberator to be problematic in that there's no direct flow in it, just a map of specifications
08:04silasdavisI haven't actually implemented anything with it yet
08:05silasdavisI've just used compojure
08:05augustlI see
08:05silasdavisdo you think it's worth investigating at all?
08:05augustlI've just been playing with it for the last hour
08:05augustlI can't see how I'd be able to actually implement something with it
08:05silasdavisok well I'm about to start writing some methods so I'll get back to you
08:05augustlprobably mostly due to the lack of documentation though, for all I know
08:14noidicemerick, why shouldn't it work?
08:31cemericknoidi: the namespace won't load if it's being required from a namespace that uses :refer-clojure
08:37yogthossilasdavis: I've got a tutorial on liberator if that helps ;) http://yogthos.net/blog/30-Making+services+with+Liberator
08:39bprcemerick: why's that?
08:40bprcouldn't that be considered a bug?
08:52cemericknoidi, bpr: see http://groups.google.com/group/clojure-dev/browse_frm/thread/a59aa6419bc84ba1?hl=en
08:52cemerickfixed on master
08:53bprcemerick: ah cool
08:53bprcemerick: thanks!
09:14xificurCif I have a .clj file saved at lets say C:/code/stuff/ and I want to load it in the repl in one go, how do I do it?
09:15ro_st,(doc "load-file")
09:15clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol>
09:15ro_st(doc load-file)
09:16clojurebot"([name]); Sequentially read and evaluate the set of forms contained in the file."
09:20xificurCro_st: thanks
09:26xificurCI downloaded this snake game Stuart Halloway's book but I'm getting an error when loading it
09:27xificurCFileNotFoundException Could not locate clojure/contrib/import_static__init.class or clojure/contrib/import_static.clj on classpath: clojure.lang.RT.load (RT.java:434)
09:27silasdavisthanks yogthos
09:28yogthossilasdavis: no problemo :)
09:30xificurC(import-static java.awt.event.KeyEvent VK_LEFT VK_RIGHT VK_UP VK_DOWN) <-- this doesnt seem to work
09:30xificurCis this old>
09:30xificurC?
09:36xificurCnevermind, it tries to :use examples.import-static but its not in the zip
09:42xificurCthis snake game: http://java.ociweb.com/mark/programming/ClojureSnake.html uses import-static as well, but it tries to load it from clojure.contrib. Where can one find it nowadays?
09:44pjstadig~contrib
09:44clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
09:44pjstadigxificurC: you'll want to look here to try to find where import-static ended up ^
09:44pjstadigbut it was probably dropped
09:47xificurCpjstadig: it's listed but not maintained. is there another library that serves the same purpose? If I understand correctly this was used to catch key presses
09:47xificurCso that the snake's movement could be changed by pressing the arrow keys
09:48pjstadigxificurC: wish i could help, but i didn't even know that import-static existed until you mentioned it
09:48pjstadigif it didn't get migrated to new contrib, then it's possible that some other library exists to do the same thing, but i don't know
09:48xificurCso how does one read key presses nowadays in clojure
09:48chouseryou can import java.awt.event.KeyEvent and then use KeyEvent/VK_LEFT
09:49pjstadigyeah you'll just have to qualify the static field names
09:49xificurCthanks pjstadig and chouser, I'll try
09:49pjstadigshouldn't affect the ability to read key presses, you'll just have to rework the code a bit
09:50chouserxificurC: another option: http://stackoverflow.com/questions/7878714/how-to-find-import-static-in-clojure-1-3
10:01yogthosxificurC: here's another example of handling inputs https://github.com/yogthos/Clojure-Tetris/blob/master/src/tetris/core.clj
10:09jweisswatchers are still called "alpha" in the docstring, even though they've been there for what, 3-4 releases? really still alpha?
10:09jweiss$doc add-watch
10:10chouserI doubt they'd go away, but I suppose they're reserving the right to change their API.
10:10silasdavisis the license key a standard part of defproject - is it interpreted by lein to do anything in particular?
10:13xificurCyogthos thanks, i'll try to check that too
10:19jweissis this a place to use transients: i'm repeatedly conj'ing onto a list in an atom. other threads might want to read that value as the conjing is happening
10:20matthavenerjweiss: afaik, you cannot store transients in an atom
10:21dnolenjweiss: no - transients are performance optimization when you need to build some data quickly - never let them escape
10:21dnolenmatthavener: not true, you can put anything in an atom.
10:21jweissdnolen: i see, so it's meant to be used locally, in a single thread
10:21dnolenjweiss: locally in a function preferable.
10:21matthavenerdnolen: ah, for some reason i thought it detected that as "bad" and threw an exception
10:41silasdavisany style guidance on when to use 'use'?
10:41yogthossilasdavis: it's discouraged generally
10:41silasdavisI'm inclined to default to require, but I see that use might make certain files (like those containing routes) more DSL-y
10:42silasdavisso require everywhere then?
10:42nDuffuse with :only can make sense
10:43yogthosI find there's 2 main issues with use, a) you don't know where things are coming from, b) you might get a collision with another namespace
10:46silasdavisyes I see both of those, I suppose the case I have in mind is with compojure in a file containing primarily defroutes directives
10:46silasdavisis (GET "url" [] (foo)) nicer than (cc/GET "url" [] (food))
10:46yogthoslike anything it's a rule of thumb, if use makes the code more readable then it's appropriate :)
10:55silasdavisis foo-bar a sensible clojure module name?
10:57silasdavisno it's not a valid class name
10:57clgvyou can name a namespace like that
10:57silasdavishow should I name two word clojure modules then?
10:58silasdavisI read that it gets converted to and underscore when compiled
10:58clgvbut the filename needs to have a "_" instead of the "-"
10:58silasdavisperhaps I should use an underscore to start with to reduce possible confusion?
10:58silasdaviswhat is the convention?
10:59augustlsilasdavis: dashes for names, underscores in file names
10:59yogthosthe convention is to use - in the names
11:01silasdavisif you have 3 identically named files in different namespaces and locations in the file structure, say 'message.clj' would you rename to 'message-tests', 'message-routes', and 'message-model'
11:01silasdavis?
11:02silasdavisthis would be similar to the convention in MVC.NET where you might have 'MessageController', 'MessageViewModel', etc
11:02silasdaviscan't remember what rails does - it's more verbose but it makes the files more instantly recognisable by name...
11:07yogthosgenerally you'd make separate folders, for example routes.messages, models.message-model, etc
11:08yogthosso you'd have structure like src/myapp/routes/messages.clj and the namespace name would be myapp.routes.messages
11:09hyPiRionHey guys, have everyone upgraded to lein 2.0.0-RC2?
11:10ToxicFrogI'm still on pre7, apparently
11:12babilenhyPiRion: I have, why?
11:13hyPiRionbabilen: If there's any bugs within RC2 I'd like to check them out before I get too busy with other things
11:15babilenhyPiRion: Well, apart from RC1's problem with lein-newnew I haven't seen anything. But I did not stress-test it (been mostly just using "lein repl" which was working fine for the projects I've been working with)
11:17hyPiRionbabilen: Yeah, I think edge cases there are fixed. There was another one in RC1 regarding "lein upgrade" not working properly, but that's fixed as well.
11:18hyPiRionIt's just, well, I'd be sad if some trivial bug which is kind of a dealbreaker got into 2.0.0.
11:19dgrnbrgSo, I'm trying to figure out if this is possible in core.logic: I have a collection of maps: [{:a 1 :b 2} {:b 3 :c 4 :d 5} {:d 6}] and I'd like to have a goal that unifies that to get {:a [1] :b [2 3] :c [4] :d [5 6]} as the answer (merging maps and concating values)
11:19jweissanyone here run lazybot (either here on freenode, or another copy)? mine gets disconnected and won't reconnect himself. i just see a whole bunch of repeated ">>>PING :lazybot" in the log. no ping response but the bot does nothing to resolve the problem
11:26TimMcaugustl: Reaching into the backlog... no, kittens will not die if you name your project "com.example/fnurbl". I can't promise the same if you name your project "stuff".
11:27Rich_Morinhttp://richhickey.github.com/clojure-contrib/doc/pprint/CommonLispFormat.html references http://github.com/tomfaulhaber/pprint-examples, but that gets a 404 error. Any ideas where it went?
11:27lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/doc/pprint/CommonLispFormat.html and try to stop linking to rich's repo.
11:28hyPiRionhahah.
11:29hyPiRionOh, speaking of cl-format, anyone here using it who would like to vet a bug in it?
11:29hyPiRion$google CLJ-1134
11:30hyPiRionHrmph, lazybot doesn't like to search anymore. Oh well: http://dev.clojure.org/jira/browse/CLJ-1134
11:31hyPiRionIt's very easy to confirm it's a bug and that the patch works, as it's an implementation of a specification.
11:33Rich_MorinThanks, lazybot, but http://clojure.github.com/clojure-contrib/doc/pprint/CommonLispFormat.html removes the broken link and says to look in "the clojure.contrib.pprint.examples package". Is http://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/pprint/examples/?r=907 now the place to look?
11:37TimMcRich_Morin: If you're doing archaeology, sure.
11:37TimMc~contrib
11:37clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:41Rich_MorinUnfortunately, when "clojure.contrib.pprint migrated to clojure.pprint", the examples seem to have gotten lost. I'm looking for some examples on how to extend pprint - suggestions welcome.
11:42TimMcAh, I see.
11:42TimMcSo archaeology indeed.
12:01devnwhoa, cool!
12:02devnGoogle Refine lets you do transforms using Clojure
12:02devnhttp://code.google.com/p/google-refine/wiki/Downloads?tm=2
12:04pandeiroi'd like to make available a wrapper for this lib: http://www.jthink.net/jaudiotagger/index.jsp - but it's in no repos anywhere as far as i can see... can anyone advise me on how to proceed?
12:05yogthospandeiro: they do have a maven repo http://mavenhub.com/mvn/java.net-m2/org/jaudiotagger/2.0.3
12:06pandeiroyogthos: oops.. thanks! how'd you find that btw?
12:06yogthospandeiro: so you'd reference it in your project as [org/jaudiotagger "2.0.3"]
12:06yogthospandeiro: google fu :P
12:07yogthoshehe
12:11maleghastAnyone give me a quick pointer as to how to create a string representation (in MySQL Datetime format) of a today-a-year-ago - need a quick hit to construct a Korma Where clause...
12:13frozenlockmaleghast: I like to use clj-time whenever I need to deal with time thingy.
12:13maleghastThanks, I will look at that :-)
12:13maleghastfrozenlock: Cheers!
12:13ejacksonmaleghast: what frozenlock said
12:14frozenlockewwww javascript... time to fire up the cljs repl!
12:19frozenlockAnyone knows of a cljs wrapper for envision? http://www.humblesoftware.com/envision/index
12:44ppppaulhey guise
12:47frozenlockWhat would be the quickest way to determine if a js library is compatible with the google closure compiler?
12:53ppppauli'm parsing xml, (using data.xml and data.zip). when i hit a string of length 1, the parser makes a char instead of a string... is there an easy way for me to prevent this)?
12:54pbostromfrozenlock: in my experience, any js library is compatible in terms of calling it from cljs with advanced optimization turned off, if you want advanced optimization, there's possibly a little more work to do
12:55pbostromfrozenlock: if you want to turn on adv comp, then the quickest thing to try is to specify the js library itself as an extern file, if that doesn't work, then you'll have to write your own extern file for the lib
12:56TimMcppppaul: <a> gives \a and <bc> gives "bc"?
12:56frozenlockpbostrom: thanks!
12:57ppppaulyes
12:57TimMcThat's... insane.
12:57ppppaulwell, actually <Number>2</Number> gives /2
12:57TimMcStill insane.
12:57ppppaulindeed
12:58AWizzArdI want to ask your opinion, about licensing. I found an interesting lib which is under gpl. I want to use it as a dev-dependency only, and think that because of this I can still freely chose my own license for my lib. It doesn’t have to be gpl, because I happen to use a gpl program during development time. Opinions?
12:58technomancythe GPL only applies to what you distribute
12:59AWizzArdno gpl code distributed – so free choice for me then
12:59technomancyyou should be fine
13:00AWizzArdthx
13:00technomancyno problem
13:03ppppaul(xml1-> ) was doing weird things that i didn't expect
13:03ppppaulit was turning my string into a list of chars
13:04ppppauli was only dealing with single length strings, so it looked like it was doing a char conversion, but it was doing really weird things with stings of length > 1
13:08silasdavisis (:require foo.bar.core :as foo) considered harmful?
13:09ppppaullol
13:09ppppaulwhy?
13:09clojurebotwhy not?
13:09ppppaulfoo/fn
13:09ppppaulhow many foos do you need?
13:09technomancysilasdavis: I'd say yes; you should wrap it in a vector so you can add more clauses
13:09silasdavistechnomancy: ah yes that too
13:10ppppaul(:require [foo.bar.core :as foo])
13:10silasdavisI mean I'm hiding the namespaces symbol
13:10silasdavis'foo'
13:10ppppauli think foo is too common of a name
13:10ppppaulyour namespace should be foo1 or something
13:11ppppaulhowever, if you have no other namespaces competing for 'foo' then you are good to go
13:11silasdavisppppaul: noted, but will bad things happen if I alias a module with the name of a namespace?
13:11ppppauli haven't used (alias) so i'm not sure
13:12silasdavisnot alias then, whatever I'm doing there
13:12TimMcsilasdavis: No, since no one is using single-segment namespaces. (Right? Right?)
13:12jduan1981let's say you are given a lazy sequence of infinite length, how can you find the first element that is repeated? e.g., given [1,2,3,4,5,1,7,8 …], should return 1
13:12TimMcsilasdavis: Also, you haven't require'd the namespace foo.
13:13ppppauljduan1981, that could take up a lot of mem
13:13silasdavisTimMc: ah so it means nothing outside of the ns macro?
13:13ppppaulconj to a list that you use (contains? on for each element in the infinite list
13:13ppppauland cross your fingers
13:13arrdemppppaul: won't work.
13:13ppppaulyou can do (take-while)
13:13arrdemcontains? never does a linear search
13:14arrdem,(contains? [1 2 3 4 5 6] 6)
13:14clojurebotfalse
13:14arrdemhas to be a set or map.
13:14jduan1981so go through the sequence one by one and call contains?
13:14arrdemor some other lookup structure.
13:14TimMcjduan1981: loop/recur building up a set of seen items
13:15ppppaul<3 sets
13:15jduan1981loop/recur should work, is there a more functional solution? loop/recur seems a bit more imperative
13:15TimMcSo?
13:16jduan1981just wonder if there's another way
13:17cemerick,(reduce (fn [s x] (if (s x) (reduced x) (conj s x))) #{} [1 2 3 4 5 1 7 8])
13:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduced in this context, compiling:(NO_SOURCE_PATH:0)>
13:17cemerickfeh
13:17cemerickjduan1981: that'll work in Clojure 1.5.0.
13:17jduan1981that's more functional!
13:17jduan1981let me try to understand it
13:18TimMcYeah, but I don't like how the type of the reduce output changes.
13:18cemerickTimMc: that's one of the 12 ways in which reduced is *awesome*
13:18TimMcheh
13:19tomojyou mean you want reduce to return the reduced?
13:26ppppaulemacs clojure-mode, how do i add fancy syntax hilighting to symbols?
13:26ppppauli want to hilite 'keep'
13:35progohi-lock-mode for starters
13:41rahcolawhat are my options if I want to define (with def) something mutually recursive?
13:41progo(declare) your other function
13:42jeremyheilerCan also use trampoline.
13:43TimMcjeremyheiler: I don't think that helps...
13:45rahcolaprogo: not a function, and I'm gettin unbound errors with declare
13:45jeremyheilerTimMc: I suppose the "with def" requirement makes that so...
13:45progorahcola: oh! :)
13:47rahcolaI actually managed to make it work once with #'
13:47rahcoladid some reorganizing of the code and it stoped working
13:48progowell then. Run bisect with your DVCS of choice ;)
13:49dnolenrahcola: sounds like you're trying to do something at the top level, you should paste what you're doing - but mutually recursive values at the top level is not really supported.
13:49TimMc~paste
13:49clojurebotpaste is not gist.github.com
13:49TimMc~botsmack
13:49clojurebotclojurebot evades successfully!
13:50TimMcnDuff: What changes?
13:51nDuffTimMc: New JavaScript that makes copy/paste often inoperable was the breaking point for me.
13:51nDuffs/in to/into/
13:51TimMcew, wha?
13:52S11001001anyway using gist isn't showing clojure pride
13:52TimMcThat's not a change.
13:53cemericknDuff: yeah, whatever editor they're using is badly broken
13:53rahcolahttp://pastebin.com/Sz112wnX
13:54nDuff*shudder*
13:54nDuff(but... at least gist isn't pastebin.com)
13:54rahcolanot even too sure why this would work in a strictly evaluating language
13:54S11001001yeah.
13:54silasdavisdoes anyone know how to serve different content types from the same url using liberator?
13:55silasdavishow would you achieve that with compojure alone
13:55S11001001nDuff: I don't understand its popularity.
13:55nDuffrahcola: ...for future note, pastebins with ads (and pastebin.com is historically full of 'em, often animated) tend to be frowned on a bit.
13:55nDuffS11001001: Which one?
13:55S11001001nDuff: pastebin
13:55S11001001given all the ads
13:55nDuffS11001001: Ahh. I think that comes from owning the domain linked to the vernacular.
13:55nDuff...only excuse I can think of, anyhow.
13:56nDuff...but it's a matter of cost/benefit; pastebin.com is high-cost, low-benefit.
13:57rahcolanDuff: noted, can't actually see the ads my self, adblocked
13:58S11001001rahcola: not everyone can do that
13:58dnolenrahcola: yeah that's not going to work (the paste).
14:00rahcolajust didn't know about the ads as I didn't see them :D. what would you recommend then?
14:01nDuffrahcola: ...well, in #clojure we tend to dogfood a bit and use refheap.com (written by Raynes in Clojure)
14:02nDuffrahcola: ...personally I'm also kinda' fond of ideone.com, since it'll actually run your code server-side, so folks can see the bug you're reporting directly, you can see that fixes they propose work, etc.
14:03nDuff(that one does have ads, but they're less conspicuous/annoying than pastebin.com, and... well, sandboxed server-side evaluation)
14:03nDuffgist.github.com also used to be a popular choice, but some recent revisions broke it a bit.
14:07rahcolaok, this actually seems to work (again) https://www.refheap.com/paste/8654
14:07lichtblauAny ideas why the *nrepl* buffer would remain empty after connecting?
14:08rahcolais there a "right" way to do this?
14:08ieureIs Clojure metadata restricted to some arbitrary whitelist?
14:08ieureBecause
14:08ieure(def xf (with-meta (fn [] "hey") {:my "sup"}))
14:08TimMcieure: In terms of its contents? No.
14:08lichtblauI've got two emacses from different machines trying to connect to the same nrepl. One emacs (23.3.1) works, the other doesn't (23.1.1). (The one that I actually need is the one that doesn't work, and I don't have root on that system to try and upgrade...)
14:08lichtblauI'm pretty certain that I'm using the same nrepl.el and clojure-mode on both. Running emacs -q --no-site-file.
14:08ieure(meta #'xf) -> {:ns #<Namespace user>, :name xf, :line 1, :file "NO_SOURCE_FILE"}
14:08dnolenrahcola: like I said earlier, there is no good way to do what you want. You need to reformulate your approach.
14:08TimMcieure: You're checking the var's meta, not the val's meta.
14:09ieureTimMc, Got it.
14:09ieureTimMc, And the attr-map in defn forms is set as metadata on the val?
14:10TimMc,(meta count)
14:10clojurebotnil
14:10rahcoladnole: ok, thanks anyway
14:10TimMc,(meta #'count)
14:10clojurebot{:ns #<Namespace clojure.core>, :name count, :file "clojure/core.clj", :line 810, :arglists ([coll]), ...}
14:10ieureTimMc, Right, so:
14:10ieure(defn hi ^{:sup "Hi"} [] "oh boy")
14:10TimMcieure: On the var.
14:10ieureDoes not show the :sup key on the var nor the val.
14:10TimMcThere you're attaching it to the args. :-)
14:11ieureTimMc, Okay, I see.
14:11TimMcdef and defn pluck metadata off of the symbol and (I think in some cases) the args, but mostly the symbol.
14:12ieureTimMc, I get it. Just wasn't thinking about how the reader interpreted what was sent to defn.
14:12TimMcnDuff: OK, yeah, gist definitely is less useful now.
14:12ieureAnd was confused by the [name doc-string? attr-map? [params*] body] doc on defn
14:13bordatouehello , could anyone please tell me how to iterate through an Enumerator type in clojure
14:14TimMc,(apropos 'enumer)
14:14clojurebot(enumeration-seq)
14:14ieureTimMc, Thanks for the clarification.
14:16bordatoueTimMc: i can't find a func apropos in clojure 1.4
14:17silasdavisif I have a module 'message-views', do I have to name it message_views.clj?
14:17silasdavisI was under the impression clojure or lein or something would handle this
14:17ppppauli want to do destructuring something like this {{user-session :session} :as company-resp}
14:18ppppaulwithout the :keys keyword as i have a symbol collision
14:18ppppauli haven't seen any examples of something like thiat
14:18ppppaulthis, is is possible?
14:20bordatouewhere is the function apropos defined
14:20dnolenppppaul: {user-session :session :as company-resp} should work
14:20jeremyheilerbordatoue: clojure.repl
14:21ppppaulreally?
14:21bordatouejeremyheiler: thanks,
14:22bordatoueis there any way to link find doc from clojure repl on emacs
14:22dnolenppppaul: yes
14:22ppppaulthanks. i thought i had trouble with it in the past... maybe i was doing something nutty
14:22dnolen,(let [{foo :foo :as bar} {:foo 1}] [foo bar])
14:23clojurebot[1 {:foo 1}]
14:24bordatouecurrently I am using C-c C-d d for doc \
14:30ppppauli have changed my ways
14:32amalloy"where is the function apropos defined" - what a sad, ironic problem to have
14:36clgvamalloy: huh?
14:36amalloybecause apropos is for finding things you don't know where they are
14:36clgvah lol. I got bitten by that as well, but for other functions^^
14:38clgvamalloy: linux has its "whereis" ;)
14:39bordatouethere used to be a func called javadoc in clojure.repl i can't find it anymore
14:39nz-has anybody ran to any problems with newest lein and midje?
14:40bordatouewhere is javadoc ? even apropos can't help
14:41jeremyheilerbordatoue: I refer you to http://clojure.github.com/clojure/
14:41TimMcamalloy: Actually, apropos is bad for that -- it tells you that something exists, but not where it found it. :-(
14:41nz-lein midje started giving Could not locate bultitude/core__init.class or bultitude/core.clj after upgrading lein from preview10 to RC2
14:41TimMcbordatoue: (use 'clojure.repl) if your repl doesn't do it for you
14:42nz-adding bultitude 0.2.0 to dependencies fixes things
14:47bordatoueTimMc: Is there any general rules / policies that are used to determine which fns needs to be stored in under certain namespaces, for example 'clojure.repl
14:48frozenlockAny `fetch' user here? I'm wondering why (fm/letrem [a (adder 3 4)] a) returns nil, but (fm/letrem [a (adder 3 4)] (print a)) will print 7...
14:48augustlI'm mapping a collection. But one of the map operation might throw an exception. In that case, I need to get the item in the collection that caused the exception and return it applied to a function. Suggestions? :)
14:49TimMcbordatoue: I don't think there are any explicit policies, but you'd have to ask someone from Relevance I mean Clojure/core.
14:49frozenlockTimMc: finger slipped? :P
14:49TimMcYeah, the keys are *right* next to each other, for some reason.
14:51bordatoueGeneral question, do you have 'clojure.repl loaded in your namespace while working on clojure. I am asking because when I use 'clojure-jack-in i don't usually load clojure.repl
14:52frozenlockOk now `fetch' really confuses me... (fm/letrem [a (adder 3 4)] (def tt a)), tt ---> 7
14:54TimMcbordatoue: I get annoyed if it's not there, yes.
14:55bordatouethanks
15:02gfredericksare there any clojure testing libs that can create mock java objects?
15:05nopolabsCan't resist: http://www.dehora.net/journal/2008/12/02/qotd-mock-objects/
15:06dnolenaugustl: catch the exception in your map fn and throw ex-info
15:06SgeoI like Lisps
15:07SgeoSlightly annoyed that Smalltalk is not a Lisp
15:07Sgeo>.>
15:08craigbrohehe
15:09augustldnolen: I actually know beforehand where the exception will be, the array wil contain a nil. So I'll just look for that :)
15:09augustls/array/mapped list/
15:09Iceland_jackSgeo: So you want SmallTalk to be even less popular :)
15:10SgeoNooo
15:10SgeoActually, I'm sure if Smalltalk were more popular, I'd be against it. I feel like a language hipster sometimes :/
15:10technomancybetter find a new obscure language, Clojure is getting dangerously popular
15:11technomancymay I suggest Io or Factor?
15:11Iceland_jackI would suggest mine but I don't want to ruin then
15:11Iceland_jack*them
15:14SgeoI think the thing scaring me from Io is largely issues getting it to work on Windows
15:14technomancyseems like that'd be a plus for a hipster language
15:15brehautmy new language is only going to run on plan9 and arch linux
15:16seangroveHrm, how can I tell if a variable is a function in cljs? Something like (= (type #()) "function")
15:17frozenlockseangrove: (fn? +)
15:17TimMcSgeo: I only write my programs in Fixie.
15:17seangrovefrozenlock: hrmp
15:18seangroveThanks!
15:18Sgeoseangrove, do you want :foo to count as a function?
15:18seangroveNah
15:18SgeoWait, I have no idea if cljs has ifn?
15:18seangroveJust keeping it basic
15:18SgeoAh, ok
15:20nz-technomancy: has leiningen started to do something different with bultitude since 2.0.0-preview10?
15:25technomancynz-: it's now contained on the bootclasspath rather than loaded as part of a plugin
15:26nz-lein midje started complaining that bultitude is not found after I upgraded lein preview10->RC2
15:26technomancynz-: did you see the mailing list thread? seancorfield got it working.
15:27SgeoFactor is cool in some ways, but annoying in others
15:27nz-technomancy: i missed that one
15:27SgeoSmalltalk's ifTrue:ifFalse: is far more readable
15:30TimMctechnomancy: Was it in fact a lein-midje bug?
15:30nz-http://librelist.com/browser//leiningen/2013/1/14/changed-behavior-between-preview10-and-rc1-2/#dda732eae0e59724a91f0fba324657ef
15:31technomancyTimMc: not sure
15:33TimMcHuh. Using :plugins isn't exactly a workaround, since that's really the right way to use it, but Marick's stacktraces are pretty weird.
15:34nz-it seems that it triggers in midje 1.4 even if you put lein-midje to plugins, if I change midje to 1.5-alpha5, it starts to work
15:35nz-also putting bultitude to dependencies fixes this
15:36nz-my project.clj: https://github.com/RuuviTracker/ruuvitracker_server/blob/master/project.clj
15:47TimMctechnomancy: You said that newnew has temporarily been copied into leiningen -- will any modifications to the included version be propagated back?
15:51TimMcI ask because I'd like to make a better fix than "quadruple bacon backslashes", but I'm not sure where to put it.
15:52technomancyTimMc: it's not temporarily; I just haven't updated the newnew readme to explain that the copy in leiningen is now canonical
15:52TimMck
15:53technomancynz-: so it sounds like a bug in midje 1.4 that was taking advantage of a bug in older versions of Leiningen perhaps?
15:53technomancysome kind of weird classpath leakage
15:58nz-something like that
16:03frozenlockAny templates to create new cljs project? (Something with ring perhaps?)
16:06TimMcstuartsierra: Does http://dev.clojure.org/jira/browse/CLASSPATH-4 need anything to move forward? (java.classpath breaks when there are spaces in the pathnames)
16:06amouatfrozenlock: there's a few I think, including lein-cljsbuild
16:07stuartsierraI hate JIRA.
16:07aroemersfrozenlock: or have a look at the Luminus project: https://github.com/yogthos/luminus-template
16:07TimMcheh
16:07stuartsierraI'll add it to my TODO list.
16:07TimMcThanks!
16:07stuartsierranp
16:08aroemersit is quite new and under development, but that may be fine for you
16:11aroemersfrozenlock: read more about Luminus in the posts at http://yogthos.net
16:13amouataroemers: looks good - wish I'd seen it before starting my cljs project yesterday!
16:13frozenlockamouat: I already use lein-cljsbuild for compiling.. it's not really what I'm looking for. But thanks for the input.
16:14rlanderamouat: have you used it for an actual prod app?
16:14frozenlockaroemers: Thanks. Again, not really what I was looking for (I just want a dev environment for a cljs library), but it sure looks very nice for a complete app!
16:14amouatI just found the blog post I read the other day: http://squirrel.pl/blog/2013/01/02/get-started-with-clojurescript-with-leiningen-templates/
16:15amouataroemers: it's just a side project, but hopefully it will get used
16:15aroemersfrozenlock: no problem
16:15amouatstill struggling to get started really :(
16:15aroemersrlander: ^^
16:16rlanderamouat: oops, I think I meant aroemers
16:16frozenlock"get-started-with-clojurescript-with-leiningen-templates" Well that looks promising :P
16:18amouatsorry, and I meant rlander ;)
16:18aroemersrlander: No, I haven't. But I read about it and thought it is nice project.
16:18rlanderaroemers: Yes, I'm taking a look at the docs now. =)
16:21rlanderyogthos: Is compojure the only routing lib on Luminus? Are you planning on supporting more?
16:21yogthosrlander: I wasn't really planning on using others at the moment, is there reason to?
16:22yogthosrlander: moustache would probably the other popular one
16:22rlanderyogthos: In my case, yes.
16:22yogthosas far as I can tell they provide fairly similar functionality and compojure is probably more popular
16:23rlanderyogthos: I'm actually not a fan of either compojure nor moustache
16:23yogthosrlander: which one do you use?
16:24rlanderyogthos: none atm, but I'm getting there https://github.com/rlander/fevre =)
16:24yogthosrlander: ah a new effort :)
16:24rlanderyogthos: I like all my routes in a single place.
16:25yogthosrlander: that's sort of how compojure does it by default though no?
16:25yogthosrlander: you have (routes ...)
16:25yogthosit lets you break them up into groups, but doesn't require doing that
16:25rlanderyogthos: Well, sortof...
16:26rlanderyogthos: first, there's no built-in reverse-url mechanism
16:26rlanderyogthos: and nobody's been able to figure out one yet.
16:26seangroveohpauleez: Any chance of a new shoreleave-browser release? The current version of chrome chokes on the Blob constructor in the current release
16:26yogthosrlander: heh I think there was a discussion on this topic yesterday :)
16:27seangroveI'm working from head now, but seems like it'd qualify for a point version release
16:27rlanderyogthos: ohh, coll. I'll go back and read the logs.
16:27rlander*cool
16:29rlanderyogthos: anyways, I like Luminus' conventions a lot, but why not let each project define it's own libraries, like ruby's Padrino does (padrinorb.com) ?
16:30rlanderyogthos: or monkrb
16:33biff_tannenwhat are some real applications that use clojure ? i define 'real' as customer-facing, scalable, etc ...
16:33biff_tannenhaving some relative usefulness
16:33tolsenjux.com uses clojure called by jruby on rails for optimizing layout of photos
16:33systemfaulttwitter storm is written with clojure IIRC
16:34nickmbaileyit is
16:34nickmbaileyor mostly
16:34systemfaultstorm is far from being a toy.
16:35eggheadmore from marz, cascalog for cascading/hadoop workflows
16:37eggheadbiff_tannen: some popular companies using clojure: http://geni.com http://runa.com http://www.factual.com/ there are tons of others
16:37dnolen_biff_tannen: do you mean companies building products w/ it? There are quite a few now
16:37eggheadgroupon is another big name using it, but I think it's mostly internal there, not 'customer facing' as such
16:38frozenlockbiff_tannen: https://bacnethelp.com is written entirely with clojure and cljs. But I'm bad at webdev, so I don't know if it's a valid example :P
16:38technomancybiff_tannen: clojars is the biggest OSS clojure web app
16:38ohpauleezseangrove: It's in master
16:38ohpauleezit'll be cut to release shortly
16:39ohpauleezThere are updates across the all the modules
16:39ohpauleezand a new one about to be released: shoreleave-baseline
16:42ohpauleezI'll cut some snapshot releases by Friday
16:44frozenlocktechnomancy: wouldn't Lein also be a perfect example? Must be one of the most used clojure project.
16:49technomancyfrozenlock: sure, but it's not very typical of a customer-facing program unless your customers are hackers
16:50biff_tannentolsen egghead dnolen_ frozenlock technomancy thank you
16:52tmciverbiff_tannen: why don't you make like a tree . . . and get outta here.
16:52biff_tannenits leave
16:52biff_tannenmake like a tree and LEAVE
16:52technomancytmciver: I was tempted to make that joke too =)
16:52biff_tannenyou sound like a DAMN FOOL when you say it like that
16:52tmciverLove those movies.
16:53systemfault1.21 GIGAWATTTS!
16:54systemfaultIn french... the dolorean takes a lot more energy... 2.12 gigawatts.
16:54systemfault*2.21
16:55TimMcArg, what keeps creating ~/repl-port?
16:55eggheadlein
16:55frozenlockI'm leaving this here for logging and google search: I had a question earlier about how to get a value when using the `fetch' library in cljs. It would always return nil. I asked M. Granger if it was possible to get the value of anything inside a fetch: "Unfortunately no :( By the nature of JavaScript letrem is an asynchronous block, meaning that it will execute at a point later and simply return nil for now. The block gets execute
16:55frozenlockwhen the server responds and so you need to think about your flow a little differently. Instead of returning something, it's basically just a callback and so everything you expect to happen as a result needs to happen in functions called within that block."
16:56eggheadquick technomancy how do I make nrepl not dump repl-port files everywhere or at least clean them up when I control+d
16:56technomancyegghead: should be fixed in the latest
16:56eggheadah cool, will pull latest then, cheers!
16:57yogthosrlander: well that's sort of what the +foo module support is like
16:57yogthosrlander: you could write a plugin which will swap out compojure with something else fairly easily
16:58rlanderyogthos: +foo module support?
16:58yogthosrlander: http://www.luminusweb.net/docs/profiles.md
16:58rlanderyogthos: ahhh, gotcha
17:11dpickhey guys, any idea why hitting a url in the browser and grabbing it with wget would give me once set of html and grabbing it with slurp or clj-http would give a another?
17:11dpickdoesn't seem to be a user agent thing
17:11pmonksredirects? <warning: n00b>
17:12dpickdoes slurp not follow redirects?
17:12dpick(there are redirects)
17:12pmonksNo clue sorry…
17:13technomancyI think curl doesn't by default
17:13rboyddpick: wireshark?
17:13brehautslurp is powered by java.net.URL et al right?
17:13amalloycurl doesn't follow redirects
17:13brehautim pretty sure it doesnt follow redirects by default either
17:13amalloyslurp doesnt either last i checked
17:14dpickI set wget to not follow redirects and it just bombs out early, I don't get any html
17:14dpickrboyd: nothing interesting there, just a couple of 302's
17:14brehautdpick: get wget to display the response
17:14brehaut'bombs out early' isnt really science
17:15dpickit sends back a 302 and wget doesn't follow it
17:15arohneris there a version of hash-map that accepts duplicates without throwing?
17:15amalloyi think in 1.5 that function is hash-map
17:16amalloyprior to 1.5, your best bet is assoc or into
17:16dpickahhh crap figured it out
17:16dpickthe server sends a different redirect if the client doesn't accept cookies
17:16AWizzArdI have N doubles, and would like to use the format string "%,11f". I don’t know however what my N is. Can be between 1-15. Is there a format directive to say “use this format string for all args and divide them by two spaces”?
17:17arohneramalloy: thanks
17:18amalloyAWizzArd: (s/join " " (map #(format ...) doubles)))?
17:19AWizzArdyes, I use join so far, but thought there might be something else
17:19brehautjkkramer's formative lib (https://github.com/jkk/formative) looks interesting
17:20jkkramerbrehaut: you just beat me to soliciting feedback about it ;)
17:20brehautlol :)
17:20brehautits not often i snipe anyone from the other side of the world
17:22dpick\q
17:22brehautjkkramer: is it possible to extend datatype?
17:23jkkramerbrehaut: yes, with formative.parse/parse-input
17:23jkkramer(a multimethod dispatching on :datatype or :type)
17:24brehautcool
17:27brehautjkkramer: based on reading only the docs, it seems solid.
17:27jkkramerbrehaut: it's been in development a while, and seen some real-world usage
17:28brehautcool
17:28kovas_ohpauleez: ping
17:28brehauti like that everything is data and that you've seperated all the bits
17:29kovas_ohpauleez: I'm having an issue with BlobBuilder. Is that limited to shoreleave-browser, or does it affect (possibly transitively) the other modules also?
17:29technomancyjkkramer: looks good
17:29technomancywish I had found that before I started syme =)
17:30technomancyjkkramer: have you considered putting the source next to the rendered form in the demo app?
17:30jkkramertechnomancy: not a bad idea, I will do that
17:31jkkramertechnomancy: does syme do form stuff? I thought it was like a pair coding thing
17:32technomancyjkkramer: there's a single form in it, but it's not tricky by any means
17:32technomancywell, technically two if you count the single-form "which project?" splash
17:34jkkramertechnomancy: ah yep I see
17:35jkkramertechnomancy: btw, do you know about the placeholder input attr? it does basically what your onfocus/blur handlers are doing
17:35technomancyjkkramer: aha; I did not. is that part of HTML5?
17:35brehauttechnomancy: yes
17:35technomancymy web programming skills are basically c. cutting-edge-2008
17:36technomancythanks
17:36jkkramermost sane browsers support it these days
17:36technomancyI doubt any IE users would want to use Syme anyway =)
17:37brehauttechnomancy: im not sure web technology has a cutting edge. just less rusty than previously
17:38frozenlockcljs : In my project I've added :foreign-libs [{:file "libs/envision.min.js" :provides ["envision.core"]}]. Now I require it in my ns declaration: (:require [envision.core :as v]). How can I access a js function envision.templates.myFn ?
17:38michaelr525am i not supposed to start a project from lighttable if I want to work on it from lighttable?
17:38michaelr525there is no "new project" command..
17:39dcjacksontechnomancy: all of sudden today lein2rc1 and lein2rc2 are glacially slow. Seemed to start right after I first attempted to upgrade to rc2. Takes MINUTES to run lein version. Any ideas what is wrong with my setup? OSX, been running lein for years….
17:39technomancydcjackson: haven't heard of that
17:40technomancyupgrading to rc2 made rc1 slow too?
17:40technomancywhat about preview20?
17:40technomancy10
17:40dcjacksonhere is what happened once: ✗ lein2rc2 version
17:40dcjacksonJan 15, 2013 2:19:34 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
17:40dcjacksonINFO: I/O exception (java.net.SocketException) caught when processing request: Connection reset
17:40dcjacksonJan 15, 2013 2:19:34 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
17:40dcjacksonINFO: Retrying request
17:40dcjacksonLeiningen 2.0.0-RC2 on Java 1.6.0_37 Java HotSpot(TM) 64-Bit Server VM
17:43dcjacksonp10 is very snappy
17:44dcjacksonthey all seem to work now
17:44dcjacksonsomething is strange
17:44dcjacksonPerhaps this is some sort of weird network issue for me
17:45ohpauleezkovas_: Just the browser
17:45ohpauleezit's all patched up in master
17:46ohpauleeznew releases for everything should be done by Friday
17:46kovas_cool. i just upgraded my deps and it seems to work again
17:46technomancydcjackson: you shouldn't need to hit the network if your ~/.m2 has been primed
17:47dcjacksonlein deps
17:47dcjacksonCould not transfer artifact postgresql:postgresql:pom:9.2-1002.jdbc4 from/to mvnrepository (http://mvnrepository.com/): Failed to transfer file: http://mvnrepository.com/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom. Return code is: 502, ReasonPhrase:Bad Gateway.
17:47dcjacksonThis could be due to a typo in :dependencies or network issues.
17:47dcjacksonCould not resolve dependencies
17:47dcjacksonthat jar is in m2 for sure
17:48technomancydcjackson: so this is only inside a specific project?
17:48dcjacksonwant me to try another project?
17:48technomancyyeah, or outside
17:49technomancyit could be we default to unreasonable fetch timeouts
17:52dcjacksontechnomancy: I am having various problems still
17:52dcjacksonoutside of a project, lein version seems to work OK
17:53dcjacksonIn a project, lein or lein version are OK. But lein deps hangs, as does a line run alias
17:59xeqidcjackson, technomancy: I notice its looking for the pom, not the jar. Also should mvnrepository.com resolve in a browser?
17:59xeqiah, 504 Gateway Time-out
17:59dcjacksonThere is no pom for that jar
17:59dcjackson:-(
18:00dcjacksonin my .m2
18:00dcjacksoncan't find one on the net. so I've just been using the jar
18:00dcjacksonalone
18:01hyPiRionHumm, make up one with no dependencies
18:01technomancyusing a jar without a pom would probably make lein very confused
18:02xeqieh, it just means it tries to find the pom, fails, and then acts as if it doens't have any dependencies
18:02dcjacksonwell, you would know, but it seems to have been working ok
18:02xeqiwhich based on an older version of postgresql seems fine
18:02xeqiif you want to stop the network looking for it copy http://search.maven.org/remotecontent?filepath=postgresql/postgresql/9.1-901-1.jdbc4/postgresql-9.1-901-1.jdbc4.pom
18:02xeqiand change the version name
18:03xeqisince it looks like a basic pom w/o dependencies that should work fine
18:03dcjacksonI'll try that
18:09tomojRaynes: my markup has [{:type :element :tag :p} "\n\n" {:type :element :tag :table}]
18:09tomojwhich requires (l/adjacent-to (l/element= :p) (l/any) (l/element= :table))
18:10tomojbug or intended?
18:10dcjacksontechnomancy, xeql: Well, one of two things helped a lot: I went back and ran lein2p10. That had NO problems doing a lein deps, etc. Also I did what xeql proposed, copied the other postgresql .pom into the new directory . now rc2 works fine
18:10tomoj..maybe I should just run htmlcleaner on the markup before I parse it?
18:11blackdoghey - what's the current hotness for emacs-clojure interaction?
18:11eggheadblackdog: I like nrepl
18:11eggheadhttps://github.com/kingtim/nrepl.el
18:11tomojor maybe I just want ~ instead of +
18:11blackdogegghead: cheers
18:13dcjacksonxeql, technomancy: thank you for the help. Now I am back to my previous level of productivity :-)
18:14xeqidcjackson: hurray, looks like the network at mvnrepository.com fixed as well
18:15xeqimy theory - slowness due to looking for the jar would have hit p10 as well, but they finally fixed it. However, now that you have the pom in place it shouldn't matter anymore
18:15xeqi* looking for the pom
18:16Raynestomoj: That's more or less a bug. Could you open an issue? There are a couple of ways I could fix it.
18:17frozenlockIs there js->cljs cljs->js now in cljs?
18:17frozenlock(IIRC one of the two wasn't)
18:18eggheadya frozenlock
18:18eggheadboth are in there now
18:18frozenlock\o/
18:18frozenlock.. which ns?
18:19egghead(ns cljs-app.yunoincore)
18:19frozenlockDamnit... it threw an error before I 'got it'
18:20tomojRaynes: also: https://www.refheap.com/paste/441a891419f3cd7d74f06ecec
18:20tomojbug?
18:20clojurebotPaste the contents of project.clj and ~/.lein/init.clj along with the output of ls ~/.lein/plugins and lein version.
18:21tomojI forgot the </table>, but that doesn't change anything
18:21Raynestomoj: What specifically?
18:21frozenlockegghead: wait.. aren't supposed to have access to the core fns in any ns? str, print, +... they all work fine.
18:22tomojwell, possible bug 1: adjacent-to doesn't skip whitespace (probably it shouldn't?)
18:22tomojpossible bug 2: in that refheap, I expect to get (("foo" "bar") ("baz" "bing"))
18:22eggheadya frozenlock, was just saying you don't need to manually include that snippet anymore
18:23tomojs/whitespace/text nodes/ I guess
18:23Raynestomoj: Probably a bug. I'm actually on a phone at the moment. I'll try this out and see what's up asap.
18:24TimMcRaynes would never be so uncool as to actually place a voice call.
18:24frozenlockegghead: I must be doing very wrong... (clj->js {:a 1}) should do it, right?
18:24TimMcThat's for *old* people.
18:25tomojRaynes: no prob, I should be doing something else right now anyway
18:26eggheadfrozenlock: maybe it's a version thing? https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L6927
18:30arohneris there a known issue with (merge) in 1.5?
18:31arohnerin 1.4, (merge) returns nil, while in 1.5.0-RC2, (merge) throws
18:33frozenlockegghead: Yup, I was using lein-cljsbuild 0.2.8 insteand of 0.2.10. Thank you :)
18:33zodiakarohner, (merge) doesn't throw for me in 1.5.0-rc2
18:33ivando the examples in https://github.com/frenchy64/typed-clojure bother anyone else because the function name appears twice?
18:36arohnerzodiak: hrm. I was going to try to reproduce it, but now I'm getting a different error. Maybe I had something else weird going on
18:37dnolen_ivan: not really since that's how it is in Typed Racket (on which it is based) and various other typed langs.
18:37ivanhuh.
18:38ivanmy memory of a concise version when it was first released must be failing me
18:38nDuffivan: The release that came with the original paper describing it had that same convention.
18:39dnolen_ivan: he may have toyed around with syntax but that would have been back before Google Summer of Code started I think
18:39dnolen_last year
18:56weavejesterHmm. When I add seque to my program, it blocks for 60 seconds before exiting.
18:57hiredmanweavejester: seque cause the agent pools to spin up
18:58weavejesterHm, so a shutdown-agents might be in order
18:58weavejesterI guess they must use an executor with a 60 second keepalive or something
19:03frozenlockIs there some way to have a namespace require different libraries depending on wether it's in prod on dev?
19:03frozenlock*or
19:04weavejesterFrozenlock: Use an environment variable to determine the difference, and then use a case statement to determine which libraries to load?
19:04technomancyor have a different :src-paths entry in the :dev profile
19:05weavejestertechnomancy: That's a better idea
19:05weavejesterhiredman: Thanks for pointing me in the right direction. It exits immediately now.
19:06frozenlocktechnomancy: That might do it :)
19:07weavejesterFor ages I thought the timeout was due to my own ineptitude in configuring a custom executor. I forgot that agents use one too.
19:37blackdogwhy does the first work but the second doesn't? https://gist.github.com/4543502
19:37hiredmanwhat is the value of .getName?
19:37blackdogi get "can't resolve symbol: .getName in this context"
19:38blackdogit's a method on the java object
19:38hiredmanwhat is the value of .getName?
19:38blackdogwell, obviously it's undefined, at least in the second one. that's why i'm asking: is there some voodoo that brings it into scope in the first form?
19:38hiredman,(macroexpand '(.foo bar))
19:39clojurebot(. bar foo)
19:40Sgeo.foo is not a value, it is syntactic sugar
19:42blackdogSgeo: ok. is there a value i can pass in to map that will do the right thing?
19:43Sgeo#(.getName %)
19:44Sgeo,(map #(.toString %) [1 2 3])
19:44clojurebot("1" "2" "3")
19:44Sgeo(Although in this case I would use str, but you get the drift)
19:45blackdogwhee, so much syntax:) can you explain what's happening there? is #( ... %) a special form?
19:45zodiakblackdog, it's short hand for an anonymous function
19:45SgeoIt's syntax sugar for a lambda
19:46blackdogah, ok. that's right, remember seeing that in joy of clojure
19:47blackdogi miss partial application :/ guess that's the price for variadic functions.
19:47Sgeo,(map (partial + 1) [1 2 3])
19:47clojurebot(2 3 4)
19:48brehautblackdog: you mean you miss automatically curried functions
19:48blackdogbrehaut: yes, was imprecise.
19:49blackdogSgeo: yeah. looking around for functional-ish stuff on the JVM, and scala scares the living shit out of me.
19:49SgeoFor me, Clojure is mostly a thing I look at in spite of the JVM, not because of it
19:50SgeoI like Haskell, but also like macros and the ability to change code at runtime easily
19:50frozenlockWhat the... when I add domina to my dependencies, clj->js stops working o_O
19:50TimMcblackdog: The various syntactic forms should be covered by http://clojure.org/reader
19:50blackdogSgeo: don stewart's thesis was interesting there - showed how far you can push dynamic systems in haskell
19:50Sgeoblackdog, I haven't seen it
19:51blackdogstill, it's not trivial, and it's certainly not the way haskell systems are typically built
19:51brehautblackdog: the problem with that is that dons is a genius and some of us are not
19:51brehaut(and by some of us i mean me)
19:51blackdogSgeo: code.haskell.org/~dons/papers/thesis/dons-phd-thesis.pdf
19:51blackdogbrehaut: :) i agree entirely.
19:51blackdog(he used to be my cubicle-mate at UNSW - scarily productive & smart guy)
19:52SgeoI like it for the IDE, not the language
19:52brehautuniversity of new south wales?
19:52blackdogbrehaut: yeah
19:53brehautblackdog: just across the ditch then
19:53blackdogbrehaut: oh, you're an NZer?
19:53brehautyeah
19:53blackdogdo you functional types hang out much? I know stephen blackheath and hamish mackenzie are kiwis
19:53brehauti dont know either of them
19:54brehautive not met many kiwi FP people
19:54blackdogi took stephen to an nz railscamp a while back and he proselytised haskell at the unwashed rails hackers for three days :)
19:54brehautlol
19:54blackdogah - stephen's the guy who got ghc working on ARM and iOS. hamish is working on the haskell ide
19:55brehautsure
19:56brehautthe closest i get to know those kinds of people is a friend who partially ported GHC to the CLR, he's not a FP guy though.
19:57TimMcbrehaut: Dammit, I'm reading about the eymology of "kiwi" and now I've completely scanted out on the word.
19:57brehauttimmc: scanted?
19:58TimMcsmock smock smock smock smock
19:58brehaut◎_◎
19:58TimMchttps://en.wikipedia.org/wiki/Semantic_satiation
19:59blackdogTimMc: you're a verbal terrorist :)
19:59brehautTimMc: oh true.
19:59Sgeosemantic satiation semantic satiation semantic satiation semantic satiation
19:59brehautTimMc: Squirrel does this to me all the time
19:59TimMcI was hoping you'd get the Calvin & Hobbes reference and I wouldn't have to try to remember the more formal term.
19:59eggheadhmm
19:59egghead30-mins isn't a valid symbol eh :(
19:59brehauti have not read C&H in many years. i need to remedy that
20:00TimMc(Hmm, that C&H strip was not actually about scanting out.)
20:00egghead&'30-mins
20:00lazybotjava.lang.NumberFormatException: Invalid number: 30-mins
20:00eggheadis this a feature of clojure or an artifact of the host?
20:02SgeoProbably Clojure
20:02Apage43symbols must begin with a not-number
20:02TimMcThe stack trace appears to indicate LispReader.
20:02Apage43Right. It's because the reader.
20:02Apage43You can, if you really want to intentionally construct a symbol object that if asked its name will give you something that can't be read back by the reader
20:03Apage43,(symbol "30")
20:03clojurebot30
20:03Apage43which would be read back of course as a number, not a symbol
20:04TimMc&(-> 30 str symbol pr-str read-string class)
20:04lazybot⇒ java.lang.Long
20:04dnolenegghead: not a valid symbol
20:05eggheadguess It's because of my poor knowledge of the reader
20:05amalloyif you made the reader accept 30num as a symbol, you'd have to change a lot of the compiler as well, because it often turns symbols into class names or member variables
20:05TimMcI think the reader is an LL(1) parser, yeah?
20:06amalloyyeah, i think so
20:08TimMcAlthough... that really depends on the tokenizer.
20:08TimMcBased on the dispatch table stuff, I'm gonna guess the "tokens" are always characters.
20:10TimMcHoly crud, C++ isn't context-free-parseable?
20:10brehautindeed it is not
20:10brehautcrazy eh
20:12TimMcThat means that someone knew *exactly* how complex the syntax was befor releasing it, because they had to implement a parser first...
20:14blackdogTimMc: suspect it went like this: "Welp, we can either implement this pig-ugly grammar, or sit through another six months of standardisation meetings. Pig-ugly it is."
20:17tomojhmm, does clojars order by date? https://clojars.org/ring
20:17tomoj1.1.7 is 'newer'
20:17tomojneed a semver library
20:17weavejesterIt must be by date
20:18weavejesterI fixed and released 1.1.7 first because more people use 1.1
20:19Foxboronputting my hands on emacs and nrepl for the first time. Damn, big learning curve from using Sublime Text :/
20:24frozenlockErrm... a javascript library I want to use requires the user to add a css file. What would be the most elegant way to package this in a cljs library? Store the css file into resources, then add it to the head on document load?
20:24xeqitomoj, weavejester: yeah, its by date atm
20:24TimMcYou could always re-push 1.1.7. :-P
20:25xeqieasier to compare that in the db, hopefully w'll finish some transition work later and we can change the sorting
20:26aaelonyany tips on the fastest way to write very large data to a file?
20:26tomojlazybot just scrapes clojars
20:27aaelonyit's actually the lazy-seq that is quite large, not the elements within the seq
20:42FoxboronUmm, trying to use nrepl with clojure, but when i use C-c C-e to eval an expression nrepl replies with: No Lisp subprocess; see variable `inferior-lisp-buffer'. Anyone able to help me in the right direction?
20:46ivanFoxboron: is your .clj buffer in clojure-mode?
20:47ivananyway, works for me with just (require 'clojure-mode) (require 'nrepl)
20:49FoxboronI found a stackoverflow question burried down. Had to enable nrepl-enable-on-existing-clojure-buffers
20:50Foxboronivan: works as a charm now :)
20:56ohpauleezFor those that follow shoreleave news - With the upcoming release a new module has been added: shoreleave-baseline
20:56ohpauleezit's a repo you can clone, and serves as a starting block, much like ClojureScript:One
20:57ohpauleezthree branches: bare, master, and kitchensink let you dial the example in
20:57ohpauleezcomes complete with everything you need, just clone, code, and off to the races
21:00frozenlockohpauleez: Any running example of shoreleave?
21:01ohpauleezfrozenlock: There's a demo app someone made, let me link you
21:01frozenlockhttps://github.com/robert-stuttaford/demo-enfocus-pubsub-remote this one?
21:01ohpauleezthat's the one
21:01ohpauleezshoreleave-baseline is a more complete version of that
21:02ohpauleezfrozenlock: haha
21:02ohpauleezI know of a dozen or so production apps that use some piece of shoreleave
21:02frozenlockHow convenient, I was toying with fetch today because I needed some client/server communication.
21:03tomojwhere is it?
21:03ohpauleezkablammo
21:03ohpauleezfrozenlock: Shoreleave is basically all the stuff you end up writing anyway when you build a serious CLJS app
21:03ohpauleeztomoj: Where is what?
21:04tomojshoreleave-baseline
21:04ohpauleezhaven't cut the release yet and pushed the repo
21:04tomojah
21:04ohpauleezjust wrapping up the kitchensink code tonight
21:04ohpauleezliterally every piece of shoreleave, all wired up. Sort of a smoke-test type of application
21:04frozenlockohpauleez: I'll use your cljs expertise then! :D I have a JS library that requires a css file. Is there a way to package everything in a nice little cljs library, without the user having to manually add the css file?
21:05tomojexcellent
21:05frozenlockohpauleez: doh! cljsbuild failed -_-
21:06ohpauleezfrozenlock: what release? what error? (I haven't cut the new releases yet)
21:06ohpauleezI cut all of my CLJS projects over to a release, let them run for a bit, then if it looks good I push the releases
21:06frozenlockWell the link above...
21:06clojurebotunlink: and constantly is just a function that takes any arguments and returns whatever argument is given
21:07frozenlockWARNING: using numeric exit values in plugins is deprecated.
21:07frozenlockPlugins should use leiningen.core.main/abort instead.
21:07frozenlockSupport for this will be removed before the stable 2.0.0 release.
21:07frozenlockcljsbuild failed.
21:07frozenlock
21:07ohpauleezfrozenlock: Ahh
21:07ohpauleezthank you, I'll make sure it gets updated
21:08frozenlockI think changing cljsbuild version solved the problem.
21:12frozenlockYup, solve it.
21:12frozenlocksolved even
21:13frozenlockohpauleez: Is it unique for each visitor?
21:13ohpauleezfrozenlock: Is what unique? The JS?
21:14frozenlockThe demo, I was wondering if each user had its own item list.
21:18frozenlockohpauleez: Is there other code examples besides the demo?
21:25ohpauleezfrozenlock: Off the top of my head, I can only think of two blog posts that made examples
21:25ohpauleezand soon, shoreleave-baseline
21:29dnolencore.logic is breaking away from cKanren naming convention for the fd functionality - http://github.com/clojure/core.logic/compare/org-fd
21:29tomojhooray
21:29dnolensorry to cause trouble for people who are already relying on this stuff - it mostly just means renaming
21:29dnolen+fd -> fd/+, distinctfd -> fd/distinct etc to make it more Clojure-y
21:31dnolentomoj: yeah, I probably should have done that from the beginning but was deep in implementation issues.
21:31frozenlockohpauleez: Would you mind explaining what is this for? (rpc/remote-ns 'example.api :as "api")
21:31tomojI was just daydreaming earlier about forking core.logic and renaming everything
21:31frozenlockI haven't seen namespace mention in `fetch'.
21:32dnolenalso clojure.core.logic.clj now has 1K less code, so hopefully a little bit easier to read for people curious about the implementation who don't want to be bogged down in CLP(FD) details
21:32dnolentomoj: heh
21:32tomojbut I feel not even close to understanding it, so..
21:32ohpauleezfrozenlock: That changes a little in upcoming release, but it let's you expose an entire namespace as a remote API
21:33ohpauleezthat call means on the client, you can call (api/whatever-fn …)
21:33dnolentomoj: well we're moving further and further away from miniKanren so, for new stuff I'm definitely up for good names and proper namespacing.
21:33frozenlockoh... Oh!
21:33tomojI was also thinking about the -o stuff
21:33tomojimagined '?foo?
21:33dnolentomoj: the core miniKanren stuff probably won't change nor the -o stuff.
21:33dnolentomoj: however we can build much better functionality off the constraint stuff anyhow
21:34ohpauleezfrozenlock: It means that instead of having to wire a whole namespace up, you can just say, "This is the remote API into my system"
21:34dnolenI look forward to the day that people don't use membero and appendo ever
21:34dnolentomoj: we'll need good names for whatever replace them, and hopefully deprecate them.
21:34frozenlockohpauleez: consider me sold. When does the new version come up? :)
21:34tomojinteresting
21:35ohpauleezfrozenlock: Should be Friday
21:35tomojI saw oleg wrote a paper about how to do arithmetic in minikanren by simulating a hardware adder
21:35ohpauleezI need to wrap up the new pieces, deploy all of my apps that use Shoreleave, then cut releases and make the announcement
21:35dnolentomoj: yes we're getting really close to being able to use bi-directional assoc and stuff like that
21:35dnolentomoj: so you can actually to proper relational programming with maps and stuff.
21:35frozenlockohpauleez: Will it still be based on Noir?
21:36dnolenactually do
21:36tomojgreat, I've been eyeballing partial-map
21:36dnolentomoj: partial-map is an implementation detail - featurec is the thing to actually use
21:36muhoois shoreleave in use in production anywhere yet?
21:37tomojI figured featurec was constraint-related and so ignored it since I don't have a clue about that stuff
21:37ohpauleezmuhoo: Yeah, I certainly know of a few - it was developed in parallel of working on productions systems
21:37ohpauleezand I know of about a dozen or so outside of my own that are using it
21:37ohpauleezfrozenlock: Nope, that's one of the changes - better ring/compojure support
21:38dnolentomoj: things are moving more and more towards constraints - they are less trouble then relations and serve much the same purpose minus the bad non-termination stuff.
21:38frozenlockDamnit. I really need to switch from Noir to compojure.
21:38dnolentomoj: constraints TDLR; - relations that can be delayed so you can avoid more non-termination cases
21:39dnolener tldr;
21:39ohpauleezfrozenlock: FWIW, the new shoreleave-baseline is a compojure/lib-noir stack on the server side
21:40muhooTDLR Time Domain Linear Refractometer
21:40tomojif that enables bidirectional assoc, I wonder if you can get bidirectional lens families
21:41muhooohpauleez: thanks, good to know. the focus on XSS security indicated to me that it was used in production somewhere :-)
21:41dnolentomoj: heh, dunno, I don't know anything about lenses. But at least you can write core.logic code with better data structures.
21:43tomojI hate to ask, but, you think, 'close' as in.. months? I ask because if it were expected sooner than months, then I really need to catch up on constraints
21:43dnolentomoj: 'close' as in anyone could implement it today
21:44tomojfeaturec is a starting point?
21:45dnolentomoj: sort of, I mean I can write up an example here in a bit.
21:45dnolentomoj: the only reason I haven't done it yet, because I have decided on the constraint implementation API - but I closing on something I like for that
21:45dnolenI haven't decided I mean.
21:45tomojcool
21:45dnolenso you could do it today - but the API is going to change - so it's not time yet.
21:47dnolentomoj: I think it will be awesome :) and it will happen soon, but perhaps not until after Clojure/West
21:47dnolentomoj: or if I'm able find enough time, demo it @ Clojure/West
21:48tomojthere are problems with higher-order relations, iirc?
21:48tomojor just you can't table them
21:49dnolentomoj: "problems"? there's just no support for that at all.
21:49tomojright, that's what I thought
21:49tomojI was trying to imagine bidirectional update-in
21:50gfredericksthat would kind of imply that a logic var's value can be a relation
21:50tomojindeed
21:50gfredericksdoes prolog have such a thing?
21:50tomojoh, I didn't realize that
21:50dnolentomoj: it's possible to do FP style higher stuff in a LP paradigm ... but it's not something I'm planning on pursuing anytime soon.
21:51dnoleneven crazier would be higher order logic programming - but I'm also not going there anytime soon.
21:51tomoj(I mean, I assumed the, uh, 'inner' relation would always be ground)
21:52dnolengfredericks: yes, you thinking about higher order logic programming - Lambda Prolog
21:52tomojso I guess you just have a function like (relation-in ks relation) that returns a new relation
21:52dnolenhttp://www.amazon.com/Programming-Higher-Order-Logic-Dale-Miller/dp/052187940X
21:53dnolenthough I will say, a lot of what people use that for is theoretical CS - and it's still an open question whether nominal logic doesn't deliver most of that power w/o the complexity.
21:54tomojI'm just completely blocking out the "nominal" stuff :(
21:54ohpauleezdnolen: I've been trying to wrap my head around the nominal stuff
21:54ohpauleezhahaha
21:54ohpauleezit looks like I'm not alone
21:54gfredericksdnolen: there are so many things I haven't even heard of O_O
21:54dnolentomoj: no worries, it's heady stuff unless you want dig into theory.
21:54tomojone of those papers where I follow along patiently for a while, waiting to catch any whiff of the idea, then skim the rest in despair
21:55dnolentomoj: what's cool about it is that it let's you literally take inference rules and operational semantics from a paper and convert them trivially into a logic program.
21:55dnolenso if you ever wanted to run the pi calculus - well that's like maybe a hundred lines of code or something.
21:59dnolenthese are the typing rules for the simply typed lambda calculus - http://en.wikipedia.org/wiki/Simply_typed_lambda_calculus#Typing_rules
22:00dnolenand the core.logic nominal program that corresponds to them, http://github.com/namin/TAPL-in-miniKanren-cKanren-core.logic/blob/master/clojure-tapl/tapl/src/tapl/stlc.clj#L89
22:01dnolen(2) in the Wikipedia article is not included - but otherwise if you squint, it's a direct translation
22:48xeqippppaul: thanks for the issues on peridot. That last one did lead to me finding a bug with multipart and :headers. Not sure if I answered everything in it or not, let me know
23:06tomojdakrone: want a pull request? https://www.refheap.com/paste/e13f0c97503bfa55601964a68