#clojure logs

2011-05-17

00:00hugodit uses some of the ideas from cdt
00:01hugodmainly the same one about building a map of locals to provide a context to eval in
00:10scottjhugod: k readme refs old version
00:11hugodscottj: thanks - I forgot to push
00:12scottjk also this doesn't work on openjdk?
00:13hugodnot tried it on openjdk…
00:14scottjk I don't actually know how openjdk differs from sun's, but fails for me on Caused by: java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine
00:14technomancyeither of you guys try the M-x clojure-jack-in yet?
00:14hugodmm, looks like it isn't finding the jdi classes
00:15hugodtechnomancy: no
00:15technomancythinking of cutting a 1.3.1 release of swank with jack-in but without the cdt stuff that's still somewhat untested
00:15hugodlooks interesting from the screencast
00:15scottjtechnomancy: nope, I can if you wan
00:15technomancyscottj: that'd be great
00:16technomancywould like confirmation that it works on at least one other machine before cutting a release
00:16scottjtechnomancy: so I need latest clojure-mode and latest swank-clojure?
00:16technomancyscottj: yeah, clojure-mode from git, swank-clojure 1.4.0-SNAPSHOT from clojars or git
00:17scottjbtw what happens if you clojure-jack-in but have an old swank-clojure?
00:17technomancyscottj: just "that's not a task"
00:17scottjok
00:17technomancyhmm... it will keep the *swank* buffer polling though
00:18hugodI get /bin/bash/lein command not found
00:18scottjI need to get a vm of ubuntu up for this kind of thing so I don't accidently mess up my dev environment :)
00:19technomancyscottj: well one advantage is this is very non-invasive
00:19technomancyscottj: exit Emacs and the changes are gone
00:20technomancyhugod: maybe a path mix-up? on OS X sometimes GUI-launched processes don't pick up $PATH customizations from ~/.profile
00:22technomancyhugod: that's like the #1 thing people run into with magit on OS X
00:22hugodlein works from emacs shell, terminal, but not eshell
00:22technomancyhugod: yeah, that's the path issue then. try from emacs -nw
00:24scottjtechnomancy: I installed swank-clojure 1.4.0-SNAPSHOT as lein plugin but clojure-jack-in says not a task
00:25technomancyscottj: hmm; let me confirm it's on clojars
00:26technomancyscottj: is there another swank shadowing that perhaps? in ~/.lein/plugins or lib/dev?
00:26scottjyeah probably let me check
00:28scottjnope, lein version 1.5.2
00:30technomancyhmmm... curious
00:30technomancywhat's the output of DEBUG=y lein version ?
00:32hugodtechnomancy: maybe a defvar for lein location?
00:32scottjmaybe it's installing an old version of swank-clojure 1.4.0-snapshot out of ~/.m2?
00:32scottjI opened up the jar and didn't see any files modified in may
00:33technomancyhugod: yeah, clojure-swank-command is actually already a defvar
00:36scottjswank-clojure on clojars shows it from gjahad on 04-24
00:36hugodI'm picking up swank-clojure-1.4.0-20110417.030036-3.jar
00:37technomancyhmm. I wonder how I'm picking up the new one even after clearing ~/.m2/repository/swank-clojure
00:37amalloyhow do i get (the equivalent of?) c.c.pr-xml in clojure 1.3? it looks like data.xml is empty
00:37technomancyeh; I'll try re-scping
00:37scottj(I was going off web search)
00:38technomancyoh... I may have scp'd without the pom earlier.
00:39technomancyok, try clearing it from m2 and re-downloading
00:39amalloytechnomancy: you should try writing a build tool of some kidn that will scp to clojars for you
00:39technomancyamalloy: brilliant =)
00:40technomancyI have a shell alias, but I never use it because scp is supposedly simple enough.
00:40hugodscottj: you have openjdk jdk or jre?
00:40technomancyapparently not!
00:40amalloyhah
00:41technomancyactually better would be getting clojars to accept proper mvn deployments; I've already got that implemneted.
00:41technomancyfor some reason the new version claims to be 1.4.0-20110417.030036-4 even though I just uploaded it.
00:41technomancycan I blame java.util.Date?
00:41amalloythat's rarely far off
00:42amalloytry java's UUID package though. that one's *always* wrong
00:42technomancyamalloy: yeah, but off-by-one errors in the month seems suspect?
00:42technomancydunno
00:43scottjI think that clojars updates the list before it's fully received the file, technomancy how long did your scp take?
00:43hugodclojars keeps the first upload date of any snapshot, and just revs it
00:43technomancyhugod: that makes perfect sense.
00:43hugodie it is the -4 that is important
00:43technomancycan't believe I never noticed that before =)
00:44scottjcause it gave me half the file when plugin installed right after you reupped
00:44technomancyscottj: I didn't notice it taking particularly long
00:44scottjtechnomancy: this could be the start of a beautiful program.
00:44technomancywoooo
00:45technomancyalthough my favourite is "Take this REPL brother; may you use it well."
00:45technomancy*may it serve you well
00:45scottjtechnomancy: so it only supports one at a time?
00:46technomancyscottj: I haven't really thought through the implications of multiple connections in a single emacs instance
00:46technomancyslime doesn't really make it easy
00:46scottjI noticed ensime (slime for scala, better in several ways) copies slime with those style messages
00:46scottjtechnomancy: slime-connect does
00:47technomancyscottj: I mean you have to manually switch between connections, right?
00:47hugodthat's what the port file was for iiuc…
00:47technomancythere's no way to say "all files in this project-root go to connection 0 and the rest go to connection 1"
00:47technomancyor is there?
00:47technomancysomeone told me there wasn't; I never bother since I just start multiple emacs instances =)
00:47scottjtechnomancy: yeah actually that part I don't understand, I typically use multiple but only the most recent and disconnect from that then it notices and re-defaults the most recent active I think
00:48technomancywell, it's just running its own slime-connect, so I'm not sure that this would interfere with that
00:48scottjbtw maybe take a directory with C-u M-x clojure-jack-in
00:48technomancyyeah, not a bad idea
00:48scottjor prompt if not in a valid dir
00:49scottjor both
00:49technomancyyeah, that'd be slick
00:49technomancywhat do you like about ensime?
00:49hugodworking here too, btw
00:49technomancyhugod: sweet; thanks!
00:49technomancyI think I'll cut a 1.3.1 without the cdt stuff for now
00:52scottjis the proper way to search for params like -U on google/gmail to do "-U" ?
00:55scottjhugod: not actually sure, I have openjdk-6-jdk and -server works
00:56hugodthat class should be in jdk/lib/tools.jar
01:00technomancyscottj: some of the debugger stuff doesn't work if you try it with a JRE rather than a JDK
01:01technomancyscottj: I had that problem with cdt on ubuntu's 32-bit JVM
01:03technomancydunno if it's the same problem
01:07technomancyI wonder if it'd be worth publishing swank with a 1.2.1 classifier in order to allow AOT
01:08technomancylet's see how much it improves boot time
01:10technomancyshaves a couple seconds of... pretty nice
01:10technomancyhmm...
01:13scottjwas there any word on how that 1.3/2.0 survey turned out? if they wanted to call it 2.0 last summer I can only imagine how much they'll want to use that number this summer/whenever it ships
01:15technomancyyeah, never heard anything back from that
01:15technomancyhopefully they can learn from scala 2.8 =)
01:22technomancymaybe I'll re-record the video tomorrow with 1.3.1 and show the clojure-mode install, but I wanted to get this out tonight: http://technomancy.us/149
01:26technomancypretty impressed with how easy http://diveintohtml5.org/video.html made embedding the viid
01:34scottjthis one might be exception because it's short, but generally I think youtube makes sense to have free bandwidth and better controls
01:35scottjhugod: no final answer for you on openjdk, I see it has the right classes so I'd guess it works fine for ppl who can get it to put tools on their classpath
01:36technomancythe controls are browser-supplied; are they not so great on some browesrs?
01:36technomancyseems pretty solid on gecko
01:37technomancyoh wow, yeah it's a mess on chromium
01:38technomancyat least before it finishes buffering
01:38scottjon my old geck (pre firefox 4) they're about the same as my chrome controls wise,
01:38scottjso not an issue for this video, but for others I'd miss popout and fullscreen buttons
01:39technomancyonce it buffers it's ok
01:40technomancyfull screen might be handy for larger ones I guess
01:40technomancyI haven't used youtube much until recently since they've been doing the webm transition
01:41scottjdo you use conkeror?
01:41technomancyyeah
01:41technomancyusing the ff4 runtime though
01:42technomancycouple minor bugs, but it's so much faster that I don't care =)
01:42scottjtechnomancy: http://jaderholm.com/paste/youtube-conkeror.html
01:43technomancystill kinda getting over the novelty of video that actually plays in the browser TBH.
01:43tomojdoes "ff4 runtime" refer to a particular version of xulrunner?
01:43scottjallows you to do n I f 0 on a youtube video page or link and it will open it in popout hd quality
01:43technomancyscottj: handing off to vlc or what?
01:43scottjtomoj: the one in ff4, firefox -app somexulapp
01:44scottjtechnomancy: no, flash still
01:44technomancytomoj: yeah, FF4 is just another xulrunner app
01:44technomancyscottj: oh, ok. I don't have flash.
01:44tomojso do native websockets work?
01:45technomancytomoj: haven't tried that
01:45tomojthey don't in my conkeror, I don't even think the flash version works, but ff4 they work fine
01:45tomojer, actually I never tried native on ff4
01:45technomancytomoj: definitely worth using conk on ff4; it makes a huge difference
01:46technomancywhat do you use websockets for?
01:46tomojis that some build step you do for conkeror?
01:46technomancytomoj: it's just how you launch it
01:47technomancycat ~/bin/conkeror # => ~/bin/firefox/firefox -app ~/src/conkeror/application.ini $@
01:47tomojoh.. thanks
01:47technomancyconkeror's just a pile of JS and XML on disk somewhere; no real build
07:21yoav_Hi, I have a question about the clojure compiler
07:23yoav_I would like to do something like - :gen-class :methods [ [myMethod [String] double[] ]]
07:23yoav_meaning - to set the return value of the function to be an array double
07:24yoav_I used the above line and the compiler generated a function that returns only double, not an array
07:25raekdouble[] is two tokens in clojure: double and [] (so you don't write array types that way)
07:27raekI think you have to you the quirky "descriptor" syntax for arrays, i.e. array of objects: "[java.lang.Object;"
07:28raekyoav_: you could try [myMethod [String] "[D"]
07:28yoav_ok, I'll try, thanks
07:29raek(also, the array-of-objects example should have been "[Ljava.lang.Object;")
07:45yoav_raek: thanks, it worked, but now it seems that I need to convert the vector returned from myMethod (written in clojure) to a [D ,
07:46yoav_when I call that myMethod from Java
07:49fliebeldoes Clojure have an @overwrite macro or something like that, to make sure you actually overwrite a method in a gen-class?
07:52raekyoav_: yes, you can use ##(into-array Double/TYPE [1.0 2.0 3.0])
07:52sexpbot⟹ #<double[] [D@1f5ca0b>
07:53raekyoav_: you also have to make sure the elements are of type Double
07:53clojurebothttp://www.assembla.com/wiki/show/clojure/Datatypes
07:55raek,(into-array Double/TYPE [1 2 3])
07:55clojurebot#<double[] [D@4d6f8c>
07:56raekok, it seems that widening conversions happens automatically, but you would need to do (map byte [1 2 3]) if you were to use an array of bytes
08:05fliebelIs there any data structure that allows constant time concatenating? Finger trees? Persistent doubly linked lists(is that even possible?)?
08:07clgvfliebel: seqs? ;)
08:07fliebelclgv: What? really?
08:08fliebel$source concat
08:08sexpbotconcat is http://is.gd/HpiI86
08:08clgvwell it's an iterator approach isnt it?
08:09clgvif they don't it should be possible to write a constant time concatenating seq-like implementation
08:10fliebelclgv: Well, yea, concat generates a lazy seq, but it really just builds a lot of conces, with the last one having the second seq as crd.
08:11clgvfliebel: it is almost the constant time behavior except that you have the lazy overhead
08:11fliebelhmpf, then I can do constant time sorting...
08:12clgvlol. I doubt that ;)
08:13clgvfliebel: I mean in a mutable world you would write an iterator implementation that uses iterators of the lists that shall be concatenated
08:13clgvconcat looks like the semantic equivalent
08:14chousersingle or double-linked (mutable) lists can be concat'ed in constant time.
08:14chouserassuming you have a pointer to the tail of the first list
08:14fliebelclgv: constant time sort: http://boss-level.com/?p=92 (just some overhead while consuming)
08:15chouserheh. not at all.
08:15chousergetting the first item in O(n)
08:16clgvfliebel: comparison based sorting can't be done in less than O(n log n). there is a proof for that
08:17clgvchouser: indeed. you have to look at all elements at least.
08:18clgvfliebeL: but if this is done for all elements you'll get n*n ;)
08:18yoav_<raek> thanks, got myself a running app :-)
08:18fliebelclgv: I know, I was just trying to make clear my view that concatenating a lazy seq will still cost you linear time. Just like sorting is n log n, but defining the lazy seq is just as constant time as your constant concatenation.
08:20clgvfliebel: you read my iterator statement? thats the idea. concat does that semantically but includes the lazy overhead and the burden of immutability.
08:22fliebelclgv: I did. I still don't agree it's constant though.
08:23clgvfliebel: It indeed is. you have only one additional if-check each time one of your iterators passes its last element
08:23clgvI wrote something quite similar in c# yesterday
08:28ilyak,(#{"yes" "true" "on"} "on")
08:28clojurebot"on"
08:29ilyak,(#{"yes" "true" "on"} "off")
08:29clojurebotnil
08:30fliebelclgv: Well, okay, in a mutable world you might do that, but Clojure actually creates n new conses.
08:31clgvfliebel: thats the mentioned overhead^^
08:31Chousukedon't assume the implementation is slower just because it's immutable, or uses lazy seqs, though
08:31fliebel…which isn't constant in any way
08:32Chousukethe jvm is good at reusing objects, and the objects might be in cache. :)
08:32clgvyep, but you could try a mutable implementation if you really need it
08:32Chousukeso it may well be just as fast if not faster than some sort of mutable thing (if the mutability happens to invalidate caching)
08:34clgvChousuke: but it remains a linear overhead if you analyse it on paper, like fliebel says
09:07markskilbeckAloha!
09:08markskilbeckWhen I'm running `lein run -m myproj.core` I've noticed it's quite slow to start up. I assume this has something to do with firing up the JVM? Any way to make this faster?
09:14fliebelmarkskilbeck: use a persistent vm or port clojure to another vm, like v8 or pypy :)
09:15dnolenmarkskilbeck: firing up the JVM + compiling Clojure + compiling your source. If you want to decrease startup time AOT compile your project.
09:19fliebeldnolen: I got a great book full of logic puzzles, it's tempting to solve them all in Logos. fun :) Only, I suppose a constraint solver is more suitable for most.
09:20markskilbeckfliebel: Logos?
09:20dnolenfliebel: cool! eventually I get back to the constraint stuff, but I have some hefty reading to do first.
09:20dnolenmarkskilbeck: core.logic now.
09:31dnolenloading AOT clojure.jar is like 1.5s, non AOT clojure.jar is like 7-8s.
09:49ilyakCan someone help me with testing code in clojure-ant-tasks?
09:49ilyakI don't understand why it doesn't seem to run the overriden report
09:50ilyakhttp://pastebin.com/VcQr3Gbm
09:50ilyakFor some reason it never fails with BuildException, even when there are failures
09:51ilyakIt also doesn't println anything, but I might be guilty, I'll check
09:53ilyakNope, it does
09:53ilyakLooks like the function is incorrect
09:55ilyakNope, I guess it doesn't
09:56shanmuhello! I am trying to get clojure.pprint/print-table to print a list of maps where some map values are small seq. but then when printing, it gets printed as a #LazySeq
09:58shanmu(clojure.pprint/print-table (list {:a "1" :b (take 2 (range 10))}))
10:00shanmuUsing doall on the inner seq does not help...
10:00clgv&(clojure.pprint/print-table (list {:a "1" :b (take 2 (range 10))}))
10:00sexpbotjava.lang.ClassNotFoundException: clojure.pprint
10:01ilyakWhere can I read on how to override report properly for tests?
10:02shanmuclgv: clojure.pprint is reorganised in 1.3, I think...
10:02clgv&(clojure-version)
10:02sexpbot⟹ "1.2.0"
10:03clgvah the other way round, probably ;)
10:05shanmuyes, I am using 1.3
10:12clgvI don't, so I can't check
10:20ZabaQI'm in a bit of pother with authentication with compojure/ring
10:20raekshanmu: if you see a #LazySeq, then some code is calling str instead of pr-str on some value
10:22raekshanmu: you could try (clojure.pprint/print-table [{:a "1" :b (pr-str (take 2 (range 10)))}])
10:22shanmuraek:Many thanks! you are star, as always... :)
10:24ZabaQthe thing to to seems to be to write a bit of middleware to check the session and see if its authenticated and redirect if it's not, no?
10:25raekit can be a bit confusing, but str means "turn this into a string somehow" and pr-str means "turn this clojure data into a readable string"
10:26ZabaQbut what to actually use for the actual authentication bit, I'm not sure.
10:26raekyou can easily see the difference if you consider strings: ##(dorun (map println ((juxt str pr-str) "foo\"bar")))
10:26sexpbot⟹ foo"bar "foo\"bar" nil
12:05cemerickfliebel, ejackson: I think you may find this interesting (remembering the chartered-conj-flight chatter from a while ago): http://www.fastcompany.com/1753756/social-flights-puts-private-flying-within-reach-of-the-everyday-traveler?partner=homepage_newsletter
12:06ejacksoncemerick: you're on a mission :)
12:06fliebelcemerick: wee, I'll reed
12:06cemerickejackson: Nah, I just saw it fly by on the twitters, and was reminded of the discussion. :-)
12:07ejacksoni did eventually figure it out, the main problems was the multiple points of departure and even then it was about 5k a pop
12:07ejacksonso somebody needs to found, build and exit a startup before the conj in order to fund it :)
12:07cemerickhuh
12:08cemericker, heh
12:08cemerickthat seems really out of bounds
12:08cemerickI suppose the international flavour of it probably ticks up the costs a lot more than e.g. NYC<=>Austin netjets arrangements.
12:09ejacksonit is a large puddle
12:15pyrhi
12:15pyrI still often times hit a wall when I try to use I/O operations in futures or agents
12:25amalloypyr: that's cause you shouldn't
12:29dnolenamalloy: what makes you say that?
12:30amalloydnolen: well, it's a slight overstatement. you can do i/o in agents as long as you don't try to modify anything other than the agent you're working with
12:30amalloyoh, he said futures. i read it as refs. futures are fine
12:30TimMcYou scared me, man. :-)
12:31amalloyhaha good thing someone caught me
12:31fliebelamalloy: What is send-off for, if not for i/o?
12:31pyryeah futures
12:32amalloymutter mutter, i hate you all. i'm going back to bed
12:33dnolenpyr: what's the wall you're running into?
12:34pyrdnolen: i get operations blocking forever
12:35pyrsay you want to bind two services together
12:35pyror you want to accept messages over a protocol
12:35pyrdo some async ops
12:35pyrand reply when ready
12:37pyre.g: you want to fetch urls on an AMQP queue do some stuff with it, reply on an exchange when done
12:37dnolenpyr: sure, but how are you writing code such that it blocks forever?
12:37pyrwhat i do is seq over incoming messages, run the handler in a future and publish to the exchange back (through an agent to ensure thread safeness) when done
12:37pyrif i do that
12:37pyrthe http outgoing op which happens in the future
12:38pyrnever returns
12:41dnolenpyr: not sure I totally get that, do you have some snippet of Clojure that illustrates your pattern?
12:42hiredmanpyr: why does publishing through an agent ensure threadsafeness?
12:43pyrhiredman: because the agent's value is the publisher, and access to it is atomic
12:44hiredmanpyr: isolated
12:44hiredmanatomic doesn't make sense in that sentence
12:46pyryep
12:46pyrindeed
12:46hiredmanpyr: you would be better off creating a channel per future and publishing from the future instead of doing that
12:46pyrthe thing is
12:46pyri usually don't get to that point :)
12:47markskilbecktechnomancy: why do you use binding here: https://github.com/technomancy/mire/blob/master/src/mire/server.clj#L24
12:49pyri'll try to isolate the blocking issue
12:49pyrany tool you guys might know to help with debugging that ?
12:57chrissbxIs there a way to pretty-print Clojure code? Including rewrapping lines sensibly.
12:57chrissbxi.e. useful to make a nice looking output from generated code.
12:58dnolenchrissbx: clojure.pprint, use code printing mode.
12:59chrissbxthanks
13:14rlbShould it be OK to pass (assoc (into {} (System/getenv)) "foo" "bar") as sh's :env parameter?
13:14rlbI'm getting an error that seems to be caused by that.
13:15rlbi.e. can't cast clojure.lang.PersistentHash to java.util.Map...
13:15rlbBut it looked like sh was using as-env-strings to handle something like that.
13:39amalloy&(supers clojure.lang.PersistentHashMap)
13:39sexpbot⟹ #{clojure.lang.ILookup clojure.lang.IPersistentCollection clojure.lang.AFn clojure.lang.IFn java.lang.Runnable java.io.Serializable clojure.lang.IMeta java.lang.Iterable clojure.lang.IEditableCollection clojure.lang.Associative clojure.lang.APersistentMap clojure.lan... http://gist.github.com/976948
13:39amalloyrlb: it extends j.u.Map, so that can't be the error you were getting
13:42ilyakI made clojure-ant-tasks to build and work with newer clojure
13:42ilyakhttps://github.com/alamar/clojure-ant-tasks
13:45cemerickilyak: It's good to know someone is taking care of the ant side of the house. :-)
13:46cemerickI wonder — in the same DRY spirit — if it's feasible to use the maven-ant-tasks to reuse clojure-maven-plugin if you happen to be driving your builds with ant?
13:46technomancycemerick: that should work
13:46cemericktechnomancy: yeah, I just wonder how much overhead you'll be taking on for each ant target maybe having to put together a maven environment, etc.
13:47cemerickMaybe I'm thinking of the maven-ant-tasks as being more heavyweight than they are.
13:53technomancyredinger: ping
13:54technomancymarkskilbeck: rebinding *in* and *out* to thread-local values makes read-line and println DTRT inside the application. we can pretend the user's socket is stdin/stdout.
13:55ilyakWe have a build system based on ivy and we don't seem to be huge fans of maven
13:55hiredmanwe?
13:55ilyak(I've never ever used maven myself, excluding running "mvn" to build third party library)
13:56ilyakBy we I mean the organization unit where I work
13:56cemerickilyak: sure; wasn't saying maven is the end-all-be-all or anything, just thinking out loud :-)
14:00ilyakant tasks should be useful to people having a tiny bit of clojure in their huge ant-build proprietary java application
14:00ilyakas opposed to tiny clojure-only modular libraries or projects
14:00cemerickyeah; I have one lone holdout still using ant, and I'm not looking forward to doing anything with it, really
14:32Null-ADoes anyone else dislike lisp syntax? Haskell and python is much easier to read
14:33Null-AIt'd be interesting if you made a lisp where lists are denoted without parens
14:34technomancyno, but I did just realize we've been way overdue for this recurring discussion.
14:34Null-Ahah
14:34Null-Ahas anyone tried to do lisp without parens?
14:34technomancyit's been nearly a year since someone proposed it; usually it happens at least every six months.
14:34Null-Ai'd like to see an implementation
14:35technomancyhttp://www.dwheeler.com/readable/sweet-expressions.html and http://en.wikipedia.org/wiki/Dylan_(programming_language) come to mind
14:35scgilardigoogle knows about even more
14:36raekI wonder how/if macros are done in Dylan...
14:37Null-Atechnomancy: that's pretty awesome
14:37Null-AI don't care so much about infix support, but that's nice too
14:38pjstadig"Dr. Strange Parens or How I Learned to Stop Worrying and Love the Parens"
14:38Null-Aah yah I know nathan marz
14:39Null-AI just spent the last 4 months reading/writing clojure code, and I found it hard to scan large blocks of code
14:39Null-Arelative to haskell or python
14:39hiredmanNull-A: get a bigger monitor
14:39technomancyand don't write large blocks of code
14:40pjstadigdon't work with nathan marz
14:40pjstadigno just kidding
14:40Null-Anathan is awesome
14:40pjstadigkeep working with him
14:40jmattNull-A: I did 15+ years ago when I first saw it. 6 weeks later the parens disappeared. In my opinion it just takes time for your perspective to change. The "old" example of lisp without the syntax was python … the story goes John McCarthy showed up to a Norvig presentation at stanford about how python is a lisp and pointed out code isn't data and that was the end of python being called a lisp. http://news.ycombinator.com/item?id=1803627
14:42jmattAll that being said when I'm not writing clojure I'm usually writing python.
14:43Null-A*nods* my python looks like clojure
14:46Null-Aeven though I don't love the parens, clojure is an obvious win to me
14:49thearthursince adopting paredit i dont efen see the parens anymore
14:50Null-Aunfortunately that doesn't play nicely with viper-mode
14:50amalloyi hear that claim a lot. i like the paren syntax, and it's easy to ignore them, but not seeing them seems far-fetched and not useful
14:51amalloytechnomancy: i'm sure it's been less than six months
14:51technomancyamalloy: lucky me; I must have missed a few then =)
14:52Null-Ae.g. (defn foo [x] (+ x 3)) changed to (defn foo [x] (let [y 3] (+ x y)))
14:52Null-Ayou have to adjust parens using paredit
14:53Null-Aalthough it probably makes little difference at the end of the day in terms of productivity
14:53Null-Ahaskell is foo x = x + 3, changed to foo x = x + y where y = 3
14:53amalloyNull-A: just use M-( to wrap the (+ x y) clause with a set of parens
14:54amalloythen you can type "let [y 3]" and you're done
14:54Null-Aoh, i'll try it out thanks
14:54amalloyanytime you fiddle with parens or lists manually, there's a paredit feature to do it faster and with less chance of errors
14:55Null-Aamalloy: nice :)
14:55Null-Athanks
14:55amalloyNull-A: see also M-<UP> and C-M-k
14:55dnolenraek: Dylan does have macros, but it has some usability problems.
14:56amalloydnolen: heh, so does lisp. the problem is people complaining about how unusable it is
14:56dnolenamalloy: usability problems compared to CL style, Clojure style, and Scheme style.
14:59cemerickif someone knows how to use a saw fairly well, they'll likely experience a period of adjustment when they start using an axe
14:59dnolenhttp://www.fun-principles.info/slot/site/dylan/alpha/openpoints/Dylanmacrosareakludge..html
15:00Null-Ai'm very amazed when I write clojure code that would've required macros/templates in C++, but doesn't in clojure
15:00cemerickThat is, all these languages have their often-exclusive syntactic idiosyncrasies.
15:00Null-Ae.g. generic algorithms that operate on any type, requires templates in C++
15:00Null-Aor programmatically constructing type hierarchies requires macros in C++
15:01Null-Abut is just a call to derive in clojure, if you're using multi methods
15:01amalloythat's because c++ throws away a bunch of type information at runtime, once it's satisfied with the compile-time static typing
15:02amalloyjava keeps all that information around at run-time so that it can 100% prevent typing errors (by throwing a classcast exception instead of doing something dangerous)
15:02Null-A*nods*
15:03Null-Aand performance is pretty good despite all that
15:10Null-AIs there a way to define an algebraic data type, and then pattern match on that for function input?
15:10Null-Alike data MyType = 4 | 5 | :empty
15:11amalloyno
15:11Null-Ahm, that was pretty useful in haskell
15:11amalloydnolen is working on pattern-matching, and you can kinda fake it with multimethods that dispatch on :type or something
15:11Null-A*nods*
15:12dnolenNull-A: it'll actually be much cooler than what Haskell gives you, but it's gonna be some work, and it will probably need a lot of testing, so don't expect anything usable in anything less than a couple of months.
15:13Null-Aexciting
15:13Null-Ahopefully its as low overhead as haskell
15:14dnolenNull-A: honestly it's just the super fast pattern matching algorithms found in PLs like Haskell but wired to a logic engine to avoid the problems.
15:14Null-AHow do you mimic algebraic datatypes feature of haskell? defrecord, and do type checking in constructor?
15:14raekthere is a adt library in contrib
15:15amalloyNull-A: you might be happier if you just dove in and drank some kool-aid. figure out what the idiomatic way to do X is in clojure, rather than asking "in haskell i solved X by doing Y, how do i do Y in clojure"
15:15dnolenNull-A: won't mimic algebraic datatypes, I'm not interested in the limitations of Haskell pattern matching.
15:15amalloythat is: there's nothing wrong with "in haskell I solved X by doing Y, how would i do X in clojure"
15:16amalloybut asking how to do Y instead won't get you far
15:16Null-Ahm
15:16dnolenNull-A: like SML, OCaml, Haskell limits the matches to be of the same type, there will be no such limitation in what I want to build.
15:17benreesmanthere was a great site with a bunch of clojure puzzles to solve, i can't remember the name of it. anyone remember off hand?
15:17Null-Awhere do I paste?
15:18Null-Agist
15:18dnolenNull-A: that's what I use.
15:18fliebelbenreesman: 4clojure probably?
15:18stirfoobenreesman: https://www.4clojure.com/
15:18benreesmanexactly right thanks!
15:19amalloybenreesman: hey, glad you like it. feel free to stop by in #4clojure if you have some feedback
15:20benreesmanamalloy: yeah it's great, i'll make sure to swing by if i have any comments!
15:20Null-AHere's what I'm trying to do amalloy https://gist.github.com/977174
15:21Null-Ait's a function for converting AST in infix notation to prefix notation, and lines 2 and 3 need some work
15:21amalloyi know nothing about clojure's pattern-matching, and only very little about haskell's. ask dnolen
15:22amalloy(cuz that function looks like a mess of question marks with no real purpose, to me :)
15:22dnolenNull-A: you're using matchure right? I haven't really messed w/ that much.
15:22Null-Ahah yah
15:22Null-Adnolen: yah
15:22Null-Adnolen: what do you use?
15:22Null-A(for pattern matching)
15:23dnolenNull-A: there's nothing satisfactory for pattern matching in Clojure at the moment. That's part of the reason why I'm working on it.
15:23Null-Aobviously I can do all this with cond's and if statements, but it's much less readable than pattern matching
15:23Null-Ak
15:23dnolenbut to be clear, what I'm building isn't pattern matching. it's more like predicate-dispatch++
15:23Null-Adnolen: where's your lib? published
15:24dnolenNull-A: no, just sketches on how to do it, a couple more details to work out and then I'll probably start in earnest. Was also hoping people would lend a hand.
15:25edwardgerm, pattern matching? very interesting. is this an extension, or will it be core?
15:25dnolenNull-A: the tricky bit is implementing an OCaml algorithm that compiles decision trees using lazy evaluation semantics.
15:25Null-Ahm, sorry a bit beyond me
15:25Null-AI look forward to using it though
15:26dnolenedwardg: I doubt it will be core, but I will definitely submit it to contrib.
15:26amalloyNull-A: i'd write it as a multimethod that dispatches on count
15:27amalloysince you're not matching on any actual values
15:27Null-Aamalloy: the first pattern accepts 2 or more count
15:27edwardgpattern matching rocks, i'll be checking it out, thanks.
15:27Null-Aamalloy: look at the comments, I want to
15:27Null-Aamalloy: matchure doesn't really support it afaik
15:27amalloyso the first and the third version accept 2+ args
15:28Null-Alines 2 and 4 accept 2+ and 4+ respectively
15:28Null-A1+ and 4+*
15:28amalloybake them both into the :default case of the multimethod, and switch based on whether the first entry is a function?
15:29dnolenNull-A: the other problem with matchure is I don't think it has any notion of guards.
15:29Null-Aamalloy: that works but is overly verbose
15:30stirfoodnolen: guards = predicates?
15:30dnolenstirfoo: yes.
15:30amalloyNull-A: well we don't have any good pattern-matching libs, so you have to compromise somewhere
15:30Null-Adnolen: uh they do have support, but it was limited
15:30Null-Aamalloy: yep
15:30Null-Aamalloy: anyways that's the whole "I'm doing X"
15:30amalloy*smile*
15:30Null-Aamalloy: and the clojure way sucks right now
15:31dnolenNull-A: Clojure doesn't even provide a solution for your problem.
15:31stirfootrying to recall what I learned about pattern matching in PAIP
15:32Null-Adnolen: the solution is cond and if statements or multi method
15:32dnolenNull-A: I wouldn't consider those solutions, but yes you can write a really verbose version of what you really want.
15:33Null-Anews: clojure is turing complete :)
15:33Null-AI had this CS assignment is class on how to design a calculator (not actually implement it)
15:34Null-Aand we spent all this time going through visitor design pattern and different tradeoffs, singletons, and the whole lot of OOP
15:34Null-Afuture fitness of designs
15:34Null-AI wrote implemented a prefix notation calculator it in clojure in like 2 minutes
15:34Null-Aand a infix calculator in like 30
15:35dnolenNull-A: visitor pattern, ick.
15:35Null-Aall this accidentally complexity around OOP, and the teacher has no idea :(
15:35Null-Aand I get marked on learning that crap
15:35Null-AI looked at the visitor design pattern, scratched my head for a few minutes
15:35Null-Athen realized it was just multi methods
15:36jolydnolen: I was using the core.logic zebra puzzle framework to try another logic problem, but ran into an issue with negative constraints (Irishman doesn't have the fish, or similar). Any ideas on how I could adapt it?
15:36Null-Ahere's my prefix notation calculator https://gist.github.com/977216
15:36jolydnolen: I tries working on a "not-member-o" but ran into trouble
15:37jolys/tries/tried/
15:37sexpbot<joly> dnolen: I tried working on a "not-member-o" but ran into trouble
15:38dnolenjoly: negation in general is a problem in Prolog and miniKanren (as far as I understand)
15:38jolydnolen: hmm, so we need something more like a constraint solver?
15:38dnolenjoly: was considered adding stratified negation to core.logic.
15:38dnolenjoly: or that yes.
15:39Null-Anathan just recently added negation to cascalog if that helps
15:40jolydnolen: I have some interest on the constraint side, but I'm not well read on it
15:40dnolenjoly: in the meantime you could look at examples of how Prologists solve it - negation as failure.
15:41jolydnolen: cool, I'll give it a look
15:41jolydnolen: thanks
15:41dnolenjoly: constraint solving, it's ridiculous huge rapidly evolving area. I find the CHR folks work most promising, they've been helping out the Haskell folks w/ some things related to type inference.
15:45jolydnolen: I'd heard you mention CHR before and took a quick look at it. I wasn't sure where to start, especially since it seems a lot of the work is recent and ongoing
15:46dnolenjoly: best place to mess w/ CHR is SWI-Prolog, it comes bundled.
15:47jolydnolen: ok, I might give that a try. My Prolog is pretty weak though :(
15:47dnolenjoly: so is mine.
15:48dnolenjoly: all this stuff is new to me, but I'm interested in seeing these wacky ideas put to use in real programs.
16:41symboleWhen macroexpanding, is it possible to get rid off the namespaces for readability purposes? It's very difficult to read otherwise.
16:46dnolensymbole: I think clojure.pprint can do that.
16:50symbolednolen: Seems like it's still printing the namespaces.
16:51dnolensymbole: you need to use code-dispatch
16:54stirfooI've bound clojure.pprint/*print-suppress-namespaces* to true for one-off macroexpansions
16:56dnolen(binding [*print-suppress-namespaces* true] (with-pprint-dispatch code-dispatch (pprint `(+ 1 2))))
17:00symboleThanks. I have something to work with.
17:02symboleSetting *print-suppress-namespaces* worked quite well. I should turn that into a macro. :)
17:02stirfoodnolen: so that's using a closure to make *print-suppress-namespaces* true on subsequent pprint calls?
17:03dnolenstirfoo: no dynamic binding
17:03stirfoodnolen: ok, so *print-suppress-namespaces* is still only true within that form?
17:03dnolenstirfoo: yes.
17:03stirfooI haven't used with-pprint-dispatch
17:04dnolenstirfoo: useful mostly for debugging, I learned how it worked get macroexpansion working swank-clojure.
17:04dnolenworking in
17:04dnolenmany moons ago now.
17:05stirfooheh, works great in swank, imo
17:05stirfooI had been doing something like: (binding [clojure.pprint/*print-suppress-namespaces* true]
17:05stirfoo (pprint (macroexpand-1 '(foo 3))))
17:05dnolenstirfoo: yeah, debugging macros used to be truly unbearable.
17:06dnolennot sure what level support everyone else has for expanding macros - La Clojure, Enclojure, CCW ...
17:48replacapprint, ftw :)
17:48replacaI should add a pp-macroexpand to pprint itself
17:48replacaso that it will be avail at every repl
18:20stirfooor just learn the 400lb gorilla emacs/slime! ;)
18:28technomancyit's recently lost weight!
18:28technomancydown to 300 lbs
18:33stirfoo(E)ight (M)egabytes (A)nd (C)onstantly (S)wapping, must have been rough in those days. I've got 6gb of ram and an i7. I *can't* slow this laptop down.
18:34stirfooactually I want to get into concurrency to see if I can make this thing breath fire
18:34amalloystirfoo: i like Editor for Middle-Aged Computer Scientists
18:35stirfooamalloy: ahahah, that's a great one
18:35brehautEscape Meta Alt Control Shift
18:36stirfooI remember a vid of hickey talking about running a clojure program that was generating gigs of garbage a second or some such astonomical figure. Concurrency sounds fun!
18:36amalloystirfoo: java loves object churn. it doesn't mind picking up boatloads of garbage as long as the objects that die are young
18:37amalloyand of course immutability and primitive-boxing both create more churn
18:44matthias__hrm, im trying to recompile my whole file (using slime). tried C-c C-k, says it compiles without warnings (even though i commented out a function that is still being called later). and when i run it, its still the old version
18:46amalloymatthias__: C-c C-k doesn't "unload" stuff that's no longer there. it just sends all the text in the buffer to the repl
18:47matthias__so how would i do it? i could restart swank and reconnect, but that's seems wrong
18:47amalloy(ns-unmap *ns* 'the-function-to-delete) is a fine-grained way
18:48amalloyor ##(doc remove-ns) should remote everything in a whole namespace
18:48sexpbot⟹ "([sym]); Removes the namespace named by the symbol. Use with caution. Cannot be used to remove the clojure namespace."
18:48matthias__thanks
19:01rlbamalloy: right you were -- different problem entirely. Thanks.
19:02amalloyrlb: what was i right about? that must have been a while ago
19:04amalloyaha, found it
19:17gtrakhmm, why can't i conj a list onto a map?
19:18gtrak&(conj {:a 1} '(:b 2))
19:18sexpbotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
19:20gtrak&(conj {:a 1} (list :b 2))
19:20sexpbotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
19:20stirfoo&(conj {:a 1} (vec '(:b 2)))
19:20sexpbot⟹ {:b 2, :a 1}
19:21gtrakyea, but that's cheating
19:21stirfoogood question though, I suppose a list cant be coerced to a map entry (vecotr)
19:23gtrakoddly inconsistent
19:23amalloy&(supers (class (first {:a 1})))
19:23sexpbot⟹ #{clojure.lang.ILookup clojure.lang.AMapEntry clojure.lang.Sequential clojure.lang.IPersistentCollection clojure.lang.AFn clojure.lang.IFn java.lang.Runnable java.io.Serializable clojure.lang.Reversible clojure.lang.IPersistentStack java.lang.Iterable clojure.lang.In... http://gist.github.com/977651
19:23amalloymap entries *are* vectors
19:24amalloythey are *not* lists
19:24gtrakah
19:25gtrak&(supers (class '())
19:25sexpbot⟹ #{clojure.lang.Sequential clojure.lang.IPersistentCollection java.io.Serializable clojure.lang.IMeta clojure.lang.IPersistentStack java.lang.Iterable clojure.lang.Obj java.lang.Object java.util.Collection clojure.lang.IObj clojure.lang.IPersistentList java.util.List ... http://gist.github.com/977657
19:26brehauthttp://davidpetersen.blogspot.com/2011/05/reference-model-port-sumac-new-mouse.html
19:26stirfoo&(conj {:a 1} '([:b 2]))
19:26sexpbotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
19:27brehautbugger wrong window
19:28gtrakstirfoo, huh?
19:28gtraki thought we just proved they were vectors?
19:28gtrak&(source conj)
19:28sexpbotjava.lang.Exception: Unable to resolve symbol: source in this context
19:29amalloywe showed that clojure.lang.MapEntry extends vector
19:29stirfoogtrak: well, when given a list, conj seems to be looking at the first of the list, in that example, any way
19:29amalloywe did not show that vector extends java.util.MapEntry
19:29stirfooah
19:30gtrakhmm, java util map vs clojure lang map
19:30stirfooI hope to have a larger clue when I finish this book (joy of clojure)
19:31gtrakon my list as well
19:31gtraki mean vector
19:32amalloygtrak: it's not just the different MapEntry types. the relationship is also backwards: A extends B does not imply B extends A
19:34gtrakright
19:35gtrakbeen going through all the 4clojure problems, I'm glad it exists
19:36amalloygtrak: with the newest release, we're accepting problem submissions from anyone who's solved 50 problems already
19:36gtrakcool, it's an easy way for someone lazy like me to practice clojure :-)
19:37amalloyyeah, that's basically the target audience
19:37stirfooI got started on 4clojure then this book came. Probably get back on in when I'm finished.
19:38gtrakJoC? I like it, though it's a bit dense to just read through and get it, I need to work some stuff out
19:38stirfooamalloy: are my solutions stored locally?
19:39stirfooby locally I mean on the 4clojure box
19:39amalloystirfoo: no. that's been on the todo list for quite a while
19:39stirfooah, ok
19:39amalloyif you choose to share them, we create a gist for you, though
19:39stirfoook
19:41amalloystirfoo: we're always happy to get more contributors, though, so if you want to add it...
19:41amalloyall the code is at https://github.com/dbyrne/4clojure
19:57stirfooI stumbled upon a language called SETL a while ago. It's got some nice syntax like {x**2 : x in {1..33} | odd x}. That got me to looking at clojur's for. (for [x (range 1 34) :when (odd? x)] (Math/pow x 2))
19:57stirfooneat stuff
19:58stirfooprobably be a good exercise converting all the SETL idoms to clojure
19:58amalloystirfoo: that syntax is very like haskell, and also mathematics
19:58amalloythough (* x x) is way better than Math/pow
19:58stirfoooh? I read Python has some of it's roots in SETL as well
19:59stirfooyes, (* x x) how did I miss that? ;)
20:00amalloy$heval [x*2 | x <- [1..10], x*2 >= 12]
20:00sexpbot⟹ Not in scope: `?|?'Not in scope: `?<-?'A section must be enclosed in parentheses thus: (? x * 2 ?>=? 12)Not in scope: `?'Not in scope: `?>=?'
20:00amalloywow what
20:00amalloyanyway that's what the haskell syntax looks like
20:01stirfoois \$heval running haskell or has some mad scientist written a haskell parser in clojure?
20:01shachafThe Haskell language is just some syntax sugar for a few list functions, though.
20:01shachaf(Or a few monad functions soon, so I hear!)
20:02shachafSETL looks like it's actually about sets.
20:02amalloyit's running haskell
20:02amalloyor shelling out to a haskell web service, i forget which
20:02stirfooshachaf: yes, it's an interesting language (from the little I've looked at it) It's been around a long time too
20:02brehautpythons list comprehensions were directly inspired by haskells
20:03stirfoobrehaut: I think python's unpack was inspired from SETL, from what I found
20:16stirfoo(take (dec 5) (repeat rest))
20:16stirfoowrong buffer...
20:18amalloystirfoo: fwiw, ##(repeat (dec 5) rest) is easier
20:18sexpbot⟹ (#<core$rest clojure.core$rest@e63294> #<core$rest clojure.core$rest@e63294> #<core$rest clojure.core$rest@e63294> #<core$rest clojure.core$rest@e63294>)
20:18amalloyassuming that you really like clojure.core/rest
20:18stirfooah, it's an example from joc
20:19amalloyi think the count argument for repeat was new in 1.2, and i know JoC was right up against the border of targeting 1.1 vs 1.2, since 1.2 only got released a little before it was published
20:22scottjjoy of clojure was published april 4, 2011, clojure 1.2 released august 2010
20:24amalloyscottj: yes, actual physical paper publishing. but they had the author's version of "feature complete" long before that
20:24Null-Aj #tutbot-testing
20:25jtoyhi all, im coming to clojure from no java experience at all
20:25jtoycan I just keep adding jars to a classpath file for them to have the libraries loaded?
20:25amalloyjtoy: don't manage classpaths at all! way too much pain
20:26stirfoojtoy: that makes at least two of us having zero java experience
20:26amalloysee eg http://stackoverflow.com/questions/5983427/how-to-install-clojure-on-ubuntu-10-04-from-github-repo-with-no-clojure-jar/5984183#5984183 to get leiningen installed, and read the readme for that project to specify dependencies for your project
20:27jtoyamalloy: i did just install leiningen, my issue is that I cant run my basic sql script
20:28amalloy$google java maven jdbc mysql connector
20:28sexpbotFirst out of 4460 results is: Maven Repository: mysql » mysql-connector-java » 5.1.6
20:28sexpbothttp://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.6
20:28amalloyadd a dependency on that to your project.clj
20:28jtoyI'm trying to do a simple sql example http://pastebin.com/nFeNKqiQ and I get : java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/socmetrics (NO_SOURCE_FILE:0) is that classpath issue ?
20:29hiredmanhttps://github.com/hiredman/agilezen-jdbc
20:29hiredmanlevel 4
20:29amalloyanyway scottj, i can't find the google-group posting now, but when 1.2 came out, either fogus or chouser was like "whew we almost had to ship the book recommending 1.1"
20:30scottjamalloy: yeah I trust you, I remember 1.0 was also released in large part for stu's book
20:31amalloyheh, i wasn't around for that one
20:31stirfooIs there a blog/post somewhere describing how to manage my local projects? Like if I create "lein new foo" and "lein new bar", how would I require/use foo in bar?
20:32scottjstirfoo: other than lein docs not sure
20:32stirfoowould I have to package foo up and put it in ~/.m2/repository ?
20:32scottjstirfoo: you lein install or put foo on clojars or your own maven repo and then add it to project.clj in bar
20:32amalloyyes
20:32seancorfieldjtoy: i suspect you don't have the postgres driver in your project.clj file?
20:32scottjstirfoo: lein install will do that for you
20:33stirfoook, thanks scottj
20:33technomancystirfoo: look at "checkout dependencies" in "lein help readme"
20:33amalloystirfoo: lein also has a concept of "checkout dependencies", which might let you get around the need to install them, but i'm not sure
20:33technomancyamalloy: too slow, bro!
20:33amalloyouch. ninja'd by the man himself
20:33stirfooahaha, lots of lein reading to do
20:33amalloytechnomancy: i'm gonna go ahread and credit your terseness and my verbosity
20:34amalloyi would also accept keyboard pants
20:35seancorfieldi wonder who will publish the first clojure 1.3 book?
20:35jtoyseancorfield: no, im still learning how to do this
20:36jtoyso how do I add a dependecy that is at another url
20:36technomancyjtoy: try "lein new tutorial"
20:36seancorfieldyou'll need to tell lein about the repo
20:36technomancysorry: lein help tutorial
20:36scottjseancorfield: chas or raynes
20:36amalloy$google java maven jdbc postgres connector
20:36sexpbotFirst out of 3450 results is: DatabaseConfigurations - Trails Framework - Codehaus
20:36sexpbothttp://docs.codehaus.org/display/TRAILS/DatabaseConfigurations
20:36seancorfielde.g., :repositories { "eaio.com" "http://eaio.com/maven2&quot; }
20:36Raynesscottj: ?
20:36seancorfieldbut for postgres
20:36amalloyscottj: i don't think Raynes is doing any 1.3-oriented stuff
20:36RaynesOh.
20:37jtoyamalloy: I found the postgresql driver at here: http://mvnrepository.com/artifact/postgresql/postgresql but I think i still need to tel llein about it
20:37RaynesYes, I am. My book will be 1.3 compatible and so will Chas.
20:37amalloyyeah, if it's not in maven central
20:37RaynesChas's book will probably be out before mine though.
20:37amalloyjtoy: like seancorfield said. add a :repositories key to project.clj, like :repositories {"sun" "http://download.java.net/maven/2&quot;}
20:38amalloyoh, but that's maven central. you shouldn't need to add a repo for that, lein already knows about it
20:39amalloyso you can just have a dependency on [postrgresql "9.0-801.jdbc4"]
20:39amalloyexcept spell postgresql right
20:39seancorfieldjtoy: the following works: :repositories { "postgresql" "http://mvnrepository.com&quot; }
20:39seancorfield :dependencies [[org.clojure/clojure "1.2.1"]
20:39seancorfield [postgresql/postgresql "9.0-801.jdbc4"]])
20:40seancorfieldi didn't try the regular repo... let me try that too
20:40technomancymvnrepository.com is just a search engine
20:40amalloyfeh
20:41amalloyi've only needed to add a repo once, for java-getopt, and i'd imagine postgres would make it to central
20:41seancorfieldyup, don't need that repo spec... my bad
20:41technomancymvnrepository has a lot of downtime
20:41seancorfieldi had to add a repo for clojure 1.3.0 snapshots :)
20:41amalloytechnomancy: fair enough, but so far mvnrepository.com has only pointed me at jars that exist in maven central. will that not always be the case?
20:42technomancyamalloy: that's right; I was reacting to putting it in the :repositories list
20:42amalloyoh
20:45seancorfieldi also had to add a repo for the eaio uuid (although i see a fork of it in maven from stephen connelly)
20:48amalloythey're so hard to work with in jara
20:48amalloyjava
20:57jtoylein compile
20:57jtoyproduces: No namespaces to :aot compile listed in project.clj. does that mean my code didnt work?
20:57amalloymeans you don't need to compile clojure code
20:58amalloyunless you have a compelling reason to do so
21:04technomancyyou can do "lein compile :all" if you just need a quick sanity check that things are working well. but in most cases "lein compile" shouldn't be necessary.
21:06jtoyit looks like I need to manually add contrib also?
21:16ihodesjtoy: yes, to your project.clj. add any libraries you want to use!
21:16ihodesjtoy: if you're set on compiling your code, there are some good articles that came up for me on google last time i checked. you have to do a little extra work.
22:05Raynesamalloy: I bet they're hard to work with in jara as well.
22:26stirfoodoes compare only look at the first element of each vector here?: (compare [2333 15 "Eno"] [979 99 "Burial"])
22:34stirfoowell I'm guessing yes because (compare 3 "x") throws, but (compare [1 3] [2 "x"]) does not
22:36darevayYeah. See compareTo() here: https://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/APersistentVector.java
22:39stirfooah so it will blast through until it finds two different elements
22:40stirfoothanks darevay
22:40darevaynp
22:42darevayit's interesting that shorter vectors are "less than" longer vectors. I would have expected it to act like a string comparison.
22:45amalloy&(< "" "1")
22:45sexpbotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
22:45amalloy&(.compareTo "" "1")
22:45sexpbot⟹ -1
22:45amalloydarevay: "" is less than "1"
22:45amalloyso it sounds like a strcmp to me
22:48darevay&(.compareTo "abc" "aaaaaaa")
22:48sexpbot⟹ 1
22:48stirfoois there a way to print that Java method source from a repl? like (source compare)
22:48stirfoothat would be neat
22:49amalloystirfoo: it's much harder
22:50darevayamalloy: "abc" is greater than "aaaa" even though it's shorter :)
22:50amalloydarevay: oh, i see. i didn't read the source; it compares length before going by element?
22:50stirfooyep
22:50darevayyeah
22:51amalloyi suppose it's just faster, and you don't "need" equivalence with strcmp like you do for strings
22:53stirfoo(javadoc (. clojure.lang.Util compare))
22:54darevayThat's probably the case. I'm sure there's a lot of room for debate over the "natural" ordering of vectors
22:54stirfoowell that was dumb, but (javadoc [1 2 3]) produces _something_, a google search
22:55amalloy&(doc javadoc)
22:55sexpbotjava.lang.Exception: Unable to resolve var: javadoc in this context
22:55amalloy&(use 'clojure.repl)
22:55sexpbot⟹ nil
22:55amalloy&(doc javadoc)
22:55sexpbotjava.lang.Exception: Unable to resolve var: javadoc in this context
22:55stirfooah, class-or-object
23:20KirinDaveJeez. I need to convert Clothesline to using the monad library REALLY BADLY.
23:27symboleAnyone know what's going on at Clojure NYC tomorrow?
23:42dnolensymbole: seems like noone's stepped up to present something :(
23:43seancorfield__so i presented an intro to functional programming (using clojure) to a bunch of cfml devs last week...
23:43dnolenseancorfield__: how'd that go?
23:44seancorfield__really well! within 30 mins after the talk, one guy had CCW installed and was already trying out some examples :)
23:44seancorfield__several devs were pretty excited about learning something new
23:45seancorfield__although one eval of the talk complained "There wasn't enough CFML in the talk" ... but he also said "Still plenty of interesting stuff I can try in CF"
23:45amalloyseancorfield__: any new 4clojure users?
23:45seancorfield__heh, i expect there will be at some point :)
23:47dnolenseancorfield__: good to hear. presented some macro philosophy to the NYC FP Meetup tonight - went well - Haskellers, Scalaists, Schemers, Prologists, Racketeers seemed to dig it. Though that's a bit of preaching to the choir I suppose :P
23:47seancorfield__now that i can work with CCW and clojure 1.3.0, i can at least make sure the other devs at work can all fire up a REPL and try code out in their normal env
23:48seancorfield__yeah, the cfml community is definitely not "choir" as far as FP is concerned :)
23:50amalloymost of those folks aren't choir for macros either
23:50seancorfield__i showed one macro example and it blew several people away...
23:51seancorfield__scala days is coming up soon... anyone here going? i don't know how much cross over there is between scalaists and clojurians
23:52dnolenseancorfield__: I was actually lamenting that tonight.
23:52seancorfield__a lack of such cross over?
23:53dnolenseancorfield__: well there was a Scalaist in the audience that understood where I was coming from about macros. He noted the dynamic / static divide, but I think that's pure fiction.
23:53dnolenI mean that the dynamic / static divide is not a real one.
23:54seancorfield__i see some very strong feelings on both sides of that issue tho'... so it's very real to some people :)
23:55dnolenseancorfield__: logic programming shows the way, you don't know need one or the other, you can have both. Was happy that the static camp there was there got that.
23:57seancorfield__strangely, in the cfml community - very much dynamic - i see quite a few folks wanting their language to change (to the static side)...
23:58seancorfield__i've even given talks suggesting they look more at other dynamic languages instead of stuff like java :)
23:59dnolenseancorfield__: Dynamic programmers like unit test - aka proofs. Static programmers want expressiveness - aka generic programming. The divide is artificial.