#clojure logs

2014-05-10

00:04caternjust getting started with clojure, following Clojure for the Brave and True, and sometimes when I try to trigger an error in the CIDER repl with (map)<RET> it doesn't show up; and never do I see the stacktrace, even though clojure-repl-popup-stacktrace is set to t. some simple problem hopefully?
00:07l1x,(/ 1 0)
00:07clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
00:07l1xwhat sort of error do you want to trigger?
00:08l1xcatern: (pst)
00:08l1x,(/ 1 0)
00:08clojurebot#<ArithmeticException java.lang.ArithmeticException: Divide by zero>
00:08l1x,(pst)
00:08clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Throwable>
00:09caternwell, I don't really care about the error ((/ 1 0) also intermittently fails to show the exception and doesn't show the stacktrace)
00:09caterni more care about the fact that it's not showing up
00:09l1x(pst) <<
00:09caternthat would probably get annoying at some point and is indicative of some deeper problem
00:09l1x,doc pst
00:09clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/doc, compiling:(NO_SOURCE_PATH:0:0)>
00:10l1x,(doc pst)
00:10clojurebot"([] [e-or-depth] [e depth]); Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12."
00:10l1xis this what you would like to do?
00:11caternwell, that's helpful, but no
00:11caternthe problem is that CIDER just seems to intermittently and randomly not print an exception when it's triggered
00:13caternit does still happen though since (pst) prints the stack trace for it
00:26rgrinbergis there a way to create a compojure route that will match any number of url slashes. For example: "xxx/*" with a url like "xxx/1/2/3" would give [1 2 3] in the params
00:38ddellacostargrinberg: from reading this, it seems like the answer would be no, since forward slashes are handled differently in compojure: https://github.com/weavejester/compojure/wiki/Routes-In-Detail#matching-the-uri
00:41ddellacostargrinberg: yeah, seems like it wouldn't work because of how Clout works: https://github.com/weavejester/clout/blob/master/src/clout/core.clj#L127-L128
00:41ddellacostargrinberg: that said, you could probably write your own alternate route compiler
01:04zeroemanyone know what protocol/interface exposes the "find" function for maps?
01:19amalloyzeroem: from memory i think it's ILookup/entryAt
01:20amalloyno, that's valAt
01:21amalloyAssociative.entryAt
01:22zeroemamalloy: ah, thanks
01:27zeroemyeah, that did it.
01:48seangroveI'm looking at Datascript right now - how would I write an aggregate function to group contacts by the first letter of their last name?
01:54sm0kecan i exclude a single test from a profile in lein?
01:59muhukeastwood doesn't seem to be checking for unused imports. :require'd, :refer'd, specific imports.
01:59muhukis there an add-on or something to enable this?
02:01sm0kehurm i think it is impossible to know something is unused in clojure
02:01sm0kei may be wrong though
02:04muhuksm0ke: I suppose it'd be difficult. But why should it be impossible?
02:04muhukif there's a symbol in :refer vec, and it's not referred later in the file, we can say it's not used no?
02:05sm0kemuhuk: unless you run the code how would you know it is unused? even if you run it the code may take different paths is a whole different thing
02:05sm0kemuhuk: keep in mind the macros and eval stuff
02:06muhuksm0ke: I'm not necessarily looking for used, as in var is resolved.
02:06muhuksm0ke: I'm ok with referred or not.
02:06muhuksm0ke: (it can be referred yet not used, as you said)
02:07muhuksm0ke: ah, something like (def xy ...) (eval (str \x \y) -- I'd rather get a warning in this case.
02:08sm0kewhat about ##(eval (read-string "(split "a b c" #\" \")"))
02:08lazybotjava.lang.SecurityException: You tripped the alarm! eval is bad!
02:08sm0keif there was a :require clojure.string :refer (split) , you would remove tit
02:08sm0keit*
02:10sm0kealtough this is a negative case imo
02:12sm0kehttps://github.com/technomancy/slamhound
02:12sm0kemay be slamhound is doing this
02:13muhuksm0ke: yeah, I wouldn't mind getting warnings in such cases. I think it'd be still more useful to get warnings on stuff that used to be used, but then removed and the import was left...
02:14muhuksm0ke: oh, neat. Thanks!
02:33sm0kei wish there was something for plain java classes in fireplace
02:33sm0kelike listing methods for a class
02:34spot35what is clojure used for?
02:35sm0keprogramming mainly
02:35spot35i was curious since I've never used it before.
02:36spot35I know C++, Python, and Javascript are the most important languages to know.
02:36sm0kepeople are doing all kind of stuff, web , music, bigdata, games, android, ml, dsl to name a few
02:36beamsopython?
02:36clojurebotpython is "I think dropping filter() and map() is pretty uncontroversial…" — GvR
02:37rpaulojavascript?
02:37clojurebotjavascript is beautiful, you're just too conformist to appreciate its quirks: http://tinyurl.com/7j3k86p
02:37rpauloc++?
02:37rpaulojava?
02:37clojurebot
02:37sm0keclojurebot: c++ |is| mule crap
02:37clojurebotRoger.
02:37sm0kec++?
02:37clojurebotc++ is mule crap
02:38rpauloruby?
02:38clojurebotChunky bacon!
02:38beamsohahaha
02:39spot35Which languages would rate as important to know?
02:40beamsoc, java, javascript, haskell, a lisp...
02:40spot35hmmm
02:40beamsoi learnt of clojurebot's functionality then because i've never heard of python being a must-know language
02:41beamsoi never did it at school and very few places hire for the skills in my local area
02:41spot35C++ is important since it is ubiquitous in scientific computing and open source.
02:42beamsoi'd strongly argue that c is more ubiquitous
02:42sm0keclojurebot: c++ |is| ubiquitous
02:42clojurebot'Sea, mhuise.
02:42spot35I would agree that C is important.
02:43sm0keclojure?
02:43clojurebotclojure is far closer to perfection then python
02:43beamsohahaha
02:45spot35http://stackoverflow.com/questions/4260522/what-is-clojure-useful-for
02:47seangroveclojurebot: forget clojure
02:47clojurebotPardon?
02:47spot35Well according to one of this question's answers, Clojure seems to be useful in that it provides better language constucts.
02:49spot35It's great.
02:50spot35"Clojure is being used extensively for processing large volumes of data. It is very well suited to data mining/commercial-AI (ie: Runa) and large scale predictions (aka WeatherBill). Clojure's concurrency story really helps in these data heavy domains where parallel processing is simply the only answer."
02:51muhukspot35: forgot who said it, but there's a famous quote like this: "scheme is not a programming language to solve any particular problem, you build programming languages using scheme to solve your specific problems"
02:51muhukspot35: you can replace scheme with pretty much any LISP
02:52muhukspot35: even Python
02:52spot35awesome muhuk.
02:52muhuk(takes cover)
02:52spot35:-)
02:57spot35why do i get this message "#html Cannot send to channel" ?
02:58spot35I tried to type in the #html channel.
03:08systemfaultTry to registrer your nickname to freenode.
03:08systemfault*register even...
03:14spot35\register spot35
03:15spot35how do I do it?
03:40amalloy$google freenode help register
03:40lazybot[freenode: frequently-asked questions] https://freenode.net/faq.shtml
05:50spot35thanks a lot
05:51spot35how come this room is so quiet?
05:51clgvalmost no US people awake I guess ;)
05:51pepijndevosspot35 time of the day + timezones
05:52clgv:D
05:53spot35i read about this channel on a hacker news article about best irc channels.
05:54dbushenkocan you share a link?
05:54clgvspot35: you got a clojure question?
05:55spot35i'm glad that clojure exists
05:55spot35https://news.ycombinator.com/item?id=7161236
05:57dbushenkonice :-)
05:57spot35clgv, no clojure questions, wwas that a private message?
05:57spot35i'm new to irc :-)
05:57hyPiRionspot35: that's neat, hope you enjoy your stay here :)
05:57hyPiRionprivate messages typically end up in another window in IRC clients
05:57clgvspot35: no, a normal question but with your name that you know you were meant ;)
05:58spot35thanks a lot i appreciate it. this is a friendly room.
05:59spot35hope everyone enjoys the article
06:00hyPiRionOh right: It's generally a bit more silent on weekends, and considering the americans aren't awake yet, even more so.
06:01ddellacostawho is uniclaude? Curious who else is in Japan
06:01sm0kei have noticed one thing very interesting, hostility in irc language rooms is directly proportional to how low level the language is
06:02ddellacostaspot35: re: why quiet, definitely I see phases throughout the day when various country/region populations wake up or go home/go to bed, etc.
06:02sm0kejava, c++ irc rooms are really hostile, haskell clojure otoh usually firendly
06:02ddellacostasm0ke: yeah, I haven't hung out on IRC for years until I joined Clojure (and sometimes Haskell, also super friendly)
06:03dbushenkosm0ke, maybe its bcs java, c++, etc. have lower entering bound, and there are lots of young zealots there :-)
06:03hyPiRionsm0ke: hm, I think that's coincidental. the #rust channel is friendly too
06:04ddellacostaanother nice thing about this channel is that a lot of the main movers and shakers hang out here...you can directly ask them questions about libs and whatnot (and everyone I've talked to is friendly ta boot)
06:04dbushenkoyep!
06:05bozhidarindeed
06:05hyPiRionAh, the power of a relatively small community
06:05bozhidarunfortunately (for Europeans at least) most of them are stateside
06:06ddellacostaI guess that is indeed part of it. I think another part is that the Clojure community really seems to emphasize learning and thinking about programming in a deep way (not to say other communities don't...Haskell certainly comes to mind)
06:06ddellacostaand I think that comes out in the patience many folks bring to it
06:06bozhidarddellacosta: and any other FP community I guess :-)
06:07ddellacostabozhidar: yeah, most definitely, I think so. Again, not to say there aren't smart folks elsewhere--and plenty of brilliant people writing in mainstream languages, of course
06:07hyPiRionddellacosta: I think the Clojure community emphasize on thinking in general. =) As in we don't usually do "hey, this test succeeds, let's ship it!"
06:07bozhidarBtw, I'm thinking of starting a #clojure-emacs channel dedicated mostly to cider, clojure-mode, etc
06:08bozhidarI wonder if people would be interested in something like this
06:08ddellacostahyPiRion: yes. :-)
06:08bozhidarI'm often here, but I rarely actually read this discussions, because there are so many of them
06:08ddellacostabozhidar: dunno...I mean, I'm on the fence since it seems like there is a fair amount of emacs + Clojure discussion here, which people tolerate okay
06:08ddellacostabozhidar: but maybe you're right that it should be elsewhere (I'd be interested)
06:09hyPiRionbozhidar: How many developers are there working witch cider/clojure-mode or other emacs-related things?
06:09bozhidaron cider - just me
06:09bozhidaron clojure-mode - mostly me
06:10bozhidarbut it has a few other maintainers as well
06:10bozhidarhopefully with the transition to cider-nrepl more Clojurists will join the cider development
06:10clgvhow can one make emacs jokes here from time to time when you direct those questions away? ;)
06:11hyPiRionIn #leiningen, we're not that many people (3-4 active), but whenever there's a discussion about lein internals, it's nice to have
06:11ddellacostahyPiRion: fair point
06:11clgvyeah, I only hope to #leiningen if I got a problem with it. that happens not that often ;)
06:11hyPiRionPeople come in to ask lein questions every now and then, but I feel it's mostly for discussions
06:11clgv*hopp
06:12ddellacostaofftopic, speaking of IRC, does anyone have suggestions on a good channel to hang out in to learn more about graphics-related math?
06:12hyPiRionI mean, most people end up asking in both #clojure and #leiningen if the have a lein problem/question most of the time :)
06:12clgvddellacosta: I doubt its existence. sounds more like a computer graphics lecture or associated student tutorials ;)
06:13sm0keddellacosta: opengl used to be very nice
06:13ddellacostaclgv: yeah, I'm actually trying to find a channel where I can fish for resources like what you're talking about! I really just need to buckle down and learn the math though. :-/
06:14ddellacostasm0ke: took openGL course yeeeeears ago
06:14sm0keddellacosta: i am talking about #opengl channel
06:14clgvddellacosta: so you mean the more basic "working math" or the complex stuff for simulating different fluids and stuff?
06:14ddellacostasm0ke: oh, yeah, I figured...was just kind of reminiscing. ;-)
06:16ddellacostaclgv: all of the above; I need a math refresher (which I can do on my own) but I also just need to try to understand *what* math to learn in the first place. I need something like a survey course of various graphics programming techniques--everything from visualization (ala math you can find in D3 libs) to 3d stuff (linear algebra?) to...physics
06:17ddellacostaclgv: I want to get a basic sense of what is out there...I'm very uninformed
06:17sm0ketake a graphics 101 or something like that to start with i guess
06:17hyPiRionddellacosta: I'm working with a guy who pursued a PhD in 3D graphics, and wanted me to start with it too. I'll try to dig up the book recommendation he had for me.
06:17sm0kemostly its all about triangles :D
06:18ddellacostasm0ke: yeah, maybe I'll poke around and see if I can find a 101-level course somewhere available online.
06:18ddellacostahyPiRion: I would be most appreciative!
06:19sm0kehttp://www.glprogramming.com/red/
06:19sm0kethis is a must read once for graphics i guess
06:19clgvddellacosta: found that book recommendation on one of the old courses "Peter Shirley: Realistic Raytracing, AK Peters."
06:20pepijndevoswhat does 101 actually mean? "bunch of random info for getting started"?
06:21ddellacostaclgv, sm0ke, thanks
06:21sm0ke101 is basic course in most colleges
06:21sm0keso just an analogy for the basic stuff
06:21ddellacostapepijndevos: I think that usually 101 was often the first level in many schools, and higher levels would have correspondingly higher numbers (200, 300, etc.)
06:21pepijndevoshttp://en.wikipedia.org/wiki/101_%28term%29
06:21ddellacostayep, that...
06:22ddellacostaman, sorry for hijacking #clojure w/graphics programming questions, thanks for all the help folks
06:24clgvddellacosta: now you must do it in clojure :P :D
06:24ddellacostaclgv: heh, that was the goal all along. :-)
06:24clgvwell no hijacking then ;)
06:25pepijndevosSwing has some things for 2D, pretty fun.
06:33hyPiRionddellacosta: I was recommended Mathematics for Computer Graphics by John Vince, 3rd/4th edition. It starts off really basic, so the first chapters could be skimmed by about anyone.
06:33ddellacostahyPiRion: thank you so much! I'll check that out right now
06:33hyPiRionBut from chapter 6 I think, you start doing stuff with cameras
06:34hyPiRionJust so you know: It's only mathematics, there's not a single piece of code in the book.
06:35hyPiRionBut it's pretty good at it.
06:36ddellacostahyPiRion: that's actually exactly what I want...
06:36ddellacostaperfect
06:36hyPiRionddellacosta: great then! :)
06:37clgvhyPiRion: oh that book really starts from scratch
06:40hyPiRionyeah, I think I said so
06:41clgvhyPiRion: yeah well "from scratch" is no absolute measure ;)
08:00mr-foobarin clojure, what is the best way to make something like "view" into symbols like make-view, ViewFoo .... ?
08:03beamso,(keyword "foo")
08:03clojurebot:foo
08:21clgvmr-foobar: you should specify an example because your sentence is not easily comprehensible
08:22mr-foobarclgv: I found a solution https://stackoverflow.com/questions/2410082/clojure-type-conversion-string-to-symbol
08:23clgvmr-foobar: ah you just did not know clojure.core/symbol?
08:24clgv$findfn "bla" 'bla
08:24lazybot[clojure.core/symbol clojure.core/read-string]
08:25clgvlazybot: botsnack
08:25lazybotclgv: Thanks! Om nom nom!!
08:27mr-foobar,((symbol "+") 1 2)
08:27clojurebot2
08:28mr-foobarclgv: i needed the resolve
08:28clgvmr-foobar: yeah thats wrong. you need to resolve the symbol to get the variable
08:28clgv,(some-> "+" symbol resolve (1 2))
08:28clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
08:29clgvargs wrong asumption ;)
08:29mr-foobarclgv: what do you think of prettify ?
08:29clgv,(when-let [f (some-> "+" symbol resolve)] (f 1 2))
08:29clojurebot3
08:29clgv,(when-let [f (some-> "++" symbol resolve)] (f 1 2))
08:29clojurebotnil
08:29clgvmr-foobar: prettify?
08:30mr-foobarclgv: oops https://github.com/AvisoNovate/pretty I'm thinking of using it for exceptions
08:32clgvmr-foobar: would only help on the command line repl. which I use less frequent than the repl of my ide ;)
08:33clgvthe colors I meant
08:35DerGuteMoritzb
08:35clojurebotb > c
08:35DerGuteMoritzhaha, oops
08:35DerGuteMoritzc
08:37clgva
08:38clgvlol strange bot
09:10wei__I’m looking for an elegant way to write a function like max(..), but returns the value x for which f(x) is maximum
09:12ambrosebs,(doc max-key)
09:12clojurebot"([k x] [k x y] [k x y & more]); Returns the x for which (k x), a number, is greatest."
09:15wei__ambrosebs: thanks! exactly what I was looking for
09:16michaniskindoes leiningen do anything special when resolving snapshot deps on windows?
09:17michaniskini'm using pomegranate directly and on windows 8 i need to downcase the "snapshot" part of the version, and on window 7 that doesn't even work. but leiningen seems to be able to do it
09:38clgvproject licenses: I have one helper namespace that isnt necessary for my library to work but useful for debuging. since that ns uses quil I can't license it as EPL. so what should I do?
09:38clgvor what is the best practice here?
09:40clgvoh wait the EPL FAQ lists the CPL as approved
09:47caternthe licensing issues really make me uncertain about clojure
10:00clgvcatern: huh? what? the majority of Clojure libs is EPL so that there are no licensing issues for those. you only get into the trouble to need to find out license compatibility if a different license is used
10:01clgvcatern: provided you use EPL for your release as well
10:01clgvor something compatible but that you'd need to find out again ;)
10:02caternyes, but EPL is so uncommon, and I don't really want to use it for my software. it would be better if the LGPL or something was used
10:06clgvcatern: EPL is actually less restrictive than LGPL and GPL
10:07caternmaybe so, but it's also much less common
10:10clgvthat doesnt convince me ;)
10:15_rccatern: it's less common in the things you're used to seeing, sure. Probably worth your while getting used to it, or at least asking your legal team if it looks reasonable.
10:17caterni think it's actually just overall less common...
10:17caternmy real question is whether anyone in the clojure community actually sees this as a problem, or if a relicensing of clojure.jar could ever even happen
10:19_rcWell from the sample you've already tapped, I'd say it's not seen as a problem. Apart from by yourself, as you're part of the community now.
10:26ddellaco_catern: this kind of stuff does come up on the mailing list, for example: https://groups.google.com/forum/#!topic/clojure/mGf_SuHsSGc
10:26ddellaco_catern: I do suggest poking around the archives if you have specific questions, it's quite likely someone has brought it up before
10:27ddellaco_catern: and--ha--probably the most pertinent message in that thread: https://groups.google.com/d/msg/clojure/mGf_SuHsSGc/kMhE4VxqG0sJ
11:18seangroveIs there some way to get datomic to return a hash map of results rather than just vectors/sets?
11:21seangroveMay be a bit too early to ask in here...
11:29pyrtsaseangrove: What would the keys and values be in that case?
11:31pyrtsa(I can think of a few ways to create hash maps from query results but datomic.api/q never returns a map if that's what you're asking.)
11:31seangrovepyrtsa: Yeah, I'm struggling to think of the proper transfomartion for what I want, but maybe at the very least => [:find ?first ?last ...] => {:first ... :last ...}
11:32seangroveBut then that's probably not right, because you might be expecting a hashmap per first/last pair
11:33pyrtsaHmm, you can also use the {:find [?first ?last] ...} syntax and build the value of the :find key programmatically... or create the map keys from it programmatically.
11:34seangrovepyrtsa: Thinking of going that route. I'll explore more, just wanted to make sure I wasn't reinventing the wheel here
11:38seangrovepyrtsa: I also can't think of a way to aggregate results by some arbitrary function, for example trying to group a set of results by the first letter of the last name
11:41pyrtsaYou can use Clojure, including Java interop, in the query expression, e.g. [(first ?last-name) ?initial] captures the value of the first letter of ?last-name to ?initial.
11:41seangroveAh, interesting, let me try
11:41pyrtsaseangrove: Btw, there's also #datomic on Freenode.
11:42seangrovepyrtsa: I'll definitely lurk. Trying to use datascript though, which probably isn't as polished/capable yet
11:45pyrtsaseangrove: You could do something like https://gist.github.com/pyrtsa/84b1c86764425a7f3def to get maps out of a query. Not sure why you'd do that, though. I usually try to fetch as little as possible from the query and use the entity API for extracting the rest of data.
11:46pyrtsaThat was maybe a bad example. Updated the Gist to show what it looks like when the patterns have a different name (?i, ?v) from the attributes (:id, :val).
11:48seangrovepyrtsa: That looks great, thank you. Second example is clear as well
11:52nathan7Hey humans
11:52nathan7Can I make gen-interface generate a .class somehow?
11:57lxsameerhey guys, I have a routing question ( so don't hit me :P) I'm not a JVM user, is clojure good for me over scala or golang ?
11:57dbushenkolxsameer, depends on your tasks
11:58lxsameerdbushenko: in general term
11:58dbushenkoanyway, scala is a mess of OOP/FP, its a modern Perl if you see what I mean
11:58lxsameerdbushenko: i'm a python/ruby user and have a little background about elisp
11:58lxsameerdbushenko: yeah i get it
11:59dbushenkowell, I think, clojure is simplier to study than elisp since it is very uniform
11:59lxsameerdbushenko: does clojure uses the FP pattern ?
11:59dbushenkoyep, clojure is mosly functional
11:59dbushenkonot so pure as Haskell but near to it
12:00dbushenkoactually I use Clojure for hobby projects and for production like 1.5 years or something and very happy with it
12:00lxsameerdbushenko: hmm good, what about golang? how is it compare to golang
12:01dbushenkoI don't know about Go much, but I think -- their areas are a little different
12:01lxsameerdbushenko: how come ?
12:01dbushenkoGo thinks in channels and is mostly about server-side speed
12:01dbushenkoClojure is more general, it may be server side/client side, the performance is OK but not that blazing
12:02lxsameerdbushenko: cool
12:02lxsameerdbushenko: thanks buddy, it was such a big help
12:02dbushenkoI don't know, may be Go is also OK for your tasks
12:02nathan7Fast enough for most real-world tasks, which is good enough unless you're actually going to worry about benchmarks
12:03dbushenkolxsameer, just don't forget that clojure can use all the java heritage which is huge: you can find a library for absolutely everything
12:04lxsameerdbushenko: nice, but scala and golang or even jruby can do that, am i right ?
12:04dbushenkoGo doesn't have anything in common with jvm
12:06lxsameerdbushenko: good to know
12:06lxsameerdbushenko: so I think clojure have some big advantages over scala
12:07dbushenkoyeah, it seems like it was designed :-)
12:07dbushenkoand scala is a mess, really
12:07lxsameerdbushenko: thanks buddy
12:07dbushenkonp
12:45gfrederi`reiddraper: oh I remember the single-trial-level-seeding was not very compelling for you because the arguments are always available to run the function directly, but here's another feature I have that I don't think is possible otherwise: resumable shrinking
12:45gfrederi`which I think can be quite valuable in any scenario where shrinking takes a long time, for whatever reason
12:45gfrederi`e.g., we have a CI system that times out builds after 1 hour; so if a test fails and it spends more than an hour shrinking, the effort can be lost
12:46gfrederi`but with the output I have I can pick up where it left off on a different machine
12:48gfrederi`I might be able to assemble a lot of this functionality into a library oriented around slow/flaky tests though
12:49gfrederi`mostly it would just have some duplication of the code in the test.check namespace and the test.check.properties namespace
12:49GlenjaminHi everyone, is there a deployment middle ground for clojure between lein run and uberjars? Something like capsule perhaps?
12:51GlenjaminSeems to be a pain to google for - I'm referring to https://github.com/puniverse/capsule
12:51reiddrapergfrederi`: erlang quickcheck writes some of that to a temporary file, which might be an option
12:52Glenjamintechnomancy: Are you familiar with capsule at all?
12:53Glenjaminaha - What's Missing/TODO (contributions happily accepted!) Gradle, Maven and Leiningen plugins for easy creation of capsules.
12:53GlenjaminMight have a go at that some time
12:53reiddrapergfrederi`: maybe this would be easier as an email thread, since I seem to be out whenever this comes up on IRC :D
12:59justin_smithGlenjamin: for deploying what? webserver? standalone?
13:00Glenjaminjustin_smith: Standalone, like an uberjar but with jvm opts and agent config included
13:00justin_smithGlenjamin: capsule looks cool, you could probably make a lein plugin for it
13:01justin_smithor even an option extending the existing uberjar
13:01GlenjaminYeah, it seems like the project.clj will already have all the info
13:02justin_smithlooks like it would just be a question of adding the capsule dep, setting capsule as your main, and adding some junk to pom.xml
13:02justin_smithor some custom stuff to the manifest directly maybe
13:03justin_smithI'm definitely bookmarking it for later, seems handy
13:13dnolen_Bronsa: ping
13:13Bronsadnolen_: pong
13:14dnolen_Bronsa: trying to fix core.match with tools.analyzer, I'm trying to detect the presence of recur in the AST, I thought I could just reuse the existing check-loops pass, but that doesn't seem to be true?
13:15gfredericksreiddraper: we should just do another lunch; it might take a while to type up the different changes I've made
13:15gfredericksreiddraper: ticket & patch for the bind issue are imminent
13:16dnolen_Bronsa: er check-recurs
13:16dnolen_(:recurs (loops/check-recur (analyze '(loop [] (recur)) (ana-jvm/empty-env)))) => nil
13:17Bronsadnolen_: check-recur does something a little different than what you're expecting it to do
13:18dnolen_Bronsa: also is it possible to disable the tail check? I just want to check the body of something
13:18reiddrapergfredericks: yeah lunch would be great
13:18Bronsadnolen_: give me one sec, I just came back home
13:18dnolen_Bronsa: k thanks
13:21Bronsadnolen_: so, in your example is correct that (:recurs ast) is nil: the (loop ..) expression is not in a recur path
13:21Bronsa(-> ast :body :recurs) however will be true
13:22Bronsacheck-recurs doesn't check if there's a recur somewhere in the children nodes, it checks whether or not the current node is in a recur path
13:23Bronsadnolen_: I don't understand what you mean with "disable the tail check"
13:24lxsameerdoes clojure has some tools like virtualenv of python or rbenv of ruby ?
13:31Jaoodlxsameer: leiningen
13:32eraserhdOops.
13:32Jaoodyou did it again?
13:32eraserhdIs there something I don't know about lazy-seq being bad for realtime event-streaming stuff?
13:32eraserhdPerhaps. I seem to have been offline when I asked that question the first time :)
13:33dnolen_Bronsa: in core.match I want to detect the presence of recur in a match clause, this is without having to analyze the entire match (as it can be quite large)
13:33dnolen_(match [x] [1] (recur ...))
13:33dnolen_so I want to check if (recur ...) contains recur
13:33eraserhdThe stream seems to be processed one event in arrears.
13:34dnolen_Bronsa: though I guess, I could just catch that error ...? and know that the user used recur?
13:34Bronsadnolen_: oh I see. so you need to (analyze '(recur ..)) without having that throw an error?
13:36Bronsadnolen_: there's not much that you can do if that's what you need.
13:39Bronsadnolen_: there's a really ugly hack that comes to mind.
13:39dnolen_Bronsa: yes but that's actually all I need I think. If the error is thrown I know the user used recur.
13:40Bronsadnolen_: you could use clojure.lang.Compiler/LOOP_LOCALS in conjunction with &env to create a fake loop wrapping the expr
13:41cljnoobHi
13:41dnolen_Bronsa: got an example?
13:41Bronsadnolen_: one sec
13:41cljnoobI am using http-kit to provide http client functionality, and I have a need to supply a query which will have an embedded double-quote
13:42cljnoobIf I do (def myquery "SELECT something from whatever where name=\"somename\"")
13:43cljnoobshould I expect this to be normalized or would this be submitted with the escape character?
13:44ambrosebsdnolen_: is it an issue using tools.analyzer if the pattern introduces some locals?
13:44dnolen_ambrosebs: I haven't use tools.analyzer before, would that be a problem?
13:45whodidthiscljnoob: not sure what you up to but you should probably look into https://github.com/krisajenkins/yesql for sql queries
13:45dnolen_in CLJS the analyzer just warns, not a hard error by default about unresolved locals
13:45ambrosebsdnolen_: I would imagine it's an error
13:46ambrosebsbut you could probably extend the local env somehow
13:46dnolen_ambrosebs: when running the analyzer just now w/ unresolved locals I didn't see any issues, i.e. (analyze '(let [x y] x) ..) works
13:46ambrosebsah cool
13:48cljnoobwhodidthis it is not a sql query
13:48cljnoobI was just giving an example
13:48cljnoobwhat do I have to do print a string that has quotations without the escape sequence?
13:49whodidthisoh, that should work then
13:50ambrosebsdnolen_: I guess a local from a pattern could shadow a macro, so you'd get a bogus expansion.
13:50cljnoob(def webquery "param1:\"somevalue\"")
13:50cljnoob#'crdf.core/webquery
13:50cljnoobcrdf.core=> webquery
13:50cljnoob"param1:\"somevalue\""
13:51cljnoobso I would like to print param1:"somevalue" instead
13:51whodidthis,(pr-str "param1:\"somevalue\"")
13:51clojurebot"\"param1:\\\"somevalue\\\"\""
13:52cljnoobthat is more backslashes even
13:52dnolen_ambrosebs: hmm good point ... though if a macro is expanding to a recur ... not sure if this some I should care about
13:52dnolen_s/some/something
13:53ambrosebsdnolen_: yea pretty insane case
13:53whodidthis,'param1:"somevalue"
13:53clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: param1:>
13:54ambrosebsdnolen_: if you can extract the locals easily from the pattern, might as well extend the current local env.
13:54ambrosebsI don't know how to do that.
13:55dnolen_ambrosebs: getting the locals out shouldn't be too hard ... need to think about it
13:57Bronsadnolen_: http://sprunge.us/WLQZ?clj
13:58Bronsadnolen_: ugly but it works fine
13:58Bronsadnolen_: also (analyze 'y (empty-env)) is working for you probably because you're not running all the t.a.j passes, thus you're not running `validate`
13:59dnolen_Bronsa: works for me, but how does that let me know that recur occurred somewhere?
13:59dnolen_Bronsa: do I just need to write my own pass? (simple enough if that's the case)
13:59ambrosebsBronsa: please keep a bag of tricks/examples like this somewhere :)
14:00Bronsadnolen_: depends on what recur you need to know of
14:00Bronsadnolen_: e.g. do you need to know if there's a recur referring to an outer loop only
14:00Bronsaor do you need to know if e.g. the expr contains (loop [..] (recur ..)) too?
14:00dnolen_Bronsa: no
14:00dnolen_just an unmatched recur
14:01Bronsadnolen_: if you only need the former, run check-recurs on the ast & look for (-> ast :body :recurs)
14:02dnolen_Bronsa: (:recurs (:body (loops/check-recur (analyze '(loop [] (recur)) (ana-jvm/empty-env)))))?
14:03Bronsadnolen_: yes
14:03dnolen_Bronsa: hmm, returns nil
14:04Bronsa:/ sorry. check-recurs wasn't really intended to be used on its own. run loops/annotate-loops instead
14:07danneuDoes anyone know what part of a commit object is being signed when you `git commit --gpg-sign _`?
14:08Bronsadnolen_: if you use t.a.j/analyze directly you get all of that out of the box btw.
14:09dnolen_Bronsa: I think this works + your loop/local code + annotate-loops
14:11Bronsadnolen_: cool. btw just FYI you should probably use (t.a.passes.jvm/emit-form (:body ast)) as your expr after you've done the analysis rather than using the original expr.
14:11Bronsadnolen_: else you might do macroexpansion twice
14:11mi6x3mhey guys, can someone provide me some insignts how idiomatic a function I wrote for a 4clojure task actually is?
14:13ddellaco_mi6x3m: just post it here if it is a one-liner, or put it in a gist/refheap and put that link in. Don't need to ask
14:13mi6x3mthe code is here: http://pastebin.com/xFxpAzdm and it's a clone of nth
14:13mi6x3mfor this task https://www.4clojure.com/problem/21
14:13dnolen_Bronsa: why do I need emit-form? the only I need to do is detect recur?
14:13mi6x3mnow I am aware one can do it with (take (drop .... ))
14:13mi6x3mbut I wanted to throw IndexOfOutBounds exception
14:14dnolen_er I mean the only thing I need to do is detect recur
14:14mi6x3mwhich won't be possible with the 1 liner
14:15Bronsadnolen_: I mean, what you're doing is more or less (defmacro match [..] (let [.. analyzed-exprs (mapv my-analyze exprs)]) (.. ~@exprs)))
14:15Bronsadoing it like this means that the exprs will be macroexpanded twice: once by t.a.j and once by clojure
14:16ddellaco_mi6x3m: I wouldn't tend to use a Java Exception if I could avoid it, but just return nil probably
14:16dnolen_Bronsa: hmm, I guess I don't really see that as much of an issue - macroexpansion is not a huge bottleneck :)
14:16Bronsato avoid macroexpanding twice you need to do (defmacro match [..] (let [.. analyzed-exprs (mapv my-analyze exprs) exprs (mapv emit-form analyzed-exprs)]) (.. ~@exprs)))
14:16dbaschmi6x3m: my solution to that problem was simply .get :P
14:16Bronsadnolen_: sure, but macroexpansion can be side-effecting though
14:16mi6x3mddellaco_: yes, but I wanted to throw the exception as extra points :) just to get it as closer to nth as possible
14:17dnolen_Bronsa: yeah this is not something I care about either :)
14:17Bronsadnolen_: ok :)
14:17ddellaco_mi6x3m: you may also want to use loop instead of a recursive function
14:17ddellaco_mi6x3m: ah, fair enough
14:17mi6x3mbut does it look idiomatic enough :)
14:17dbasch,(.get [1 2 3 4 5 6] 10)
14:17clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
14:18dbasch,(.get [1 2 3 4 5 6] 4)
14:18clojurebot5
14:18ddellaco_mi6x3m: instead of (empty? coll) the usual idiom is (seq [])
14:18mi6x3mdbasch: well, you see, I am trying to learn something here and not call interop :)
14:18ddellaco_er, (seq coll) rather
14:18ddellaco_,(seq [1])
14:18clojurebot(1)
14:18ddellaco_,(seq [])
14:18clojurebotnil
14:18dbaschmi6x3m: in that case don’t worry about throwing the exception
14:18mi6x3mah, I see, thanks :)
14:19ddellaco_mi6x3m: and yeah, I think using loop would be more idiomatic compared to the let defined fn you're using, but whatevs
14:20mi6x3mddellaco_: afaik loop/fn with recur doesn't matter as clojure will optimize the tail recursion into iteration?
14:21dbaschmi6x3m: it you’re trying to loop, writing loop/recur makes your intent more clear
14:21ddellaco_mi6x3m: sure but you asked about what was idiomatic
14:21mi6x3mah, yeah!
14:21mi6x3mgood point
14:21mi6x3mthis is what I asked about, you are right :)
14:21ddellaco_mi6x3m: I mean, I'm not one to hate on people doing things differently...don't get me wrong. ;-)
14:21mi6x3mnope, perfectly clear point, it is more clear
14:23dbaschbtw, nth is a function that’s probably optimized for underlying collections, so it’s not the best pick for idiomatic clojure if you really want it to be as good as the original
14:24mi6x3mdbasch: yeah, it's optimized for the different types, I just checked, I wanted functional equivalence, nth is far more powerful
14:25mi6x3mthanks guys :) very useful insights
14:25mi6x3mall very helpful
14:26mi6x3mthank you very much
14:30ddellaco_mi6x3m: why didn't you want to use something like take though?
14:30ddellaco_,(defn nnth [c n] (if (< (count c) (inc n)) (throw (IndexOutOfBoundsException.)) (last (take (inc n) c))))
14:30clojurebot#'sandbox/nnth
14:31ddellaco_(nnth [1 2 3] 0)
14:31ddellaco_er
14:31ddellaco_,(nnth [1 2 3] 0)
14:31clojurebot1
14:31ddellaco_,(nnth [1 2 3] 2)
14:31clojurebot3
14:31ddellaco_,(nnth [1 2 3] 3)
14:31clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
14:31mi6x3mddellaco_: count would execute the lazy seq
14:31mi6x3mI wanted to avoid that
14:31ddellaco_mi6x3m: ah, okay. I never think about much other than solving the problem when it comes to 4clojure
14:32dbaschyou could avoid the count with a map-indexed
14:33mi6x3mhow do you mean?
14:33dbaschand take-while your index is less than n
14:33ddellaco_oh, nice, yeah
14:34mi6x3myes, that would work
14:35mi6x3mbut what was that map-indexed thing?
14:35dbasch,(doc map-indexed)
14:35clojurebot"([f coll]); Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item."
14:36dbasch,(map-indexed #(do [%1 %2]) [:a :b :c :d])
14:36clojurebot([0 :a] [1 :b] [2 :c] [3 :d])
14:37mi6x3mah yes, dbasch, this is an elegant solution
14:44Frozenlo`The low-constrast Liberator's webpage is killing me
14:44mi6x3mcan someone tell me why (seq coll) is more idiomatic than (empty? coll) ?
14:45Frozenlo`I don't think it's more idiomatic
14:45Frozenlo`Here's `empty?' source: (not (seq coll))
14:46mi6x3mhm, I see
14:47nathan7So I found a language annoyance and wrote a patch to fix it, filed a JIRA issue etc — http://dev.clojure.org/jira/browse/CLJ-1419
14:47nathan7Anything I'm doing wrong there? It's my first attempt at contributing to Clojure.
14:48lxsameerwhat is the difference between slim, javadoc and normal version of clojure ?
14:50bbloomlxsameer: https://groups.google.com/forum/#!topic/clojure/sCCg6i-gue0
14:50bbloomlxsameer: if you're just getting started, use lein
14:50bbloom~lein
14:50lxsameerthanks
14:50clojurebotlein is http://github.com/technomancy/leiningen
14:51nathan7seems I get to sign and mail a CLA, whoo
14:51lxsameerbbloom: thanks buddy
15:50programmancerIs there a way to hook into the calls to println (or similar) in core.async go blocks?
15:50programmancer(with-out-str (go (println "Nope"))) returns "".
16:04mi6x3mclojure, how can I check what a reader form expands to?
16:05justin_smithprogrammancer: iirc, with-out-str uses dynamic binding, which is per thread, so the go block is already in another thread, and printing to that thread's *out*
16:05programmancerYeah, precisely.
16:05mi6x3mlike an anonymous function
16:06justin_smith,(macroexpand '#({:dont :do-this}))
16:06clojurebot(fn* [] ({:dont :do-this}))
16:06justin_smithlike that?
16:06justin_smith(probably the most frequent error in usage of anonymous fns)
16:06programmancerEssentially I want to test that a "print-everything-and-pass-it-on" chan actually mutates *out*.
16:07programmancerIt's hardly essential to test, though, I was just curious.
16:07mi6x3mjustin_smith: yes
16:07mi6x3mthanks
16:07mi6x3mperfect :)
16:07programmancerSo it's a channel that takes something, pprints it, and returns a chan onto which what it takes is put.
16:08programmancerMostly for debugging, obviously.
16:08mi6x3mi didn't know the reader macros can be expanded as normal macros
16:11mi6x3mis there a way to get vector projection?
16:15mi6x3mclojure is there a version of take that has a start parameter?
16:16mi6x3mso a combination of drop and take
16:16FrozenlockI was going to say drop and take... I don't think it has its own function
16:19Frozenlockkind of a general question: any advice on how to deal with invoicing and subscription? general tips? (Like store the pricing inside each account to give you the ability to give different prices with rebates and stuff)
16:19Frozenlock'Stuff' being the most important, obviously :-p
16:20mi6x3mFrozenlock: what are you working on?
16:21Frozenlockmi6x3m: In what sense? What industry? What kind of application? What part I'm currently coding?
16:22Frozenlock*which part
16:22mi6x3mFrozenlock: it seems to be a shop so I would ask about the current part
16:22FrozenlockWell, the invoicing part
17:14tuftFrozenlock: i've usually done that with positive and negative valued line items
17:14tuftit does get tricky if the pricing structure is really complicated, though
17:15tufti worked on one system where trying to codify their pricing revealed all these inconsistencies, heh
17:16Frozenlocktuft: the pricing is not complicated, but I know I haven't though of everything. When the problems bubble up, I don't want to be 'well, too bad I can't change anything in my pricing'.
17:16FrozenlockPositive and negative values seem to be the safest route I've seen so far
17:16Frozenlock*thought
17:17tuftreplicating the on-paper techniques always seems like a pretty good starting point
17:17tuftusers can get it more easily then too
17:32seangrovednolen_: I'm just getting around to actually experimenting with Datascript - how's it compare to the datomic interface? Seems like it has a few twists
17:33dnolen_seangrove: I haven't actually played around with it that much, just enough to see that I like the idea and I want to something like it to work well with Om
17:34seangroveWell, it didn't take you long to threaten a re-implementation then ;)
17:34dnolen_seangrove: yeah I have a private repo I'm hacking on here and there.
17:35seangroveGot it. Presumably close to the datomic interface, so porting shouldn't be a problem if you release it?
17:35dnolen_seangrove: yes my intention is for it to be as close to Datomic as possible, also thinking about performance from the get go.
17:37seangroveYeah, looking at the timing for some simple queries in datascript's current state, it'd be very, very difficult to get consistent 60fps. To be fair though, he mentions it in the readme.
17:37d0kyhello how can i rename file using clojure ?
17:37mi6x3md0ky: use the standard java api?
17:38dnolen_seangrove: yeah I think with a some tweaking you could easily query tens of thousands of datoms at 60fps
17:38seangrovednolen_: I'd hope so, but seeing the GC pressure for this kind of stuff makes me think it's going to be tough. You'd have to be mindful of it pretty early on in the design
17:38mi6x3mcould someone explain why (fn [str] (apply clojure.core/str (filter Character/isUpperCase str)))
17:39mi6x3mfails
17:39d0kymi6x3m: i tried (File/renameTo xml-file (str file-name ".xml")
17:39d0kymi6x3m: but it doesn't works
17:39mi6x3mclojurebot
17:39mi6x3mhow is it used?
17:40dnolen_seangrove: I'm not really concerned too much about that, reducers work :)
17:40d0kyxml-file (File. (str "."(java.io.File/separatorChar)"rss"(java.io.File/separatorChar)"settings.xml"))
17:40seangroveBut yeah, should work
17:41seangroved0ky: Also the fs library if you're ok with adding a dep http://raynes.github.io/fs/me.raynes.fs.html#var-rename
17:41seangrove~fs
17:41clojurebotIt's greek to me.
17:41seangroveclojurebot: fs is https://github.com/Raynes/fs
17:41clojurebotIn Ordnung
17:41seangrove~fs
17:41clojurebotfs is https://github.com/Raynes/fs
17:42d0kyseangrove: thanks i will try it
17:43mi6x3mseangrove: I am wondering why you can't use def with a java static method, any help for me?
17:43mi6x3mlike (def x Character/isUpperCase)
17:43mi6x3mit seems I can only invoke the method
17:43mi6x3mI understand it might not be a normal clojure function
17:44seangrove,(map Character/isUpperCase ["a" "B"])
17:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: isUpperCase in class java.lang.Character, compiling:(NO_SOURCE_PATH:0:0)>
17:45d0kyseangrove: thanks it works :)
17:45seangroveHrm, doesn't work for me :)
17:45seangrove,(map #(Character/isUpperCase %) (seq "aBcD"))
17:45clojurebot(false true false true)
17:46waynrwhy do clojure stacktraces always look like gibberish to me
17:46seangrovewaynr: We've tried to make it better, but people like technomancy refuse to accept the PR into clojure.core for it
17:47waynrthat's too bad...
17:47waynri usually just end up changing random stuff around until i am able to get to the next step in getting things to run
17:48seangrovewaynr: Actually, it's not too bad, you'll get used to it. There are some packages that make it better as well I think
17:48seangroveBut it isn't ideal, I agree
17:49waynrfor example right now i see java.io.FileNotFoundException: Could not locate clj_time/local__init.class or clj_time/local.clj on classpath: but i'm not sure what clj_time is or what i'm doing that is leaving it out of classpath
17:53waynrah, figured it out
17:55waynr"No such var: com.cemerick.pomegranate.aether/resolve-artifacts"
18:00waynrseangrove: thanks for the encouragement by the way
18:01seangrovewaynr: Keep at it ;)
18:02teslanickQuestion: is there something like (doto) that allows for multiple assignment (does doto allow multiple assignment?
18:03teslanickI have a dom node in clojure script that I want to set some properties on compactly without calling set! (.-blah node) over and over again
18:05amalloyteslanick: i mean, you can do it with doto, but it's not very pleasant: (doto node (-> .-blah (set! 1)) (-> .bar (set! 2)))
18:05teslanickGross. Oh well.
18:05amalloybut you can easily enough write a macro set-multi! or something
18:06teslanickIt might be easier to smash a new function onto the dom node that would let me use doto. :)
18:07teslanick(and the JS programmer in me comes out)
18:16dnolen_optimized case dispatch in ClojureScript master
18:16mi6x3many way to lazily append an element to a sequence in clojure?
18:16dnolen_not as fancy as Clojure's yet, but still a nice bump
18:22waynrinteresting, respolve-artifacts was added in Pomegranate 0.3.0 but for some reason Pomegranate 0.2.0 is being used
18:22waynrcan't quite tell why that is
18:24Glenjaminmi6x3m: i think http://clojuredocs.org/clojure_core/clojure.core/concat will do this
18:24clojurebotexcusez-moi
18:25dbaschmi6x3m: what exactly do you want to do?
18:37waynrif my lein plugin specifies pomegranate 0.3.0 and 'lein deps :plugin-tree' doesn't show any other library requiring pomegranate, why is pomegranate 0.2.0 being used? is it related to the version of clojure or leiningen that i am running?
18:38Glenjamini'd try throwing a debug line that prints out the classpath
18:39technomancywaynr: you can't override dependencies that ship with Leiningen itself
18:40waynr:/ is there a version of leiningen that uses pomegranate 0.3.0?
18:40arrdem|finalsyou could build one :P
18:42waynrthis is true...but probably wouldn't always be practical for my intended use case
18:43seangrovearrdem|finals: Get back to finals
18:43arrdem|finalsseangrove: fiiiine
18:43arrdem|finalstata
18:54waynrhmm so if i want to use the latest leiningen, should i just put https://github.com/technomancy/leiningen/blob/master/bin/lein in my PATH?
18:55waynri did that, doesn't seem to have worked
18:58waynrderp, nevermind wget doesn't automatically overwrite existing files
18:59waynrit's trying to install leiningen-2.4.0-SNAPSHOT which i have installed in ~/.m2/
19:01dbaschwaynr: why do you want to use an unstable version?
19:02waynrbecause it uses pomegranate 0.3.0 which has the cemerick.pomegranate.aether/resolve-artifacts function
19:02waynrpomegranate 0.2.0 does not have this function
19:02waynrso when writing a plugin it is apparently not available
19:03waynrokay so i have to copy the uberjar where the self_install shell function would normally put it
19:05waynror maybe update the lein bash script to search for the snapshot in ~/.m2 if LEIN_VERSION contains 'SNAPSHOT'
19:05waynror maybe i can get by without using resolve-artifacts
19:18nathan7I'm building a little thing for making DTrace more accessible from Clojureland
19:19nathan7I have a macro that looks like (defprovider trace MyApp start hello [int String] end)
19:19nathan7and the interface I'd like to have looks like (trace/start) (trace/hello 42 "Hello, world!")
19:20nathan7I'm rather unsure about just barging into the user's namespace and creating a publically visible sub-namespace though
19:21nathan7I was going for (create-ns (str *ns* "." name)), which would expand to (create-ns (str *ns* ".trace"))
19:21nathan7and then defining trace/start, trace/hello and trace/end in that namespace
19:22nathan7having that publically visible is a bit of a bummer, though
19:22nathan7I suppose I could do (create-ns (gen-sym)), but I'm not sure if that's a sane idea
19:29tuftman, clojars is really picky about pgp public key format
19:29tufthad to trim headers, etc.
19:30tuftwow abbreviated scp deployment is wicked though
19:31Glenjaminnathan7: how about ((trace :start)) ?
19:32nathan7Glenjamin: trying to make it feel like a real function though
19:32Glenjamin(trace!start) perhaps?
19:32nathan7I'm doing the (create-ns (gensym)) thing now, it seems to be working alright
19:33Glenjamini suppose if you're using it and the docs clearly say its going to create a namespace you should be fine
19:33nathan7I'm prefixing it with my module's own namespace now
19:34nathan7so I have like jsdt.provider.probe1234
19:34nathan7which you get imported as trace
19:34Glenjaminmakes sense
19:35nathan7no polluting namespaces I don't own
20:04amcnamaradnolen_: any recommendations for a cljs book, I dig your work with om
20:05dnolen_amcnamara: I don't know of anything beyond the O'Reilly one. I mostly suggest getting familiar with Clojure, ClojureScript isn't that different.
20:05amcnamaracool, thanks!
20:10servowhats the right way to do this: (assoc {} :foo "bar" (if (= 3 3) [:been "baz"]))
20:13Kitty-I'm hoping someone can help, I'm trying to figure out how I can 'escape' quotes. I'm connecting to Oracle and to create a new table, quotes are needed. i.e "CREATE TABLE "TEUSER"."TEMP" " however I am not sure how or if there is a way to escape the double quotes needed around "TEUSER."TEMP", I've tried googling and had no joy, perhaps there is a way?
20:14Glenjaminservo: more than one assoc?
20:14servowatcher.core=> (println "\"FOO\"")
20:14servo"FOO"
20:14Glenjaminnonono
20:15GlenjaminKitty-: for database stuff, you probably want to be using JDBC and whatever escaping facilities it provides that has knowledge of what is and isn't safe for use when talking to a database
20:16servoGlenjamin: how would i keep "state" of the previous assoc?
20:16Glenjaminservo: chain it
20:16servonot sure conceptually how to do that
20:16space-otterim not aware of a way to optionally chain function calls
20:16Glenjamin,(let [m (assoc {} :foo :bar)] (if (= 3 3) (assoc m :been "baz") m))
20:16clojurebot{:been "baz", :foo :bar}
20:17space-otter,(println "\"FOO\"")
20:17clojurebot"FOO"\n
20:17servo(inc Glenjamin)
20:17lazybot⇒ 4
20:17Kitty-Glenjamin: In the depencies list, I see it's using clojure.org
20:18Kitty-It's using the clojure jbdc
20:18Kitty-I did find http://stackoverflow.com/questions/16115465/easy-way-to-work-with-text-without-having-to-escape-quotation-marks-in-clojure so I will try \
20:19GlenjaminKitty-: http://clojure.github.io/java.jdbc/
20:19Glenjaminoh
20:19Glenjaminbut why are you typing the quotes?
20:19Kitty-Glenjamin: hmm? like why should they be in there or?
20:19Glenjaminhttp://clojure-doc.org/articles/ecosystem/java_jdbc/home.html#manipulating-tables-with-ddl
20:20Glenjaminin general, when working with databases you should let the DB library take care of putting quotes in the right places
20:20space-otterit's probably better to use a higher level API where you can pass queries as data structures instead of strings
20:20space-ottermore robust
20:20Kitty-API, hah I wish
20:21Kitty-It's just a command line tool
20:21space-otteri mean like the library Glenjamin is suggesting
20:21Kitty-hmm
20:22Kitty-Here is a snipit of the code (where I attempted to add "'s with an \ escape) http://pastie.org/9163779
20:23Kitty-Although based on Glenjamin's link, I can use something like...
20:23Kitty-(jdbc/db-do-commands db-spec (jdbc/create-table-ddl :fruit
20:27koreth_Can someone explain why if-let with a destructuring form tests true even if the destructuring sets everything to nil? Example:
20:27koreth_,(if-let [[x] []] :succeeds)
20:27clojurebot:succeeds
20:28koreth_,(if-let [[x y z] []] :succeeds)
20:28clojurebot:succeeds
20:28koreth_It wasn't the behavior I expected, which is a sign I don't understand if-let as well as I thought I did.
20:30space-otter,(if [] :succeeds :fails)
20:30clojurebot:succeeds
20:31koreth_Oh, right. Duh. Thanks.
20:31amalloykoreth_: the "if" part of if-let doesn't know/care about how you're destructuring the value. it just looks at the value you're testing, and if it's truthy then it destructures it
20:31koreth_For some reason I had it in my head that it was looking at the truthiness of the bound values. Thanks.
20:32space-otteriirc false is the only falsey value
20:32Glenjamin,(if-let [[x] (seq [])] :ok)
20:32clojurebotnil
20:32Glenjaminnot that that's particularly readable
20:32amalloyspace-otter: nil
20:33space-otterthat too
20:41Glenjaminwhat are the advantages of moving a lib to clojure contrib?
20:41seangroveIt's instantly obsolete?
20:41seangroveIf you want to make sure no one uses it in production, maybe.
20:42Glenjamini note that simple-check moved recently
20:42seangroveOh, no
20:43seangroveWell, if that's what you mean by contrib, then I think the advantage is that it can be used in core clojure testing
20:43Glenjaminright, yeah - not the old contrib
20:44Glenjaminnot sure what the correct term is now
20:44seangrove"I'm happy to announce the first release of the newest Clojure contrib library: test.check"
20:44seangroveSeems they call it that more or less as well
20:44seangroveSo, please excuse my joke
20:44Glenjaminit does seem to add a few barriers to contribution
20:44seangroveIt does, but ti's not really a big deal
20:45seangroveI didn't mind it at all for cljs contributions
20:45Glenjamini have no objections to signing a CLA
20:45Glenjaminbut my pull request to an MIT licensed project on github is now in limbo due to an imminent move to clojure.data :)
21:09coventryIs there a way to execute a defspec at the repl? (In cljs with double-check, if it makes a difference.)
21:12Glenjaminyou can just call it as a function
21:13Glenjaminwell, that works in simple-check - i asked the same thing yesterday
21:16coventryThanks, I may be confused by bad uninformative errors from the browser repl, then.
21:18coventryWhich namespace has such-that? Trying to get this example to run: https://github.com/clojure/test.check#clojuretest-integration
21:18coventryAh, generators.
21:22coventryAm I doing anything wrong here? The contents of the property def seem to run fine in the first line when tested with (every?), but I'm still getting an error when I try to run the defspec. https://www.refheap.com/85324
21:29Glenjaminit looks about right to me, but i'm no expert
21:29Glenjamini suspect the cljs version cannot just be called
21:30Glenjaminalthough the stack trace looks like it got into the body of the check
21:33tomjackis Writable insane?
21:33tomjack(Hadoop's)
21:39amcnamara4clojure's about to pass 555555 solutions :)
21:41amalloytomjack: for most X, hadoop's X is insane. but Writable seems okay to me?
21:44tomjackI feel vaguely that the 'Clojure way' would not include anything like Writable
21:45tomjackwhich makes me wonder -- is the Clojure way not satisfactory?
21:45tomjackI conjecturally reduce this question to "do we really care about boxing and allocation _that_ much?"
21:46tomjacks/care/need to care/
21:49tomjackI guess if you're writing a framework that you expect many java developers in many different contexts to use for many years, the question sounds different
22:49amcnamarayay, 4clj just hit 555555 solutions
22:50amcnamaracongrats amalloy
23:24cljnoobAnyone using Emacs Live? If so, how to get rainbow parens in a cider repl? Works OK when editing a file.
23:35nathan7I'm mucking around with *data-readers* at macro evaluation time — this seems to break when AOTing, though.
23:35nathan7When I use (when *compile-files* …) though, it breaks when *not* AOTing, but works perfectly fine when AOTing