#clojure logs

2011-11-29

00:06hhutchdnolen, or anybody else that knows: is the clojurescript/nodejs repl source public ?
00:08dnolenhhutch: https://github.com/swannodette/clojurescript
00:11hhutchdnolen: thanks, i appreciate it
00:11hhutchdnolen: i've been working on these http://hhutch.github.com/cljs-closure-demos/
00:12hhutchany help making them more idiomatic / "best practices" would be greatly appreciated
00:13dnolenhhutch: neat!
00:16dnolenhhutch: those look good to me - interop-y, but about what you'd expect from integrating w/ gclosure.
00:19hhutchdnolen: thanks. I don't know what the general community plans are, but with all that i'm learning from this, i'll probably help with any effort to write a wrapper library
00:20hhutchthere's a lot of stuff in the goog namespace to exploit
00:21dnolenhhutch: no gclosure community plans that I'm aware of. but yes it would be nice to have a cleaner interface to all the stuff that's there.
00:25hhutchdnolen: is there any new stuff since the conj with d3 ?
00:27dnolenhhutch: not sure, I haven't followed the d3 stuff closely.
00:27ibdknoxnew stuff in terms of what?
00:34hhutchibdknox: just wondering if anybody has released anything using d3/clojurescript since the conj
00:34ibdknoxI wrote a basic d3 in CLJS
00:35hhutchcljs-d3 ?
00:35ibdknoxno
00:35ibdknoxpinot has a visualization ns: http://github.com/ibdknox/pinot
00:36hhutchoh yes, i saw that before, i've been meaning to give it a shot
00:40scottjhhutch: maybe linked to github source page from demos page
00:48hhutchscottj: done. the demos page will be better as i get more time
00:58ibdknoxhttp://news.ycombinator.com/item?id=3289261
01:04duck1123good post
01:06duck1123I played with using the term "controller" with ciste, but it just didn't fit and ended up going with "actions" as the core of the app
01:14devnibdknox: you know, someone brought this up in IRC the other night which I believe prompted him to ask on the list (not sure on that)
01:15devnMy initial reaction was to agree it was worth bringing up (having a feeling you'd put some serious thought into it)
01:15alexbaranoskyamalloy, I will write it as a regular macro probably if there's no interest in a reader macro. Figured I might as well ask, and am enjoying the exercise of making changes to the clojure project, since I haven't done that before.
01:15amalloyalexbaranosky: no good as a regular macro
01:16amalloyactually you could probably reuse most of the code from my "real multi-line comments" patch
01:16devnibdknox: When I just re-read your response on the ML I realized that when I've mucked around with compojure, ring, etc. I found myself ending up with...basically...noir.
01:16alexbaranoskyamalloy, you think it can't be done as a regular macro?
01:16amalloycertainly not. (heredoc The following text should be a bunch of close parens ))))))))))
01:16devnibdknox: noir seems like a predictable stable state for a web app
01:17ibdknoxdevn: I think so too, Noir was extracted from apps I wrote
01:18devnibdknox: i found myself going through this feeling of uncertainty over and over where I'd think: "Where's the controller? Am I just making a mess?"
01:18ibdknoxlol
01:18devnthe truth is, adding more namespaces would have been a mess
01:19alexbaranoskyamalloy: I'd also like to see a non-regex-only way to write strings that don't need escaping - that and heredocs are things I use all the time when I have the option available, and they make manipulating strings that much less of a pain in the rear
01:19ibdknoxamalloy: I really wish it *could* be done as a regular macro though
01:20ibdknoxI'd love a way to have a set of characters magically turn into a string without having to write it as a string, but that's mostly just because it's more aesthetically pleasing for certain scenarios
01:21devnibdknox: i think the other thing is that with clojure the same "lines" between various aspects of the app melted away a bit. At exactly which point could you say it had exited the view and entered the controller's domain?
01:21alexbaranoskyamalloy, ibdknox I guess it can be done - in powered down form, where it obvioulsy doesn't accept right o parens as legal values
01:21amalloyalexbaranosky: that's how the " reader macro already works - it doesn't accept " as a legal value
01:21ibdknoxdevn: yeah, I don't think those boundaries make sense. You're better off modeling your domain directly
01:21alexbaranoskythat said: its inability to be written as a regular macro seems to give it legit reasons for existing as a reader macro
01:22amalloyand there are a zillion other problems with using it as a plain macro: the string you're heredoc-ing has to be syntactically valid
01:22amalloyeg, (heredoc [[[[[[) isn't possible without a reader macro
01:22ibdknoxyeah :(
01:22alexbaranoskyamalloy, sometimes though, you really don't care about ")", you might just want to write the equivalent: 'The Sarah said to Bob, "Hello"', without dealing with escaping
01:22devn(heredoc ~@'`[[[[[)
01:23teromcontrollers aside, how do you organize your "models" and "views"? i ended up with namespaces like app.model.entity and app.view.entity and it's sometimes confusing (for example both would be in a file called entity.clj, although in different directories)
01:23amalloyalexbaranosky: if you need to write that it should probably be in a config file, which you can write unescaped and slurp whenever you want
01:24devnalexbaranosky: What sorts of things are heredocs useful for?
01:24amalloyi mean, having heredocs wouldn't be a disaster, but it hardly seems worthwhile when we have so many other ways to quote and/or escape
01:24alexbaranoskyamalloy, you're making a lot of sense over there. Soooo why the heck is this not great reason to make this sucker a reader macro built-in?
01:24alexbaranosky:)
01:24amalloyhuh?
01:24ibdknoxlol
01:24ibdknoxsomeone is confused
01:24ibdknoxit might be me
01:24amalloyi think there are at least three of us in that club
01:25alexbaranoskyha
01:25devnWhy not just use ""? I'm not trying to dash any hopes or dreams. I'm just trying to understand why it's a valuable feature. Using "'s with escapes seems to work fine?
01:26devnThe annoying formatting of docstrings is proof that multiline strings in "s work just like I'd imagine a heredoc would, no?
01:26alexbaranoskydevn: why not? I don't understand why we want to avoid adding a language feature that almost all modern languages have?
01:26devnalexbaranosky: because we don't want to end up like Ada
01:27alexbaranoskywhat the heck is Ada? :)
01:27devnhttp://en.wikipedia.org/wiki/Ada_(programming_language)
01:27duck1123It's nice having the parsing kept simple
01:28ibdknoxlo;
01:28ibdknoxlol*
01:28ibdknoxwhat's ada :p
01:28alexbaranoskyIt's not like these kinds of additions would make the parser crazy complex - like amalloy said they're pretty straightforward
01:29ibdknoxyou do pay in cognitive load
01:30alexbaranoskyguess it depends how many of us are going to be reading the parser regularly, right?
01:30amalloyfwiw this is exactly the response i got for my #| multi-line comment |# patch. it was so obvious to me that we should have this feature
01:30devnalexbaranosky: I would agree with amalloy that it wouldn't be the end of the world if there were heredocs in clojure, but the chances of this rising to the top of the queue and being debated seems pretty unlikely given there are a number of issues being addressed in the next release.
01:30alexbaranoskywell, honestly I figured the interest wasn't there for it, hence asking on the dev list
01:30amalloybut nobody really wanted it
01:32ibdknoxwhen I said cognitive load, I meant for consumers of code not the people reading the parser :p
01:32alexbaranoskydevn: I mean, if I wrote it it wouldn't need to be near the top of their queue would it?
01:32alexbaranoskyanyway, moot point :)
01:32alexbaranoskygoodnight folks
01:33alexbaranoskyibdknox, I guess you're right, it would keep the syntax simpler, less squiggles, ticks and hash signs :)
01:35devnim still wondering with all honesty if there's a difference between a heredoc and using the current behavior of "
01:35devnI've always avoided them.
02:12accel_okay; everything I like
02:12accel_except lein startup time
02:12accel_too slow
02:13accel_it needs to go from 5 seconds
02:13accel_to somethign lower
02:13accel_like 0.05 seconds
02:13accel_how can we make this happen?
02:13amalloyaccel_: never going to happen on the jvm
02:14accel_i have disk and memory to spare
02:14accel_why can't I have a "preloaded jvm"
02:14accel_where all it deos is mmap a file into memory
02:14accel_and viola, it's a running JVM ?
02:14Chousukeyou can run a persistent jvm instance
02:14amalloycake and jark do something like that
02:14accel_that soudns good
02:14accel_can lein use persistent jvms?
02:15devnibdknox: still around?
02:15amalloybut the jvm will never let you mmap a file into a running jvm - they couldn't guarantee bytecode integrity, etc
02:15amalloyit's something being planned as a possible optional feature for lein, now that it's merging with cake
02:15accel_wait wait
02:15accel_cake and lein are merging?
02:16amalloyas of the conj
02:16devncake's team is joining the lein project
02:16Guest61397¹
02:16accel_http://stackoverflow.com/questions/3906276/whats-the-difference-between-cake-and-leiningen looks good
02:16accel_cake uses persistent jvm
02:16accel_why is it not lein joining cake ?
02:16accel_i like persistent jvm
02:17devncake has done a better job from a usability standpoint. i hope that gets into the water.
02:17amalloybecause everyone uses lein? lein has way fewer bugs? it doesn't matter who's "joining" who?
02:18devnaccel_: amalloy is right. lein enjoys pretty widespread adoption
02:18amalloyi mean, i use cake, i work on cake. it has some cool features. but i start up the jvm so rarely that lein is fine
02:19amalloyand i end up doing enough "just in case" `cake kill` that i don't get much of a boost from the persistent jvm
02:19devnwell, a lot of the time I want to kill my persistent JVM so I can open up a new swank
02:19devnafter a lein deps
02:19accel_don't you have to startup the jvm every time you want to test your clojure app?
02:19devnaccel_: no, I work in the REPL
02:19amalloyswank, slime, emacs. never kill your jvm again
02:19accel_you write actual code in the repl?
02:19accel_how do you save it to disk?
02:19devnyou paste it into your source file :)
02:20amalloyaccel_: the way hiredman was telling you earlier (that was you, right?)
02:20devnaccel_: it's really a great way to work.
02:20accel_amalloy: that was me
02:20accel_but I wasn't listening
02:20amalloyi write it in a source file, and swank sends it to the repl for me
02:20accel_how does this way work?
02:20accel_so you write files on disk
02:20amalloyyou can do it the other way if you want, and i guess devn does
02:20accel_then load them into the repl?
02:20accel_and the repl basically never dies?
02:20amalloyin broad strokes, yes
02:20devni do both, depends on when I'm experimenting or building
02:20devnsome of the architecture gets done up top, but then i monkey with subexpressions, threading, etc. in the REPL
02:21devnsort of like madlibs :X
02:21devn(that's a really scary analogy)
02:22devn(and reflective of clojure's strengths at the same time)
02:22amalloyif you ever find yourself terrified of a madlibs-based analogy, i have to wonder how you came to live in such an otherwise low-stress life
02:22devnverb, noun, verb the noun, (-> noun, verb)
02:23devn(verb (adjective noun))
02:26devnamalloy: you did a syntax highlighting update recently, yeah? What do you think about highlighting the left and right hand sides of a (foo/bar) differently?
02:27amalloythat was brehaut
02:27amalloyi guess mine is the one on github
02:27devnamalloy: either way, do you think that would work?
02:27amalloydevn: it's certainly possible? i'm unclear on "would work"
02:27brehautim not sure i follow
02:28devnamalloy: it's sort of a readability concern
02:28devnparsing the namespace every single time could be reduced with some different highlighting
02:28brehautdo you mean the namespace and name of symbols and keywords?
02:29devnbrehaut: yeah: (ns foo.core (:require [hello.core :as world])) (world/people)
02:30brehautdevn: the brush doesnt know about namespace globals specifically atm.
02:30brehautit does rudimentary local tracking
02:30devnbrehaut: i'll pose the same question to you as I did to amalloy, do you think it is useful for readability?
02:31brehautdevn: ive put a bit of thought into it and im not sure
02:32brehautat the moment things like head of form highlighting and local analysis provide a decent balance between useful highlighting and the occasional incorrect highlighting (or absence of highlighting)
02:32brehautdeterming whether something is a function, static method, method, class or constructor is mostly just guess work
02:33devnbrehaut: yeah, i suppose there's a balance, but I'm not sure where / would be abused in a way that could confuse the highlighter
02:33neotykGood morning everyone!
02:33brehautdevn: the problem is, when it gets it wrong (which it does sometimes) to exacerbates the problem
02:34neotykdevn: you mentioned ws-cljs, did you have any luck with it?
02:34brehautthe more highlighting rules, the more it implies that the brush is sure of the meaning of something
02:34devnneotyk: i have to admit that i wound up on a related problem for the same project, but it's still open in my browser and I've read a bit of source
02:35devnbrehaut: yeah, i can see the balance there
02:35brehautdevn: the other point is that theres already a lexographic marker for the namespace, name split
02:36brehauti leaned away from doing 'clever' tricks to highlight reader static seperate to the things they cling to
02:37brehautdevn: if i do swing back around to thinking highlighting namespaces seperately is a good idea, it'll definately be as a secondary class
02:37brehautdevn: so that consumers of the brush can control what the highlighting is with CSS
02:37brehaut(the way meta and quoting currently are)
02:38brehaut(because far out the default style sheet is a mess)
02:38neotykdevn: to run it you need to build against closure-library head
02:38devnneotyk: thanks for the tip. added a note in org-mode.
02:38neotykdevn: but even then you might have problems cause by ws protocol versions
02:39devnneotyk: that's fine -- I can hack around with it, was just curious if anything was already out there to peek at
02:41neotykaleph I built against depends on netty with some other version of ws: than version 10
02:42neotykand that one is not backward compatible with older ones
02:42neotykso keep also that in mind when hacking it
02:42neotykall is all I guess it is very early for websocket applications
02:55georgekhi, can anyone tell me what are the Sphinx-like doc tools typically used in Java/Clojure projects?
02:56devnneotyk: they're becoming pretty commonplace IMO
02:56devnneotyk: there has been a slow transition, but I think we're close
02:57neotykonce draft 10 is easily available on server, yes. as most browsers work with v10 only
02:58neotykdevn: I war writing it in a time where chrome was just pushing draft 10, so my app just stopped working, now it should be better, I hope
03:19patchworkman, suddenly > lein deps is taking forever to run
03:19patchworkand pegging my cpu at 99%
03:19patchworkwhat could cause that?
03:31tomojI see it taking forever sometimes
03:31tomojdidn't think to check cpu
03:32tomojI do `lein clean` and try again, usually works, but I'm not sure the clean actually helps at all
03:32tomojin other words I have no clue what could cause that..
03:32tomojintermittent network issues?
03:35patchworktomoj: hmmm… interesting. I'll try that
03:39amalloyi like to imagine that he's interested in trying out "intermittent network issues"
03:40tomojunplug the cord?
03:41amalloyor a ping -f of localhost scheduled as a cron job, i dunno man, but it sounds exciting
03:41hiredmanflex your cat5 until you get some wire fatigue
03:56patchworkYeah I can simulate the issue if I shake a magnet above the ethernet cord really fast
03:59patchworkand I mean approaching relativistic speeds fast
03:59ejacksonpatchwork: you must drink a lot of coffee
04:01patchworkI drink an amount of coffee approaching the mass of the universe
04:01patchworkthough time has almost stopped entirely
04:31BahmanHi all!
04:33tufflaxHi
04:34tufflaxIs the reference on clojure.org is up to date with 1.3?
04:52changbeerif clojure async story tied completely to threads, e.g. send and send-off. what if you building a web crawler, using send-off will result in many threads as the threads block waiting for io completion.
04:56changbeersend-off seems to be what is suggested meaning the thread pool will grow as large as the number of actions concurrently running even though most of them will be in an io wait state
05:21rrc7czis there any way to rebind (like binding for vars) something that was lexically scoped? for example (let [x 1] (defn foo [] x)) then do something like (binding [x 2] (foo))?
05:24tufflaxI would guess not, the binding created with let is not something the rest of the program should know about, so it doesnt make much sense for another part of the program to change it
05:28ejackson~tryit
05:28clojurebotExcuse me?
07:47neotykdevn: just updated my ws-cljs, new aleph works with chrome
08:07fliebel&(instance? Object nil)
08:07lazybot⇒ false
08:18clgv:O
08:25cemerickfliebel: is that surprising?
08:26fliebelcemerick: Not sure, I just hadn't thought of it. I had the "everything is an object" mantra in my mind.
08:26clgvnil/null is a special value. there are language concepts where each type has its own null-value...
08:26cemerickprimitives aren't objects either
08:27fliebelcemerick: I know, but ##(instance? Object 1) does work(I hope), because it wraps stuff, right?
08:27lazybot⇒ true
08:27cemerickright, you're benefitting from autoboxing there
08:27cemerick"benefitting"
08:27cemerickThat's equivalent to ##(instance? Object (Integer. 1))
08:27lazybot⇒ true
08:28fliebelRight, so why isn't there a Null box?
08:28clgvfliebel: what for?
08:29fliebel$source seque
08:29lazybotseque is http://is.gd/aZK2oD
08:29cemerickyou're looking for a sentinel?
08:30fliebelcemerick: No, I extended Object to my protocol, and then it bombed out, but seque is one example where a primitive nil is a problem.
08:31cemerickYou can extend nil to a protocol.
08:31fliebelcemerick: I know, I just hadn't anticipated the need to do that.
08:31cemerickah
08:31fliebelthe correct url is https://github.com/clojure/clojure/blob/1.3.x/src/clj/clojure/core.clj#L4721
08:32cemerickThere's a lot of strong opinions re: nullability as a general concept, esp. in ML and adjacent worlds IIRC.
08:32clgvlazybot needs an update^^
08:33fliebelcemerick: I suppose a non-primitive null would set the world on fire, but it'd be useful... sometimes.
08:34xdanypxhi
08:34xdanypx !list
08:35cemerickfliebel: you mean, so that a protocol extension to Object will handle nil cases too?
08:35fliebelcemerick: yea, and so that you can insert nil into queues and such.
08:36xdanypxhttp://itunes.apple.com/us/app/textual-irc-client/id403012667?mt=12
08:36cemerickThat's a serious conflation of concepts.
08:37cemerickObject and nil are diametrically opposed notions. Making the latter fit into a hierarchy headed by the former would be insanity.
08:37fliebelcemerick: I'm not saying it's a good idea, just that it's convenient... sometimes.
08:40cemerickwow, app store spam in irc
08:40clgv~guards
08:40clojurebotSEIZE HIM!
08:40cemerickhey, that worked! :-P
08:42ejackson~botsnack
08:42clojurebotthanks; that was delicious. (nom nom nom)
08:43ejackson~cemericksnack
08:43clojurebotGabh mo leithscéal?
08:43ejacksonit was worth a try...
08:43ejackson:P
08:45cemerickejackson: it's appreciated in any case :-)
08:45ejackson:)
08:47fliebelejackson: Maybe he has another prefix
08:48raek☃cemericksnack
08:50fdaoudcemerick: your book release date got pushed back again :_(
08:51fdaoudso in the meantime I'm reading clojure in action.. and doing review for programming clojure 2nd edition
09:12cemerickfdaoud: huh, so it has :-/
09:17fdaoudcemerick: are you guys all done with it? it is just up to o'reilly now?
09:34fliebelWhat does the Eclipse Public License say, in human language?
09:40clgvfliebel: "use me" ;)
09:41fliebelclgv: Ok, as long as it does not say "abuse me"
09:41fliebelclgv: Or in one sylable words :P
09:42Fossitoki pona?
09:43Fossioh, that's two :[
09:44clgvFossi: does toki pona reach the information theoretic bound? ;)
09:45fliebelFossi: Loyban rather, totally unambiguous.
09:46fliebelAt least you should be able to make a statement, run the interpreter and get an output. IllegalException ;)
09:48Fossiclgv: nobody knows i guess
09:49clgvFossi: the wikipedia entry read as if they wanted to maximize information per character ...
09:49clojurebotExcuse me?
09:50Fossihmm, not really
09:51Fossiit only has 123 words, so it's highly context sensitive
09:51clgv"Kisa designed Toki Pona to express maximal meaning with minimal complexity."
09:51clgvoh dont get me wrong I didnt mean soley on single characters
09:52Fossisince i don't know any experiment to create a big enough vocabulary, it's kinda hard to say whether it would be too ambiguous/limite to
09:52Fossitalk about things like licensing
09:53Fossibut most words are very short ;)
09:57Fossianyway, it's totally worth checking it out ;)
10:24noidifliebel, afaik, the EPL is pretty much the same as LGPL. i.e. do whatever you want with the code, as long as you make it (and your modifications to it) available under the EPL
10:24cemerickEPL does not mandate the open-sourcing of changes
10:25noidicemerick, http://www.eclipse.org/legal/eplfaq.php#MODDIST
10:26cemerickah, I thought you were saying open-sourcing was mandated even if used internally
10:27noidiheh, I don't think even the GPL goes that far :)
10:28jweissthat would be pretty difficult to enforce
10:28cemerickI've always avoided the LGPL because of various rumblings from the FSF about what constitutes a "derivative work"
10:29ejacksonwhat's the licensing story for services ? I build an webapp based on some GPL/EPL/LGPL. What sort of obligations do I have ?
10:29cemericki.e. Is an uberjar that contains LGPL'd classfiles a derivative work?
10:29cemerickejackson: None AFAIK, as long as you avoid insanity like affero
10:30ejacksonnever even heard of that... crikey
10:32cemerickAFAICT, it's mostly a foil for companies that want to do the "open core" thing.
10:33cemerickSimilar (but more extreme) to what MySQL AB did with the GPL.
10:33jweissi was under the impression that you can generally build any service off open source, and keep your own code secret, as long as you don't distribute
10:33pjstadigright
10:34pjstadigbut the Affero license was intended to close that "loophole"
10:34ejacksonyeah, that's an historical artifact though. How many of you ever actually distribute your code ?
10:34pjstadigit considers a service a "distribution"
10:34cemerickejackson: PDFTextStream is still my cash cow. :-)
10:34jweissyeah, that is an ever growing loophole which licences will eventually have to address
10:35pjstadigthe EPL allows you to combine EPL'ed code with proprietary code and distribute it as a binary without having to release the proprietary source
10:35pjstadigonly changes to the EPL'ed code must be distributed
10:36cemerickjweiss: except distribution and uptake are the scarce "resources", not contributions. All other things being equal, a project that has a liberal license will generally outpace one with a restrictive license.
10:38jweisscemerick: good point
10:39gtrakpdftextstream looks pretty hot, how long did it take you to make that?
10:40cemerick"hot"? :-D
10:40cemerickI might use that as a quote.
10:40cemerickgtrak: No way to answer that at this point. First released late 2003 IIRC.
10:41gtraki want a cash cow, too, but i have so many interests bouncing around in the head
10:41cemerickProbably has a couple of man-years baked into it, plus however many years of live-fire testing in absolutely absurd conditions. :-)
10:41gtraksounds like a good way to do it
10:43gtrakcemerick, so are you at a point where you pretty much get to do what you want from that?
10:44cemerickgtrak: I wouldn't say that, though I'm not entirely clear on what you mean either. :-)
10:45gtrakwell, you know, I'd love to be able to quit a job at any point and not worry about it, climb everest, that kind of thing :-)
10:46gtrakthough i'd probably still work
10:47cemerickah
10:47cemerickI'm hardly retired. :-P
10:49jheandergood morning!
10:50mdeboardhi
10:53jheanderhi!
10:53mdeboardhey !
10:53mdeboardok i'm done
10:53jheanderanyone here using midje for tests and mocking?
10:55Raynes~anyone
10:55clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
10:56jheanderthanks clojurebot :)
10:56Raynes:p
10:56fdaoudhaha
10:56fdaouddoes anyone know the best way to get some help?
10:59jheanderalright then: would like to mock a function called with some levels of nesting from my function-under-test, but since the FUT is defined in a separate file and namespace it always seems to resolve the original function first and ignore the mock. How can you get around this problem?
10:59jheanderThe documentation and examples on midjes home page all have the function and the tests in the same file and namespace. Nice for documentation and clarity, but rare in practice?
11:19algalSuppose I wanted to modify the Clojure reader to default to interpreting numbers as Integers rather than Longs. Is that very tricky? or is there a simpler way to produce the same effect?
11:19gtrakalgal, i don't think there's any performance benefit for that
11:19algalgtrak: I'm not doing it for perf.
11:20gtrakfor interop?
11:20algalgtrak: yeah.
11:20algalthe long story is… :
11:21gtrakthe 'long' story :-P
11:21algalI've written clojure code to wrap a Java library. So I have a representation of certain java objects as clojure maps. I'd like to be able to print/read them. The java objects use Integers. Those integers will get printed to numbers and read back in as Longs.
11:21algalSo if take my java object, convert it to clojure. print it, read it, convert back to java, the object is now different -- all its Integers have been turned into Longs.
11:22algalThis is bad because the Java library actually expects them to be Integers (they're keys).
11:22gtrakalgal, well you should be using a constructor to create the java object, or setters and getters, no? is it a pojo?
11:23algalI could go through all my code and force Long->Integer conversions. but if I could just do a dynamic binding that modified the reader for the duration of certain functions that would suffice.
11:23algalgtrak: they've got getters and setters but they're quite messy beasts and they are hard to construct accurately.
11:23gtraki just don't understand why the object can be created with a Long instead of an Integer if it has a Integer field?
11:23algalIt has an Object field.
11:24algalThis is the object: https://vaadin.com/api/com/vaadin/data/util/HierarchicalContainer.html
11:24gtrakso, the lib expects an Integer in an Object field, and can't deal with a Long, odd :-)
11:24algalIn particular. the addItem(Object itemId) method is the one that needs to be fed Integers instead of Longs.
11:25gtrakoh i see, it's some kind of rendering component
11:25algalgtrak: it can deal with a Long, but it will generate Integers on its own in the future and treat them as distinct from the Longs. And then when I print/read, I'll get a collision.
11:25algalgtrak: actually a data container backing a rendering component, but you get the idea.
11:25gtraka collision? you mean with hashcode/equals problems?
11:25algalcollision with (Integer 5) == (Long 5).
11:26gtrakright
11:26algalThe Java object behaves as if (Integer5) is a distinct key from (Long 5)
11:26algalBut once I print/read, clojure's reader will clobber that by turning those two distinct items into two items with both having a key of Long 5
11:26Wild_Cat,(= (.hashCode (Integer. 5)) (.hashCode (Long. 5)))
11:27clojurebottrue
11:27gtrak(.equals (Integer. 5) (Long. 5))
11:27gtrak,(.equals (Integer. 5) (Long. 5))
11:27clojurebotfalse
11:27algalyeah, the Java object is relying on equals() to define equality of key objects. This is my problem.
11:28algalvalue identity vs object identity strikes again….
11:28gtrakwell, i think it's just as easy to funnel your maps through a post-processor, i doubt you'll have a performance bottle-neck, and it would be more clear than reader magic (which you can't even do)
11:29sharmsI have a (for loop over a directory walker which will return a sequence of all the directories that match a regex -- how do I not add nil values? In other languages I would use next or continue (it looks like maybe I should use recur?)
11:29algalgtrak: ah. well if redefining the reader is not a practicable option, then I guess it's moot!
11:30algalgtrak: bummer. that would have allowed a single point of change.
11:30gtrakalgal, rather, I think it would be unclear if you could, AFAIK you need a custom build for that right now
11:30Wild_Catit's interesting. I'd have expected Integer(5).equals(Long(5)) to be true. Probably not ==, but .equals, sure.
11:30gtrakWild_Cat, too bad, sucka
11:30sharmsI made a paste bin -- I just want to eliminate the nil's from being returned
11:30sharmshttp://pastebin.com/TqUHBs4G
11:30Wild_Catthat really is backwards.
11:31sharmsalso I have only used clojure today, so if you see anything there which doesn't make sense let me know
11:31gtrakWild_Cat, I'm sure if they fixed it, it would break code elsewhere :-)
11:31algalgtrak: custom build? No thanks. I'm already too far off the reservation.
11:31Wild_Catgtrak: oh, sure. Yay for legacy ;)
11:31Wild_CatJava's equality semantics have always been a mess, really.
11:32Wild_Cat(which I mostly blame on primitive types not being part of the object hierarchy)
11:32leafwwhat can possibly cause this: Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: clojure/lang/AFunction
11:32leafwI am doing:
11:32leafw,(eval (read-string "[255 255 255]"))
11:32clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:33leafwok clojurebot doesn't what that ... but it works as standalone, and fails when the string comes from a function that, I've tested, gives exactly that string
11:33algalWild_Cat: why weren't primitives weren't in the object system? Seems so braindead, but they must have been thinking something..
11:33gtrakalgal, performance parity with C++
11:33Wild_Catalgal: I suspect what they thought was "C++ did it"
11:34algalBut that doesn't explain it. You can keep the primitives in the object system and handle the treatment of them under the hood, no?
11:34Wild_Cat(of course, using C++ in the context of a discussion regarding a braindead language feature is barely a step above PHP)
11:34Wild_Catalgal: yeah, but when you do that, you sacrifice some performance. Java did it with autoboxing in 1.5
11:34sharmsso if I have a loop that returns values, is there no way to eliminate returning a nil, and I have to use map to remove it later?
11:34Wild_CatPython has had it since the beginning, and it's noticeably slower than Java for number-crunching ops
11:34gtrakalgal, well, python needs numpy for fast numbers, that's a C extension
11:35Wild_Cat(and the boxing/unboxing cost is mostly to blame)
11:35algalI may be confused, but my understanding is that in-vs-out-of-the-object system is a separate issue from uses-boxing-or-unboxing.
11:35Wild_Cathowever, I have no objections to sacrificing some performance in the name of retaining language semantics that make sense.
11:36algalFor instance, I believe Common Lisp allows unboxed mathematical operations and the numbers are still in the object system. Could be I'm wrong.
11:36clgvsharms: if you 'map something and get nil values in the result you kann switch to 'keep and it's done
11:36gtrakwithin clojure, you get good semantics, the further lower-level you go, the worse it gets
11:36leafwis (eval (read-string ...)) somehow thread-context dependent?
11:36Wild_Catalgal: it's linked -- see, if you want numbers to be part of your object system, you can't simply map them to underlying C types, you need to construct proper classes
11:36Chousukethere are ways around it
11:37jheandersharms: you could change walk-directory into a lazy-seq. That would be more idiomatic and solve your problem
11:37Wild_Catbut yeah, Java got around that with autoboxing in 1.5. Now you can call methods on ints and all, but if/when you do you incur a performance penalty.
11:37algalWild_Cat: Are you quite sure about that? I know that's what's said about Java's choices, btu I remember reading somewhere that Java's choices here were actually being dictated by earlier errors int he language design.
11:37ChousukeWild_Cat: not like that, that's just a compiler hack
11:37Wild_Cat...and it doesn't solve the fact that equality semantics are still moronic, because of the need to retain backwards compatibility
11:38ChousukeWild_Cat: I mean you can have ~primitive numbers that have object semantics, but it requires trickery
11:38Wild_CatChousuke: oh. I am disappoint.
11:38algalchousuke: "trickery"?
11:38Wild_Catin fact, Java sacrificed *all* its operators on the altar of slight-performance-improvement.
11:38Chousukealgal: tagged pointers :P
11:38clgvsharms: that would be a clojure solution: (defn walk-directory [dirpath pattern] (map #(.getPath %)  (filter #(re-matches pattern (.getName %)) (-> dirpath File. file-seq))))
11:39sharmsok so there is basically no way to say 'dont return anything this iteration' in clojure, and that is intended because it's functional?
11:40gtraki don't know why people expect java not to suck :-), it's fast, we have clojure, there are warts
11:40algalChousuke: hmm.. I must read more on this someday. Maybe it's in the Quienniac book.
11:40Chousukesharms: use filter :P
11:40clgvyou can use 'for with :let and :when
11:40Wild_Catgtrak: I stopped expecting Java not to suck after coding in it professionally for 2 years.
11:40jheandersharms: yes, you only iterate if you really *need* side-effects. For generating lists it is more efficient to use lazy sequences
11:41Wild_Cat(I was, however, surprised when I discovered C++ and realized that compared to it, Java was the epitome of non-suckiness)
11:41dnolenalgal: Common Lisp does this (maybe some Schemes), but that's a goal. tagging means you have less bits for the number itself.
11:41algalgtrak: I'm just curious what lead to that particular bit of it sucking. I'm not expecting otherwise.
11:41gtrakWild_Cat, indeed :-) I did C++ first, came into java biased against it, warmed up to it, now I hate it for different reasons than before
11:41Wild_Cathaha
11:42algaldnolen: thx. I thought I remembered that CL did this. Didn't realise how. Still leaves open the question of why the guys didn't use the same trickery for Java. I realise this is really a historical curiosity...
11:42gtrakI mean... but I don't actually care, because clojure makes the difference
11:43gtrakand honestly, if i were running a company that needed warm bodies, I'd pick java
11:43Wild_CatJava's history is tortuous and full of bizarre things. Remember that it was initially conceived as a language for embedded hardware with very weak hardware.
11:44ejacksonWild_Cat: yup, and I have used it there.
11:45Wild_Catejackson: you mean Android? :p
11:45ejacksonhehe
11:47sharmsso I can google this, what is the verbose written name of the '->' function
11:48ejacksonits the thread macro
11:49ejacksonsharms: Fogus' piece is good http://blog.fogus.me/2009/09/04/understanding-the-clojure-macro/
11:49duck1123minus_gt is a good name for it
11:49gtrakthrush
11:49TimMcI prefer to call it a "stitching macro".
11:49algalbtw, anyone know if there is or will be video available of the Strange Loop 2011 talks?
11:49gtrakhttp://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/
11:50ejacksongtrak: careful, its not actually,
11:50gtrakya
11:50zerokarmaleftalgal: they're being posted at infoq.com
11:50ejacksonbut you know that :)
11:50dnolenalgal: because Java folks were competing w/ C++. What do they need tagged numbers for?
11:50gtrakthat blog post was most enlightening
11:51algalzerokarmaleft: th
11:51algalzerokarmaleft: thx.
11:51gtrakthe thrush discussion shows the intent of -> and its shortcomings
11:51algalzerokarmaleft: Do you happen to know if they're all going up eventually?
11:52zerokarmaleftalgal: i'm not sure
11:53algalBeen wondering if dnolen's talk on the mapping dilemma is going to go online anywhere… :)
11:54gtrakalgal, https://thestrangeloop.com/news/strange-loop-2011-video-schedule
11:54zerokarmaleftif it's anything like http://www2.parc.com/csl/groups/sda/projects/oi/towards-talk/transcript.html, i hope so too
11:55algalgtrak: awesome, thanks!
11:56leafwhi all
11:57leafwwhen one runs an eval or a load-string and gets this error: "Caused by: java.lang.ClassNotFoundException: clojure.lang.AFunction" -- what does it mean?
11:57leafwI've been banging my head for half an hour
11:57leafwit cannot find the namespace? Well (str (in-ns 'tmp) (use 'clojure.core) "[255 255 255]") also fails
11:58leafwwhat is eval expecting in the string?
11:58leafwor the clojure.lang.Compiler, for that matter
11:59gtrakAFunction is a core clojure class
11:59leafwgtrak: indeed, and how come the compiler cannot find it?
11:59gtrakmaybe the classloaders are messed up somehow
12:00gtrakthat stuff's a can of worms
12:00leafwhum
12:00jolyyou're running this from a repl?
12:00leafwno
12:00leafwafter pushing ok on a dialog
12:00leafwparsing three values for a color in an array
12:00leafwor vector, rather
12:01leafwfunny part is that it run before, when there was only one click to a button. With two dialogs--two clicks--it does not run
12:01leafwit's all the EDT anyway
12:02clgvleafw: the (in-ns 'tmp) could be very evil if it 'tmp does not exist it does not automatically refer-clojure
12:02leafwclgv: it was just a test. Without it fails anyway
12:04clgvleafw: you are definitely doing something weird with your clojure environment - or can you give a reproducible example for a plain clojure repl?
12:05leafwclgv: I've been trying to reproduce it, but as I said, it involves GUIs and clicking on a button, then on an ok button of a dialog. Then it fails.
12:05clgvleafw: your project is clojure-only? or are you using clojure from java?
12:06leafwno, clojure only with imported swing classes
12:06clgvcan you come up with a minimal example to post in a gist?
12:07leafwclgv: will try
12:27leafwclgv: https://gist.github.com/1405585
12:28leafwthe gist shows a minimal non-working eval that throws Caused by: java.lang.ClassNotFoundException: clojure.lang.AFunction
12:28leafwpush the button to run it.
12:29clgvleaf: clojure 1.2 or 1.3?
12:29leafw1.3
12:29leafwthere must be something about eval that I do not know about yet.
12:30raekthat's a weird exception...
12:31leafwraek: it indicates an error perhaps in the class loader, as clgv suggested
12:31clgvleaf: so I put that code in the file "test.clj" (renamed the namespace) and fired up a 1.3 repl where I did (use 'test). I got the window and when hitting the button there was no exception
12:31leafwclgv: so did you get a print of the [255 255 255] vector?
12:31clgvyes
12:32leafwwell that means the error is in my setup
12:32leafwgood to know
12:32clgvit looks like it.
12:32leafwusing clojure 1.3.x 1f55cc0a9df8e98c79973a1f563bb68baab7bccd
12:33clgvI have the release 1.3.0 from clojars
12:34leafwclgv: thanks for the help. Will find out what is up.
12:35raekleafw: are you using a pre-release version?
12:35leafwfrom git
12:35leafwthe hash is above
12:36raekthen I guess you haven't heard about Leiningen :-)
12:36leafwraek: I did, I am just used to Fiji and its Script Editor for one-off scripts.
12:36leafwfiji.sc
12:37raekhrm, 1f55cc... should be the release
12:44leafwsee you all later
13:37gfredericksI'm using lein-difftest, which is nice and colorful but the colors turn into puke when I pipe to less. Is there a linux-tactic I'm missing? Is there a simple way to disable the difftest colors?
13:40TimMcgfredericks: There's an option to less to *keep* the colors.
13:41TimMcgfredericks: use less -R
13:48ibdknoxtechnomancy_: ping?
13:49technomancyibdknox: heya
13:49technomancyjust wanted to touch base re: your plans for korma
13:49technomancyyou mentioned at one point you were considering migrations and/or schema declarations. have you taken a look at lobos?
13:49Raynestechnomancy: Since you're here and in need of someone to bother you, do you have any clue what this guy is talking about: https://github.com/Raynes/tryclojure/tree/master/src/tryclojure/views
13:50ibdknoxtechnomancy: yeah, I'd prefer not to do it myself
13:50ibdknoxtechnomancy: migrations/creation-y things are scary
13:50ibdknoxthey cannot be wrong
13:50ibdknoxperiod
13:50technomancyRaynes: what guy?
13:51ibdknoxtechnomancy: he meant this one: https://github.com/technomancy/leiningen/issues/339
13:51RaynesOh. Wow.
13:51RaynesMy clipboard doesn't change to reflect my thoughts, does it?
13:51mdeboardlol
13:52technomancyRaynes: yeah... I dunno. I can see the reasoning, but I don't think it's a problem in newnew and don't know that it's worth fixing in 1.x.
13:52mdeboardAnd thank god
13:52Raynestechnomancy: I'm just not sure what he is even talking about.
13:52gfredericksTimMc: cool, thanks!
13:52Raynescat doesn't care if my file has newlines.
13:52technomancyRaynes: if you cat a file that doesn't end in a newline, your prompt ends up in a funny place I guess.
13:52RaynesYeah... I don't care.
13:52Raynes:p
13:53technomancythere are certain cases where it's absolutely crucial
13:53technomancylike crontabs--cron will just ignore the last line if it doesn't end in a newline
13:53technomancywhich is its own brand of insanity
13:53ibdknoxlol
13:53mdeboardOrite, that has actually bitten me before
13:53technomancyso anyway, it's good hygiene to get in the habit
13:54RaynesI guess I'll add the damn newlines then.
13:54amalloygfredericks: better yet, set an env var so that less always keeps the colors
13:54mdeboardRaynes: Dude don't give in. Just rewrite cron so it doesn't do that
13:54ibdknox+!
13:54ibdknox+1*
13:54amalloyexport LESS="-R"
13:56TimMcSurprisingly, there's no common GNU command that strips ANSI control sequences from stdin.
13:58yazirianyou don't have an awk 1-liner for that memorized? tsk
13:59amalloyRaynes: man, just set emacs up to put newlines at the ends of files when you save. they don't do any harm, and they make some programs/users happy
13:59RaynesI don't like making emacs do things to my files when I save them. I think I can manage on my own.
13:59yaziriananything you have to do yourself more than twice, the computer should be doing for you
14:00ibdknoxyazirian: sweet, it can code for me?
14:00gfredericksamalloy: That is indeed "better yet". I'm on it!
14:00yazirianonly on ipad
14:00technomancyI don't like hooks that modify the buffer automatically, but I make an exception for require-final-newline because it's a single byte
14:00duck1123I need to alias something so that curl always puts a newline at the end. I hate my prmpt getting messed up
14:00amalloyduck1123: just make your prompt start with a newline
14:01yaziriani wonder if you could construct a prompt that ... yeah, that
14:01yazirianonly smart enough not to make your terminal double-spaced
14:01amalloyfixes that issue, and makes things look less cramped when there *is* a trailing newline
14:01duck1123amalloy: will that put extra spaces in the terminal, I was thinking of piping curl to sed
14:02amalloyit will. i don't really understand why everyone thinks that's such an issue, though
14:02duck1123simply that I don't like it double spaced
14:03amalloywell, i guess that's good enough reason then
14:03gtrakavout!
14:03yazirianalias cat to pipe real cat's output to autodetect the final newline and insert one if it's not there
14:03technomancygtrak: it's avout time, amirite?
14:04gtrakyea, that's what I was hoping to exist for a while, simple and clean client code for distributed state
14:04duck1123yazirian: you would probably do that with a regular expression and sed
14:05yazirianrealistically you could probably get away with just always echoing the extra newline, since it would only ever happen on cat anyway. but that doesn't have the same nerd cred
14:05Raynestechnomancy: Aren't Leiningen committers meant to get stickers? You should get more stickers.
14:06technomancyRaynes: I still have a few of the first run. send me a sase.
14:06duck1123I've been feeling it more with curl. Hiccup doesn't put a newline, so it screws up my prompt whenever I hit a url
14:06Raynestechnomancy: PM me your address.
14:17y3dihey guys, im taking an AI course spring term. I was wondering if learning clojure would be appropriate for it?
14:18y3diI have some experience with scheme so i'm not completely new to functional languages
14:19amalloyi don't see why not
14:22technomancyisn't that a question for the instructors?
14:23mdeboardtechnomancy: How do you know we're not instructors for his course
14:23ibdknoxI'm teaching it
14:23technomancydun dun dun!
14:23mdeboardOMG me too!!
14:23ibdknoxDUDE
14:23mdeboardy3di: just kidding buddy :)
14:24kephale1clojure is used in a number of the ai courses i've been involved in recently
14:24duck1123If the instructor were in this channel, I'd say the chances would be pretty good
14:24y3diive been meaning to learn clojure some time, but i wanna know whether this course is a good excuse to learn it sooner rather than later
14:24TimMcThe instructor could answer whether it is allowed, but we might be better at saying whether it is useful (if the instructor hasn't used it.)
14:25TimMcy3di: I used it for a computer graphics class, so why not? And Lisp is classically an AI language.
14:25mdeboardy3di: Sounds like a great excuse.
14:25duck1123I still want to see an AIML processor done in clojure (the language for chat bots)
14:26duck1123There's program D for java, but it's really old now
14:27ibdknoxClojure works nicely for AI stuff
14:28y3dicool
14:28amalloyi bet even a clojure bot would tell you clojure is good for ai, right???
14:28lazybotamalloy: How could that be wrong?
14:28y3dianyone know of any AI tutorials dealing specifically with clojure?
14:28ibdknoxamalloy: he needs better yes responses :p
14:29amalloyibdknox: plz fork
14:29amalloyi wrote those in like two minutes, would love some more variety and/or better-ness
14:36TimMcamalloy: How did you decide on the mapping of {2 :no 3 :yes}? Coin flip?
14:36amalloyTimMc: partly based on my delusional beliefs about how fsbot in #emacs works
14:36TimMcor did you consider the most likely number of question marks for each?
14:36TimMcah
14:37TimMcamalloy: I had decided that it as because truth is stranger than fiction. :-P
14:37TimMc*was because
14:37amalloy*chuckle*
14:40TimMcy3di: ohpauleez mentioned that his company uses Clojure for some ML stuff.
14:46gfredericksI always assumed the map was based on ##(map count ["no" "yes"])
14:46lazybot⇒ (2 3)
14:50TimMcheh
14:50gfrederickspresumably amalloy would actually implement it as ##((comp (partial into {}) (partial map (juxt count identity))) ["yes" "no"])
14:50lazybot⇒ {3 "yes", 2 "no"}
14:51amalloyi'm not a totaly HOF-nut, i'm just nuts for juxt
14:51RaynesMan.
14:51TimMc(juxt count identity) is (comp reverse (annotate count))
14:52gfredericksamalloy: "nuts for juxt" is a phonetic gem.
14:52ibdknoxRaynes: ?
14:52RaynesOne line up. :p
14:52RaynesContext is always a backlog away.
14:53amalloyibdknox: he called me nuts for juxt in his talk. i'm just pleased as punch, but he seems to regret it
14:53ibdknoxlol
14:53RaynesHeh
14:53gfredericksoh so Raynes is the original author
14:54gfredericks$inc Raynes ; then
14:54gfredericks$dec lazybot
14:54gfredericksI quit.
14:54Raynes$kill
14:54lazybotKILL IT WITH FIRE!
14:56mdeboard,(inc Raynes)
14:56clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Raynes in this context, compiling:(NO_SOURCE_PATH:0)>
14:56mdeboardballs
14:56mdeboard,"balls"
14:56clojurebot"balls"
14:57TimMc(inc Raynes)
14:57TimMc&(inc Raynes)
14:57lazybotjava.lang.RuntimeException: Unable to resolve symbol: Raynes in this context
14:57RaynesGuys.
14:57TimMcYep, the bots hate you.
14:57RaynesIt's broken. Move on.
14:57mdeboardlol
14:57ibdknox~guards
14:57clojurebotSEIZE HIM!
14:57mdeboardI'LL NEVER LET YOU GO
14:57TimMchrmph, I thought you fixed it
14:57RaynesI did.
14:57RaynesDunno what's causing this.
14:57mdeboard$reload
14:57lazybotmdeboard: It is not the case that you don't not unhave insufficient privileges to do this.
14:57mdeboard:(
14:58TimMcRaynes: Pssh, where are your regression tests? :-P
15:00RaynesTimMc: Your mom has them.
15:00TimMcno, those are regression *testes*
15:03Raynes(dec TimMc) ; for implying that his mother has testes.
15:03lazybot⇒ 2
15:03TimMcSo, version numbers. Where did I recently hear something about someone trying to rework the notion of version number comparison in a distributed-development world?
15:04technomancyTimMc: rich talked through some of his ideas about that at the '10 emerging langs conference
15:05technomancynothing recent has happened afaik though
15:07TimMcOK, must have been oneof the videos I watched recently.
15:08TimMcI was just thinking about that stuff today -- what we really care about is major and minor versions, a revision number, and the "publisher".
15:08TimMcplus maybe some qualifier like SNAPSHOT
15:09technomancypart of the idea is you need another repository to host the DAG for the entire family of forks, plus a way of correlating a given mvn artifact to a point in that tree
15:09TimMcDo we really care about the DAG?
15:09technomancythen a way of specifying how you'd like to resolve conflicts
15:10technomancyyou need a way of determining which is the newer of two revisions
15:10TimMcIsn't it good enough to say, "this is the publisher we trust"?
15:10technomancynot for transitive dependencies
15:11TimMcPick one? :-/
15:11duck1123what's the best way to stream a tailed log file over a ring request. I know that if I return a lazy seq, that seq will be streamed, but if I use with-open, the stream will be closed. Anyone have any tips that won't leave a bunch of files open?
15:11technomancyyou need the whole DAG if you're going to be able to implement "pick the newest" as a conflict resolution strategy.
15:11technomancyother strategies may need other things
15:12_ulisesnot just that, if A depends on B and C, and in turn B depends on Dv1 and C on Dv2 you need to resolve that and sometimes "newest" is not enough
15:12technomancyit's a messy problem
15:13amalloyduck1123: so you anticipate that the whole lazy-seq will be realized eventually, and you want to close the filehandle exactly when that happens?
15:14duck1123amalloy: I assume that the browser page would be closed before that happened really. these files are constantally being written to
15:14duck1123I'm thinking of just actually calling tail as this app is pretty closely tied to linux servers anyway
15:15danlarkintechnomancy: heads off for lunch! http://www.gogmsite.net/_Media/1769_marie_antoinette_by_jo.jpg
15:15hiredmanduck1123: tail the log into some kind of broadcast queue, and have lazy-seqs and just consume from the broadcast queue
15:15clojureboteg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging
15:16duck1123hiredman: yeah, that's probably what I'll do. I'm already using lamina and aleph, but I'm not using aleph for the server just yet
15:17TimMc_ulises: Maybe I'm thinking too much of package management. E.g. on my Ubuntu installation, I want the ubuntu-modified versions of packages, not the originals.
15:18_ulisesTimMc: dependency management is a big faff and definitely not a trivial task
15:18_ulisesTimMc: more often than not, I think "well, just get the newest" but that's not the right answer sometimes
15:18_ulisese.g. package C depends on Dv1 because Dv2 changed API
15:19@chousertechnomancy: in case you haven't caught my earlier comments, I'm now using a lot more of your work than I used to (emacs starter kit, clojure slime/swank, and more lein than ever) -- it's all fantastic, thanks!
15:25_ulises,(doc juxt)
15:25clojurebot"([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"
15:30triyoMy app has a leiningen :main entry point. I have a few -main functions in other modules of my project I wish to run as separate java processes. Is there a way to say: lein run <which-main-module>
15:30triyoAnd if I don't specify <which-main-module>, run :main defined in project.clj
15:31hiredmanyou can pass lein run a namespace to run
15:34triyohiredman: thanks, thanks great. However I got -> Exception in thread "main" clojure.lang.ArityException: Wrong number of args (1) passed to: core$-main
15:34triyoHmm, that sounds like its firing :main in porject.clj file with one arg :-)
15:34triyoI'm certain
15:35triyoThat use to be a `run` lein plugin that used to work that way..
15:36triyoIs the built in `run` command the same?
15:37triyolein help -> "run Run a -main function with optional command-line arguments."
15:39TimMcWhat if there's no :main?
15:41TimMcHmm, that doesn't do it either.
15:41triyo-> :main namespace specified in project.clj
15:41triyo*no :main namespace specified in project.clj
15:41triyothat after running -> lein run mypkg.core
15:42triyothat has the -main fn
15:42triyoThis is what I used to use https://github.com/sids/lein-run and it seems to have been merged in to lein
15:43TimMcPhil is at lunch at the moment.
15:43triyosince 1.4. I'm running 1.4.2
15:44TimMclein 1.4? that's old
15:44amalloylike really old. i felt bad for having 1.5.2
15:44TimMclein upgrade
15:46TimMctriyo: "USAGE: lein run -m NAMESPACE[/MAIN_FUNCTION] [ARGS...]"
15:46TimMcso it needs both namespace and main's name.
15:46triyoOk great will test
15:46triyohopefully this upgrade is backward compatible.
15:46amalloyTimMc: [] is optional
15:46TimMcoops, misread
15:48oc_can i write this any shorter (fewer chars): (filter #(= 0(mod % 3))(map #(* 2 %)(take 1000(iterate inc 1))))
15:49amalloyyes, but why?
15:50TimMcoc_: Doing 4clojure stuff?
15:50oc_nah competing with a haskell friend :p
15:51oc_= much more important
15:51RaynesCompeting for the most insane solution?
15:51amalloy(range 1 1001), for starters
15:51amalloyand taking out your whitespace is just absurd
15:51TimMc&(filter #(zero? (mod % 3)) (range 1 1001 2))
15:51lazybot⇒ (3 9 15 21 27 33 39 45 51 57 63 69 75 81 87 93 99 105 111 117 123 129 135 141 147 153 159 165 171 177 183 189 195 201 207 213 219 225 231 237 243 249 255 261 267 273 279 285 291 297 303 309 315 321 327 333 339 345 351 357 363 369 375 381 387 393 399 405 411 417 423... https://gist.github.com/1406410
15:51oc_ah range takes a step
15:51oc_sweet
15:52TimMcactually...
15:52TimMc&(range 3 1001 6)
15:52amalloyhah
15:52lazybot⇒ (3 9 15 21 27 33 39 45 51 57 63 69 75 81 87 93 99 105 111 117 123 129 135 141 147 153 159 165 171 177 183 189 195 201 207 213 219 225 231 237 243 249 255 261 267 273 279 285 291 297 303 309 315 321 327 333 339 345 351 357 363 369 375 381 387 393 399 405 411 417 423... https://gist.github.com/1406415
15:52RaynesTimMc: = 0 is less characters than zero?
15:52TimMcRaynes: so what, I like zero?
15:53RaynesHe was going for short.
15:53TimMcThat's his problem. :-)
15:53oc_it's all about short, i initially used zero? and spaces ;)
15:53Raynes:P
15:54TimMcoc_: Actually, it looks like (range 6 1001 6) is what you want.
15:54oc_hehe thats perfect
15:54oc_now he shut up :D
15:54oc_thanks
15:54amalloyno, he'll win
15:54amalloyif he does the same algo in haskell it's fewer characters
15:54TimMcoc_: Wait until he asks in #haskell.
15:55amalloy[6,12..1001]
15:55TimMcnice
15:55amalloy$he [6,12..1001]
15:55lazybot⇒ [6,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,102,108,114,120,126,132,138,144,150,156,162,168,174,180,186,192,198,204,210,216,222,228,234,240,246,252,258,264,270,276,282,288,294,300,306,312,318,324,330,336,342,348,354,360,366,372,378,384,390,396,402,408,414,420,426,432,438,444,450,456,462,468,474,480,486,492,498,504,510,516,522,528,534,540,546,552,558,564,570,576,582,588,594,600,606,612,618,624,630,636,642,648,654,660,666,672,678,684,690,696,702,
15:55amalloyhm. not a very good gister
15:56gtrakhow does it know it's not x*3-6?
15:56amalloywut
15:56oc_hehe (range 6 2002 6) btw
15:56gtrak6, 12, 30, 84?
15:57amalloygtrak: that bears no resemblance at all to 3x-6
15:58gtrakhmm, let me put it another way, is the [6,12...1001] necessarily additive by a constant?
15:58amalloyyes
15:58amalloyalways arithmetic series
15:58oc_range is somewhat optimized tho, as I need to know the 1000 first chars to use it, thats why i iniitially didnt
15:58TimMcIt's not a generic pattenr-guesser like Seek-Whence.
15:58TimMc,(doc range)
15:58antares_hey guys. I have a Clojure project (that uses Leiningen) that has Java bits in it. I am trying to build a jar I can distribute but it fails to find classes to AOT. lein javac works fine, lein javac + lein test also work. What I may be missing?
15:58clojurebot"([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."
15:59TimMc&(take 400 (range 6 Double/POSITIVE_INFINITY 6))
15:59lazybot⇒ (6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96 102 108 114 120 126 132 138 144 150 156 162 168 174 180 186 192 198 204 210 216 222 228 234 240 246 252 258 264 270 276 282 288 294 300 306 312 318 324 330 336 342 348 354 360 366 372 378 384 390 396 402 408 414 420 4... https://gist.github.com/1406447
15:59TimMc(there's no [start step] form)
16:01oc_should be some sugar for infinity
16:01gtrak$he[2,4,8..1001]
16:01gtrak$he [2,4,8..1001]
16:01lazybot⇒ <no location info>: parse error on input `..'
16:01TimMcthree dots
16:01amalloyno
16:01gtrak$he [2,4,8...1001]
16:01lazybot⇒ Not in scope: `...'
16:02amalloytwo dots, no 8
16:02TimMcAh, it doesn't like the third number.
16:02oc_perhaps ∞ should = Double/POSITIVE_INFINITY ;)
16:02gtrakjust fail :-)
16:02gtrakgotta learn haskell
16:02oc_ups, guess irssi don't support 'all' utf8 chars
16:02TimMc&(let [∞ Double/POSITIVE_INFINITY] (range 6 ∞ 6))
16:02antares_technomancy: do you have a minute?
16:03lazybotjava.lang.OutOfMemoryError: Java heap space
16:03oc_:D
16:03gtrakTimMc, don't realize the seq
16:03amalloygtrak: there's some pretty cool stuff in haskell, but i can't bear to deal with the uncool stuff
16:03oc_you crashed lazybot ;)
16:03oc_&(+ 1 1)
16:03lazybot⇒ 2
16:03oc_nop
16:03gtrak&(let [∞ Double/POSITIVE_INFINITY] (take 5 (range 6 ∞ 6)))
16:03lazybot⇒ (6 12 18 24 30)
16:04TimMcOh, I thought lazybot wouldn't try to realize the whole thing.
16:04amalloylazybot: the unkillable
16:04gtrakthe problem with that seq is it'll stop incrementing
16:04TimMcthere's some dynamic var for that, yeah?
16:04gtrakright?
16:04clojurebotflatten |is| rarely the right answer. What if your "base type" is a list
16:04amalloyTimMc: there is, but eh. if the output is so long he can't gist it, you probably asked a dumb question
16:04TimMc:-)
16:05amalloy,(range 10)
16:05clojurebot(0 1 2 3 4 ...)
16:05amalloyand nobody wants THAT behavior
16:05TimMcheh
16:05gtrak&(last (take 100000 (range 6 Double/POSITIVE_INFINITY 6)))
16:05lazybot⇒ 600000
16:05gtrak&(last (take 1000000 (range 6 Double/POSITIVE_INFINITY 6)))
16:05lazybot⇒ 6000000
16:05gtrak&(last (take 1000000000 (range 6 Double/POSITIVE_INFINITY 6)))
16:06amalloy&(doc nth) ; gtrak
16:06lazybot⇒ "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
16:06lazybotExecution Timed Out!
16:06gtrak&(nth 1000000000 (range 6 Double/POSITIVE_INFINITY 6)))
16:06lazybotjava.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number
16:06gtrak&(nth (range 6 Double/POSITIVE_INFINITY 6) 1000000000))
16:06lazybotExecution Timed Out!
16:08mefestoanyone know of a good clojure/java markdown parser lib? google shows a posting by Brian Carper. Looking for alternatives
16:08TimMcgtrak: Depends on how the incrementing is done...
16:10gtrakTimMc, I'll let you know in a couple weeks when it's done
16:10TimMcyeah
16:10oc_markdownj perhaps?
16:10gtrakpegdown
16:10TimMcgtrak: Start higher. :-)
16:10TimMcdiscount
16:10mefestooc_: thanks. looking at clj-markdown atm
16:10mefestoi'll check it out tho
16:10TimMcwait, that's in Python
16:12gtrak&(type 10000000000000000000000000000000000000000)
16:12lazybot⇒ clojure.lang.BigInt
16:12TimMc&(take 4 (range Long/MAX_VALUE Double/POSITIVE_INFINITY 2))
16:12lazybotjava.lang.ArithmeticException: integer overflow
16:12TimMcha, works in 1.2
16:12TimMc(9223372036854775807 9223372036854775809 9223372036854775811 9223372036854775813)
16:12gtrakyea, how do you make it promote there?
16:13gtrakI know there's a +' but it doesn't apply
16:13TimMc$source range
16:13lazybotrange is http://is.gd/QPzkqk
16:13gtrakrange uses +
16:13TimMcwell, that's the 1.2.x version at least
16:14gtrak1.3 also uses +
16:14oc_see, a trivial lazy question, and a 1.3 bug is found
16:14oc_:D
16:14mefestogtrak: thanks for mentioning pegdown. i think that's the one
16:14TimMcoc_: Not exactly a bug... maybe a wart.
16:15gtrakyou can make a range' if you like
16:16gtrakhell, you could make a macro to do it for you right? just replace any + with +'
16:16TimMcTricky to do that correctly.
16:16gtrak&( +' Long/MAX_VALUE 1)
16:16lazybot⇒ 9223372036854775808N
16:17gtrak&(type (+' Long/MAX_VALUE 1))
16:17lazybot⇒ clojure.lang.BigInt
16:17gtrakTimMc, why tricky?
16:17oc_&(doc +')
16:17lazybot⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"
16:17oc_&(doc +)
16:17lazybot⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
16:18gtraksomething like (promoting (range 10))
16:19amalloythat doesn't really work
16:19oc_&(doc addP)
16:19lazybotjava.lang.RuntimeException: Unable to resolve var: addP in this context
16:19gtrakhaven't really learned macros yet, but why?
16:19jacortinas&(doc promoting)
16:19lazybotjava.lang.RuntimeException: Unable to resolve var: promoting in this context
16:19jacortinas,(doc promoting)
16:20jacortinasbah
16:20clojurebotGabh mo leithscéal?
16:20oc_is the inlined source / natives documented (outside the source)?
16:20gtrakjacortinas, it doesn't exist
16:20gtrakjust an idea
16:20oc_{:inline (nary-inline 'addP) ...
16:20amalloybecause it...doesn't make sense. macros only transform the source they can see, not source somehow inside of other functions
16:20duck1123it seems that clojuredocs isn't indexing clojure.core anymore
16:21amalloyif there were some bindable variable the macro could affect, then it would be possible. but i think *unchecked-arithmetic* is a compile-time flag and range was compiled without it
16:22gtrakah I see, you'd have to read the source into the macro
16:23gtrakprobably no way to make that not terrible, it makes an assumption that you can call the source
16:24oc_interesting: https://github.com/clojure/clojure/blob/aa7d26336faff6ccc65e4405e28e471221f35fc4/src/jvm/clojure/lang/Numbers.java#L500
16:25oc_think i need to spend some time in the clojure source
16:27TimMcagain with the complete lack of javadoc
16:27gtrakyea, srsrly
16:27oc_don't need javadoc for that clean source
16:28oc_imo
16:28oc_could have some doc on stuff like ops, though it's pretty obvious once you navigate to it
16:28brehauti am amused by the implication that 'clean source' could be defined as 'code without all that messy documentation'
16:30gtraki don't really understand this: if ((ret ^ lx) < 0 && (ret ^ ly) < 0)
16:30gtrakin addP
16:30gtraki guess that's just an overflow check?
16:31TimMcoc_: Source does not convey intent.
16:32oc_gtrak: yup
16:37oc_gtrak: it basically just checks that xor ret % is larger than x and y, otherwise it has overflowed.. i.e. -1 xor 1 < 0 (-2)
16:37oc_umm negate that
16:37oc_:)
16:40technomancyantares_: what's up?
16:45@chousertechnomancy: you rock, btw.
16:45technomancychouser: haha; thanks
16:46TimMcantares_'s question was at 15:49, where now == 16:36
16:46technomancyare you using version 2 of the starter kit?
16:46antares_technomancy: I figured it out but still curious
16:46antares_technomancy: I have a project that has Java bits and I wanted to create a jar to release
16:47antares_technomancy: as long as I had :aot in my project.clj, lein jar or lein javac, jar failed saying that .class file could not be found
16:47antares_technomancy: removing :aot helped. Is this expected?
16:47@chousertechnomancy: 2.0.3 I think
16:48technomancyantares_: so it was clearing out classes/ in between javac and compile?
16:49technomancyon the latest leiningen?
16:49technomancychouser: how's your team taking to it?
16:50@chousertechnomancy: One or two are resisting yet, but otherwise it's going swimingly.
16:50@chouserevil helps a ton
16:50technomancycool
16:51@chouserone thing I've been doing lately is adding project.clj stubs to other projects I have checked out so that they will work as symlink targets from my checkouts dir
16:51technomancychouser: yeah, some kind of lossy roundtrip functionality would be nice for poms
16:52antares_technomancy: possibly
16:52@chouserI'm far from knowing if this is even possible, but what would you think of allowing metadata on my own project.clj's dep vectors to specify the various paths to local projects, thus not needing a checkouts dir at all.
16:52antares_technomancy: but in the end with :aot in project definition I could not build a .jar
16:53jweissif i want to serialize a closure, how do I get the value of the surrounding fn's arrguments? eg, (defn makeclosure [x] (serialized/fn [] (+ x 1))) - technomancy's serializable.fn doesn't seem to be able to do this - throws NPE
16:53technomancychouser: paths to directories of .class files or what?
16:53@chouseryeah, :source-path, :compile-path, :resources-path
16:54@chousertrying to write code to understand pom.xml, build.xml, etc. seems hard and fragile, but specifying those manually in my own project.clj would be nicer in a couple ways than putting symlinks in a dir
16:55@chouserfor one, you'd look in one place to find what version of a thing you're actually asking for
16:55technomancychouser: maybe. I tend to shy away from placing arbitrary classpath entries in project.clj, and this isn't the first place I've seen a use for pom->project.clj conversion.
16:56technomancydoesn't work with ant, but do people still actually use ant?
16:56TimMcNot directly, I hope.
16:56@chouseras with checkouts, this would be strictly for development. Would be wise to have a git hook that disallows pushing such a project.clj, for example.
16:57@chouserRich still builds clojure with ant, I think, though I guess there's a valid pom.xml in there now too,
16:57hiredmanmvn package
16:57TimMcdesnailed
16:58chouserI suppose I should figure out how to make that the default
16:58TimMcnow you are no longer an annotation.
16:58chouserdon't deref me, man!
16:58TimMc s/man/bro/
16:58chouserbro!
16:59chousersorry, my hip cultural references aren't very hip.
16:59chouserI suppose hip itself probably isn't hip.
16:59amalloychouser needs a hip replacement?
16:59chouserhey now
16:59patchwork your ironic use of quasi-hip terms could be considered pre-hip
16:59TimMcThat's what my s/// was.
17:00algalIn gen-class, when defining methods with :methods, is there a special syntax for specifying Java array types?
17:00technomancyantares_: if you can narrow it down to a repro case it would be great to see an issue created for that
17:00amalloyalgal: you have to use their real java classnames, like ^"[B" for an array of bytes
17:01algalamalloy: Woah. Don't think I've ever learned about how to construct the real Java classnames. Can I interrogate them from the repl?
17:01antares_technomancy: I will try, the repo is open source and all it takes is a small change in project.clj. Tomorrow.
17:01TimMc,(type (bytes []))
17:01technomancythanks
17:01amalloysure
17:01clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [B>
17:01amalloy&(class (byte-array 0))
17:01lazybot⇒ [B
17:02TimMcMy way worked too. :-P
17:02amalloy&(class (make-array Integer 0))
17:02lazybot⇒ [Ljava.lang.Integer;
17:03TimMc&(class (make-array (class (make-array Long 0)) 0))
17:03lazybot⇒ [[Ljava.lang.Long;
17:04amalloyTimMc: ##(class (make-array Long [0 0])), i think
17:04lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Character
17:04TimMcwut
17:04amalloy&(class (make-array Long 0 0)), i guess
17:04lazybot⇒ [[Ljava.lang.Long;
17:04algalamalloy: Hmm. interesting. thanks. I notice make-array keeps type information, unlike to-array.
17:05hiredman,(to-array Long [1 2 3])
17:05clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$to-array>
17:05algal&(class (make-array java.util.HashMap (java.uil.HashMap.)))
17:05lazybotjava.lang.ClassNotFoundException: java.uil.HashMap
17:05hiredmanOh, well
17:05TimMc,(doc to-array)
17:05clojurebot"([coll]); Returns an array of Objects containing the contents of coll, which can be any Collection. Maps to java.util.Collection.toArray()."
17:05amalloyhiredman: into-array? i've never had a reason to use to-array, myself
17:05hiredmanamalloy: thats the one
17:05hiredmanyeah
17:06TimMcamalloy: I don't understand that error message you got at 16:55 EST.
17:07amalloyi don't either
17:08amalloy$javadoc Array newInstance
17:08amalloyi hate you, lazybot
17:08TimMc&(int [0 0])
17:08lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Character
17:08TimMcwelp
17:08hiredmansomeone here (ok, lots of someones here) had a bean generating macro
17:09TimMchiredman: gfredericks
17:09amalloyTimMc: okay, the reason you get that error message is c.l.RT/intCast
17:10amalloyit checks for Integer, then Number, and falls back on Character
17:10amalloyi love that for Numbers, it does intCast(longCast(x))
17:10TimMchiredman: https://github.com/fredericksgary/lib-2367
17:11hiredmanhttps://gist.github.com/34229 even I did I guess
17:13devthtrying to figure out macros / syntax quoting. can someone tell me why this expands to nil? https://gist.github.com/1406759 i was hoping it'd expand into 10 (println 1)s
17:13hiredmandevth: what does doseq return?
17:14devthnil.
17:14hiredmanso when you use doseq and you get nil back should you be surprised?
17:14devthbut i'm trying to expand the macro, not eval a fn
17:14devthtrying to write code that writes code and all that :)
17:16brehautdevth: i think hiredman is suggesting that your macro _executes_ a doseq, it doesnt quote it
17:17brehautdevth: the body of a macro isnt magically quoted for you; its 'just like' any other function other than it is run at eval time
17:17devthhmm. basically i'm trying to write a macro that just write the statement (println 1) 10 times to help me understand the nature of macros and syntax quoting.
17:18devthbrehaut: right. i don't want the macro to write a doseq expr. only a println
17:18brehautdevth: you wont achieve that through side effecting then
17:18amalloydevth: macros return code, remember, rather than (say) printing it to stdout
17:18algaldoes the REPL offer any shorthands for the lsat expression evaluated, the second-to-last expression, a la *, **, *** in CL?
17:19chouseralgal: *1
17:19amalloyif you want to return ten copies of a list, you need to construct another list that contains it ten times
17:19algalchouser: thx
17:19brehaut,(list* 'do (map (constantly '(println 1)) (range 10))) ; devth
17:19clojurebot(do (println 1) (println 1) (println 1) (println 1) ...)
17:19amalloyhaha brehaut, you couldn't think of a more foul way to do that?
17:19brehautamalloy: im sure i could :P
17:20brehautamalloy: but i couldnt think of a simpler way to emphasis the point
17:20TimMc,(doc list*)
17:20clojurebot"([args] [a args] [a b args] [a b c args] [a b c d & ...]); Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence."
17:20TimMcaha
17:20amalloybrehaut: well, you want cons and for, instead of list*, map, and constantly :P
17:20brehautfine
17:21brehautor
17:21brehautrepeat
17:21amalloybut i suppose i can get behind mentioning list* in here, because there always seems to be someone who's excited to hear about it
17:21amalloyoh, sure
17:21brehaut,(cons 'do (repeat 2 '(println 1)))
17:21clojurebot(do (println 1) (println 1))
17:21devthok, i think i follow...
17:22brehautlist* is also generally quite useful for macros, to avoid someone doing (cons foo (cons bar (cons baz …
17:22amalloyreally? i've used it a fair number of times but usually not in macros
17:22brehautamalloy: depends if you want to syntax quote or not i guess
17:23amalloyi was using it to manipulate key-sequences for update-in: "if the first element is :meta, replace it with the two elements :my-obj :meta"
17:25brehauthuh cool
17:46TimMcso list* is like a multicons.
17:47gtrakhow is it different from list?
17:47brehaut,(list 1 2 3 [:a :b :c])
17:47amalloy&((juxt list list*) 1 2 3 [4 5 6])
17:47lazybot⇒ [(1 2 3 [4 5 6]) (1 2 3 4 5 6)]
17:47clojurebot(1 2 3 [:a :b :c])
17:48brehautamalloy wins
17:48amalloybrehaut: juxt always wins
17:48brehauti should have known
17:48TimMclazybot is so much faster...
17:48gtrakoh, so I would have expected list to do what list* does
17:48amalloygtrak: i doubt it
17:49gtrak&(doc list)
17:49lazybot⇒ "([& items]); Creates a new list containing the items."
17:49TimMcgtrak: (list 1 2 3) is '(1 2 3)
17:49amalloyyou would expect (list 1 2) to throw an exception because 2 isn't a lsit?
17:49TimMc&(list* 1 2)
17:49lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
17:49TimMc&(list* ())
17:49lazybot⇒ nil
17:49gtrak&(doc list*)
17:49lazybot⇒ "([args] [a args] [a b args] [a b c args] [a b c d & more]); Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence."
17:50gtrakah
17:51amalloyif you prefer, you can think of list* as (partial apply list)
17:51gtrakyea, I was just trying to come up with that
17:53slyrus_so it's been a long time, but I'm trying to run lein again and I get: "Exception in thread "main" java.io.FileNotFoundException: -m (No such file or directory)"
17:59slyrus_well, using 1.6.2 and a lein self-install seems to fix the problem
17:59TimMcslyrus_: yeah, `lein upgrade` fixes a lot of things
18:00amalloyi run lein upgade when my car runs out of gas, just in case
18:02slyrus_hmm... "The upgrade task is not meant to be run from a checkout."
18:03amalloyif you're using lein from source, you want to git pull
18:03amalloyupgrade is for stable versions
18:04technomancyif you pull, be sure to use the 1.x branch
18:04technomancymaster is in turmoil for 2.0
18:05amalloy"in turmoil". i need to start describing my projects this way
18:07slyrus_yeah, I figured that out and switched to 1.6.2. I guess I should use the 1.x branch instead of the 1.6.2 tag though.
18:09jodaroheh
18:09jodaro1.2.3-chaos4
18:14slyrus_now onto my next problem... how do folks who use both CL and clojure go about using slime these days?
18:14technomancyit's ... not a pretty picture
18:15slyrus_bummer. I was hoping things would have improved in my absence.
18:15technomancynobody really uses CL anymore
18:15hiredmanso did all the other absent cl people
18:17devthhow would I check if something is a java.util.regex.Pattern?
18:17algalslyrus_: I gave up on trying to use them together in one emacs installation.
18:18algalslyrus_: I keep Quicklisp-maintained current version of slime in aqua emacs, and it keeps working fine.
18:18algalThen I installed all of technomancy's toolchain into plain vanilla emacs, and I use that for clojure.
18:18algalslyrus_: and then there's an ugly conditional in my init.el.
18:19algalslyrus_: I was using mrBliss's fork of swank-clojure, but it requires you to use a frozel old version of SLIME, and I'd rather stay on the Quicklisp reservation, so I gave up on that.
18:19slyrus_technomancy: the swank-clojure README says "...Common Lisp, which has a distinction between interpreted code and compiled code". I would say that the distinction is between loading code and compiling code.
18:20blakesmithdevth: Can't you introspect the class using the 'class' method?
18:20hiredman(doc instance?)
18:20clojurebot"([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"
18:21devthhiredman: thanks. wasn't having any luck googling.
18:21technomancyslyrus_: because slime's "load" commands don't always imply interpreted code?
18:21hiredmanfuh
18:21devthblakesmith: yep, instance? was what i was looking for.
18:21hiredmandunno what that "Evaluates x" is there for
18:21hiredmanall functions evaluate their arguments
18:21hiredmanwell, all functions have their arguments evaluated for them
18:21technomancyslyrus_: if you don't have any slime-contribs set up, you might be able to get along OK with M-x clojure-jack-in since that bootstraps the clojure-compatible slime
18:24slyrus_technomancy: yes, it's true that load doesn't necessarily imply interpreted code -- that's an implementation detail. I'm trying to understand why CL's notion of compilation/load relates to the overloaded reload-all.
18:25technomancyslyrus_: clojure just has "compile", so originally the load commands just did the same thing as the compile commands
18:25technomancybut slime doesn't expose reload commands, so I repurposed the "load" varians
18:25technomancyvariants
18:26slyrus_OK
18:33jacortinasanyone have experience getting vimclojure and nailgun working?
18:59schaeferi'm writing a webapp with the webapp written in clojurescript. i'd like to share code between the client and the server (things like input validators). does anyone have any suggestions for best practices? how to organize the code, build tips, etc
19:01adamesterlinejava4lf
19:02alexbaranoskyhow do I make myself enter so magnanimously?
19:02alexbaranoskythe trumpets and all
19:02stuartsierraalexbaranosky: Type /me followed by whatever you want.
19:03alexbaranoskythanks
19:03cemerickUsually the guards show up when I enter.
19:04alexbaranoskynice
19:04stuartsierraLisp has no wrong sides!
19:05cemericknewlisp might be the wrong side of the lisp tracks.
19:05slyrus_stuartsierra: I was informed earlier that "nobody uses CL anymore"
19:06cemerickI kid, I kid.
19:06technomancycemerick: hehe
19:06slyrus_cemerick: heh!
19:06slyrus_ah, common ground :)
19:06technomancyslyrus_: I meant no one in this channel
19:06cemerickslyrus_: dying breed, dying language as far as anyone can tell
19:08cemerickI wonder what the attrition rate of CLers to some flavor of scheme are (vs. other language X).
19:08slyrus_low, I'd guess, but, clearly I'm biased
19:08slyrus_he not busy born is busy dying
19:09slyrus_It's alright ma, i'm only consing
19:09slyrus_next y'all are going to tell me that nobody listens to Bob Dylan anymore either
19:10cemerickslyrus_: that's my uneducated impression too, but I can't imagine why
19:10peteriserinswhat's wrong with this minikanren -> logic translation http://pastebin.com/UMNMZNd2?
19:11cemerickThat is, I can imagine a CLer not finding Clojure hospitable (the JVM is a big pill to swallow if it doesn't align with your needs), but there's a number of killer schemes.
19:11technomancyCL is the last holdout of people who don't consider lisp-2 a mistake
19:11slyrus_I can handle the JVM. It's the slime/swank/bifurcation/incompatibilities that seem to cause the most headache for me
19:12technomancymay explain why they're not keen on switching to schemes
19:12cemericktechnomancy: you think that's really a driving factor?
19:12cemericklisp-1 is so *obviously* better :-P
19:13technomancyI dunno, it's all I've got by way of explanation
19:13technomancyelisp folks at least are embarrassed about it. =)
19:13cemerickYeah. Who can't love a language with a symbol called FUNCALL?
19:13stuartsierracemerick: But haven't you ever wanted to write (list list (list list)) ? :)
19:13hiredmanwell, you can
19:14hiredman,(list list (list list))
19:14clojurebot(#< clojure.lang.PersistentList$1@82226f> (#< clojure.lang.PersistentList$1@82226f>))
19:15cemerickstuartsierra: you should write an interpreter for a novelty language that supports only `list` symbols and lists; call it Buffalo.
19:15stuartsierraheh
19:16stuartsierraI wrote a CL->Perl FFI, some considered that a novelty language. :)
19:16cemerickThat's downright baroque!
19:18technomancyslyrus_: all that stuff would be simple if the slime devs would just agree to cut stable releases
19:18technomancybut I've complained enough about CVS Cowboy release management in here already
19:19brehauttechnomancy: do you need a time machine to work on clojure-swank ?
19:20technomancyif I needed a time machine it wouldn't be so bad; but for it to be required for all the users too is a problem =)
19:20stuartsierraHow long 'till we fork SLIME?
19:20brehautfar out, i have cvs installed
19:20technomancystuartsierra: waiting for a volunteer
19:20technomancyI certainly am not going to do it
19:21hiredmanstuartsierra: it more or less has already happened
19:21hiredmanthe symbols just haven't been renamed yet
19:21cemerickThat's like having good memories of MacGyver.
19:22airolsonexcept that MacGyver was still enjoyable
19:23cemerickThat doesn't seem possible. :-)
19:23cemerickMan, all that emacs-fu lying about, and no one wants to take on a local poster child for worse-is-better?
19:24brehautcemerick: im confused, isnt that unix?
19:25cemerickbrehaut: we need crazy, but not *that* crazy
19:25brehautbut but everyone loves writing parsers!
19:25brehautdont they?
19:26cemerickparsers?
19:26hiredmanif you love writing parsers why would you use lisp?
19:26hiredmanit is the simplest thing to parse
19:27brehautlets pretend i never said a thing
19:41amalloyaw, is clojure.reflect new in 1.3?
19:41hiredmanyes
19:47stuartsierraHey check this out: https://github.com/stuartsierra/clojure/tree/clj322
19:47stuartsierraNew solution to transitive compilation
19:47stuartsierraSet *compile-files* to :interop to emit files only for interop forms (gen-class, deftype, etc)
19:48cemerickstuartsierra: queued
19:48stuartsierra:)
19:48cemericki.e. it's in a browser tab :-P
19:49amalloyso if anyone has an urgent request for cemerick, please send him a browser virus and then ask him very nicely
19:49cemerickI respond only to groveling and patronage.
20:00stuartsierraI'll buy you a beer.
20:38jweissis there any way to get at the "closed over" values of a closure? with reflection I can see the package private field on the object, I think there's some reflection tricks to bypass the security, but was hoping for a more direct way
20:39amalloyno
20:40amalloyreflection tricks are unlikely to make you very happy either, since they will have munged or made-up names
20:42jweissamalloy: damn. is there a way to grab that value sometime before the object is created? (let's say I can call an alternate fn macro)
20:42amalloyyes
20:42amalloywith an alternate fn macro it's easy-peasy
20:42amalloy$google technomancy serializable fn seajure
20:42lazybot[Seajure's Profile - GitHub] https://github.com/Seajure
20:43jweissamalloy: i've been there, it does not work on closures. it calls .init on the closed over localbinding, which returns null
20:43jweissthrows NPE
20:44amalloyit was designed to work for closures, and has worked for numerous people in the past. possibly it's broken in 1.3, i dunno
20:44jweissoh hm, that is a forked version, let me see if it's different
20:45jweissno, it also uses .init. it didn't work with 1.2, i can try again now with 1.3
20:46jweissamalloy: at least with 1.2, it works with (let ...) locals but not closures
20:46amalloythose are the same thing. what is a specific use case that works and one that doesn't?
20:50jweissamalloy: (defn blah [x] (serializable.fn/fn [] (+ x 3))) (pr (blah 5))
20:50jweissthat does not work ^
20:51jweiss(let [x 5] (pr (serializable.fn/fn [] (+ x 3))))
20:51jweissthat works ^
20:52jweissthey both create LocalBindings, but the former, when you call .init, returns nil for some reason
20:52amalloywell, there's no init form
20:52amalloybecause it happens at macro time. seems to me like phil could have done this at runtime instead, but maybe not
20:53hiredmanjweiss: x isn't closed over unless it is a local
20:53amalloyhiredman: i either disagree or don't understand. inside that fn scope, x is closed over
20:54jweissamalloy: seems to be closed over based on inspecting the object created with reflection
20:54hiredmanamalloy: oh, I am misreading it
20:54amalloythe issue is that serializable/fn is checking the bindings at compile-time instead of runtime
20:55hiredmanright, but the bindings don't exist at runtime
20:55hiredmanclojure doesn't have reified environments
20:55amalloyhiredman: they don't have to. (serializable.fn/fn [] (+ x 1)) could expand to (with-meta (fn [] (+ x 1)) {:locals {'x 1}})
20:56amalloyer, {:locals {'x x}}
20:56hiredmanfair point
20:57brehauthiredman: ive heard you mention 'reified enviroments' before; what does that mean?
20:57amalloytechnomancy: when you have a sec: is there a reason you didn't do it this way, or just some oversight?
20:58hiredmanbrehaut: it means you have some construct that represents the execution environment available for inspection at runtime
20:58hiredmanallowing for things like eval getting access to locals
20:59brehautinteresting; is there an obvious example of a langauge that does have them?
21:00hiredmanwell, it depends if you make the distinction between the languages runtime having access to such a thing and the language have access to it
21:01jweissamalloy: how does storing {:locals ...} help? seems like at compile time the value of x isn't known, and by the time you look at the closure object, it's too late to get it
21:01brehauthiredman: so many things ive never considered before; i have n idea if i would make that decision
21:01hiredmanscheme's eval has access to the locals because the language's runtime has such a bookkeeping structure
21:02hiredmaninterpreters almost always have such a thing (I am not really sure how you'd design one with it)
21:02jweissamalloy: oh wait i think i see, the expansion contains the symbol x which at runtime will get the right value
21:04brehauthiredman: i think i follow; thanks
21:05amalloybrehaut: javascript has it, sorta
21:05amalloyand scheme does for reals
21:05amalloyjweiss: right
21:06brehautamalloy: ive not experimented much with javascripts eval
21:06amalloybrehaut: it's pretty shocking. i probed it a bit last time this came up, and was puzzled by how it behaved
21:07jweissamalloy: so the print-method will also need updating, the current one doesn't distinguish one instance of a closure from another
21:07brehautamalloy: its full of great evil – along with – thus i have avoided it
21:07amalloylike, the interpreter seemed to only save references to locals that it could prove you might need, but i forget how it knew that
21:08amalloy(function(s){ var x = 1; return eval(s);})("x") // returns 1
21:09brehautyikes
21:09amalloyoh, i remember how i confused it now. one sec
21:09amalloy(function(f, s){ var x = 1; return f(s);})(eval, "x") // ReferenceError: x is not defined
21:10brehautworse (function(s){ var x = 1; eval(s); return y})("var y = 2"); // returns 2
21:10amalloyso i guess that probably eval is not a "constant" function - every time you enter it as a literal you get a fresh copy of eval with bindings for your current set of locals
21:12amalloyanyway, my understanding is that in scheme you have to pass eval two arguments: an expression, and the environment in which to evaluate it
21:12amalloyand somehow or other there's a way to manipulate environments, or get a snapshot of your current env, etc
21:13hiredmanoh, actually I guess at least for racket eval is non-lexical as well
21:14brehautthe more i learn, the more i have to learn
21:25alexbaranoskybrehaut, it really does snowball
21:26technomancyamalloy: with-meta and :locals just wouldn't work
21:26technomancyit wouldn't allow for round-tripping
21:27technomancyjweiss: I'm up for changing serializable-fn for whatever it takes to get closures to work; what's committed now is kind of a half-hearted effort
21:27technomancyI was just poking around and if I knew the right methods to call it could surely be made to do what you want
21:27technomancybut none of that stuff is documented
21:29amalloyi don't understand how that doesn't allow for round-tripping? when you pr-str it you include the source and the locals, and you make sure to bind *print-meta* to true. then when you read it, you pull the meta out, wrap a let of the locals around the source, and eval that
21:33developernotesCan anyone explain why conj adds to the front of lists but to the back of vectors - seems odd to me.
21:34amalloyi guess your point is you want to be able to (eval (read-string (pr-str ...))), so you couldn't actually store it in a separate locals map
21:34amalloybut you can still do the same thing of making the locals be evaled at runtime instead of compile-time, which is the main point i was making
21:45TimMcdevelopernotes: conj puts the new element at the "most natural place" in the collection. For lists this is clearly the front. For random-access data structures like vectors, the obvious choice is the end, since that preserves indices.
21:45TimMc(good question, by the way)
21:46developernotesTimMc: thanks for the answer!
21:48mdeboardTimMc: Why is the front "clearly" the most natural place in a list?
21:48brehautmdeboard: because thats where its cheap
21:49brehautmdeboard: because lists are singly linked
21:49mdeboardBecause it doesn't have to traverse the whole list or what
21:49mdeboardah
21:49brehautyeah
22:01cgraya clojure list is a bit more sophisticated than a singly-linked list, though
22:01brehautits still not free to add at the end rather than start
22:02cgrayit might make more sense to say that conj puts the new element at the front because the list could be infinite
22:02cgrayi haven't looked at the clojure implementation, but i have a feeling that it might be pretty close to free
22:02amalloycgray: incorrect, lists cannot be infinite. you mean seqs
22:02cgray(as long as the list is realized)
22:02brehauta list cant be infinite
22:02brehauta seq can be infinit
22:02brehaute
22:03cgrayi stand corrected :)
22:03hiredmancgray: clojure lists are just linked lists
22:03amalloylazybot needs a $ninja'd brehaut command. but i'm not sure what it would do
22:03brehautamalloy: i dont understand
22:04amalloybrehaut: i got in there right before you. it would be fun to be able to say $ninja'd brehaut and have him say something clever
22:04brehautamalloy: ah right
22:04cgraywhen is there a benefit to using a list rather than a seq?
22:04brehautim slow today it seems
22:05brehautcgray: you usually don't want a list unless you are writing a macro
22:05hiredmancgray: lists have constant time counting
22:05amalloycgray: lists are (mostly) just counted seqs
22:07cgrayso is it fair to say that lists are seqs without the possibility of being infinite?
22:08amalloyi think so
22:09brehautcgray: at a mechanical level, being a seq is (just?) implementing clojure.lang.ISeq which list does
22:09cgraybrehaut: oh true, and vectors and maps do to right?
22:10cgrays/to/too/
22:10brehautcgray: nope
22:10brehaut,(map seq? [() [] {} #{}])
22:10clojurebot(true false false false)
22:10brehautthey are clojure.lang.Seqable though
22:11cgraymeaning that you can turn them into seqs?
22:11brehaut,(map (partial instance? clojure.lang.Seqable) [() [] {} #{}])
22:11clojurebot(true true true true)
22:11brehautyes
22:12brehauthowever, not everything that is seqable implements clojure.lang.Seqable
22:12brehaut,((juxt seq (partial instance? clojure.lang.Seqable)) "abc")
22:12clojurebot[(\a \b \c) false]
22:12cgrayok... it's an interesting distinction (between seqs and lists)... i guess i still don't quite understand why it exists
22:13cgraybut it's supper time here, so i will find out later :)
22:15brehautcgray: abstraction vs concrete implementation
22:17jweisshow do you evaluate something first (whose value is a symbol) and *then* quote it?
22:18jweiss(let [s 'x] (something s)) -> 'x
22:19amalloy(def something (partial list 'quote))
22:20amalloybut in a macro it's easier
22:20amalloy(or rather, in a syntax-quoted form)
22:20amalloy&(let [s 'x] `(do '~s))
22:20lazybot⇒ (do (quote x))
22:21jweissthis is a fn called by macro, so this isn't inside syntax quote... although it could be
22:21amalloyyou're still looking at serializable.fn, right?
22:21jweissamalloy: yeah, i've almost got it
22:21amalloyoh good, that means i don't have to
22:22jweissjust trying to do the {:locals {'x x}} part
22:22amalloyjweiss: technomancy is right though, you don't want a separate map, you want it shoved into the enclosing let form
22:24jweissamalloy: damn, i missed that part. that should simplify things a bit though
22:26jweissamalloy: was he right that it doesn't allow for round-tripping? seems like it would
22:26jweissassuming i modified the print-method to replace the symbol with the value
22:26amalloyi think it depends on what he means by round-tripping. if you want to be able to (eval (read-string (pr the-fn))), then you have to put all the necessary info into the ::source meta
22:27jweissamalloy: i don't think so
22:27jweissnot if you specify a print-method that combines the locals and the source
22:28amalloywell, sure. but then you just delay the work of mashing it together into a single let - it happens in print-method instead of in the macro
22:28jweisseg, ::source (fn [] (+ x 1)), ::locals {'x 4} -> (fn [] (+ 4 1))
22:28amalloyew ew ew
22:28amalloydo not do that
22:28jweissok ok i wasn't sure which way was best
22:28amalloy(fn [] (let [x 10] (+ x 1)))
22:29jcrossley3amalloy: i just finished reading this: http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging
22:29jweissugh so if there are compile time locals AND runtime locals we'll get something like (let [x 5] (fn [] (let [y 10] (+ x y)))) ?
22:30jcrossley3amalloy: it was very helpful, but it left me wondering, why isn't there a defmethod for java.util.Date?
22:30amalloyuhhh, i don't think there is such a thing as runtime vs compile-time locals
22:31brehautjcrossley3: that presupposes youd want to do anything with java.util.Date :S
22:31jweissamalloy: (let [x 5] (defn blah [y] (fn [] (+ x y 10))))
22:31jweissx is compile time, y is runtime
22:31brehaut(well, aside from take it behind the barn and put it down humanely)
22:31amalloyjcrossley3: why isn't there a print-method for java.io.File? or java.lang.Package? or java.lang.StringBuffer?
22:32amalloyjweiss: that distinction makes no sense. you just mean that one of them is closed over and one isn't
22:32jweissamalloy: one will be able to call .init and .eval, the other won't
22:32jweissi guess i'm not using the right terms
22:33amalloyif you call .eval in your implementation i think you're guaranteed to have the same problems you do with technomancy's impl
22:33jweissamalloy: i am only calling .eval when .init is non-nil
22:33amalloydoesn't matter
22:34jweisshm, it seems to be working - the meta has the right stuff in t
22:34amalloyyou haven't found the breaking cases yet, is atll
22:34jcrossley3amalloy: i think an argument could be made for *any* Serializable java object to be serializable without requiring the user to define a method to do so. unreasonable?
22:34jweissok, can you think of one?
22:34amalloy(let [x 10, y (inc x)] (fn [] y)) might be one
22:35jweissok i'll try that
22:35amalloyand if that works, then try ((fn [x] (let [y (inc x)] (fn [] y))) 10)
22:36jweissamalloy: ok you were right :) Can't call public method of non-public class: public java.lang.Object clojure.lang.Compiler$StaticMethodExpr.eval()
22:36jweiss
22:36amalloyyou want all the evaluation to be done in the expanded scope, not at macro time
22:38jweissamalloy: technomancy's impl puts the let outside the (fn ...) - any suggestion whether it should be outside or inside?
22:39amalloyneeds to be outside
22:39jweissok
22:39amalloyjcrossley3: meh. doesn't seem like much of a win to me, but i dunno
22:40amalloyfor example you have to deal with encoding bytes into a character stream and getting them back into bytes - what encoding do you use?
22:41amalloyjweiss: one sec, i'll push up a fork with a proposed change
22:42amalloyjweiss, technomancy: https://github.com/amalloy/serializable-fn/commit/8c83ca07a965ea084f0be525f5ba8e23938cddef
22:43jcrossley3amalloy: doesn't java's automatic serialiazation have to deal with the encoding issues, too? configurable somehow?
22:43amalloyhm, that doesn't actually work yet. i was testing the wrong thing
22:43jweissamalloy: that's sort of what mine looks like: https://gist.github.com/1407876
22:44amalloy*nod* that should basically work, assuming you got the quoting more-right than i did :P
22:44jweissoops, 1 too many levels of quoting in mine
22:45amalloyugh, maybe not. needs more work
22:47jcrossley3amalloy: and even without some general purpose marshaling scheme, Date seems as commonly used as some of the other datatypes for which print-dup is defined.
22:48jcrossley3plus it seems the most common example of a print-dup returned by google. :)
22:49devnAm I late to the party? Have we already exhausted conversation about heredocs this evening?
22:50alexbaranoskyhellllllllllll, no
22:50amalloyjweiss: okay, what about https://github.com/amalloy/serializable-fn/commit/472f8c85249fdcb30ca9948401cd0e8d5e2f9094?
22:50alexbaranosky;)
22:50amalloy(pr-str (let [x 10 y (inc x)] (fn [] y))) ;=> "(clojure.core/let [y 11 x 10] ^{:line 1} (fn [] y))"
22:50devnheh, alexbaranosky: You're tenacious, man.
22:50alexbaranoskywe've moved on to triple-quotes though I think
22:50devnI really dislike that :X
22:50alexbaranosky:|
22:50devnNot triple quotes, the idea of having moved on.
22:51alexbaranoskydev: ahhh... I read it as tenacious
22:51amalloydevn, the language-feature stalker, just can't move on
22:51devnThat post arrived as a "Well, Python does it with triple quotes" and then people started talking about triple quotes.
22:51devnI don't think we're there yet. However, I do have some questions which I will post to the list, but I wanted to discuss briefly.
22:52jweissamalloy: nice!
22:52alexbaranoskydevn: it does't have to be heredocs... I'm not really married to heredocs over triple-quotes
22:52amalloyjweiss: it seems to still have some rough patches though :P
22:52alexbaranoskydevn: I'd liek to hear your alternate views
22:52devnIf we enumerate a half-dozen proposals for heredcos, do we always end up with the same tradeoffs?
22:52brehauti just hope that whatever occurs doesnt encourage people to tunnel data into strings
22:53devn* How about string interpolation. String interpolation is related. Should we be having a discussion about some solution which combines both string interpolation and heredocs? Too far?
22:53devn* Might there be any benefits or problems for clojurescript as a result of changes made during the process of adding heredocs?
22:53devn** Does that matter? How much?
22:53alexbaranoskydev: I think we should... I put a spot for it on the wiki page
22:54jweissamalloy: only problem i see is calling .sym twice, i can try dropping this version in place of the old one, run it through tomorrow and see if there's any breakage
22:54devn* Could docstrings be changed to heredocs without breaking old docstrings?
22:54alexbaranoskydevn: I mean to say I think it could be discussed, since it's in the same realm... but I don't necessarily think we need interpolation
22:54amalloymeh, .sym is free, and happens at macro time anyway
22:54jweissah
22:54amalloyi mean actual breakages in my code
22:55amalloyeg, (fn [x] (let [y (inc x)] (fn [] y))) fails to compile at all
22:55alexbaranosky~nuclear
22:55clojurebotPardon?
22:55gfrederickscan anybody familiar with clojure.core.match confirm that I'm doing this right? Getting a compile error.
22:55alexbaranosky~sandwich
22:55devnalexbaranosky: They are very related. It should at least be considered even if it's rejected out of hand. To date I haven't seen anyone mention interpolation on the ML.
22:55clojurebotPardon?
22:55gfrederickshttps://gist.github.com/1407915
22:55nuclearsandwichheey that's me!
22:55jweissamalloy: stack overflow, nice
22:56alexbaranoskydevn: are you thinking of adding your thoughts to the thread /wiki page?
22:56devnalexbaranosky: I haven't read your wiki page yet, but aside from C. Granger's example (which I did find rather compelling) I haven't been able to muster any person examples beyond docstring usage examples which involve strings as input or output.
22:56amalloyjweiss: yeah, i'm building the metadata wrong somewhere
22:57devnpersonal*
22:57devnalexbaranosky: I don't know yet. I'm feeling like I might just sideline for a bit and see where the discussion travels. I need to condense some thoughts before I put out some half-baked opinions.
22:57alexbaranoskyI've only really got docstrings, test of xml/json/sql
22:58alexbaranoskybut it does seem like more people than just myself, think they make some sense at least on some level
22:59devnThey do...on some level, but I have this nagging feeling that for long strings you'll do a little bit of typing to escape double quotes, and for longer things you probably should be reading from a file, but that's just an immediate reaction, not a fact.
22:59gfrederickswell it seems to work okay for the latest snapshot release :/
23:00alexbaranoskytests are a great use case where seeing the text in front of you is valuable
23:01devnalexbaranosky: by the same token they may minimize the issue. If we cherry pick particularly hairy examples of escaping, does that actually confirm that this is a real problem worth solving, or does it confirm that we know how to find hairy examples?
23:01devnI could present to you examples where a heredoc could be helpful if I'm golfing, but would not provide any significant benefit, for example.
23:02alexbaranoskydevn: its tough to say
23:02alexbaranoskydevn: I need some time to let my excitement die down so I can see the issue a little more clearly
23:03alexbaranoskybecause write now I'd say that I think they make sense... I can only think of one modern language that doesn't have some form of super-string
23:03devnData helps. You could pull down a bunch of clojure toolbox projects and document escaped characters and do a little math to see how common the problem is with mainstream libraries.
23:03alexbaranoskydevn: darn good idea
23:04alexbaranoskylet me write that one down to do another time
23:04devnI mean, it's going to be a gradient. Granger's example is on one end clearly. There are many, many other examples on the other side of that gradient.
23:05jweissamalloy: does the fn symbol in the meta need to be explicitly changed to clojure.core/fn ?
23:05clojurebotclojurebot is not very good at indicating the difference between a return value and an exception
23:05devnTo assess the value it would be helpful to see how many escapes are common in certain contexts or situations.
23:05jweissthat's the only way i can see getting stack overflow - if it expands infinitely
23:05amalloyi don't think so, because it should be quoted, not evaluated
23:05alexbaranoskythese kinds of strings are not useful most of the time. Does something have to be useful a lot of the time to be added to Clojure? or, just really nice to have when you run into certain issues?
23:05amalloysure, it's clearly expanding infinitely
23:06devnalexbaranosky: Edge cases are edge cases.
23:06jweissamalloy: how can the values get set in the let, if it's not being evaluated
23:07devnThat's not saying they aren't worth considering. But they're *edge* cases, so my suggestion is to get a handle on the value by showing common contexts where heredocs would be useful.
23:07amalloythe let part needs to get evaluated, but not the body
23:07alexbaranoskyyeah, that's a great idea, which I will do
23:08alexbaranoskyon another note, programming is so much fun. I'm working on making midje's tabular tests not need to use variables that start with '?' -- tabular actually works, but something sneaky is causing stackoverflows in other constexts
23:09devnalexbaranosky: cool. objectivity wins in this community, even if it doesn't. by that I mean, if you spend a bunch of time and realize the number of people who actually need heredoc is incredibly low, then you lost, but you also are passing on some valuable knowledge to the rest of the community. no shame in being wrong, and all of that.
23:10alexbaranoskydevn: I love that about Clojure. Its probably my favorite thing, the way people in general are really trying to do what is best... and sometimes it happens that your ideas weren't the best, no big deal
23:10devnit was posted on the ML, but this is not the first conversation about heredocs, so try and get that conversation to some sort of conclusion, whether it means no heredocs or it means heredocs everywhere.
23:10devnthat's my opinion anyway...
23:12devnalexbaranosky: same here, i routinely think "don't lose your head, be lazy, defer evaluation, think." ;)
23:12devnnot sure I would have gotten on that process train without this community.
23:13alexbaranoskyI mean Clojure has to be willing to reject ideas... the alternative would be much worse
23:13devnit's a good one. it keeps people honest. honesty makes society work. honesty keeps things moving in the right direction. pure functions are truth. truth matters. </rant>
23:14devnanyway, you'
23:14alexbaranosky"pure functions are truth. truth matters." that's deep
23:16devnanyway, you're getting shit done, or not. just do what's right and think hard about it, make graphs and present data. everyone's programming language will be better for it.
23:17devnand yeah, I'm feeling philosophical, but mainly I'm just the village idiot in this community. :D
23:18alexbaranoskydevn: I'm not sure what that make me in this community
23:19alexbaranoskyambrosebs, thanks for the pointers on twitter
23:19alexbaranoskyambrosebs, I'm inching closer to getting the tabular variables working correctly without the '?'s
23:19amalloyugh, this is just like having nested backticks, except one of them is invisible because you're printing to a string and then eval-ing it
23:20amalloyso hard to keep straight
23:20ambrosebsalexbaranoksy, could you give me a link to what you're trying to do?
23:20alexbaranoskyyes sure
23:20alexbaranoskyambrosebs, issue is here: https://github.com/marick/Midje/issues/70
23:20devnalexbaranosky: "eager" is probably fitting. it's cool to see you in IRC and on the ML post-conj. It's encouraging. Stay thirsty my friend.
23:21alexbaranoskyI was never an IRC guy
23:21alexbaranoskyfor no particular reason.. just wasn't
23:21ambrosebsDoes it make sense to call ClojureScript functions from Clojure?\
23:21ambrosebsI want to play around with ClojureScript from the comfort of Clojure
23:21alexbaranoskyambrosebs, also, the branch I've pushed has one commit: https://github.com/marick/Midje/commits/no-q-tabular
23:21ambrosebsspecifically the clojurescript compiler
23:22zackmarilWhat's the keyword for binding the parameters of function all together?
23:22devnambrosebs: to what end? My immediate feeling is no, but I suppose it's just a different entry point.
23:22zackmarilSomething like (defn [ a b :as args] blah)
23:22devnambrosebs: if you want to play with the compiler it's probably not a bad idea, but you may as well have both sides up so you can watch what happens when you change things.
23:22ambrosebsdevn: feed clojure code into the cljs analyzer and play with the map it returns
23:23alexbaranoskydevn: thanks for the encouragement, btw
23:23devnalexbaranosky: :) know when to hold em, know when to fold em, and all that jazz -- I'm the Jack Handy of IRC
23:23adamesterlineAnybody seen an exception like this: "java.lang.IllegalStateException: Attempting to call unbound fn". It occurs when invoking a this servlet from jetty (https://gist.github.com/1407977). Interesting enough... this same thing works when using gen-class. Any ideas?
23:24devnambrosebs: that doesn't seem crazy to me. why the paranoia? just feels wrong or unfamilliar or something?
23:24amalloyjweiss: https://gist.github.com/1407984
23:24ambrosebsdevn: I haven't touched ClojureScript :)
23:24devnambrosebs: read core.cljs
23:25ambrosebsdevn: I've done some reading, but I want to set up a leiningen-like project and start some prototyping
23:25ambrosebsdevn: how? :P
23:25spoon16any great libraries for making HTTP requests from clojure?
23:26devnambrosebs: seriously. it's really interesting. read it all the way through. then step up and start looking at the compiler. read the google closure o'reilly book.
23:26devn"You know, the one with the bird on the cover.
23:26devn"
23:27devnspoon16: https://github.com/mmcgrana/clj-http
23:27spoon16devn: thanks
23:27amalloyzackmaril: you can only use :as if they were already a list to begin with - the args to a function never were
23:28amalloyyou could write (fn [& [a b :as args]]), but then you lose checking/dispatching on argument count
23:28devnspoon16: there are others. do you know about clojars? the search isn't grep but http should be easy to search
23:29spoon16devn: yeah, I know about it, but I haven't trained myself to use it for search yet… good idea
23:29devnspoon16: http://clojars.org/search?q=http
23:30ambrosebsdevn: from what I've seen from the Compiler, ClojureScript is genius
23:30zackmarilamalloy: figured that I might be asking for a bit much. Already worked around just hoping it could save time in the future. Thanks
23:30ambrosebsdevn: but right now I'm mostly interested in utilizing the analysis phase for type checking
23:31devnambrosebs: clojurescript is still pretty young. if you want a really fun ride start at the first commit on github and just walk through.
23:31devnit's a really fun journey to the announcement
23:32drewrspoon16: this is the maintained version https://github.com/dakrone/clj-http
23:32ambrosebsdevn: In Clojure, I'd just create a leiningen project. What should I do with ClojureScript?
23:32devndrewr: thanks.
23:32ambrosebsdevn: :) will do
23:35devnambrosebs: I have a bit of a weird setup. For a long time I was just using the cloned source and doing things by hand.
23:35devnToday I'm using the cloned source and doing everything by hand, but with a browser repl. ;)
23:35ambrosebsright, I've got a cloned source. what commands do I need to know?
23:36devnambrosebs: honestly I can't say with any amount of certainty that what I'm doing is efficient or "correct" because I've seen some fancy setups
23:36ambrosebsdevn: I don't care for fancy right now
23:36devnambrosebs: if you follow the getting started docs it should be enough to get you rolling
23:36ambrosebsdevn: sweet
23:37devnambrosebs: if you have any issues ping me though. if you use emacs check out the inferior lisp docs.
23:39ambrosebsI was planning to use inferior lisp (usually I'm a vimmer) .. is this what I want? https://github.com/clojure/clojurescript/wiki/Emacs-%26-inferior-lisp-mode
23:39devnthe docs on the wiki are a little different from what i do: M-x set-variable [RET] M-x set-inferior-lisp-program [RET] (type the following with quotes) "path/to/my/repljs" [RET] M-x inferior-lisp
23:39ambrosebsdevn: sweet, I'll give it a shot
23:40devnambrosebs: happy clojuring :)
23:40devng'night
23:40ambrosebsdevn: cya
23:54dnolenambrosebs: using the ClojureScript compiler to analyze Clojure definitely sounds like a good idea - cgrand was talking about doing something along these lines
23:56ambrosebsdnolen: please tell me if I'm being dense, but I just want to add the CLJS compiler as a dependency from Clojure and just call the compiler. How do I do this :/
23:57dnolenambrosebs: not following. why do you need to call the ClojureScript compiler?
23:57dnolendon't you just want to deal w/ the analyzer?
23:58ambrosebsright, basically I like my Clojure setup, do I have to change my entire environment to play with analyzer, or can I play from the comfort of Clojure?
23:59dnolenambrosebs: you could use the CLJS analyzer on CLJ, but of course anything JVM related will be missing.
23:59ambrosebsdnolen: I just want to experiment with what the meat of a type checker might look like