#clojure logs

2012-01-26

00:02jeremyheilerclj_newb: Anything that you send to an agent will be executed at the end of a transaction, or not executed at all if the transaction is rolled back.
00:03clj_newbjeremyheiler: I'm not using transactions; apparely just agents have sufficed so far
00:03jeremyheilerYou are using transactions, although implicitly.
00:05jeremyheilerAt the very least, an agent will never change unless a transaction completes.
00:09muhoois it possible for javascript apps to use libraries from clojurescript in much the same way that java programs can use libraries written in clojure?
00:10zenoliWhat version of SLIME is currently recommended for use with the swank-clojure 1.4.0 snapshots?
00:13clj_newbjer
00:13clj_newbjeremyheiler: ah, your point is that the value of a @ is either the old value, or the new value if the function completes, right?
00:14clj_newbjeremyheiler: (I, personally, was just amazed when I read that agents are automatically run in different threads, thus providing concurrency)
00:14jeremyheilerclj_newb: yeah, it's cool stuff.
00:16muhoonice, so stuff you write on a 1 core machine is already ready to run on a sun server
00:18jeremyheilermuhoo: re: clojurescript; I haven't used CLJS, but I don't see why not. CLJS compiles to straight JS. The problem is if you compile your CLJS with google closure's advanced option, you probably cannot rely on function names being consistent from compile to compile.
00:19jeremyheilerI could be wrong, though.
00:19dnolenmuhoo: yes, it can work even under advanced compilation, just declare your exports
00:19dnolen(defn ^:export name-should-not-change [] ...)
00:20jeremyheilernice, that's awesome
00:21zenolinvm, found it - 20100404, the version in ELPA.
00:23muhoojeremyheiler: dnolen thanks
00:25muhooone really fundamental question: i'm trying to understand the difference between for and map/filter. are they different in syntax only, or in function?
00:26muhoofor seems prettier in most cases.
00:29alandipertmuhoo: map and filter are functions, for is a macro, so they're different in that sense
00:30muhoooh, i'll look at the source of for. i bet it's implemented as map and filter
00:31jeremyheilerthe source for `for` is really intense.
00:31muhoohm, maybe i'll wait then :-)
00:32dnolenmuhoo: not quite, it does quite a few fancy things - more similar to Haskell list comprehensions
00:32hiredmanthe source for map is more complicated then you would expect as well
00:33muhooi don't know haskell. i'm coming to clojure from python, with some scheme background.
00:33dnolenmuhoo: similar to for comprehensions in Python too
00:34muhoogood to know, thanks
00:34RaynesI used to turn on the parallel list comprehension GHC extension in Haskell and pretend I was high.
00:34muhooheh
00:35muhoothis language is obsessively addicting
00:44amalloyfwiw for is implemented mostly with mapcat, which is more general than map and filter
00:51romanandregquick, dummy question: what does the ^:dynamic flag means on def sexps?
00:51romanandregI'm trying to google the hell out of that but can't find any specific result that would answer that
00:51clj_newbread about bindings
00:52RaynesIt declares the var dynamic, meaning it will be possible to rebind that var with binding.
00:58romanandregRaynes: oh so… if I want to use "binding" form on a def, I have to set it as dynamic
00:58romanandregthat explains everything… thanks
00:58RaynesAs of Clojure 1.3, yes.
00:59adam_what is the ->> operator called?
00:59RaynesI've heard both -> and ->> referred to as the 'threading' function.
01:06adam_word, i found it on clojureDocs, its actually a macro
01:07adam_http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E
01:07amalloy$cd ->>
01:07adam_http://clojuredocs.org/clojure_core/clojure.core/->>
01:07amalloyhm. Raynes, is clojuredocs plugin off, or am i forgetting how to use it?
01:07Raynesamalloy: What did you expect to happen?
01:08RaynesOh.
01:08RaynesI thought that what adam_ said was lazybot sayin git.
01:08RaynesLet me check the logs for breakage.
01:09Raynesamalloy: Looks like cd-client doesn't like the symbols in the URL.
01:09adam_i corrected it when I realized it didn't copy
01:10amalloyadam_: the first paste is a more correct url. urlencoding, dudes (apparently cd-client needs a lesson on that too)
01:12Raynesamalloy: FYI, people who have 'develop' branches without master branches are the devil.
01:12Raynesdevn: We use the shit out of git-flow, but it isn't git flow if you don't have a bloody master branch.
01:13RaynesAlso, dakrone is in here, so I'm being rude.
01:13devnRaynes: it sort of is, no? master is production.
01:13devndevelop before production, right?
01:13RaynesRight, but in this case, many releases have gone by with no master branch.
01:14devnmaybe he doesn't think of them as releases?
01:14RaynesUh. Okay.
01:14devnbumping a number on a repo doesn't make a release a release. it could be the buggiest piece of garbage ever written. just playing devil's advocate here.
01:14RaynesI've seen some stuff man, and some things. I wouldn't recommend it.
01:15RaynesI think pushing to clojars and using it in production constitutes a release. *shrug*
01:15RaynesBut you could be right.
01:15devnnot crazy by any stretch of the imagination
01:16RaynesThere is always the chance that he grew up on Mars and is only just now adapting to life on Earth, pretending to be one of us.
01:17devnfor the sake of argument, why is master, "master"? Verbs are nice. "develop" serves the role of "canonical edge branch" and "verb suggesting this is 'in development'" nicely
01:18devnmaster is clojars
01:18devnit's not for developing from -- there's a tag or a commit for that, y'kno?
01:19devnthat's one way of looking at it, anyway.
01:24devnbtw, I hate oauth
01:25devnoauth manages to make every mashup, done in 15min programming idea and turn it into 2 hours of bullshit.
01:26Raynesdevn: Generally the same experience. It's why I went with BrowserID on RefHeap. I don't like difficult and annoying authentication protocols.
01:26devnunless you have boilerplate at the ready, hence the reason most oauth libs have examples of how to use oauth with their library, with specific APIs
01:26muhoooauth2 does in fact suck. but are there any libraries for doing it in clojure?
01:26Raynes$google clojure-oauth
01:26lazybot[mattrepl/clj-oauth - GitHub] https://github.com/mattrepl/clj-oauth
01:26devnmuhoo: oauth-clj
01:26muhoonice
01:26muhoothanks
01:26RaynesPeople really need to stop naming shit like that.
01:26devnoauth-clj.v2 handles v2 oauth stuff
01:26devnRaynes: agree 10,000%
01:26Rayneso-clj-auth is coming next, I bet.
01:26devnclo-jauth
01:27muhoopart of the problem is that lot of the cool names are already taken
01:27devnWe need to just programatically exhaust clj-* combinations, and dilute the search space so much that existing libraries will need to change their names to stay relevant.
01:29devni will create a list of random names for current clj-* maintainers to use when renaming their project. for instance, a small sample: ["baked-potato" "merle" "burt-reynolds" "foozball" "donut-buyer"] and so on.
01:29muhoonot worth the time. but it could be worse, you could end up with names like they have in ruby land, like "texticle" and "cheepnis" and such.
01:29devnhonestly i think that's an improvement
01:30Raynesmuhoo: I named a project 'conch' just a few days ago. Don't tell me all the good names are taken.
01:30devnwhat are we arguing about again?
01:30RaynesThe price of tea in China.
01:30muhoothis library seems very useful; thanks
01:31devnadam_: ->> is often referred to as thread-last, -> would be thread-first
01:31clj_newbIs there a notion of priority in clojure agents? What I have here in my WYSIWYG editor is an (doc-Agent), which renders to a (image-Agent) [which blits to a Java Graphics2D]. I would like to make my doc-Agent, image-Agnet VIA (Very Important Agents) ... right now, this extra level of indirection (having rendering to image done in extra thread rather than directly in swing), seems to be causing some extra lag
01:33jeremyheilerSo, i've started working on an SMTP client lib for Clojure that doesn't depend on JavaMail. I'm calling it Lime (not smtp-clj or something wicked awesome like that) either case, it's up on github, and i'm keeping a blog that tracks my progress: http://abitofclojure.com/
01:33devnjeremyheiler: cool!
01:34jeremyheilerdevn: thanks
01:34Raynesjeremyheiler: I tried wrapping JavaMail a long time ago.
01:34devnjeremyheiler: do you follow the list?
01:34RaynesI still have the scars.
01:34Raynesjeremyheiler: I, for one, applaud your word. Keep it up.
01:34jeremyheilerRaynes: I've seen a lot of wrappers, even created one myself ... but yeah, you don't need me to explain .. lol
01:34adam_devn: thank you!
01:35jeremyheilerdevn: yeah im on the list
01:35jeremyheilerRaynes: thank you, much appreciated.
01:35devnadam_: np. to remove a -> or a ->> from an expression is to "unthread" a form
01:36devnjeremyheiler: you might consider sending an email announcing your library if you're interested in feedback?
01:36devnSubj: [ANN] Lime: SMTP Library for Clojure
01:36jeremyheilerdevn: Thanks, I will. I'm not sure I want to do it yet, but there's probably no reason to wait.
01:37devnno pressure, just mentioning it. i'm on the list and when I don't have time it's still fun to peek at [ANN] emails, so I'm being self-centered to suggest it to you in the first place ;)
01:38devnjeremyheiler: releasing is nice. it's kind of like gambling. either no one will care, or you'll get a bunch of pull requests and wind up supporting a library a lot of people in the community find valuable
01:39devnjeremyheiler: except it's the opposite of gambling in that either way you sort of win
01:40jeremyheilerdevn: haha yeah. i think i might write up an email tomorrow. I mean, i forced myself to get enough done to write a couple blog entries before saying anything to anyone, which has made me happy. I just want it to be clear that it's no where near ready to be really used.
01:42amalloyRaynes: fwiw, oauth and browserid have different goals. the thing you decided not to do was openid, not oauth
01:42Raynesamalloy: I was comparing openid to oauth in complexity. Didn't mean to imply I used browserid in place of openid.
01:47Raynesdevn: You're a clojuredocs-client commiter?
01:47Raynescommitter*
01:48RaynesCould have swore I glanced "devn" under list of people to notify of my pull request.
01:58emezeskeTotally on-topic: could somone please type the word "relevant"? I'm trying to get my IRC client to *not* hilight that, even though it contains my name (evan).
01:58Raynesrelevant
01:58emezeskeAs it stands, the word "relevant" gets typed a lot in here
01:58emezeskeRaynes: Thanks!
01:58RaynesNo problem.
01:59Raynesemezeske: I recently noticed you're the one who put up the paredit.vim repo I've been using. Thanks for that.
01:59emezeskeHaha, awesome. No prob!
02:00emezeskeDo you know that I made a funky change to it?
02:00RaynesNope.
02:00emezeskeThe default version does weird things when I "cw", so I disabled paredit for that (I think)
02:01RaynesI don't know what that does.
02:01emezeskeChange Word
02:01RaynesI see.
02:01RaynesThat's useful.
02:01RaynesI needed that like 20 minutes ago.
02:01emezeske:)
02:01emezeskeI use that command a *ton*
02:02jeremyheilernice, it beats the heck out of doing "dw" then "i" lol
02:02RaynesI do a lot of da( i
02:02emezeskejeremyheiler: Definitely!
02:02RaynesI guess I could just be doing ca(
02:02jeremyheilergonna have to train my fingers to hit the cw quickly, though.
02:03emezeskeI also like doing "c2w" or "c3w" to change two or three words
02:03emezeskeOr really, any motion; "c$" or "c3l"
02:04emezeskeThe best thing about "c" is that you can repeat it with "."
02:04jeremyheileremezeske: it think it's safe that the emacs guys aren't watching
02:04jeremyheiler***hides
02:04RaynesThey're always watching.
02:05emezeskeYeah, I'm sure their emacs has IRC built in, and they can see all vim-related heresy by pressing C-M-Win-x-p-t
02:06jeremyheilerhahaha
02:06acts_as_davidquestion, is there a way to keep leiningen from opening the java applet in the dock when starting a repl?
02:06RaynesI used ERC when I used Emacs.
02:07acts_as_davidrunning clojure manually has never done this for me (via java -cp, etc.), so I'm assuming this is a lein thing
02:07Raynesacts_as_david: That shouldn't happen.
02:07jeremyheileracts_as_david: are you using lein-ring?
02:07RaynesWhat version of Leiningen and are you running `lein repl` in a project?
02:07RaynesIt has to be a plugin or a dependency or something that's causing it, because Leiningen certainly doesn't.
02:08acts_as_davidah okay
02:08acts_as_davidhold on a sec
02:08acts_as_davidlein --version: Leiningen 1.6.1.1 on Java 1.6.0_26 Java HotSpot(TM) 64-Bit Server VM
02:08jeremyheileri know lein-ring will use clojure.java.browse/browse-url and for me (on linux/xfce) it opens a java swing window and loads the page in it *pukes*
02:09acts_as_davidthe only dependency so far is incanter, which i know comes with a sort of "interactive mode" that would do such a thing
02:09acts_as_davidany way of suppressing it?
02:10jeremyheilerneed to find out what's opening it first
02:10acts_as_davidhere's my project.clj:
02:10acts_as_david(defproject ml "0.0.1-SNAPSHOT"
02:10acts_as_david :description "A study in machine learning, using Clojure"
02:10acts_as_david :repositories { "sonatype-oss-public"
02:10acts_as_david "https://oss.sonatype.org/content/groups/public/" }
02:10acts_as_david :dependencies [[org.clojure/clojure "1.3.0"]
02:10acts_as_davidoops sorry for the multiline. damn irssi
02:10acts_as_david[incanter "1.3.0-SNAPSHOT"]])
02:10jeremyheilerit good, just don't let it happen again.
02:10jeremyheiler;-P
02:11acts_as_davidlesson learned ... pastie all the way heh
02:11Raynesacts_as_david: https://refheap.com </shamelessplug>
02:11acts_as_davidso i'm assuming it's incanter. is the first step to require indiv. incanter modules instead of the wholesale package?
02:11jeremyheileryeah... https://github.com/liebke/incanter/blob/master/src/incanter/main.clj
02:11RaynesYou can also set java.awt.headless
02:11acts_as_davidRaynes, I'll check out it out :)
02:12acts_as_davidah i see
02:12Raynesacts_as_david: You are required by law to use refheap if you plan to be friends with me.
02:12acts_as_davidis java.awt.headless the way to go?
02:12acts_as_davidheh
02:12RaynesIt's *a* way. I'm not sure if there are consequences to using it besides preventing a dock icon from showing up.
02:13acts_as_davidi don't do the whole "law" thing ;-)
02:13acts_as_davidah okay
02:13jeremyheiler~guards
02:13clojurebotSEIZE HIM!
02:13RaynesShould acts_as_david use refheap??
02:13lazybotRaynes: Uh, no. Why would you even ask?
02:13RaynesBetrayal!
02:13acts_as_davidmaybe the solution is to remove it in a pull request ;-)
02:14clj_newbcan I stick an ImageIcon directly in a JPanel, or do I have to throw in an intermediate JLabel first?
02:14acts_as_davidanyone know leibke?
02:14RaynesI interacted with him in an elevator once.
02:14acts_as_davidRaynes, it's like a magic eight ball. ask enough times and you'll get the right answer
02:14jeremyheilerhttp://incanter.org/developer/ might get you started
02:15acts_as_davidso did i, if by elevator you mean e-mail, and by interacted with, you mean "chatted"
02:15jeremyheileracts_as_david: ^
02:15acts_as_davidthanks jeremy
02:15RaynesI wanted to touch his beard but he had shaved it.
02:15acts_as_davidat one point i considered adding some stats functionsi to incanter but the codebase scared me a little bit
02:15acts_as_daviddoes he have an epic beard
02:17RaynesHe did.
02:22acts_as_davidjust sent an e-mail to the incanter group
02:23acts_as_davidi want to see if they can turn this off -- seems like it'd be covered by some sort of a "start-friendly-version-of-incanter" script
02:23acts_as_davidRaynes, so why do i need to use refheap instead of gist/pastie?
02:23acts_as_davidi'm curious
02:24RaynesWell, I was hoping being friends with me was enough.
02:24muhoobecause it has clojure syntax highlighting?
02:24RaynesWell, so does gist and pastie.
02:24muhooand it's shit-tons faster than either pastebin or pastie
02:24RaynesIt is?
02:24muhoowas for me
02:24RaynesWell, that's cool.
02:24muhoopastebin is always a 3-second wait
02:24Raynesacts_as_david: Go paste something and then click "maximize" in the upper right corner of your paste.
02:25RaynesFor best effect, paste something large.
02:25muhooRaynes: was it written with noir or compojure? :-)
02:25RaynesBoth.
02:25RaynesNoir uses compojure.
02:25RaynesBut technically I use noir. :)
02:26acts_as_davidah cool
02:26Raynesacts_as_david: Anyways, that's my favorite feature.
02:26acts_as_davidokay, so fast + friends-with-Raynor + zomg-expansion
02:27RaynesYou can link people to your code and only your code if you want.
02:27acts_as_davidyou should totally put this in your next billboard sign
02:27muhoo+ written in clojure
02:27acts_as_david;-)
02:27acts_as_davidah cool
02:27RaynesWe plan to implement revisions and diffs as well. Basically do what github does without git.
02:27acts_as_davidhave you ever considered taking all pastes, concatenating, and typing (eval ...) in a repl? :p
02:28acts_as_davidnice idea
02:28RaynesHeh.
02:28muhoodangerous?
02:28clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
02:28Raynesacts_as_david: I wrote this a couple of days ago: https://github.com/Raynes/refh if you want a command-line app for pasting.
02:28acts_as_davidwow does clojurebot eval all clojure code?
02:28RaynesAlso wrote a vim plugin and there is a super alpha elisp library.
02:29RaynesNo, he just sometimes says random things.
02:29RaynesI guess it isn't fair to say refheap is written in Clojure. It's actually written in Clojure, Ruby, Python, and Javascript.
02:30acts_as_davidnice. i'm going to investigate. is the token passed over ssh?
02:30RaynesAnd a little VimL if you count refheap.vim.
02:30muhooheh, refh is in ruby.
02:31Raynesacts_as_david: Over ssh? :o
02:32acts_as_davidsry ssl ... i'm in server mode today
02:32RaynesHaha.
02:32RaynesYeah everything is SSL.
02:32RaynesAny non-ssl request redirects to SSL.
02:32RaynesBut your token is basically disposable.
02:32RaynesYou can generate a new one at any time, rendering the old one useless.
02:32acts_as_davidexcellent. back to the swing problem, how do i set java.awt.headless?
02:33acts_as_davidit's been way too long since i've tweaked JVM options
02:33acts_as_davidis it like -D java.awt.headless=true or something
02:33Raynesacts_as_david: In your project.clj, set :jvm-opts ["-Djava.awt.headless=true"]
02:33RaynesOught to do it.
02:33acts_as_davidawesome
02:34acts_as_davidthat did the trick. excellent
02:35Raynesacts_as_david: Also, in all seriousness, you don't have to use refheap. I've been told in the past that my marketing abilities are terrible, so I thought I'd tackle you with refheap and make a user out of you.
02:35muhooi'm already sold
02:35Raynes:p
02:35muhoois there a RESTful way to post to it (so i could write my own CLI to do it)?
02:35acts_as_davidi'll certainly give it a look. i'm all for supporting the new guy on the block
02:36Raynesmuhoo: https://github.com/Raynes/refheap/wiki/Documentation:-API
02:36muhoothx
02:36acts_as_davidboom ... just followed you on GH
02:37Rayneshttps://github.com/Raynes/innuendo or https://github.com/Raynes/rubyheap for examples of using that API.
02:37RaynesI've got an even 100 followers on Github.
02:37muhoooh yes https://github.com/Raynes/refheap.el
02:38RaynesNot promising that actually works.
02:38Raynes:p
02:38RaynesMy elisp isn't so great.
02:38alandipertRaynes: you guys should do structural diffs!
02:38Raynesalandipert: I like how enthusiastic you are about that!
02:38alandipert!!!
02:38muhooi don't like the way that google code shows diffs
02:39muhooi do like a plain old "diff -u" style diff.
02:40acts_as_davidall right i'm heading out. ciao
02:40RaynesHe's a nice fellow.
02:42Raynesalandipert: I just can't wait for revisions, myself.
02:42RaynesRevisions are super cool.
02:42alandipertRaynes: yes that will be great
02:42RaynesYou can edit and fork right now, but we needs us some revisions.
02:44Raynesmuhoo: Do you actually plan on writing your own CLI tool?
02:44RaynesOr were you asking just in case?
02:58muhooRaynes: my cli tool will likely be bash wrapping curl
02:58muhoounless i end up using the emacs mode, which i'd prefer
02:59muhoobut bash+curl+shell-command-on-region would work just fine if the emacs mode isn't ready
03:16emezeskejkkramer: Any chance I could convince you to update Clojuresphere? ^_^
03:16emezeskejkkramer: It looks really cool, but it's a ways out-of-date.
03:34Blktgood morning everyone
03:35AWizzArdBuongiorno Blkt
03:35frankvil1elmsenI can have two expressions in a partition-by such as (partition-by # (<% 3) "(>% 8)"? (range 1 9))
03:37Blktbuondì AWizzArd :D
03:38frankvil1elmsensorry it should be a question
03:43AWizzArdfrankvil1elmsen: what is your example supposed to do?
03:44frankvil1elmsenI would like to have them less than three, AND those larger than 8
03:46AWizzArdfrankvil1elmsen: then you can just do this in your function.
03:46AWizzArdfor example:
03:46AWizzArd,(group-by #(or (< % 3) (> % 8)) (range 1 15))
03:46clojurebot{true [1 2 9 10 11 ...], false [3 4 5 6 7 ...]}
03:47AWizzArdIf you are just interested in those elements that match to your rule you can run (filter #(or (< % 3) (> % 8)) (range 1 20)).
03:48AWizzArdpartition-by will traverse the whole sequence and not group those elements that your rule describes, but instead split at that point.
03:48frankvil1elmsencool - I have gone completely in the wrong direction, thx, I think I got it :-)
03:50frankvil1elmsenhaha,, the group-by is perfect in my case .. thanks AWizzArd
03:51clj_newbI'm in Clojure. I'm having Java run out of memory heap errors.
03:51clj_newbAre there clojure functions to help me print out heap statistics, and manually call GC?
04:24atc-morning all :)
04:25atc-Quick question: I have three collections, I want to put the last item from the latter two into the first, but without nils. What's the best way to do this? Some application of reduce?
04:26clgvatc-: make a small example to rule out misunderstandings ;)
04:27Fossialso, how often, etc
04:27Fossii'd reverse and find or such
04:28Fossibut might not be what you need performancewise
04:29atc-OK, let me drum up an example quick :)
04:32atc-Hopefully the following will clarify: http://pastebin.com/0uaPH7ni
04:32atc-Sorry, I don't want to paste all the code 'cause I want to solve the greater problem myself :)
04:33atc-clgv: hopefully the pastebin will clarify a little.
04:35clgvatc-: you could make pairs of both seqs until both run out and then cons/conj them on a list and do a filter afterwards. instead of filtering you can remove nils when before adding to the list
04:36atc-clgv: yeah, I'm trying to avoid "post processing" by using a filter to remove the nils afterwards at that could be very inefficient.
04:37atc-clgv: so how do I achieve not adding nils? :|
04:37atc-clgv: BTW, I'm a newbie! :)
04:39atc-clgv: I currently conj the three together: (conj pile (last top) (last btm))
04:39atc-clgv: but of course, the last calls yield nils when there's nothing in top/btm
04:39atc-god I keep writing ) at the end of sentences!
04:43clgvatc-: you definitely want to use loop-recur for that?
04:44atc-clgv: perhaps not. I'll show you all my code, it'll give a better context for you
04:44atc-clgv: I'm solving a shuffle problem using brute force
04:44atc-clgv: brute because it makes me write more code and learn clojure
04:44atc-clgv: here's the code: https://github.com/atc-/clojure-playground/blob/master/shuffle/shuffle.clj
04:46clgvatc-: a right, you want to just interleave the two collections, right?
04:47atc-haha
04:47atc-yes, probably
04:47atc-haha, that's cheating! :P
04:47atc-I didn't know the term...
04:47clojurebotexcusez-moi
04:47atc-cheating?
04:47clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
04:47Fossiwat?
04:47Fossi;D
04:47atc-wut
04:47atc-cheating?
04:47clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
04:48atc-hehe, perhaps a bug
04:48clgvatc-: well interleave does not handle different sized collections correctly
04:48atc-clgv: oh, that's a bummer. That's exactly what I'll have
04:48clgvatc-: it'll stop when one of the sequences runs out
04:48clgvatc-: but you can take the interleave code and patch it ;)
04:48atc-clgv: I definitely don't want that
04:49atc-clgv: now THAT'S brute force :P
04:49jaleyanyone know if there's a function like (find-first #(odd? %) [2 4 6 8 9]) in the core libs anywhere? There was one in clojure.contrib.seq in 1.2 but now I've lost it.
04:50clgvatc-: there is a "(when (and s1 s2) .." form in it. you can change that "and" to "or" then you#ll have nils and all elements in it
04:50atc-clgv: hmmm, those dasterdly nils again :|
04:50clgvatc:- to get rid of the nils you'll have to check via 'if
04:51Fossithere's gotta be a mor eclever way to do that
04:51atc-atc-: ok, just thought I could do it more succintly than that
04:52atc-Fossi: yeah, my thoughts. hence why I haven't written an if for it
04:52clgvhmm well it'll be lazy so filter-ing it afterwards is almost no overhead
04:52atc-unless I use a set?
04:52atc-that'll mean only one nil will be there
04:52atc-unless they're true sets?
04:53atc-i.e not allowing nulls/nil
04:53clgvatc-: rewrite interleave with "or" and filter with identity
04:54clgvatc-: both operations are lazy so it's almost as if you included the if-dispatch in the rewritten interleave but without the pain ;)
04:54atc-clgv: forgive me, but it feels like a hack :|
04:54clgvatc-: nope thats idiomatic clojure.
04:55clgvthe only missing part in clojure is a "consume all" interleace and also a "map" version of it
04:55clgv*interleave
04:55atc-clgv: ok, I'll take your word for it
04:55atc-I think I might've solved the interleaving by using nested cons
04:56atc- (cons (last btm) (cons (last top) pile)))
04:56atc-(ignore the last ")")
04:56RaynesRewriting core functions isn't idiomatic Clojure. :p
04:56RaynesUsing filter certainly is.
04:56clgvatc-: in idoimatic clojure you usually shouldnt start with loop-recur
04:56atc-Raynes: so filtering on the possible very large result would be idiomatic?
04:57atc-clgv: really? how would you solve it?
04:57clgvRaynes: yeah. but he needs interleaving and the is no consume all version of it
04:57atc-clgv: I thought recursion was very clojurish :(
04:57Raynesatc-: Yes, because filter is lazy.
04:57clgvRaynes: you cant even "mapcat list" on the sequences since it wont consume both completely
04:58atc-Raynes: lazy? how so? it won't evaluate all? can you elaborate perhaps?
04:58Raynesclgv: I'm not saying he shouldn't roll his own interleavr here.
04:58clgv~lazy-seq
04:58clojurebotTitim gan éirí ort.
04:58atc-lemme RTFM on lazy
04:58clgvRaynes: thats what I suggested to him - not rewriting the whole core ;)
04:58atc-I've got enough clojure.org tabs open to sink a ship
04:59Raynesatc-: It won't evaluate anything until you actual need them.
04:59Raynesclgv: Just the way you worded it irked me.
05:00atc-Raynes: ok. in my example problem I was afraid that it would evaluate it entirely because I'd do something like this: (filter #(not (nil? %) (conj pile (last top) (last btm)))
05:00clgvRaynes: yeah, well you have to think in context. All I was saying that the resulting implementation from taking interleave implementation with 'or and filtering is idiomatic. but as you see explaining it carefully out of context gets pretty long ;)
05:01amalloyyou can do it in just a couple lines, really, but i don't want to spoil the fun by just pasting it
05:01atc-amalloy: the shuffle problem? or interleave consuming all?
05:02amalloyinterleave
05:02atc-right
05:02amalloyi didn't notice anyone had a shuffle question
05:02atc-I'll go read the interleave source and see what I can muster up
05:02amalloyalso, (cons x (cons y z)) is just (list* x y z)
05:02Raynes$cd interleave
05:02lazybotclojure.core/interleave: http://clojuredocs.org/v/1869
05:02lazybotclojure.core/interleave: http://clojuredocs.org/v/5560
05:03atc-thank you
05:04atc-ok, lots of food for thought
05:04amalloymy solution to the interleave problem is at https://refheap.com/paste/435 if you want a spoiler
05:04Raynesamalloy: Didn't you want those all in one message? You should patch it.
05:04atc-thanks clgv, Raynes, amalloy
05:05Raynesamalloy: braid is a significantly awesome name.
05:05clgvamalloy: ah right, if you do it for arbitrary collections its the map first and keep. good one :)
05:05amalloyRaynes: braid is a significantly awesome game
05:05atc-amalloy: oh nice, that list* had eluded me thus far. very handy
05:05amalloy$findfn 1 2 3 [4 5] [1 2 3 4 5]
05:05lazybot[clojure.core/list*]
05:05clgvinc lazybot
05:05clgv;)
05:06Raynes$botsnack
05:06lazybotRaynes: Thanks! Om nom nom!!
05:06atc-heh
05:06clgv(inc lazybot)
05:06lazybot⇒ 4
05:06Raynes$karma
05:06clgvsince you guys are here - what do you use for debugging?
05:06Raynes$karma Raynes
05:06lazybotRaynes has karma 12.
05:07Raynes(doto x prn)
05:07clgvand what do you think are good tools for debugging clojure code that you might not use?
05:07amalloyi use useful.debug's ? macro mostly, since i wrote that. it's primitive but useful and easy
05:07clgvRaynes: nothing more elaborate?
05:07RaynesNope.
05:08RaynesJust (doto x prn). Has never failed me.
05:08amalloyit'd be nice to have a debugger like gdb or eclipse's java debugger, but in a non-stateful language it's both less necessary and less useful
05:08clgvhm ok. I use debug-repl quite frequently and adapted it a bit
05:08clgvamalloy: I use eclipse debugger sometimes. but debug-repl more frequently
05:09RaynesWow. Why am I still awake?
05:09clgvRaynes: since it's almost noon - at least over here ;)
05:09Raynes$time -6
05:09lazybotRaynes: The time is now 2012-01-26T04:12:43Z
05:10clgv$time 1
05:10lazybotclgv: The time is now 2012-01-26T10:13:00Z
05:10clgvoh thats wrong
05:10clgv$time 2
05:10lazybotclgv: The time is now 2012-01-26T10:13:16Z
05:10clgv$time +1
05:10lazybotclgv: The time is now 2012-01-26T11:13:26Z
05:10Fossi:D
05:10clgvah better
05:11Raynes I should have only made it work for my timezone.
05:11Fossidebug-repl looks nice
05:12Fossibut not being able to use it in slime makes it fail :(
05:12RaynesNight.
05:12clgvFossi: yeah it's pretty awesome. often more handy like eclipse's or visual studio's debugger
05:12clgvFossi: slime does use a client-server-architecture, right?
05:12clgvFossi: then thats the reason
05:12Fossiwell, i use println and then realise i had to print something else
05:13Fossiso it'd be nice for that
05:14clgvFossi: I thought of rewriting it to open a Swing Console and let the executing process wait for that one to close. then it would work in slime and nrepl as well
05:14Fossisomething like that
05:14Fossithen again, you could prolly just use some slime hook
05:15clgvFossi: but you can switch to lein repl, for the cases where you want to use debug-repl
05:15clgvFossi: I have no idea about slime implementation details and am not even using it ;)
05:16clgvgoogling for clojure debug doesnt turn up much more than debug-repl and "clojure debugging toolkit" which seems to be libn using java debug interface
05:17clgvbut the cdt 'set-catch seems awesome
05:38faust45hi guys
05:48ordnungswidrigis there a way to have flymake work with clojure-swank?
06:23clgvFossi: according to this page you can use the 'break macro in slime similar to the debug-repl https://github.com/GeorgeJahad/debug-repl
06:34clgvleiningen always aot-compiles everything that is referenced in the ":main clojure file". if I understand correctly, I'll be able to remove all AOT class files that do not belong to that :main class and my jar should be runnable right?
06:54casperchi folks
06:55ordnungswidrigslime-compile-and-load-file report "unkown location". altough in reports the line number afterwards...
06:55casperci am looking at creating a lazy seq from an atom feed, but I don't quite know how to get started
06:56caspercbasically you ask a service for a chunck of events and then get a link to the next chuck
06:57caspercso I need to be able to get a chuck and keep a reference to the next chuck but I don't know how to do that
06:58faust45casperc: sounds good idea, wrap atom to lazy seq
06:58caspercoh and the chuck is a number of events btw (bad formulation on my part)
06:58clgvcasperc: keeping the ref is easy by passing it to the next function call in the lazy-seq
07:00casperchmm, how would that look? I am looking at the fibo example in programming clojure
07:00casperci can't quite get the state in there in my head :)
07:02clgvyou do something like: (defn f [url] (lazy-seq (when url (let [[chunks next-url] (get-my-feed-stuff url ...)] (concat chunks (f next-url)))
07:03clgvchunks is a list of events (bad name then ;) )
07:06caspercah right, so next-url keeps the internal state
07:06clgvcasperc: exactly. now the technical part of getting the data remains for you to solve
07:06casperchad to get my head around this, but i'l give it a go. Thanks alot :)
07:08thorwilafter updating swank-clojure, i now get this, when i try to start my appengine-magic project: http://paste.pocoo.org/raw/541000/
07:08caspercclgv: right, that is actually the easy part :) Thanks again!
07:09thorwilin short "No such var: ae/serve". i guess after not touching this for weeks, i'm missing something silly again
07:10clgvthorwil: ae = appengine and that lib is missing?
07:10clgvthorwil: or there is no (:require [... :as ae]) ?
07:11thorwilclgv: yes and no, there's a matching jar in lib/dev/
07:13thorwilclgv: i did indeed forget a require, thanks
07:16thorwilwhat a success :) [Thrown class java.lang.NullPointerException], where the important thing seems to be "NO_SOURCE_FILE:1 tlog.routes.routes/eval2049"
07:17thorwiloh, and [No Locals]
07:21thorwilhow do i find out what "tlog.routes.routes/eval2049" refers to?
07:28thorwilnm, works after deleting everything in classes
07:39faust45is it possible use arguments destruction in clojure? like http://friendpaste.com/lHZAupyqQTNGEee9mFTtw
07:42ordnungswidrigfaust45: argument desctructuring is available but not with matching like the example
07:42faust45ordnungswidrig: thanks
07:42ordnungswidrigyou can have (defn foo [a [b c] {d :e}] ...) and call it like (foo 1 [2 3] {:e 123})
07:43ordnungswidriggiving a = 1 b = 2 c = 3 d = 123.
07:43ordnungswidrigworks with let as well
07:43ordnungswidrigsee here http://clojure.org/special_forms
07:53ordnungswidrigis there a ref on how to use cdt with swank? The recent changes of clojure-swank suggest support for locals
08:18clgvordnungswidrig: afair you can connect to host:port or process id via cdt
08:19ordnungswidrigclgv: cdt fails loading...
08:19clgvordnungswidrig: oh. clojure 1.3 issues?
08:19ordnungswidrigcfe with com.sun.jdi.Bootstreap
08:20ordnungswidrigtools.jar is added by cdt
08:44ordnungswidrigwarning: unabled to add tools.jar to classpath. This may cause CDT initialization to fail. #<IllegalAccessError java.lang.IllegalAccessError: Context classloader is not a DynamicClassLoader>
08:44ordnungswidrigis there any known problem on cdt with clojure 1.3?
08:45ordnungswidrigcdt comes from swank-clojure todays git HEAD
08:54pyr1/win3
09:15jsabeaudryIs autodoc the defacto standard for automatic documentation generation in clojure?
09:20jkkramerjsabeaudry: there's also marginalia and codox
09:22jsabeaudryjkkramer, Would you have a suggestion between the 3 of them?
09:22ordnungswidrigjkkramer: use all three, let the user decide :-)
09:23ordnungswidrigis there an example doc for codox?
09:24jkkramerjsabeaudry: I kinda of prefer reading code & comments directly
09:24jkkramerordnungswidrig: http://mmcgrana.github.com/ring/
09:25ordnungswidrigjkkramer: ah, then I like it
09:26mdeboardit's electrifyin'
09:26jkkramerwish it had a "source" links, since I usually end up seeking out the source for libs i use anyway
09:29arkhI'm still new to emacs - how does clojure-jack-in know which project (and project.clj) a person would like to work with?
09:29compjarkh: I think it uses the cwd
09:29Bronsaarkh: the one in the cwd
09:30arkhok, so where I launch emacs matters - thank you. Feeding parameters at run-time to clojure-jack-in didn't seem to be an option.
09:30compjyou can also M-x cd
09:31arkhoh - cool
09:36stuartsierraWhenever you find (open) a file in Emacs, the cwd becomes that dir.
09:40arkhstuartsierra: also good to know : )
09:41arkhI am an emacs tabula rasa : (
09:45arkhhas anybody tried the new release of Clojurescript One? When I execute (dev-server) from from a slime connected repl it acts like either the classpath or ns isn't set up correctly. Error: "Unable to resolve symbol: dev-server in this context"
09:47dakroneRaynes, amalloy_: cd-client is really old, it needs a rewrite, but until then it will hobble along
09:47clgvsince there are now more people online here, I'd like to ask you again: What debug facilities do you use for your clojure projects?
09:49pandeiroarkh: haven't tried it from slime, but maybe you can do (use 'one.sample.repl) first and then try
09:51arkhpandeiro: thank you - that worked.
09:55pandeiroarkh: thank you for giving me the idea to run cljs in slime instead of *shell* :)
09:56manutterclgv: have you tried counterclockwise in Eclipse?
09:56clgvmanutter: It's kind of a survey question to get to know what others use and what options there are
09:57clgvmanutter: so, you use ccw?
09:57manutterclgv: I've used it in the past and I've played with the debugger, which works pretty well
09:57manutterclgv: I'm still mostly emacs though
09:59clgvmanutter: so what do you use when debugging within emacs?
09:59manutterclgv: well, um, (println)
10:00manutterI'm not doing anything really hard core at the moment
10:08clgvok, lets see if others have different debugging tools
10:14arkhclgv: +1 for println
10:18pandeiroarkh: were you able to get the cljs repl working in slime mode?
10:23clgvarkh: thx. that one seems pretty dominant and widespread ;)
10:24arkhclgv: for better or worse
10:26arkhpandeiro: I'm currently working on what happens when I execute (cljs-repl) - "ClojureScript:cljs.user> java.lang.RuntimeException: EOF while reading"
10:27arkhI think it's running that in another thread and the error message is printed in a loop
10:28pandeiroarkh: yeah i think that is what's going on for me, too
10:33arkhpandeiro: hmm - works just fine from a shell launched repl
11:0918WABFMSC,(byte 128)
11:09clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for byte: 128>
11:1118WABFMSChow do I get bytes between 128 and 255?
11:11dnolen18WABFMSC: Java doesn't have unsigned bytes
11:1318WABFMSC,(byte -1)
11:13clojurebot-1
11:16TimMc&(.byteValue 255) ; 18WABFMSC
11:16lazybot⇒ -1
11:25pjstadigyou can work with bytes just fine if you're adding, subtracting, multiplying, or using bitops
11:25pjstadigwhen they get converted to decimal they will have a signed range from -127 to 128
11:26pjstadigso you'd have to be careful about printing them or something
11:26pjstadighttp://blogs.oracle.com/darcy/entry/unsigned_api
11:26TimMcpjstadig: -128 to 127, actually
11:27pjstadiger
11:27pjstadigright
11:27pjstadigtwo's complement division is totally different than unsigned division, but otherwise the bits are the same and just interpreted differently
11:28pjstadigi guess comparison is a problem too
11:29llasramlol. usually *the* problem :-)
11:29llasram(for what I've done w/ unsigned, anyway)
11:29pjstadigwell it depends on if you're using bytes as numbers or data
11:29pjstadigif you're using them as data and doing some occasional bit ops, then you're probably ok
11:30pjstadigif you're doing math and comparisons...uh don't use bytes?
11:31llasramHow else would you suggest implementing a sort-comparison operation for IPv6 addresses?
11:31pjstadiguse a library :)
11:31llasramheh
11:31pjstadigor represent them as what 64-bit ints?
11:32llasramOk, sure, but whatever library you use is going to need to do that under the hood.
11:32llasram128-bit
11:32pjstadig128
11:32llasramYou can do it in C/C++ with gcc
11:32llasramBut Java, not so much
11:32pjstadigyeah, i haven't had that problem, so i'm blissfully unaware at least while we still have IPv4 addresses to allocate
11:33llasramAnyway, being to pendantic. I just wanted to make the point that there are some situations where you can't help but wanting to compare bytes unsigned, although they are rare
11:33llasrams,to,too,
11:33TimMcpjstadig: Allocation is done.
11:33pjstadigwell
11:33pjstadigyeah, but they're still being "allocated"
11:34rlbllasram: it's also handy to be able to work with unsigned bytes when you're wanting to talk to a squeezebox over a socket (or other binary packet based device).
11:34TimMcSure, the block holders are still assigning from their pools.
11:34pjstadigllasram: yeah, agreed
11:39ljosI might be using the wrong terminology here, but: Is there a way to make print/println synchronous over multiple threads? Or, I guess they sort of are on a per character basis as they don't write over each other. I just want the whole string from one thread written before the next one starts.
11:40m0smith_ljos: you can use an agent to do that. Log everything to an agent and have it do the actual write
11:40m0smith_I am still trying to get the hang of numbers in 1.3
11:40m0smith_&(Character/toChars 65)
11:40lazybot⇒ #<char[] [C@bab86d>
11:40m0smith_does not work in my repl
11:42ljosm0smith_ : ofc. Thank you. I didn't really think of that. It would still be quite nice if I didn't have to do that myself. :P
11:42TimMcm0smith_: What does *clojure-version* give you?
11:43TimMc&(seq (Character/toChars 65))
11:43lazybot⇒ (\A)
11:43m0smith_:major 1, :minor 3,:incremental 0
11:44muhoo&*clojure-version*
11:44lazybot⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil}
11:44TimMcAnd what happens in your REPL?
11:44m0smith_Characer/toChars gives me IllegalArguementException
11:44tmcivercast to long?
11:44m0smith_I am using swank in emacs
11:44jeremyheilersAre you sure your using toChars and not toChar?
11:45tmciverwasn't that a problem I've seen discussed here before?
11:45jeremyheilers,(Character/toChar 65)
11:45clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: toChar, compiling:(NO_SOURCE_PATH:0)>
11:45m0smith_toChars
11:46m0smith_,(class 65)
11:46clojurebotjava.lang.Long
11:46dnolenm0smith_: on 1.3.0, works for me.
11:46m0smith_could it be swank?
11:46TimMctmciver: This doesn't have to do with longs/ints -- there would be a dispatch problem if it were.
11:47dnolenm0smith_: doubtful, why don't you paste the output from your repl somewhere?
11:48m0smith_pastebin?
11:48TimMcor refheap
11:48tmciverTimMc: dispatch? there's only one single-arg toChars method which takes an int.
11:49tmciverTimMc: If you pass it a long, you'd get that exception, no?
11:49TimMc&(seq (Character/toChars (Long. 65)))
11:49lazybot⇒ (\A)
11:49TimMc^ I do not understand this
11:49TimMcwhoops, lunch
11:50tmciverHa!
11:50m0smith_I changed from swank-clojure 1.3.3 to 1.3.4 and now it works
11:51dnolenm0smith_: oof
11:52m0smith_(char 200) still blows up though
11:52muhooRaynes: thanks!! https://refheap.com/paste/437
11:56stuartsierraTimMc: Java chars are (mostly) UTF-16.
11:56m0smith_Ok, here is what I am trying to accomplish
11:57stuartsierraUnicode code points higher than 16 bit integers get represented as a pair of chars.
11:57m0smith_I have a byte array and I want to convert it into something similar to what emacs does with hexlify-buffer
11:58m0smith_which is print the hex for each byte and if the byte represents a printable char, print that as well
11:58m0smith_this should be a no-brainer
11:58m0smith_except type conversion of numbers is making me crazy
12:00m0smith_&(Character/toChars 65)
12:00lazybot⇒ #<char[] [C@35672e>
12:00m0smith_works
12:00m0smith_(Character/toChars. 65)
12:01m0smith_&(Character/toChars. 65)
12:01lazybotjava.lang.IllegalArgumentException: No matching method: toChars.
12:01m0smith_That is one of the problems
12:02jeremyheilersm0smitih_: The form with a dot at the end of it indicates a constructor call.
12:03m0smith_I was just looking it up. I do not know where I got the idea it was a static method call as well
12:03jeremyheilersnice
12:03dnolenm0smith_: it is a static method - not a constructor.
12:04m0smith_If you are using emacs and swank type \0200 and see if you go into the emacs debugger
12:04m0smith_\u0200
12:04m0smith_it seems to hate that character
12:05dnolenm0smith_: works just fine though it doesn't print at the REPL
12:07m0smith_\u0223?
12:08dnolenm0smith_: also doesn't print for me, but that's probably because of my Emacs settings
12:11jcrohi
12:12jcrois it useful to define protocols for various "components" of a business domain model?
12:13jcroeven if I don't use records, and just use maps, or some other structure?
12:14jcrobah, every time I set out to design something big in Clojure I get paralyzed by the array of choices
12:14dnolenjcro: protocols w/o types/records doesn't make much sense.
12:14dnolenjcro: don't overthink it, write some functions, use maps.
12:14drewrjcro: use the simplest thing that works (in clojure that usually means maps)
12:14jcro:P rigth
12:14jcroright
12:15jcroI am trying to come up with a strategy to build a decently functional system and then tie it into our existing (quite nasty) DB
12:15jcroI don't want to just create ORM mappings between the DB and business objects
12:17jcrobut I'm also having a hard time imagining how to model our domain without going to the DB
12:17jcrolike, how can I worry about the DB later?
12:18m0smith_I have a project that maps Hibernate to clojure
12:18m0smith_it uses maps to represent the "entities"
12:20dnolenjcro: should be simpler, right? Clojure avoids the ORM problem entirely, you just have maps.
12:20jcroI wonder if I can do it in a way that avoids keeping the whole model in memory
12:23jcroI guess I need to write a repository layer that can be swapped for the ugly DB later?
12:37technomancy_clgv: slime has pretty good tracing facilities built in: C-c C-t
12:37technomancy_that plus swank.core/break means I only reach for cdt in times of great distress
12:38clgvtechnomancy_: what does C-c C-t do?
12:38technomancy_it toggles tracing on a given defn
12:39clgvtechnomancy_: ah ok. do you have an example for the trace output? link to an example/blogentry...?
12:40technomancy_not off the top of my head; just try it
12:40Bronsawtf
12:40clgvok
12:41Bronsatelecom network is crashing in the whole italy
12:41TimMcjcro: memory-mapped maps?
12:41TimMcBronsa: They accidentally the whole Italy?
12:42Bronsayeah :(
12:42TimMcYou're still online...
12:42jcroTimMc: interesting idea
12:42BronsaTimMc: just got back
12:42jcroTimMc: I'm also looking into the Domain-Driven Design material
12:43jcrowhich seems to be pretty friendly to FP
12:43TimMcjcro: Totally messes with the immutability thing...
12:43jcroTimMc: what does? DDD?
12:43TimMcMaps backed by databases.
12:43jcroyeah
12:43TimMcUnless you have persistent databases, like Nathan Marz explained.
12:44TimMcpersistent persistence :-)
12:44jcrothat would be nice
12:44jcroI think I'll end up with a "root" object representing a client/organization
12:44jcroand it would act like a ref
12:44TimMcah, nice
12:44jcroor just be a ref
12:45TimMcWhat about references to old versions? Could be a problem...
12:45jcroI guess I'll need some revision number
12:45TimMcand you'll need to let the DB know when it is OK to GC.
12:45TimMcjcro: Transients, maybe?
12:46TimMcI think they throw on access to old verisons.
12:46TimMcversions, even
12:47TimMcI think there are some serious problems here.
12:48dnolenjcro: have you seen Out of the Tarpit?
12:49glob157im a little concerned about all the clojureScript traffic i feel like its making it harder to learn the fundamentals of functional/lisp style programming - because its so heavily focused on the side effects of web ui, javascript, etc.
12:50dnolenglob157: Clojure is about managing side effects, functional programming is one aspect of that story
12:50jcrodnolen: yes, but I have never seen a good implementation
12:50jcrodnolen: or anything even close to one
12:51tmciverdnolen: I have not seen it. What is it?
12:51dnolentmciver: an interesting paper
12:51tmciverdnolen: link? or just google it?
12:52dnolentmciver: google it :)
12:53tmciverah, by Moseley and Marks, 2006?
12:53TimMcThe "Tar Pit" being a reference to MMM?
12:54jcroTimMc: yes
12:55jcroI think certian principles are more easily applied than the entire proposal
12:55jimdueyThat paper is great. I'm thinking you could implement it in clojure pretty easily, if you were of a mind to.
12:55technomancythe first half of the paper is awesome. the second half is merely interesting.
12:57faust45which paper?
12:57tmciverfaust45: http://web.mac.com/ben_moseley/frp/paper-v1_01.pdf
12:58faust45its about functional approach?
12:58technomancyclojurebot: out of the tarpit?
12:58clojurebotOut of the Tarpit is a short, accessible paper on FP and reducing complexity by identifying and minimising state: http://ben.moseley.name/frp/paper-v1_01.pdf
12:59technomancyclojurebot: botsnack
12:59clojurebotThanks! Can I have chocolate next time
12:59muhoowow, it seems like rich hickey got a lot of stuff from that paper
12:59faust45interesting clojurebot is a bot? or not
13:00faust45hi ask my question O_0
13:00faust45he answer my question
13:00faust45i mean
13:00TimMcfaust45: Everyone in here is a bot except for you.
13:00dnolenmuhoo: rhickey got a lot of things from a lot of papers
13:00faust45TimMc: huh , good
13:04glibHello, I have been studying clujure and I am wondering how to prpeperly create and denote an anonymous function?
13:04glibPlease help
13:04Philip__Well, if you are in chrome, you are going to type in ctrl-shift n and then your function will be created
13:04Philip__however,
13:04Philip__if you are in firefox the clojure language changes
13:04Philip__so...
13:04Philip__i suggest setting your default browswer to chrome in order to use clojure correctly
13:04glibim on ie6 however
13:05dnolenglib: (fn [] ...)
13:05glibbut thanks anyway!!!
13:05Philip__dnolen please stop trolling
13:05smokecfhis Seesaw the most mature swing-wrapper for clojure?
13:05Philip__this is supposed to be a channel to help people
13:06dnolenI suggest ignoring Philip__
13:06glibWhy?
13:06clojurebothttp://clojure.org/rationale
13:07muhooglib: anonymous functiosn are fn http://clojure.org/special_forms#Special%20Forms--%28fn%20name?%20[params*%20]%20exprs*%29
13:08babilenglib: You can also use a reader macro #(...) - http://clojure.org/reader#The%20Reader--Macro%20characters
13:08muhoohm, does the bot do docs?
13:09muhoo,fn
13:09clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/fn, compiling:(NO_SOURCE_PATH:0)>
13:09tmciver,(doc fn)
13:09clojurebot"([& sigs]); params => positional-params* , or positional-params* & next-param positional-param => binding-form next-param => binding-form name => symbol Defines a function"
13:09muhoo&(doc ffn)
13:09lazybotjava.lang.RuntimeException: Unable to resolve var: ffn in this context
13:09muhoo&(doc fn)
13:09lazybot⇒ "Macro ([& sigs]); params => positional-params* , or positional-params* & next-param positional-param => binding-form next-param => binding-form name => symbol Defines a function"
13:09muhoo,(doc fn)
13:09clojurebot"([& sigs]); params => positional-params* , or positional-params* & next-param positional-param => binding-form next-param => binding-form name => symbol Defines a function"
13:09muhooterse, but helpful
13:12babilenMore ops would help -- This channel's access list is a bit, well, short. Maybe clojure/core members or something :-/
13:12chouserI'm not always paying attention, but PMs to me about trolls may sometimes bare fruit.
13:12mabesC-c C-t for tracing in slime is pretty sweet... yay for lurking the IRC channel :)
13:13chouserbear
13:13erewhonbare fruit!?
13:13chousersorry
13:13erewhonheh
13:13tmciverMmm, bear fruit!
13:13TimMcdnolen: Kind of like how spam lets you know your mail provider is working?
13:13muhoois it straightforward to have slime connect to a swank on a remote machine?
13:14TimMctmciver: Haha, I went the same place.
13:14mabesmuhoo: I always ssh tunnel and connect to my local host on the forwarded port.. works like a charm
13:15babilenchouser: PM ok? (re: ops)
13:15technomancymuhoo: in the next version of clojure-mode you just might be able to do M-x clojure-jack-in over tramp
13:15World_of_WarcrafHello what is the best clojure REPL?
13:15TimMcspeaking of which...
13:15muhootechnomancy: thanks. i looked at the code to clojure-jack-in and it looked like localhost was hardcoded in.
13:16WorldOfWarcraftThow do u define a value in clojure i want yourmom to be equal to 7
13:16TimMcchouser: ^ case in point, high schooler brought in unwisely by zmaril
13:16World_of_Warcrafit goes yourmom ==== "&&7&&" that might work im a little rusty
13:16tmciverPhilip_, is that you?
13:17pandeirohow do i set a ring session using the default memory-store provided by ring.middleware.session.store from within a compojure route?
13:18tmcivermuhoo: I think you can connect to a remote swank session via 'slime-connect'
13:19muhoook, i have to try it. right now i'm just using comint-mode via telnet to an ssh-forwarded connection to the lein repl on the remote
13:19chouserbabilen: yeah, PMing me about ops stuff is fine
13:19muhooit's time i try all this slime/swank goodness people are raving about
13:37smokecfh`does emacs/slime have code completion on keywords? i had expected that (when using seesaw) :monospaced could be completed from :m M-tab
13:39technomancysmokecfh`: keywords can be arbitrarily named, so using slime for completing them doesn't make sense. you can use dabbrev to search for similarly-named keywords present in other buffers though
13:39technomancyusually M-/
13:39muhoosmokecfh`: there's always M-/
13:40muhoo(well, not always, if you rebind it)
13:40muhoowhat's the clojure-ish to reconcile databases with the STM?
13:40smokecfh`hm.
13:40faust45i try implement custom behavior for ISeq http://friendpaste.com/2relveMN9ZAf1yUR6LjYxu
13:41faust45but in repl i got error
13:41faust45IllegalArgumentException No matching field found: SeqFly for class java.lang.String clojure.lang.Reflector.getInstanceField (Reflector.java:289)
13:41faust45for user=> (.toString (.SeqFly "cool"))
13:41faust45whats i am doing wrong?
13:45TimMcfaust45: .foo is a method call, foo. is a constructor call
13:46faust45user=> (.toString (SeqFly. "cool"))
13:46TimMcfaust45: You're doing the Java equivalent of "cool".SeqFly().toString()
13:46faust45CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: SeqFly, compiling:(NO_SOURCE_PATH:65)
13:46TimMcfaust45: And now your problem is that you haven't import'd the class.
13:46TimMc(guessing)
13:47faust45but i have this declaration http://friendpaste.com/2relveMN9ZAf1yUR6LjYxu
13:47muhoowow, cool, http://stackoverflow.com/questions/4522796/how-should-i-make-a-clojure-stm-program-persistent
13:47TimMcYes, and your repl's namespace doesn't know about that JVM class yet. import.
13:47frankstechnomancy: making up some random filename, passing that to a function, then checking whether that filename was ever used to make an actual file and if so trampoline into that one... you are one nasty hacker! ;-)
13:48faust45TimMc: hm
13:48technomancyfranks: trust me; I only resorted to that after exhausting all other possibilities =)
13:48technomancycould probably use a few more comments though!
13:49faust45TimMc: this is my source http://friendpaste.com/5FHstkUHvAm9Jqhdmw8TXN i use lein repl
13:49faust45TimMc: and user=> (use 'test.core :reload-all)
13:49frankstechnomancy: very creative though... comments would be nice to guide a casual coder thru your brain-twists ;-)
13:50faust45TimMc: i am confused why repl couldn't resolve my class SeqFly
13:50TimMcfaust45: 'use is not enough when it comes to classes. You're doing interop; you'll need import.
13:51frankstechnomancy: (good thing you didn't use perl...)
13:52faust45TimMc: thanks, looks good (import '(test.core SeqFly))
13:52TimMcgood
13:53TimMcHuh. Within 24 hours I have seen three different people do "nick: (side-comment in parens)". I haven't seen that construction in IRC before. I suppose it's just another grammatical meme.
13:54tavisTimMc: ((oddly appropriate here))
13:54frankstechnomancy: submitted a 3rd iteration pull-request for lein - pls take a look when you have a moment
13:55technomancysure, thanks
14:06TimMcI wonder if there are more open or close parens in this channel. There are those people who don't bother closing sample expressions, but there are also emoticons.
14:09TimMcOK, that's 64428 open and 73059 close in my logs.
14:09TimMcI don't know why I did that.
14:09jeremyheilersTimMc: I would guess emoticons would win (and they did lol)
14:09jeremyheilersIt's a cool random stat :-P
14:09TimMcThat was just (count (filter #{\(} (slurp "..."))) for each. Nice.
14:10tavismaybe the bots should be trained as parens enforcers
14:11TimMc:-()
14:11duck1123By the time someone posts a simley, it's too late to open it. :(
14:12tavisbot replies )
14:12tmciverThe bots could enforce non-emoticon parens.
14:12TimMcTHat would be even more irritating than clojurebot.
14:12tmciverWe should expect nothing less in this channel.
14:12TimMctavis: ^
14:13duck1123That was one of the reasons I loved XQuery. it used (: and :) to delimit comments. Such a friendly language
14:15muhoowhat are people using for dom stuff in clojurescript?
14:15m0smith_thanks for you help this morning. I got my hexlify working: https://gist.github.com/1684476
14:15llasrammuhoo: All the people using clojurescript so far are subs. I'll be here all night, folks!
14:16llasram(Sorry, don't actually know.)
14:16gtrak``domina, I think it's called?
14:17gtrak``https://github.com/levand/domina
14:17muhoogtrak``: thanks
14:18TimMcllasram: Terrible.
14:18technomancyIIRC you can use jquery if you set up externals
14:18technomancysupposedly it's not as nice, but if it's familiar it may be easier to start out with
14:18muhooi already am used to jquery, but it seems there's no advanced mode compilation for it
14:19technomancymuhoo: you can still make it work; maybe bug ibdknox about it when he comes online.
14:19muhoothere seems to be dojo and mochikit, both of which i haven't touched since 2006
14:19muhootechnomancy: thanks
14:19tsdhDoes anyone know if the parser combinators Nate Young demonstrates in his strangeloop talk are available from somewhere?
14:21gtrak``yes
14:21gtrak``let me give a look
14:21technomancyparsatron, innit?
14:21gtrak``https://github.com/youngnh/parsatron
14:22tsdhtechnomancy: Oh, yes.
14:22tsdhGreat, thank you.
14:22tsdhCool name, btw.
14:22gtrak``he's a pretty creative guy
14:23technomancyI wonder if he gets any "Young Neil" jokes from Scott Pilgrim fans.
14:23technomancyoh, the project's name... yeah, that's cool too.
14:26dnolenhttp://dosync.posterous.com/comparing-javascript-coffeescript-clojurescri
14:26dnolenfirst blog post in a long time, please upvote on HN if you got a second, thx
14:28gtrak``sp error, abstration
14:28dnolengtrak``: thx
14:30tsdhdnolen: Nice post.
14:30dnolentsdh: thx!
14:30tsdhdnolen: And what's HN, and how do I upvote?
14:31muhoodnolen: "haven't had this much fun", i agree
14:31dnolentsdh: Hacker News
14:31tsdhBut not this one, right? http://www.hackernews.com/
14:31gtrak``dnolen: when you submitted my ruby/python/clojure post to HN, I got 4k views :-)
14:32tsdhhttp://news.ycombinator.com/ ?
14:32TimMcyeah
14:33tsdhOk, the eagle has not yet landed. :-)
14:33dnolenhttp://news.ycombinator.com/new
14:33gtrak``//newest
14:34tavisdnolen: have you ever played with slices in R?
14:35dnolentavis: no I haven't use R much, though the slices aspect is really just about using objects as fns :)
14:35jeremyheilersdnolen: great blog post -- i look forward to using clojurescript in the near future.
14:37tavisyeah, I like that. Great post. It just made me think of the polymorphic behaviour of indices/slices in R. They're multimethods under the hood and R libraries make some great use out of them.
14:37tavissame with numpy in Python
14:40philclojurebot: botsnack
14:40clojurebotThanks, but I prefer chocolate
14:40arkhIn ClojureScript One, why would 'lein repl' work but a clojure-jack-in repl need a namespace qualification before working?
14:41gtrak``clojurebot: have some chocolate, then
14:41clojurebotPardon?
14:41philclojurebot: chocolate
14:41clojurebotIt's greek to me.
14:41tavisclojurebot: swiss is better
14:41clojurebotYou don't have to tell me twice.
14:41phil,(println "Thank you sir.")
14:41clojurebotThank you sir.
14:41philclojurebot: no problem
14:41clojurebotexcusez-moi
14:41phillol
14:42amalloyclojurebot: swiss?
14:42clojurebotswiss is better
14:46smokecfh`technomancy, muhoo: i've managed to get the auto-completion i want with ac-slime
14:47ferdAnybody playing with ClojureScript(One) on a mobile device (iPhone/Android) ? Anything preventing that?
14:47clojurebotCool story bro.
14:51gtrak``ferd: compiling from android, or browsing the result?
14:52gtrak``or something else
15:05chewbrancadnolen: fun article, very interesting to see protocols in action with javascript
15:06chewbrancadnolen: any thoughts on whether that would work well for adding extensions to existing javascript libraries? ie could you piggy back on objects created in backbone.js or google maps or anything else?
15:06ferdgtrak``: I mean, having the app running on the device, connecting to it from Emacs on my laptop
15:10brehautchewbranca: you can safely implement protocols for the core javascirpt types (object, array, string etc) and thats normally verboten. i would imagine that backbone or google stuff would be fine too
15:11chewbrancabrehaut: interesting
15:11brehautchewbranca: if i understand how it works correctly, clojurescript stashes namespaced protocol implementations in the types _constructor_ rather than its prototype
15:12brehautwhich means it wont bleed into instances via prototypal inheritance and the namespacing avoids collisions
15:12chewbrancaI need to play around with clojurescript more, but I'm very curious to see how well the interop is for existing libs, I've seen some examples of calling out jquery methods and what not, but being able to use protocols to extend objects of third party libs is very intriguing
15:12brehautlikewise
15:13brehautwow. jquery without the argument order confusion
15:13chewbrancatechnomancy: is that actually lazy though? seems like it could be problematic if it does the full load of everything
15:14technomancyno idea; it's just a rumor
15:14ieureCan someone explain what I'm doing wrong with this gen-class usage, please? https://gist.github.com/dae8f53f89388e8e1b76
15:14brehautchewbranca: the jquery selector would be just as strict as always, but any computation based on it would still be lazy; just like seq on a vector
15:14brehauthmm. vector might be a bad example
15:14ieureAlternately, if someone knows how to make (proxy) and lein's :main play nicely together, I think that is a viable alternative.
15:15amalloyieure: you want the gen-class inside of the ns
15:15amalloymaybe some other changes are needed, i dunno; i don't really do that
15:15technomancyTimMc: I believe you're the man ieure needs to speak with.
15:15technomancydid you end up renaming your uberjit thingy?
15:15TimMchrm?
15:15TimMclein-jit
15:15TimMctechnomancy: Although now I want to rename it lein-otf, for on-the-fly
15:16ieureamalloy, Non-obvious from my example, but that is not an option for what I actually want to do.
15:16technomancyTimMc: yeah, I like otf a lot better
15:16TimMcsince "JIT" is a confusing name
15:16ieureamalloy, Or do you mean I need a :gen-class in there as well?
15:16TimMcMaybe I'll do it and piss off the people who rely on it...
15:16amalloyieure: i think your example makes no sense. i can't tell what you're trying to do, much less how you should do it
15:17chewbrancaI wonder if you could seq on events, that would be cool. I was reading clojure in action a recently and I liked how he created a lazy seq on a rabbitmq queue so that you could just lazy listen on the seq for messages to come in, would be very cool to be able to do something similar with events
15:17TimMcieure: Are you just trying to get something that can be called with java -jar, or do you really need a specific classname for that namespace?
15:18ieureamalloy, I am trying to create a Clojure wrapper for Dropwizard; I need to extend Dropwizard's Service class, and have that end up as the mainClass that gets set in the pom.
15:18ieureI want to write e.g. (defservice blah), which I don't think works with putting my class stuff in the (ns ) block.
15:19brehautchewbranca: have a look at microsofts Rx linq extensions to jquery
15:19muhooi remember seeing a macro or function that basically does this : (reduce #(str %1 " " %2) stuff) , but i don't remember the name of it
15:19brehautchewbranca: erik meijer has done some stuff about reactive programming on jquery
15:19brehaut(as well as in .net with C#)
15:19TimMcmuhoo: interpose
15:19muhooTimMc: thas
15:19TimMcmuhoo: string join, actually
15:20gtrak``ferd: perhaps, but i imagine it would be hard, plus I think the working android clojure is 1.2 and cljs requires 1.3?
15:20chewbrancabrehaut: oh fun, checking that out now
15:20TimMc,(do (require 'clojure.string :as 's) s/join)
15:20clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol>
15:20TimMcoops
15:20gtrak``and in general I think getting clojure to work at all on android was quite an accomplishment, don't know how far it can go
15:20amalloyTimMc: that wouldn't work even if you had the syntax right, i think. not sure, i guess
15:20TimMcit would
15:21amalloy,(do (require '[clojure.string :as s]) (s/join " " [1 2 3]))
15:21clojurebot"1 2 3"
15:21amalloyokay, you win
15:21muhoooh it works on android
15:21TimMc\o/
15:21muhooit just takes up like 4mb or something, IIRC
15:21muhooi tried clojure, kawa, and one other i forget, on android, last year
15:22TimMc,(do (require '[clojure.string :as s]) (s/join (range 10) ", ")) ; amalloy, look what happens if you accidentally reverse the args
15:22clojurebot",clojure.lang.LazySeq@9ebadac6 "
15:22technomancymirah on android is OK if you can survive without a repl
15:22technomancy(I can't)
15:22TimMcpretty slick, in a way
15:22amalloyor, not slick at all? you be the judge
15:24ieureOkay, maybe someone can explain this: (do (import [com.yammer.dropwizard Service]) (proxy [Service] ["x"])) -> java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
15:25benares_98chewbranca: I haven't gone through this completely but it maybe relevant http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure
15:25ieureService takes a type param, which seems like it might be what's up. But I thought those were ignored in Clojure.
15:26TimMcieure: I'm pretty sure your first statement in that 'do is wrong.
15:26TimMc'import outside of an 'ns form needs to have its args quoted
15:27chewbrancabenares_98: fun link, I'll check it out but I was talking more about event driven programming in clojurescript, not sure how much ports over
15:28ieureTimMc, Works in the repl. Import's args are in a vector. But that is not relevant to my question.
15:29ieure,(import [java.io InputStream])
15:29clojurebotjava.io.InputStream
15:29muhoo,(do (require '[clojure.string :as s]) (seq (s/join (range 10) ", ")))
15:29clojurebot(\, \c \l \o \j ...)
15:29muhoomore readable
15:30muhoowait, what?
15:31muhoowtf is that thing actually doing?
15:31ieuremuhoo, Turning it into a seq of characters.
15:31ieure,(seq "abc")
15:31clojurebot(\a \b \c)
15:32muhooi mean the (s/join (range 10) ", ")
15:32tmcivermuhoo: you've swapped the args to s/join
15:32muhoooh
15:33muhoo,(do (require '[clojure.string :as s]) (s/join ", " (range 10))))
15:33clojurebot"0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
15:33brehautyou dont need to keep requiring namespaces with the bots
15:34brehaut,(s/join "," (range 10))
15:34clojurebot"0,1,2,3,4,5,6,7,8,9"
15:34muhoonice
15:34muhoowhat happens if the ns gets clobbered in the bot?
15:34hiredmanbrehaut: well, safebot resets every 10 minutes or so
15:34brehautthe bots recycle their evaluation contexts somewhat regularly
15:34hiredmanclojurebot
15:35amalloybrehaut: lazybot doesn't
15:35hiredman(there is no safebot)
15:35amalloyhaha i was wondering who safebot was
15:35muhoosafebot is hiding
15:35muhoosomewhere safe.
15:35hiredmansafebot is the instance of clojurebot we have at work
15:36amalloyah. sensible. what does he do that's different? a non-sandboxed mode, i'd guess; anything else?
15:36hiredmanno, still sandboxed
15:36hiredmanhas some github and ci integration
15:36brehautis it short for safe-from-muppets-bot
15:36muhoomuppets?
15:37muhookermit the frog is sending forms to a clojure bot?
15:37hiredmansafe is just the name of the project
15:37brehautthats an angloism isnt it?
15:37brehautmuppet = idiot
15:38amalloybrehaut: yeah, i only ever hear it from english folks. apparently kiwis too
15:39Raynesbrehaut: lazybot doesn't recycle his evaluation context because clojail keeps it from being changed.
15:39amalloyuhhhh, except for use/require/refer
15:39Raynesbrehaut: Though a better solution would probably be to just give everybody their own namespace and reset them every once in a while.
15:39Raynesamalloy: Yeah, that's *your* fault. I've been wanting to get rid of use for forever.
15:45TimMcieure: Ah, I didn't realize 'import is a macro, unlike 'require and 'use: ##(.isMacro #'import)
15:45lazybotjava.lang.SecurityException: You tripped the alarm! class clojure.lang.Var is bad!
15:45TimMcpffft
15:45TimMc,(.isMacro #'import) ; let's use unsafebot
15:45clojurebottrue
15:51amalloy&(-> import var meta :macro)
15:51lazybot⇒ true
15:54TimMcamalloy: Calling a method directly on a forbidden class is the bad part?
15:55gtrak``maybe the fact that it's a reader macro?
15:55gtrak``&(.isMacro (var import))
15:55lazybotjava.lang.SecurityException: You tripped the alarm! class clojure.lang.Var is bad!
15:55amalloyright. you can call as many functions on an object as you want; if the functions are dangerous we blacklist them instead. but for interop, it's safer to just say "don't do it"
15:56gtrak``ahh
15:56TimMcHow do you know that it is being called on Var?
15:58amalloyTimMc: (.isMacro x) gets changed to (dot x isMacro), where dot is a macro we use that inserts a bunch of safety checks
15:58TimMcAh! Clever.
15:59Ashiii'm kind of new here, and i got intrested of clojure after hearing so much talk about it, what is it about? i've been reading on webpage but.. i can't comprehend if its new or not
15:59muhoowhomever wrote (pp), i've wished for it for years in repls of various kinds
15:59TimMc&(dot 4 toString)
15:59lazybot⇒ "4"
15:59Ashiiis there any good intro videos for clojure?
16:00TimMcAshii: Simple Made Easy is pretty good.
16:00muhooAshii: all the blip.tv talks by rich hickey
16:00Ashiity :)
16:00muhoohttp://blip.tv/clojure
16:03TimMcAshii: Clojure takes a whole bunch of great ideas from Lisp but also features some really great abstractions that were totally missing. Also, there's the whole bi-directional interop with Java, which is a big boost.
16:06muhooi think i'm weird. i find (:macro (meta (var import))) easier to read than (-> import var meta :macro)
16:08amalloywell, that's because it's easier to read
16:08amalloythe -> version was shorter to type
16:08TimMcmuhoo: The var part is weird, because it's a macro.
16:09amalloyif i were aiming to make it most readable, maybe (:macro (-> #'import (meta)))
16:09TimMc&(-> 5 (if true false)) ; WTF
16:09lazybot⇒ true
16:09muhoooic, if i pretend there are .()'s between, it makes sense :-)
16:09clj_newbis there a way to atach java member fields to a proxy? (instead of just functions)
16:09amalloy...TimMc, what is the WTF?
16:09clj_newbamalloy: !
16:09clj_newbamalloy: so great to see you again
16:09clj_newbamalloy: especially since I have a clojure question :-)
16:09TimMcamalloy: Just visually, I find it pretty fucked-up to "pass" stuff to a macro.
16:10clj_newbhmm; if I need extra fields
16:10TimMcIt should be called a nesting macro, not a stitching macro.
16:10clj_newbmaybe this is a time to use defType instead of proxy
16:11muhooclj_newb: or just assoc, maybe
16:12clj_newbscrew it; I think I can do this without state
16:13TimMcwoo
16:13muhooi dunno, just having done enough lisp, when i see () my brain skips into (foo (bar (baz))) mode, and seeeing (-> baz bar foo) seems sdrawkcab to me
16:14gtrak``foo bar baz bar foo is a little less clear
16:14TimMc"chaining", that's it
16:15gtrak``i thought the -> was weird at first, but I like it now, there's also -?>
16:15muhoowat?
16:15muhoo-?> ?
16:15gtrak``null-safe threading
16:15muhooum, how would i even look that up in the reference, i wonder
16:15gtrak``somewhere
16:15TimMcEh, I dunno. I still feel that macros that quote or rearrange syntax shouldn't be used in ->
16:15clj_newb, (doc ->)
16:16clojurebot"([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
16:16clj_newb,(doc ->)
16:16clojurebot"([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
16:16tmcivergtrak``: I felt the same way; much easier to read than the deeply-nested alternative.
16:16muhoo,(doc -?>)
16:16clojurebotExcuse me?
16:16muhoosee
16:16gtrak``TimMc: you can always use the reduce variant
16:16muhoo,(doc -?>)
16:16clojurebotI don't understand.
16:16muhoo,(i SAID. DOES HE LOOK LIKE A -?>) ?
16:16clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: i in this context, compiling:(NO_SOURCE_PATH:0)>
16:16gtrak``TimMc: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/
16:17TimMcmuhoo: http://symbolhound.com/?q=-%3F%3E
16:17clj_newbi want to define a function namned )
16:17TimMcmuhoo: It's in monolithic contrib, unfortunately.
16:17clj_newbso it looks like () args ... )
16:18muhoooh
16:18muhooit's a haskell-ism, i gather, based on that link
16:18brehautits really not
16:19brehautcomp is a much closer fit to what haskell does
16:20TimMcclj_newb: Try this in a REPL: (eval `(def ~(symbol ")") 5))
16:20gtrak``than reduce?
16:20TimMcclj_newb: and @(resolve (symbol "adhoc.core/)"))
16:21TimMcThat's as close as you're getting.
16:21brehautgtrak``: oh i didnt see the link to fogus's article
16:21TimMc@(resolve (symbol ")")), rather
16:26clj_newbdamn it; I feel like clojure is making me a better programmer day by day
16:26muhoostarted keeping track of time, to see how long exactly it takes me to go from "wtf?" to "oh, i can do that, give me a minute or two"
16:26clj_newbmuhoo: I have found that the time it takes me to do something in clojure is inversely porportional to how reponstive #clojure is
16:26muhoothat's nota good sign
16:27muhooi figure if i have to ask on irc, that means i failed at googling/studying/reading/thinking
16:27muhoowhich i do often, but still :-)
16:38TimMcor Clojure failed at documentation
16:45ieureIf anyone is feeling helpful: http://stackoverflow.com/questions/9025882/extending-dropwizard-service-class-in-clojure
16:46jaleyso... i just did ;; (time (dotimes [i 500000] (+ 1 2 3 4))) ; in a 1.2 and a 1.3 REPL, and it appears 1.3 is 50x faster o_O
16:50brehautjaley: primatives vs boxed types
16:50ztellmanjaley: micro benchmarks are the opiate of the masses
16:51pjstadigztellman: especially on the JVM
16:51jaleyztellman: damn straight, i was much pleased
16:52ztellmando people know about https://github.com/hugoduncan/criterium ?
16:52ztellmanit injects some semblance of reality into these sorts of measurements
16:52hiredmanneat
16:52ztellmanI was pleased when I found it
16:53technomancy,((vec (range 10)) 3 7)
16:53clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>
16:53technomancywhy doesn't that just subvec it up?
16:53technomancymaybe because of GC issues we don't want to encourage subvec?
16:54technomancyor maybe (like having negative numbers count backwards from the end) it's "just nutty"?
16:54amalloyi wouldn't be surprised to hear that nobody thought of it. but also it's less clear that subvec is ther ight behavior: maybe it should be ##(get (vec (range 10)) 3 7)
16:54lazybot⇒ 3
16:56technomancyhmmm... I'm pretty sure making it work like c.c/get is the wrong thing, but maybe maintaining the parallel between .invoke and get is enough to disqualify subvec
16:56brehaut,({:a 1} :b 2)
16:56clojurebot2
16:57sritchieRaynes: can the default "lein new project-name" command take any extra arguments?
16:57muhooget or take?
16:58Raynessritchie: Possibly. I've purposely left it open so that it shouldn't be difficult to use it for general scaffolding purposes, so probably. If not, I'd accept a patch.
16:59sritchieRaynes: ah, never mind -- I was going to say that w/o lein-newnew on the classpath, something like "lein new noir project-name" works, just not as expected
16:59technomancyso how about this: javascript is CVS, coffeescript is svn, parenscript is monotone, and clojurescript is an early version of git?
17:00sritchieRaynes: looks like that creates a project called "noir" with a namespace of "project-name"
17:00dnolentechnomancy: not bad
17:01technomancyor... parenscript might be darcs? I don't know.
17:01muhoo,(get (vec (range 10)) 3 7
17:01clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
17:01muhoo,(get (vec (range 10)) 3 7)
17:01clojurebot3
17:01muhoohm
17:01sritchiew/ lein-newnew on the classpath, you either get a new noir project, or a failure if the noir template isn't found
17:02technomancyneed to get newnew to look on clojars for templates it can't find locally
17:03muhooand what's jquery? bzr? hg?
17:03Raynesjquery is a library.
17:03technomancyI dunno; sourceforge?
17:03RaynesNot a programming language.
17:04muhoopart of the set of Things Which Attempt To Make Javascript Suck Less.
17:05muhooRaynes: sorry, i should have gone down the tree a level or two :-)
17:05brehauti thought jquery was on github these days?
17:05muhooanalogy soup!
17:09jcrossley3can someone please clarify how with-redefs affects "all threads"? if i rebind say, 'str', does that mean every thread in the jvm sees that change even if not running the body of with-redefs?
17:09hiredmanwith-redefs isn't binding
17:10hiredmanit changes the value of the var and then changes it back at the end
17:10technomancythe root value, to be specific
17:10jcrossley3but if the fn i want to redefine isn't dynamic, i can't use binding, right?
17:10hiredmanright
17:11hiredmanand with-redefs is not safe
17:11technomancywith-redefs is there primarily for testing purposes
17:11hiredmanit should really only be used for testing
17:11technomancyjinx!
17:11jcrossley3so what's the right way to redefine a non-dynamic fn? :)
17:11hiredman"you owe me a coke"
17:11hiredmanjcrossley3: why do you want to do that?
17:12jcrossley3hiredman: it's complicated.
17:12hiredmanwell, so the first easy answer is "don't do that"
17:12technomancychanging the root value of a var is monkeypatching
17:13technomancyI'm going to go with "submit a pull request"
17:14jcrossley3monkeypatching gets a bad rap. monkeys are adorable!
17:14technomancyI think you can automate that these days with tentacles and pomegranate
17:14brehautid prefer lemur patching
17:14technomancyhow awesome would it be for a program to submit a pull request for its own dependencies, monitor the mailing list for a release announcement, and pull in the changed version via pomegranate?
17:14technomancy(hint: so awesome)
17:15tmciverHa!
17:15jcrossley3technomancy: so if i want to monkeypatch, i should use ruby or python instead of clojure?
17:15technomancystart filling out the :mailing-list field in your project.clj files, guys
17:15jaleyand fix compatibility breaks itself
17:16technomancywell
17:17hiredmanjcrossley3: you can do it
17:17hiredmanjust know what you are doing
17:17jcrossley3hiredman: i'm listening
17:17hiredmanlike, if you don't know enough about clojure to know how to do it, I dunno if you qualify under "know what you are doing"
17:18technomancyit's akin to the rules of optimization: "rule 1: don't optimize. rule 2: (for experts only) don't optimize yet..." =)
17:18hiredman:|
17:19technomancyif you take a look at the source for with-redefs it might give you the hints you need
17:21jcrossley3hiredman: technomancy: thanks, i guess. :)
17:23muhoois there a way to run lein commands from inside the repl?
17:24Raynes(require 'clojure.java.shell) (clojure.java.shell/sh "lein" "deps")
17:24muhooheheh
17:24RaynesFor even more fun, https://github.com/Raynes/conch
17:24Raynes</shamelessplug>
17:24technomancymuhoo: your project runs in an isolated context from leiningen
17:25muhootechnomancy: that's kind of what i suspected, thanks
17:26muhooi'm trying to run "lein ring uberwar" to see if i can generate a war that'll run in tomcat (from a noir project)
17:26muhooand it says "That's not a task."
17:27muhooi pulled "lein ring uberwar" from fragments of many google search results, wasn't sure if it was going to actually work
17:28muhooRaynes: i can run a bash shell from inside clojure inside jvm inside emacs!
17:30muhooah, i didn't have it iin dev-dependencies
17:30scottjmuhoo: you can even run emacs from bash.
17:31muhoohmm Exception in thread "main" java.lang.NullPointerException (NO_SOURCE_FILE:0)
17:31AimHereIf you do that, it eliminates the need for hardware
17:32muhooso, trying this lein ring uberwar trick, no luck so far
17:33llasrammuhoo: uberwar not war ?
17:33muhooso saith the internets
17:33muhoosupposdly a uberwar will enable the noir app to run in tomcat not jetty
17:34llasramAh, sorry. Only played with it and misremembered. Yes, uberwar
17:35muhooand, indeed, lein ring help shows uberwar as a choice, so it's all installed. i have something else misconfigured, apparently.
17:40jcrossley3technomancy: hiredman: muhoo's use case is a great example!
17:41jcrossley3why should he have to create a war to run his noir app in tomcat?
17:41jcrossley3because noir makes assumptions about the current directory that aren't valid in tomcat
17:41technomancyweeeeelllll... I refer you to my comment about pull requests? =)
17:41technomancyseriously though, monkeypatching at build time can be appropriate
17:42technomancyit's in production contexts where you need to be more vigilant
17:43hiredmanjcrossley3: I have no problem with monkey patching as long as you enough about what you are doing to be responsible for it, instead of "oh I have this magic thing that makes what I want work"
17:43hiredmanif you can explain it in terms other than "it's magic" (or similar) go ahead
17:43jcrossley3technomancy: why not runtime? i can envision ring middleware to "monkeypatch/decorate/whatever" io/file to resolve relative to the app root or delegate to the *real* io/file if it can't find it.
17:44hiredmanjcrossley3: that is pretty horrible
17:44jcrossley3horribler than forcing the creation of a war file?
17:44hiredmanno
17:45hiredmanbut the silent change of behavior solution to that problem
17:45jcrossley3horribler than forcing noir to always use absolute paths?
17:45hiredmanyou should provide a (get-app-root) that the functions can use if they want
17:45jcrossley3hiredman: i agree it requires care, and done poorly, could piss someone off.
17:45jcrossley3but it also could be a huge help
17:46jcrossley3hiredman: but then noir would have to use that!
17:46hiredmansure
17:46hiredmanand it would be more flexible and useful for it
17:47technomancyjcrossley3: well, the thing about middleware is that it's explicitly inserting a layer in there you can inspect
17:47faust45i just try this code http://friendpaste.com/3wUpitsB3SPO0HsJmQcuql
17:47faust45and run in repl
17:47faust45user=> (some-seq '())
17:47faust45but got error
17:47faust45IllegalArgumentException No implementation of method: :some-seq of protocol: #'test.core/Some found for class: clojure.lang.PersistentList$EmptyList clojure.core/-cache-protocol-fn (core_deftype.clj:495)
17:47faust45user=>
17:47technomancythe problem with monkeypatching is that it modifies something at a distance, and you have no way of tracking it down
17:48faust45can any one help me?
17:48technomancymiddleware is explicitly composable
17:48hiredmanwell, middleware doesn't modify anything
17:48technomancyah, quite
17:48hiredmanit returns a new thing with different behavior
17:48jcrossley3y'all are referring to ring middleware specifically, right?
17:49hiredmanI am yes
17:50jcrossley3hiredman: so it sounds like you're suggesting the best course is to change noir to use absolute paths?
17:50hiredmanno, I am not
17:50hiredmanI have not suggested any changes to noir
17:51faust45can any one suggest whats wrong with this code ? http://friendpaste.com/3wUpitsB3SPO0HsJmQcuql
17:51hiredmanI have just said that your changes sound horrible
17:51faust45please
17:51technomancy(that was me suggesting the patching, albeit not having a firm grasp on the problem at hand)
17:52hiredman53.215 jcrossley3 technomancy: why not runtime? i can envision ring middleware to "monkeypatch/decorate/whatever" io/file to resolve relative to the app root or delegate to the *real* io/file if it can't find it.
17:52hiredmanlooks like jcrossley3 suggesting it to me
17:54jcrossley3hiredman: so what would your approach be to the problem of allowing a noir app to be deployed to tomcat (or let's say... immutant ;) where it sits on disk, without having to go through the annoying step of war file creation?
17:56hiredmanjcrossley3: I am not familiar enough with the code to say, but as someone who uses clojure.java.io a lot I would be very annoyed if someone changed the behaviour out from under me
17:56amalloyfaust45: i guess what's wrong with it is that you haven't posted enough code to guess at what you're trying to do
17:56amalloyso far, it all seems correct, if a little weird
17:56devnanyone use test.generative?
17:57jcrossley3hiredman: even if only changed/bound for the short duration of creating the noir handler?
17:57devnis it anything like quickcheck?
17:57faust45amalloy: i just find out ) i was typo error in name same-seq must be some-seq
17:58faust45is it possible define Protocols in this way http://friendpaste.com/4bxhUYkpQDdd6minNK3nO0
17:58faust45?
17:58technomancydevn: haven't used it, but I hear its goal is to be quickcheck-ish
17:58RaynesWow. The pastebins people find…
18:02faust45is it possible define method with diff num arguments for Protocol?
18:06jkkramer,(doc defprotocol)
18:06clojurebot"([name & opts+sigs]); A protocol is a named set of named methods and their signatures: (defprotocol AProtocolName ;optional doc string \"A doc string for AProtocol abstraction\" ;method signatures (bar [this a b] \"bar docs\") (baz [this a] [this a b] [this a b c] \"baz docs\")) No implementations are provided. Docs can be specified for the protocol overall and for each method. The above yields a...
18:06jkkramerfaust45: ^
18:08Raynesjkkramer: ##(doc defprotocol)
18:08lazybot⇒ "Macro ([name & opts+sigs]); A protocol is a named set of named methods and their signatures: (defprotocol AProtocolName ;optional doc string \"A doc string for AProtocol abstraction\" ;method signatures (bar [this a b] \"bar docs\") (baz [this a] [this a b] [this a ... https://refheap.com/paste/439
18:08RaynesPoint being: lazybot pastes.
18:08RaynesAnd word wraps terribly, but you can't have your cake and eat it too.
18:09faust45clojurebot: thanks man )
18:09clojurebotGabh mo leithscéal?
18:09jkkramerI can never remember which uses , or ## or &
18:09Raynesjkkramer: & is for code at the beginning of a line. ## is for code embedded in a message. , is for clojurebot.
18:09jkkrameri know, i just mean which bot is which
18:09RaynesOne is lazy, the other isn't.
18:10RaynesNot hard.
18:10Raynes;)
18:10TimMcjkkramer: clojurebot got the cool eval-trigger, but lazybot doesn't suck
18:10amalloy~guards
18:10clojurebotSEIZE HIM!
18:10TimMchaha
18:11RaynesTimMc: funfact: , works for lazybot in every channel except for this one.
18:11technomancyit's worse if you hang out in #emacs, because , triggers factoids in there
18:13TimMcRaynes: I noticed!
18:16jcrossley3technomancy: so because with-redefs sets the root binding, it's useless if the thing you're redefining has a thread-local binding, right?
18:17cemericktechnomancy: that's a fabulous write-up
18:17technomancyjcrossley3: correct; it will be shadowed by binding
18:17technomancycemerick: thanks!
18:17technomancyjust trying to distill all the "yeah, don't do that" moments I've had so far =)
18:19TimMclink?
18:19technomancyhttps://github.com/technomancy/leiningen/wiki/Repeatability
18:19TimMcclojurebot shut up
18:20TimMcOh hey, it didn't even try.
18:20jondot2hey guys - if anyone read both of these - what should i go for - clojure in action or 'the joy of clojure' ?
18:23sorenmacbethtechnomancy: what's the recommended proceduce to keep -SNAPSHOT versions of lein plugins up to date?
18:23AimHereDoes "The Joy of Clojure" have charcoal drawings of bearded hippy Clojure hackers doing clojure in various different positions, because, if so, that
18:24technomancysorenmacbeth: hmm; what's the context?
18:24technomancyyou mean like third-party plugins, or stuff you're developing internally?
18:24sorenmacbeththird-party, swank-clojure in this particular context
18:25sorenmacbethtechnomancy: right now I occasionally do a lein plugin uninstall, followed by a lein plugin install
18:25technomancysorenmacbeth: swank-clojure and other user-convenience plugins kind of stand outside that whole "build-as-a-function" metaphor
18:25technomancyif it doesn't reflect the output of the build, the repeatability concerns don't really apply
18:27sorenmacbethso just do the uninstall, install dance then?
18:27technomancyoh, sorry; no I think I fixed the bug where you had to do a manual uninstall first
18:27technomancyjust do install again
18:28technomancysorenmacbeth: lein2 will allow you to just declare it in a user-level profile that's applied across the board
18:28technomancyrather than having a plugins directory
18:28jondot2AimHere, hmm?
18:29sorenmacbethtechnomancy: nice, I like that
18:29sorenmacbethtechnomancy: the lein2 bit I mean
18:29technomancyit's pretty close to being ready to try out
18:29AimHerejondot, Maybe you've not heard of "The Joy of Sex", which was where the title was pilfered from
18:29technomancywhat?
18:29clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
18:29technomancyI thought it came from the joy of cooking.
18:30jondot2AimHere, sorry, i haven't. i'll go for that one though.
18:30technomancythat's what my obscure joke on the back cover suggests anyway
18:33AimHereI though The Joy of Sex was the original, but it seems I'm mistaken
18:33TimMcThis can be arranged at the next Conj.
18:36tmciverAlex Comfort wrote "The Joy of Sex", technomancy: you should have said "What Alex Comfort did for sex ..."
18:36technomancyAlex "Comfort"? really.
18:37tmciverfunny, I know.
18:37TimMcPhil "Hagelberg"
18:38tmciverTim "Mc"?
18:38TimMcyup
18:38TimMcbow chicka wow wow
18:38tmciverHa!
18:41sritchiehow would you guys recommend checking if a namespace exists from java>
18:41sritchie?
18:42sritchieRT.var("clojure.core", "symbol").invoke("user");
18:42sritchiegives me a symbol for user --
18:42sritchieI'm looking for a better way than catching a FileNotFoundException from RT.var("clojure.core", "require").invoke(userSymbol);
18:43technomancyelisp's require accepts a "noerr" argument
18:44technomancyI don't think there's a better way than try/catch though unless you want to bring in some serious classpath-searching
18:44sritchietechnomancy: I'll describe this weird case, maybe there's a better way --
18:45sritchiecascalog needs to require a namespace, but I want to catch the error if the ns doesn't exist, since the user might be working at the repl
18:45sritchiethe problem is that if the namespace does exist but (require 'my.namespace) throws an error,
18:45sritchiethe error passes silently
18:45sritchieand later calls to the functions throw "Attempting to call unbound fn"
18:46hiredmanand namespaces are not always loaded from files
18:46sritchieyeah
18:46sritchieso the question is, what to catch in a call to "require"
18:46technomancyprobably need to inspect the message of the exception then
18:47sritchieoh, yeah, of course
18:47hiredmansritchie: I'd suggest that if users have errors in their code (requires not working, etc) they should fix their code
18:47sritchiehiredman: you're right, but this is a little odd, since it's a distributed hadoop process that's doing the require
18:48sritchiein local mode, a call to "require" from java can fail if the ns doesn't have a file, but functions will still be invokable
18:48sritchiefrom the "user" namespace, for example
18:48hiredmanthe call to require from java shouldn't fail if the namespace exists
18:48sritchieit's if it doesn't exist
18:48sritchieif you define it at the repl
18:48sritchiefor example
18:49hiredman:|
18:50sritchietechnomancy: I'll inspect the error message and add in a test so I can catch it if it changes
18:50sritchiehiredman: https://gist.github.com/
18:50sritchieerr, https://gist.github.com/1685941
18:51Raynesamalloy: So, I've been thinking about your paste mirroring idea. It makes sense to mirror pastes from crappy pastebins like pastebin.com to refheap. I think I'm going to get a list of crappy non-clojure-supporting pastebins and consider the whole mirroring thing.
18:53faust45if when override methods first next and rest which Protocol i need to use ?
18:53hiredmansritchie: RT.load has a failIfNotFound argument
18:54sritchiehiredman: oh, nice
18:54sritchieand that's all I need instead of "require", I'm guessing
18:54hiredmanshould do the trick
18:56sritchieyou're the man, thanks
18:58philhow can this be simplified? {:x (+ (:x p1) (:x p2)) :y (+ (:y p1) (:y p2))}
18:58sritchie(merge-with + p1 p2)
18:59sritchie,(merge-with + {:x 1 :y 1} {:x 2 :y 2})
18:59clojurebot{:y 3, :x 3}
19:00philah, merge-with, many thanks
19:00sritchienp
19:00amalloyor use a [y x] vector instead of a map
19:01amalloy&(map + [1 1] [2 2])
19:01lazybot⇒ (3 3)
19:02dgrnbrgwhy is clojure EPL? I've never heard of that license, and the FAQ likes to an IBM FAQ that 404ed.
19:03technomancyit's a non-viral copyleft license
19:03technomancybest of both worlds
19:03dgrnbrgis there a req to redistribute source code for epl portions of shipped binaries?
19:05technomancyyes, if you ship a modified version of Clojure you must distribute your modifications
19:05technomancybut you don't have to license your own application under the EPL just because it's what Clojure uses
19:09AimHereNor is there a clause insisting you distribute your apps via the Clojure appstore
19:12faust45i try implement custom Seq http://friendpaste.com/2WeL6Co1rofx7GCWMnzdq7
19:12faust45and got this error
19:12faust45user=> (next (SeqFly. '(1 1 2 3 3)))
19:12faust45(AbstractMethodError clojure.lang.RT.seqFrom (RT.java:473)
19:13faust45what its mean?
19:25the-kennyFunny. The ThinkRelevance Podcast is marked "explicit" in iTunes.
19:28gfredericksI think the alternative should be to mark things as "implicit".
19:29TimMcStuart Halloway and the Naked Abstractions
19:30faust45can any one help me with this error
19:30faust45user=> (next (SeqFly. '(1 1 2 3 3)))
19:30faust45(UnsupportedOperationException nth not supported on this type: SeqFly clojure.lang.RT.nthFrom (RT.java:835)
19:30faust45?
19:30faust45sorry guys
19:30faust45)
19:31gfrederickswhat is SeqFly?
19:31faust45thttp://friendpaste.com/1PqCEPdXCaSQmlyzTASKeu
19:31faust45SeqFly define this place http://friendpaste.com/1PqCEPdXCaSQmlyzTASKeu
19:33gfrederickshmmm. I do not know.
19:33faust45TimMc: can you help?
19:34ztellmanfaust45: AbstractMethodError means you didn't implement the method
19:35faust45ztellman: nth? but why when i call next clojure need nth?
19:37the-kennyMaybe split needs nth
19:38gfredericksbut split operates on the field
19:38gfredericks(the list)
19:38aphyrClojurites: any recommendations for parser libraries? Looking for a PEG, LALR, or parser combinator library with good performance characteristics.
19:39TimMcaphyr: I don't know the details of any of them, but parsley and fnparse get mentioned a lot.
19:39faust45interesting but i don't call split
19:39faust45i call next
19:39technomancyI don't know about you, but clojure.core/read-string is my favourite parser
19:39gfredericksfaust45: the impl of next calls split
19:40ztellmanI'm pretty sure the issue is that you can't just return 'this' in seq
19:40TimMcfaust45: You didn't finish implementing ISeq
19:40gfredericksMy fingers are tired of C-x o; how can I switch emacs windows more efficiently?
19:41gfredericksalt with arrow keys doesn't work
19:41aphyrtechnomancy: yep, I've got to be compatible with an existing protocol though
19:41faust45TimMc: hm, but which methods i missing ?
19:41ztellmanhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ISeq.java
19:41TimMcfaust45: https://github.com/clojure/clojure/blob/1.3.x/src/jvm/clojure/lang/ISeq.java
19:41ztellmanmore cons
19:41faust45TimMc: also it's confused if i have own impl of next, and then call, why it try call something else?
19:42faust45http://friendpaste.com/1PqCEPdXCaSQmlyzTASKeu
19:42technomancygfredericks: I have C-x C-o go forwards two and C-x S-o go backwards 1
19:42technomancygfredericks: that covers you until you get to more than four, which I never really do.
19:42gfredericksthis suggests there must be a natural ordering that it goes in, which I haven't figured out yet
19:43gfredericks...or tried
19:43ztellmanfaust45: this isn't a minimal example, but here's some code that implements an ISeq: https://github.com/ztellman/gloss/blob/master/src/gloss/data/bytes/core.clj
19:46TimMcfaust45: Why do you keep pasting that link?
19:47faust45TimMc: point to impl of ISeq
19:47RaynesBecause he really, really likes friendpaste.
19:48faust45this new version of impl ISeq but still have error
19:48faust45http://friendpaste.com/4lZlMSpfZN6DCCcxE2canl
19:48faust45user=> (next (SeqFly. '(1 1 2 3 3)))
19:48faust45(UnsupportedOperationException nth not supported on this type: SeqFly clojure.lang.RT.nthFrom (RT.java:835)
19:49faust45which interface have nth ?
19:58faust45hm, its not simple to implement custom seq behavior
20:04dgrnbrgHello clojurians, I just posted a writeup of a part of a talk I gave on Clojure concurrency. This post is about vars: http://blog.dgrnbrg.com/post/16449608086/concurrency-with-vars
20:20TimMcUgh, ##(compare [1] '(1))
20:20lazybotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IPersistentVector
20:21tmciverTimMc: why not ##(= [1] '(1))
20:21lazybot⇒ true
20:21tmciver?
20:22faust45how i can identify which interface declare method?
20:22TimMc&(compare 9 1)
20:22lazybot⇒ 1
20:22faust45for example nth
20:22TimMc&(compare [9] [1 1 1])
20:22lazybot⇒ -1
20:22tmciverright
20:22TimMctmciver: I'm trying to compare collections lexicographically; turns out compare isn't worth shit for that.
20:23brehaut,(compare (seq [1]) (seq (list 1)))
20:23clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to java.lang.Comparable>
20:23TimMcOr rather, vectors implement it non-lexicographically. (A.k.a., wrongly.)
20:23brehaut,(compare [1] (vec '(1)))
20:23clojurebot0
20:24TimMcTime to make a library...
20:28amalloyTimMc: (some (complement #{0}) (map compare a b))? not quite right because if one is a prefix of the other they compare as equal, but otherwise probably good
20:28TimMcThat's not enough.
20:29amalloyno, certainly not. just a starting point that might be easy to build from (not that it's hard to do by hand recursively)
20:32TimMcI'll just go for the loop/recur, I think.
20:35amalloyTimMc: https://github.com/flatland/useful/commit/019801cc04e70ca784c03853ec4c579c589e7820 is something i wrote recently, if you want to steal that
20:52radsanyone have experience with enfocus? I'm trying to append a dom fragment then fade it, but I'm not sure how to get the newly appended node and do something with it
20:53radsfor example say I have a dom node, n, and I append it to the document like so: (em/at ["body"] (em/append n)). now how do I get the actual dom object for n now?
20:54radsenfocus appears to make clones of n, so trying to call something on n directly does not work
20:55radsmy workaround so far has been to generate an ID for the node if it does not have one then select that, but it seems like a hack to do it that way
20:55radsckirkendall: any ideas?
20:56ckirkendallrads: hold on thinking about it
20:57ckirkendallyou can do an (at n (em/fade-in time))
20:57ckirkendallif you still have a refrence to N
20:58ckirkendallrads: you can also reference through css selector
20:58radsckirkendall: I tried your first suggestion but it doesn't seem to actually work
20:59ckirkendall(em/at js/document
20:59ckirkendall ["body"] (em/append n)
20:59ckirkendall ["#idofN"] (em/fade-in 500))
20:59radsin this case the node is dynamically generated and does not have an ID, so it does not have a unique selector
20:59ckirkendallwhat is the type
21:00ckirkendallyou can use last-child
21:00radsit's an <li>
21:00radsI didn't think of first-child, but I'm essentially doing what you said: I dynamically assign a temporary id to the node before appending it, then I select that
21:01radsI was just wondering if there was a better way to do it
21:01ckirkendall(em/at js/document
21:01ckirkendall ["body"] (em/append n)
21:01ckirkendall ["body > *:last-child"] (em/fade-in 500))
21:03ckirkendallit might be body:last-child
21:03radswhat if I want to keep a reference to that node after appending more?
21:04ckirkendallif you do you can always pass it into an (at)
21:04radsit doesn't work -- for me at least
21:05radsif you try to (at) that same node you just appended, nothing happens
21:05ckirkendallcrap sorry forgot I have to do a clone
21:05ckirkendallI do that because you can append to all selected nodes.
21:06ckirkendallI might be able to modify it so if you select on it will append the exact node
21:06ckirkendallselect one
21:07radswell let me tell you my use case. maybe this is part of a deeper problem
21:07ckirkendallI would love to here it
21:10radsI have these "events", which are simply <li> documentfragments generated from an enlive template with clojurescript macros
21:11radsso it compiles to (defn event-snippet [] (goog.dom/htmlToDocumentFragment "<li>...</li>"), something like that
21:11radsthese snippets do not have IDs when they are created
21:11radsI want to fill a list with these snippets
21:13radshmm after thinking about this some more maybe I should figure out how to assign some meaningful IDs to the snippets dynamically
21:13ckirkendallIf you know the index you can also access that way with li:nth-of-type(n)
21:14ckirkendallenfocus supports snippets
21:14radsI wanted them to load at compile time though
21:14radsnot on page load
21:14ckirkendalloh
21:14ckirkendallnot a bad idea
21:15radsI actually need to get going but thanks for helping me out with this. I'll think about this some more and if I come up with anyhting interesting I'll ping you on github
21:16ckirkendallIf I think of something I will post it out on the enfocus google groups.
21:17philif anyone is feeling helpful: http://stackoverflow.com/questions/9026863/locally-editing-a-purely-functional-tree
21:17radscool. I really like your library by the way. it's just magical to be able to use the same templates and selectors on both the server and the client
21:18radslater
21:25TimMcHmm, a good way to check if something is either nil or meets a predicate? fnil seems a bit weird here.
21:26ckirkendallrads: thanks
21:26TimMcPerhaps there's a way to check multiple predicates and use nil? as one of them.
21:28brehautwasnt there a function that was introduced in 1.3 to test multple predicates?
21:29amalloy,(do (require 'clojure.repl) (clojure.repl/apropos "every"))
21:29clojurebot(every-pred not-every? every?)
21:29TimMcI could do something cute with juxt and some...
21:29brehaut(doc every-pred)
21:29clojurebot"([p] [p1 p2] [p1 p2 p3] [p1 p2 p3 & ps]); Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logical true value against all of its arguments, else it returns false. Note that f is short-circuiting in that it will stop execution on the first argument that triggers a logical false result against the original predicates."
21:29TimMc&(doc every-pred)
21:29lazybot⇒ "([p] [p1 p2] [p1 p2 p3] [p1 p2 p3 & ps]); Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logical true value against all of its arguments, else it returns false. Note that f is short-circuiting in that... https://refheap.com/paste/442
21:29amalloy&(map (any-pred nil? even?) [0 1 2 3 nil])
21:29lazybotjava.lang.RuntimeException: Unable to resolve symbol: any-pred in this context
21:30amalloy&(map (every-pred nil? even?) [0 1 2 3 nil])
21:30lazybotjava.lang.IllegalArgumentException: Argument must be an integer:
21:30amalloywell, there's an any version, but i forget what it's called
21:30TimMcsome?
21:30amalloy,(clojure.repl/apropos "pred")
21:30clojurebot(every-pred)
21:30amalloy,(clojure.repl/apropos "some")
21:30clojurebot(some some-fn)
21:30amalloysome-fn
21:30TimMchah
21:30brehauthuh. why doesnt every-pred short circuit?
21:31amalloybrehaut: it does
21:31amalloynil passes the first test, so you have to try the second
21:31brehautoh right. my bad
21:33jeremyheiler\msg clojurebot
21:33jeremyheileroops
21:38muhooheh, the war file for tomcat deployment of a "hello world" app in noir, is 6.5MB
21:39tavisrudd1 byte per person almost
21:40amalloyhuh?
21:40muhooperson?
21:40tavisruddhttp://www.google.ca/search?q=world+population+2012
21:40amalloyalmost one byte per thousand people, if you mean world population
21:40tavisrudder, right
21:42brehautmuhoo: my site (embeded jetty) is 7.4MB
21:42brehautalthough thats just a jar, not a war
21:43jeremyheiler6.5 mb isn't bad if contains all its clojure dependencies inside.
21:43jeremyheilerif it*
21:44muhooit does. it's a uberwar, contains the whole language, all the dependencies, etc.
21:44brehauthuh. and apparently 75mb of resident ram
21:46tavisruddnot bad when you consider 'du -sh /usr/lib/python2.7' -> 41M
21:47brehautnot really a hugely relevant measure though is it?
21:47ivan___tavisrudd: yeah, but python is shipped with almost every OS so you never think about it!
21:47amalloynot at all relevant. you forgot to include the jvm in the clojure measurements
21:47brehautexactly
21:47muhooit's amusing, but not terribly meaningful.
21:47amalloybrehaut: it probably doesn't need those 75MB either, if you tuned the heap/gc params
21:48brehautamalloy: yeah i suspect you are completely right. thats entirely untuned
21:48muhooi come from an era where floppy disks had 400kb on them
21:49muhoowhen i see huge numbers like that for "hello world", it's just kinda funny.
21:49brehaut64bit hello world via the web is a bit different to 16bit hello world on the console too ;)
21:50ivan___muhoo: with playframework when you create a uberwar its like 41mb (although they include the scala compiler for some reason) - it seems really excessive - especially when you live in NZ with our crap upload speeds :(
21:50tavisruddI mean 6.5mb is pretty good if includes the lang, all the deps, etc. The 45MB for Python is just the stdlib
21:50gfredericksbit-inflation
21:51brehautivan___: push the source to a vm on the net and build there; dont push built resources from down here
21:51ivan___brehaut: your here too? or missing a t?
21:51brehautivan___: correct. the tron
21:51hiredmanI had to download the jdk earlier, it was 79M
21:51clojurebotPardon?
21:51ivan___brehaut: yeah thats what i do
21:52ivan___brehaut: haha, cambridge
21:52brehautrimu?
21:52ivan___i used to work there
21:52brehautof course ;)
21:52ivan___now i work for cloudbees
21:52ivan___so just work from home, but i live with others that work at rimu hehe
21:53brehautgfredericks: our local dialect is a) replace all vowels with 'u' and b) string a chain of 'yea' sand 'nah's together
21:54gfredericksbrehaut: interpret the latter as binary ASCII?
21:54brehautyeah nah
21:54gfredericksyuuh nuh
21:54brehautbingo
21:54brehautyou could fake it down here
21:54hiredmanaren't the dialects of nz all "bah bah baaaaah"? it's like 80% sheep
21:54gfredericksI'm Nuw Zuulunduc!
21:54ivan___thats aus now, New Zealand is diary more
21:55gfrederickser, U'm
21:56hiredmanivan___: huh
21:56hiredmango figure
21:57brehauthiredman: its especially cow heavy near ivan___ and i. other parts of the country are more like the stereotype (a lot of the south island for example)
21:57ivan___yeah
21:57hiredmanthats too bad about sheep farming not being profitable for many farmers anymore, I wish more things were wool
21:57ivan___basically any flat land is generally diary, or is being converted.
21:58ivan___sheep can handle hilly area better, and they cant be used for cows
21:59tavisruddfunny thing about Lord of the Rings is most of the forest filled valleys in the film have had the trees painted in. They're really full of sheep.
21:59hiredmanI seem to recall a big mad cow scare in korea a while back over american beef so you could only get newzealand
21:59brehauttavisrudd: actually, the stacked the sheep up and painted them green
21:59brehautbut i understand how the confusion arrises
21:59ivan___haha
22:00gfredericksgreen sheep on pole == tree
22:00hiredmanhttp://en.wikipedia.org/wiki/2008_US_beef_protest_in_South_Korea
22:00tavisruddhttp://blogs.reuters.com/wp-content/uploads/2006/09/sheep360.jpg
22:00brehautgfredericks: have you considered a job at weta workshop?
22:01gfredericksbrehaut: nope.
22:04duck1123what's the best lein plugin for clojurescript currently. Ideally, one that also gives me access to goog.dom.query and optionally goog.net.WebSocket
22:05jeremyheilerwhoa, clojure? this is sheeptalk.
22:06jeremyheilerduck1123: i think i read somewhere today that clojurescriptone has converted to lein.
22:06duck1123It got to me that clojurescriptone went against the standard lein structure
22:06duck1123I wound that a bit odd
22:07jeremyheilerhmm
22:07jeremyheilerwasn't it just how they depend on clojurescript and domina, since there's no official releases for them yet?
22:09duck1123I really haven't done much clojurescript yet, I did a short proof of concept and then set it aside. I'm trying to get a tad further tonight, but am having no luck even after I tried yanking pinot out
22:10duck1123time to abuse M-;
22:10tavisruddduck1123: have you tried lein-cljsbuild?
22:11duck1123no, does that one work well for you?
22:11duck1123cljs-watch hasn't been updated in a while, so I assumed there was a new star
22:11tavisruddI've only played with it so far, but it seemed good.
22:17philis clojure.algo.monads compatible with cljs?
22:21duck1123for some reason, every now and then, lein deps takes forever for me
22:21gfredericksduck1123: whenever there's a cache miss?
22:22duck1123I think so, yeah it's checking the repos now
22:23devnphil: if you mean out of the box the answer is no. with some work you could get it going though, i believe.
22:24phildevn: im checking out the source right now, doesnt look too hard
22:30devnphil: i'm sure you can handle it, just tough to gauge where someone is when they ask if something in contrib is compatible
22:30devnthat could be driving in a lot of different directions
22:31phildevn: yea of course, what i rather meant is i *hope* it wont get too hard :)
22:32devnphil: the dependency on clojure.tools.macro is something i don't know very well
22:33phildevn: yea that stroke me as odd too, but i hope in the worst case im just gonna be able to rip out the single macro they depend on
22:33technomancyduck1123: probably checking for snapshots; try moving to releases or timestamp-locked snapshots
22:34muhooaha. i may have figured out why nobody likes to talk about how to use vars
22:35muhoolooks to me like they can be used to do mutable c/java/etc style mutable stuff
22:35duck1123I've gotten rid of as many snapshots as I can. Timelocking will probably come next
22:36technomancythe only reason vars are mutable is to support interactive development; using them otherwise is an abuse.
22:37muhooum, i see them in noir
22:37technomancyyou're seeing set! and/or alter-var-root?
22:37muhoonot set, i'm seeing binding
22:37muhooand declare
22:37technomancyoh, that's not using mutability
22:38muhoooh good
22:38gfredericksman that link technomancy just tweeted has one of the worst definitions of functional programming I've come across.
22:38muhoostill, if i understand what i'm reading (and i probably don't quite yet), it looks like they can create new bindings for existing vars
22:39hiredmanalso LISP
22:40gfredericksI think I went into that with my expectations way too high.
22:40technomancygfredericks: oh, were you not greatly entertained?
22:41gfrederickstechnomancy: if you're not in the right mood for it it becomes sad
22:41gfredericksmaybe if I had known ahead of time it was bad I would have enjoyed it.
22:41gfredericksMy favorite sentence: "Working in this paradigm requires a different, more mathematically oriented mindset than working with imperative languages like C, Java, and Basic, but it offers some distinct advantages."
22:42hiredmanoh right, that sounds just like PHP
22:42brehaut"LISP programmers are free to create their own verbs, called functions" seriously? have OO programmers forgotten so much that they need to be told what a function is?
22:42TimMchaha
22:42gfredericksmy guess is programmers aren't the intended audience
22:42gfredericksmaybe I'm expecting too much again though
22:43technomancy"IT Software Community"... yeah, never really sure what "IT" means.
22:43technomancyit makes me think of printers.
22:43TimMcIt makes me think of shitty ads on teh subway.
22:44gfredericks"Get the insight and confidence it takes to always perform better"
22:44gfredericksnot sure what's unclear about that
22:44brehauttechnomancy: im pretty sure IT is a clown or a spider or something
22:44brehautthought he was more concerned with eating children than software though
22:44devnbrehaut: hahaha
22:44jeremyheilerclown: http://www.imdb.com/title/tt0099864/
22:45devnit makes me think of a weird john dvorak, Dev Null, Apple Newtons, majordomo
22:45devnaol 2.5, something like that
22:45devnthose were the IT days
22:46gfredericksI hear it used a lot around here and it can usually be traced back to mainframes
22:46brehautis this parody?
22:46gfredericksme? no
22:46devnbrehaut: i...don't know.
22:47gfredericksoh the article
22:47brehautthe comments are newest first. wtf
22:47gfredericksbrehaut: == best first
22:47brehautlol
22:47devnhaha
22:47muhoofrank zappa said about rock journalists: "people who can't write, interviewing people who can't think, to prepare articles for people who can't think"
22:48muhooi suspsect tech "journalism" isn't far removed.
22:48devnguys...cut him some slack
22:48TimMcmuhoo: think * 2?
22:48muhoosorry, can't READ
22:48gfredericksThe "User Rank" for the PHP commenter is just "BASIC CODER", so I guess that means...I don't even know
22:49muhooi'm kind of done with pundits of the musical, political, and technical variety.
22:49technomancygfredericks: couple upvotes on that comment and they'll be promoted to "VISUAL BASIC CODER"
22:49devnit would be a shame if the article talking naively about how great lisp is, had snarky comments by people who objectively know how great it is
22:50technomancydevn: yeah, better keep it to IRC =)
22:50TimMcI'm not falling into that trap.
22:50devnIT'S A TARP!!1
22:50gfredericksthose Scala bastards again
22:50gfredericksalmost had us
22:50muhooi also love when journalists write "science says". really? where did you interview science? at starbucks?
22:51TimMc(seq some-empty-collection) => nil ; was a bad decision
22:51technomancymuhoo: http://files.sciencegallery.com/files/images/i%20will%20do%20science%20to%20it.jpg
22:51muhootechnomancy: +1
22:54jeremyheilertechnomancy: i love your "more magic" switch.
22:55technomancyjeremyheiler: yeah, problem is sometimes I forget to turn it off
22:55technomancygotta be sustainable, you know?
22:55jeremyheileryeah i hear ya
22:56jeremyheilerthe natual magic resources are limited these days
22:56brehautthats the result of less perl programmers
22:57philis there a way to (extend-type clojure.lang.Atom) in clojurescript?
22:57philor are only native types supported
23:02brehautphil: yes of course. (defprotocol Foo (do-foo [this])) (extend-type clojure.lang.Atom Foo (do-foo [this] (str "foo: " @this))) (do-foo (atom 1)) ;=> "foo: 1"
23:03brehautphil: and you can try this in your own clojurescript repl
23:04philbrehaut: in the compiled js output the browser complains about clojure.lang being undefined... did i miss something?
23:05brehauti would presume so
23:05philbrehaut: (havent set up a repl yet)
23:05philhmm
23:05brehautphil: the clojurescript repl ships as part of the git repo
23:05brehautscripts/repl
23:05brehaut(ive only used the repl)
23:07philbrehaut: are we talking about a bash repl or browser repl here?
23:07brehautbash
23:07philah... is it possible the bash repl somehow includes the clojure runtime or something?
23:08philwhich isnt compiled down to js?
23:08brehauti dont think that makes any sense
23:09philbrehaut: yea possibly, just guessing
23:14philbrehaut: when i look at the src/cljs/cljs/core.cljs Atom is defined there, i.e. in the cljs.core namespace
23:15brehautoh may well be i ran the wrong repl then
23:16brehautyes https://github.com/clojure/clojurescript/wiki/Quick-Start
23:19brehautand as i just wacked the pinched nerve in my foot, im going to go away
23:24tavisruddswank-clojure 1.4.0-SNAPSHOT is just about ready for release. If you have time in the next day, pull the latest snapshot to give it a final spin.
23:25tavisruddThe clj-stacktrace version issues should be gone.
23:30franksadded swank-clojure to my project's dependencies in the hope that I could use some of the completion magic - however, clojure can not find any swank-clojure namespaces... anything "special" about swank-clojure?
23:30tavisruddit's best to install it as a plug-in, actually
23:31tavisruddlein plugin install swank-clojure 1.4.0-SNAPSHOT
23:31frankseven if you only want to use a few functions and not the server part?
23:31muhoohow would i go about, say, viewing or printing the contents of a ring request from inside a page request in noir?
23:32tavisruddfranks: oh, I see
23:32muhooi have this: (defpage "/req" [] ((noir.request/ring-request)))
23:32tavisruddthe ns is swank.xxx
23:33tavisruddswank.commands.completion, etc.
23:33tavisruddnot sure if it will work without some of the server state though
23:33frankstavisrudd: right - trying to require swank.commands.completion, but cannot find it - weird...
23:33tavisruddand the jar is on the classpath?
23:34muhoobut it gives me a pretty massive spew: https://refheap.com/paste/443
23:34frankscan see the swank-clojure jar file that was added by lein deps...
23:34franksand inside it I can find swank.commands.completion...
23:35tavisruddmuhoo: looks like double parens
23:35tavisrudd((noir
23:35tavisrudd(noir and it should work is my guess
23:36muhootavisrudd: doh, thanks.
23:37franksException in thread "main" java.io.FileNotFoundException: Could not locate swank/commands/completion__init.class or swank/commands/completion.clj on classpath: (core.clj:9)
23:38tavisruddfranks: does lein swank work at least?
23:40tavisruddjeremyheiler: speaking of sheep http://zongmusic.wordpress.com/2010/01/17/clojure-concurrency/ (and on topic ;)
23:42frankstavisrudd: no... i seem to have 2 versions of swank in my plugin dir already... let me clean up first...
23:43jeremyheilertravisrudd: that is completely awesome
23:50clj_newbI run my code. I get "NullPointerException clouure.core/add-watch (core.clj:1926)." Question: how do I get a stack trace out of this? I want to know which line of code in my *.clj files causes this null pointer exception
23:52jeremyheiler,*e
23:52clojurebot#<Unbound Unbound: #'clojure.core/*e>
23:52ivanhttps://github.com/clojure/tools.trace
23:52clj_newb,(doc *e)
23:52clojurebot"; bound in a repl thread to the most recent exception caught by the repl"
23:53clj_newbjeremyheiler: nice; thanks
23:53clj_newbivan: jotted down to look into the next time I get a cryptic error
23:53frankstavisrudd: ough - removed 1.3.2, 1.3.3 and installed 1.3.4, and then I can find the swank.* ns - if I use dependencies only, it doesn't work - some black magic in that code...
23:54bbloomi'm not sure i understand the behavior of "Vars" and "binding" especially with respect to asynchronous code
23:55bbloom(import java.lang.Thread)
23:55bbloom(defn set-timeout [ms fn] (.run (Thread. #(do (Thread/sleep ms) fn))))
23:55bbloom(binding [x "in-binding"] (println x) (set-timeout 1000 #(println x)))
23:55bbloomprints "in-binding" and nil
23:56bbloomoh actually, the nil is the return value
23:56bbloomisn't not running
23:56bbloomnevermind, ignore me :-P
23:57bbloomah yes ok: missed some ()
23:57bbloom(defn set-timeout [ms fn] (.run (Thread. #(do (Thread/sleep ms) (fn)))))
23:57bbloomok, that prints what I expect: in-binding and then in-binding again
23:58bbloomnow… the problem: clojurescript doesn't have vars:
23:58bbloom(binding [x "in-binding"] (.log js/console x) (js/setTimeout #(.log js/console x)))
23:58franksbbloom: and no threads...
23:58bbloomwell right
23:59bbloombut i still expected the var to be bound in the callbacks
23:59bbloomthat line prints "in-binding" and "top-level"
23:59bbloomwhen i expected "in-binding" twice like clj proper