#clojure logs

2012-03-21

00:03amalloyaperiodic: (comp not not x) is (comp boolean x)
00:06aperiodicamalloy: indeed it is. thanks for the tip.
00:26fhdI'm migrating an older project to Clojure 1.3 but can't find a replacement for clojure.contrib.duck-streams/to-byte-array, ideas?
00:28jayunit100hi ::>
00:28jayunit100not sure what :main does in leiningen.
00:28wmealingsays which function is the one to start ?
00:29wmealingwhen you execute the jar ?
00:29wmealing(just taking a punt, from what ive seen so far)
00:29wmealings/execute/run
00:29jayunit100oh ok
00:30jayunit100well... kinda
00:30jeremyheilerhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L77
00:30jayunit100ahhh
00:30jayunit100ok
00:32jayunit100oh ... and another silly question.
00:33jayunit100how do you exit the repl to restart it ? I am starting to feel bad about overusing Ctrl-C....
00:37_atonothing wrong with using Ctrl-C
00:38amalloyCtrl-D, though, just like any well-behaved console app (Ctrl-Z on windows probably works)
00:44arohnerjayunit100: you can also do (System/exit 0) if it makes you feel better. (but there's nothing wrong w/ Ctrl-c)
00:46jayunit100cool.
00:48jayunit100hmmmm okay.. heres another low hanging fruit :)
00:48jayunit100if I have a list... than clearly, each element is a clojure.lang.Symbol
00:48jayunit100(type (nth '(a v c) 0))
00:49jayunit100now -- can i search for a string which "looks" like one of those symbols ?
00:55wmealingjayunit100, you can iterate over them with a few different functions and write your own compare.. i guess
00:59amalloyjayunit100: your if/then strikes me as nonsensical
00:59jayunit100?
01:00jayunit100oh haha
01:00jayunit100yeah... my bad.
01:00jayunit100if I have a list '(a b c) ... than clearly, each element is a clojure.lang.Symbol
01:00jayunit100better @amalloy ?
01:01amalloyyep, sounds accurate
01:15emezeskeArrgg, I know the answer is "no" but can someone *please* un-moderate me on the clojure google group?
01:15emezeskeI just biffed the tab and enter keys and posted half a message
01:15emezeskeBut I don't get to see it for ??? hours, so I can't post a reply that contains the rest of my message
01:18wmealingwe've all done something equally stupid if not more so, don't be too hard on yourself.
01:19emezeskeI'm not being hard on myself, I'm just frustrated that my message goes into a black hole for like 20+ hours now
01:19emezeskeSo I can't fix it
01:19wmealingah
01:39slyrusis there a better svg lib then the freehep stuff these days?
01:39slyrustechnomancy: you'll be pleased to hear that I finally got clojure-jack-in working :)
01:44lynaghkslyrus, if you just want to write svg itself, check out c2: http://keminglabs.com/c2/
01:45lynaghk(or just use hiccup directly)
01:52slyruslynaghk: thanks, but I need freehep's SVGGraphics2D
02:24sorenmacbethis there a way to enumerate all of the bound vars in a namespace from the repl?
02:30emezeske,(doc ns-publics)
02:30clojurebot"([ns]); Returns a map of the public intern mappings for the namespace."
02:30emezeskesorenmacbeth: ^ might be helpful?
02:31aperiodicthere's also ns-aliases
02:31aperiodichmm, that's not what i thought it was
02:33aperiodic(doc ns-maps)
02:33clojurebotGabh mo leithscéal?
02:33aperiodic,(doc ns-maps)
02:33clojurebotExcuse me?
02:34hiredman_(doc ns-map)
02:34clojurebot"([ns]); Returns a map of all the mappings for the namespace."
02:34aperiodicthanks, hiredman_
02:47sorenmacbethhiredman: cheers
02:50jtoyhi tomoj I'm still playing around with your example, i get different results for some reason
03:11tomojjtoy: are you using different data?
03:11jtoytomoj: yeah
03:13jtoytomoj: all my final results print out to 1, I saved the first query to file and did some counts by hand and see the correct data though, still investigating
03:16tomojgood luck, gotta go
03:16jtoytomoj: nice, i rechecked all my data and found the error is with my data
03:16jtoythanks!
04:22muhoomuaahahaha https://refheap.com/paste/1247
04:23DerGuteMoritzRaynes: thanks!
04:59jtoyhow can I run a single command that I normally run in the repl and have it exit immediately? I just want to be able to do "time leon repl command" so i can see how long it takes to run
05:04andrew_kndrtvch_you can check http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/time
05:11jtoyandrew_kndrtvch_: thanks
05:30jtoywhy if i run lein repl on 1 machine it downloads data to lib and loads the repl, on another machine it doesn't create a lib dir and my code doesn't run
05:31jtoythe code is exactly the same, both pulled from git
05:31ejacksonusually you need to run lein deps to get the lib dir populated
05:31ejacksonthen lein run will work
05:32raekjtoy: maybe you have an old version on the second machine
05:32raekdeps is performed automatically if lib is empty in more recent versions
05:32raekversions of lein
05:33jtoyi just upgraded lein on both machines
05:33jtoyand still don't get lib on one machine
05:33raekdo you get an error?
05:34jtoyno, just return immediately
05:34jtoyhmm
05:34raekwhich command? "lein repl"?
05:34jtoythe broken machine gives me a much newer version: Leiningen 2.0.0-preview2 on Java 1.6.0_31 Java HotSpot(TM) 64-Bit Server VM
05:34raekin leiningen 2 the lib dir is not used
05:35raekthe jars are used directly from .m2 instead
05:35raekbut the program should behave the same
05:35jtoyhmm, how can i downgrade to the older one to see if that fixes it
05:36raekthere are some breaking changes in lein 2
05:36raekthat's why I think most people keep both versions around
05:37jtoyim a clojure newbie
05:40jtoyI'm copying my old one over, thanks
05:41babilenjtoy: You essentially want to follow the installation instructions on https://github.com/technomancy/leiningen not on http://leiningen.org/ -- The difference is that the former asks you to download https://raw.github.com/technomancy/leiningen/stable/bin/lein (i.e. the stable version) not https://raw.github.com/technomancy/leiningen/preview/bin/lein (i.e. the preview/development version of leiningen *2*)
05:42raekversion 2 has not officially been released yet, so it can be wise to stay with version 1 until it is released
05:42jtoyi had previsouly just followed the instructions on github
05:49twem2the github instructions pointed to the preview version as well for a bit
05:54Raynesraek: lein 2 is generally stable enough for use.
05:55RaynesPeople using lein 1 just means more people that are confused and more projects to move when lein 2 final is released.
05:56RaynesThe best bet is to install them both side by side and use lein 2 whenever possible, especially for new projects.
05:56RaynesBut anyways, I need sleep.
07:48pandeirois there an analog of filter, something that takes a fn and coll and returns any items that gave nil/false?
07:52Hali_303hi! what is the easiest way to copy the sexp at the cursor to the clipboard in emacs?
07:53xeqipandeiro: remove
07:53Hali_303also, is there a shortcut for auto-formating?
07:53dan_bi use C-M-k C-y
07:53dan_bcursor at beginning of sexp
07:54dan_balso - C-M-t (transpose sexp) is the best thing ever
07:54jakemcc`Hali_303: if you are using emacs-starter-kit C-c n for indenting
07:54dan_bonce you've acquired the habit, you will curse life evey time you're using a non-sexpy language that doesn't support it
07:55Hali_303ok, i take that as a warning :) thanks!
07:56pandeiroxeqi: never woulda found it, thanks
08:03clgv$findfn odd? [1 2 3 4 5 6] [2 4 6]
08:03lazybot[clojure.core/remove]
08:03clgvpandeiro: ^^
08:12pandeiroclgv: neat trick, findfn
09:03yoklovanybody know what: "recur arg for primitive local: horizontal_QMARK_ is not matching primitive, had: Object, needed: boolean, compiling:" means? I can fix it by wrapping the indicated argument with (boolean), but that's hardly ideal...
09:09nDuffDo sorted maps allow fast random access? I'm looking for a data structure where I can quickly find the keys which sort both immediately before and immediately after a given item if there's no exact match.
09:14yoklovi don't really know the details of the implementation, but i'd be surprised if they favored access from any particular area over another. They are still maps after all...
09:19yoklovso yeah, i'd assume quick random access. iirc, what you're talking about is known as the nearest-neighbor problem, so you might want to look into that if you run into performance issues (there could be a fast algorithm that applies to what you're doing).
09:25clgvnDuff: Clojure's sorted-map is implemented as PersistentTreeMap
09:26clgvyoklov: you have a primitive binding in your loop-statement
09:27yoklovand that means I need to continuously cast to boolean when calling recur?
09:28yoklovI'm binding initially with "(= (rand-int 2) 0)", and call recur with "(= (rand-int 10) 0)". if one of those is a primitive, i would have assumed both were...
09:31clgvyoklov: can you ~paste the whole snippet?
09:31clgv~paste
09:31clojurebotpaste is http://gist.github.com/
09:33yoklovits a fairly beastly function but here: https://gist.github.com/2146893
09:35clgvyoklov: are you using clojure 1.3?
09:35yoklovyup
09:37yoklovchanged it so it should be runnable, but honestly i'm not that concerned
09:38yoklovits annoying because wrapping (not= …) with (boolean) is ugly but if its whats needed thats fine.
09:38andrew_kndrtvch_how to run lein2 on windows ? with script from github i have got this https://dl.dropbox.com/u/6802923/gyazo/1332336452.png
09:40jkkrameryoklov: just a guess, but it might be due to = being inlined while not= is not
09:40clgv yoklov: ok, looking at the source of 'not= and '= - I see that '= is an inline function and hence returns a primitive boolean. 'not= is no inline and and thus can only return a boxed boolean
09:40jkkramerjinx
09:41clgv:P
09:42yoklovhuh.
09:42yoklovpresumably not can't either?
09:42yoklovhrmmmm. nope
09:43clgvyoklow: 'not is no inline function either
09:43pandeirosearching through a large collection of maps for a value - is there a better way than filter?
09:43yoklovoh
09:43yoklovfixed it
09:43yoklov(= 0 (rand-int 2)) is the same as (not= 0 (rand-int 2)), but isn't a primitive
09:44yoklovawesome, thanks
09:44jkkrameryoklov: see 'zero?'
09:44yoklovoh, right
09:45yoklovbut then it's (not (zero?…))
09:45clgvhmmm, imo the doc-string should indicate :inline
09:45jkkramerforgoing zero? isn't a sin
09:45yoklovalso zero? gives me the same problem as before
09:46jkkramerit's inlined too
09:46yoklovthen i can't use it here
09:46yoklovfor whatever reason
09:47yoklovin my defense this is a port from some oldish scheme code i wrote, where there's no 'zero?'
09:47clgvyoklov: (not= % 0) is equivalent to (> % 0) if you have only positive integers
09:47yoklovof course, but you don't think the first is slightly more readable?
09:47yoklovwhen that really is what you're checking
09:48clgvbut '< and '> are inlined ^^
09:48jkkramerpandeiro: filter or for are probably what you want, but depends on the circumstance
09:48clgvI guess there should be ticket to point at that issue.
09:50yoklovhm. i can fill one out later today, i actually have to run right now
09:50yoklovthanks for the help!
09:51andrew_kndrtvch_so.. now can anybody help me ?)
09:51andrew_kndrtvch_how to run lein2 on windows ? with script from github i have got this https://dl.dropbox.com/u/6802923/gyazo/1332336452.png
09:55clgvandrew_kndrtvch_: maybe you can add the leiningen standalone jar to your classpath manually. have you checked if it was downloaded?
09:58andrew_kndrtvch_yes
09:58andrew_kndrtvch_but it doesn't really contains this class
09:58andrew_kndrtvch_so .. or there are some dependency exists or the script is wrong
10:01clgvandrew_kndrtvch_: the script seems wrong. in preview 2 of lein there is no leiningen/core.clj indeed
10:03clgvandrew_kndrtvch_: so this seems wrong then >> clojure.main -e "(use 'leiningen.core)(-main)"
10:04clgvandrew_kndrtvch_: the linux script has >> clojure.main -m leiningen.core.main
10:05ericmoritz\0is there a easy way to read n bytes from a bufferedreader?
10:10raekericmoritz\0: use a BufferedInputStream. readers are for textual data and input streams are for binary data.
10:13pandeirojkkramer: I'm cleaning up typos in collections of 5000+ maps, referencing them against another large collection, so i am iterating through the reference collection for every word to remove matches
10:46ScorchinIs there a curses-like library for Clojure available? E.g. to build my own REPL-like app
10:50fdaoudI'm starting out with ClojureScript and one thing I find very appealing is to use Clojure data structures instead of JSON to communicate data between server and client. I'm finding a ton of CLJS stuff but I can't seem to find a simple example of this.
10:50ohpauleezlynaghk: ping
10:50fdaoudthe data still has to go "over the wire"..
10:50fdaoudand it is still ajax..
10:50fdaoudso I'm having a bit of trouble wrapping my head around how that would work.
10:51ejacksonfdaoud: I give an example of this on my blog: http://boss-level.com/?p=102
10:53ejacksonfdaoud: no, I'm lying.... it was somewhere else....
10:53TimMcYou just print/read, right?
10:53ejacksonsorry: http://boss-level.com/?p=119
10:54fdaoudejackson: thanks, I was going to say, doesn't seem to be what I am looking for.. nice tutorial though, definitely looking at that too sometime soon
10:54ejacksonYeah, the second link is, I think, what you're after. Now I'll stop with the shameless self promotion.
10:54fdaoudTimMc: as a hello world maybe, but eventually want to render a view from the received data
10:55TimMcNot sure what you're asking, then.
10:55TimMcHow is pr-str/read-string any different architecturally from toJSON/readJSON or whatever?
10:56sparkleshywhy is throw a special form? ...couldn't it just be implemented with a bit of java?
10:56ejacksonTimMc: saves you writing the serialisation functions more than once
10:57fdaoudejackson: thanks! that's exactly what I was looking for. s/stop shameless self promotion/please continue helpful contributions/ !
10:57fdaoudejackson: trust me I googled.. just not for the right terms I guess :/
11:06TimMcsparkleshy: If it were a function, it would itself show up in all the stack traces.
11:07hhutchfdaoud: the fetch library lets you do this pretty easily
11:08fdaoudhhtutch: from ibdknox?
11:08hhutchhttps://github.com/ibdknox/fetch the example there are passing clojure structures not json
11:09fdaoudhhutch: thanks-- and btw from all my googling I found your cljs-clojure-demos, thanks for putting those up
11:09hhutchfdaoud: :)
11:09hhutchi need to finish them
11:13fdaoudhhutch: definitely will look at fetch, but want to learn the core first.. just like I found it better to learn ring before learning compojure before learning noir :)
11:13LajlaYou're tearing up my heart when I'm with youuuuu
11:13Lajlabut when we are apart I feel it tooooo
11:13LajlaAnd no matter what we do I feel the paaain
11:14Lajlawith or without you
11:14raeksparkleshy: I guess you could delegate throw to a clojure function (implemented in java) or to a java method. you couldn't do that with catch, though.
11:15raekbut why not let the compiler generate the bytecode instruction for throw instead of a call to the throw funcion/method?
11:16Lajlaraek, my love.
11:16Lajla&"I worship His Shadow"
11:16lazybot⇒ "I worship His Shadow"
11:17raekbut yeah, I guess you could have throw as a function and let the compiler optimize it the way it optimizes plus, minus, and friends
11:21edwThis may seem weird, but I'm at a start-up in NYC as the product lead and I'm looking for a CTO, VP of eng., or "just" someone who's talented at stats and big data. Clojure love would be a big plus.
11:28fdaoudejackson: what are pr-str and read-string?
11:28TimMcfdaoud: doc 'em
11:29TimMcedw: Cool. What industry?
11:30ohpauleezedw: Where in NYC are you? Tutorspree is all about the Clojure love
11:30ohpauleezalso, the Clojure community here is pretty big
11:31fdaoudTimMc: yeah it wasn't working in my cljs repl
11:31TimMcsparkleshy: Actually, throw *can't* be a function, because it needs to have control over the evaluation of its body.
11:31TimMcfdaoud: (use 'clojure.repl)
11:31TimMcAre you in SLIME?
11:31edwOur office is in SoHo. (I live in West Village.)
11:32edwTimMc: Advertising, of course.
11:32fdaoudTimMc: no, just straight-up command line
11:32edwohpauleez: Who/what is Tutorspree?
11:33ohpauleezWe're a YC-backed startup here in NYC (our office is in tribeca). I just finished up a talk at Clojure/West on Clojure-powered startups
11:33TimMcfdaoud: Huh. Leiningen's repl should include that by default...
11:33fdaoudTimMc: no biggie. Anyway, I think I get it, but obviously you still need a string representation to go over the wire. So pr-str and read-string could be json-str and read-json and it wouldn't change much, or am I missing something?
11:34TimMcfdaoud: Anyway, pr is the Clojure serializer and read is the deserializer. pr-str and read-string are the string counterparts (instead of streams).
11:34ohpauleezedw: ^ and I'd go to the Clojure Meetups at Google. You'll get connected to a lot of people. Are you personally using Clojure now? Why have you selected Clojure to tackle your problem?
11:34TimMcfdaoud: Using json limits your expressiveness and may require custom (de)serialization.
11:36fdaoudTimMc: I see. So they are just more powerful and clojure-adapted ways to make the data go through. Once back into Clojure data format, you can use them as regular data structures in ClojureScript instead of (not as powerful) objects in JavaScript.
11:36fdaoudvery nice.
11:37fdaoudTimMc: thank you for your patience, I am just trying to wrap my head around it all..
11:37TimMcfdaoud: More precisely, this is the native string representation of Clojure.
11:37TimMc&(pr-str '[1 2 (a :b #{c})])
11:37lazybot⇒ "[1 2 (a :b #{c})]"
11:37edwohpauleez: I use Clojure for most of my problems (unless the problem needs to be solved in a web browser, in which case I'm still using JS) because I'm a Lisp guy and the JVM host gives me access to a huge ecosystem. But we're not actually using Clojure right now; we're doing development in Java, which is due to working with a consulting shop.
11:37raekTimMc: does it? isn't <expr> in (throw <expr>) evaluated like any other expression?
11:38ohpauleezedw: Also TimMc is an AWESOME consideration is he's available :)
11:38ohpauleezedw: Awesome!!!
11:38TimMcraek, sparkleshy: Augh, I was thinking try for a moment instead of throw. Never mind...
11:38fdaoudTimMc: I see. And you're right, lein repl works properly.
11:39fdaoudfor some reason I thought pr-str and read-string were clojurescript, not plain clojure, thus my confusion.
11:39ejacksonedw: if you're interested in consultants, I might be able to help you out, check your PM
11:41edwejackson: Will do. (I'm IRCing through a soda straw here, dealing with my META key not working.) That said, we're looking to hire someone to be my peer; I intensely dislike contractor situations.
11:41ejacksonno sweat, i intensely dislike employment situations :)
11:42edwHey, I feel the same way about being employed anywhere but at a start-up.
11:42edwOtherwise, consultant city.
11:43TimMcMy dad has been self-employed for a large portion of his life.
11:43TimMcSeems prety happy with that. :-)
11:44ejacksonI've bene self employed only 18 mnths, but I'm loving it
11:44TimMcDoes starting heirloom seed companies and selling them off count as being "in the startup business"? :-P
11:45ejacksonmost def'
11:45TimMcEven if it takes like a decade for each?
11:46edwI grew up in my parents' small business and that ruined me for working anywhre that I have to deal with people who I have to connect the dots for. That and almost twenty years of working in my own design firms, for new companies, as a consultant.
11:46edwTimMc: I'd like my _next_ "start-up" to be like that, more of a 37signals affair.
11:53patrikkarlinhej i used the new? clojure-jack-in function in clojure-mode and it connects fine and i can eval expressions but the repl dosent open. Anny one had the same problem?
11:56TimMcedw: Have they actually sold anything off?
11:56raekpatrikkarlin: what do you mean by "the repl dosent open"? didn't the repl buffer pop up when you got connected? where did you eval the expressions?
11:57patrikkarlinfrom the file buffer
11:57patrikkarlinno it did no open
11:57cap10morganmorning dakrone. thanks again for the noir demo last night.
11:58dakronecap10morgan: thanks for coming :)
11:59clgvcap10morgan, dakrone: did you talk about noir and cljs? is there any material online?
11:59edwTimMc: I was at Half.com from nearly day one. We sold to eBay for $350 million or so.
11:59dakroneclgv: noir on heroku, not much material; it was mostly a coding-example walkthrough
12:00clgvdakrone: ah ok.
12:00raekpatrikkarlin: for me the buffer is called *slime-repl nil*. do you see any buffer like that if you press "C-x C-b"?
12:00edwTimMc: And I had a boutique consulting firm that I founded and sold to my partners back in late '08.
12:01patrikkarlinraek: no i have a slime events buffer tho and it dosent give me anny errors :(
12:01ejacksonedw: busy man !
12:02tmciverpatrikkarlin: do you see a *swank* buffer?
12:02patrikkarlintmciver: yea
12:03raekpatrikkarlin: what does the *Messages* buffer contain? a bunch of lines like "Loading (...)slime(...)done", "Connecting to Swank on port (...)..", "Connected. Lemonodor-fame is but a hack away! (or some other quote)"
12:04raekpatrikkarlin: also, what clojure related stuff have you installed in emacs? just clojure-mode?
12:05patrikkarlinStarting swank server...
12:05patrikkarlinConnecting to Swank on port 63441.. [2 times]
12:05patrikkarlinerror in process filter: Symbol's function definition is void: slime-output-buffer [2 times]
12:05patrikkarlinConnected. May the source be with you!
12:05patrikkarlintheres an error
12:05replaca_Q: does someone know how to do (def ^:dynamic ...) without using a reader macro?
12:05raekreplaca_: like from a macro?
12:05replaca_no, I want something that will work in all versions of clojure
12:06pandeiropatrikkarlin: i vaguely remember that being a version issue? look in ~/.lein/plugins?
12:06patrikkarlini installed clojure-mode and clojurescript mode and lein-clojure i think
12:06patrikkarlinlein-clojurescript-1.1.0.jar swank-clojure-1.3.2.jar
12:07raek(having slime installed is known to cause problems. you don't have to install it when using clojure-jack-in, since it the swank server you connect to provides a matchin version for you)
12:07replaca_although, I could use a macro, if I could find a way to make it work
12:07raekreplaca_: is this for maintaining compability with Clojure 1.1 and earlier?
12:08patrikkarlinraek: dosent seme logical that that whuld void out a function tho??
12:08lazybotpatrikkarlin: Uh, no. Why would you even ask?
12:08replaca_raek: yeah, in autodoc
12:08raekoh, I see
12:08pandeiropatrikkarlin: ls -l your .emacs.d?
12:09raekmaybe you could consider running autodoc in the leiningen clojure instance
12:09patrikkarlin06 *** benares_98 JOIN
12:09patrikkarlin17:06 <replaca_> raek: yeah, in autodoc
12:09patrikkarlin> init.el package package.el places swank
12:09raekit will be >= 1.2
12:10pandeiropatrikkarlin: swank has the slime elisp files?
12:10pandeiroi think i had that problem when i accidentally deleted that folder or its contents
12:10replaca_raek: that doesn't work for documenting, e.g. clojure itself
12:11raekreplaca_: anyway, you can construct a symbol with {:dynamic true} metadat like this: (let [sym (acquire-symbol-somehow)] (vary-meta sym assoc :dynamic true))
12:11replaca_raek: yeah, that's about where I'd gotten to and I think it's the right approach
12:11replaca_raek: thanks
12:12patrikkarlinit has slime files in it i asume this whas installed by the package maneger i dident install swank manualy
12:12raekreplaca_: is the problem that the reader autodoc uses might not be able to read the source?
12:12raeksounds like a hard problem to solve
12:13replaca_raek: at the core, autodoc is usingg whatever version of clojure that is involved in that program
12:13raekif the syntax changes is the only problem, maybe maintaining a separate 1.1 version is simpler
12:13replaca_once I've dig out all the vars, protos and types, I switch back to clojure 1.3
12:13raekah
12:14replaca_*dug
12:14replaca_mostly it works pretty easily, at the cost of some copy and paste pattern
12:15raekpatrikkarlin: have you seen this? https://github.com/technomancy/swank-clojure/issues/92
12:15pandeiropatrikkarlin: weird, sorry i don't remember exactly what i had to do but you might just remove swank of .lein/plugins and .emacs.d/ and lein install swank-clojure 1.3.3
12:16raekfrom that page it looks like there was a problem in swank-clojure 1.3.2, and that 1.3.3 should work
12:16raek1.4.3 seems to be the latest stable version, though
12:18raekpatrikkarlin: try removing all you installed plugins first (as pandeiro suggested, using "rm ~/.lein/plugins/*")
12:18raekand then "lein plugin install swank-clojure 1.4.3"
12:19raekalso check that you _don't_ have swank-clojure mentioned in your project.clj file
12:20patrikkarlini got a artifact missing error is that version not on clojars?
12:22raekhrm, did I spell it wrong?
12:22patrikkarlini dident find it on the site
12:22patrikkarlinusing the 1.5.0-SNAPSHOt
12:23raekah, it's called lein-swank now
12:24raekpatrikkarlin: "lein plugin install lein-swank 1.4.3"
12:25raek(I tested that on my box too, just to be sure)
12:25sparkleshyis there any way to overload + without damaging performance in the normal case?
12:26patrikkarlinTHADA
12:26raek:)
12:26patrikkarlinkisses and hugs everyone who helped :D
12:27raeklycka till!
12:27replaca_raek: so it turns out that vary-meta was the wrong tree up which to bark. By the time you have a var, it's already pulled from the meta. But (.setDynamic #'foo) seems to do the trick
12:27replaca_dunno if it works in 1.1 though
12:28replaca_but I think I was conditionalize that
12:28replaca_*was=>can
12:28raekare you generating code?
12:28raekor making code that should be readable in any clojure version?
12:29raek.setDynamic sounds like an invention of 1.3
12:30replaca_the latter
12:30replaca_I agree that it sounds like a 1.2 or 1.3 thing, but I don't know for sure
12:30replaca_but that's what macros are for :)
12:33raekreplaca_: maybe you could (ab)use the eval reader macro: (def #=(vary-meta '*some-var* assoc :dynamic true) 123)
12:34raekthen you can have metadata in the code without using "^" or "#^"
12:36eggsbyHi guys, I have question. I was looking over the implementation of sort-by in clojure.core and I was puzzled by the line "(sort (fn [x y] (. comp (compare (keyfn x) (keyfn y)))) coll)))
12:36eggsby"
12:36meliponewhat's the clojure library that has the trace tools in 1.3.0?
12:36eggsbySo it's sorting the result of applying the anonymous function to the collection
12:37replaca_raek: oh, that's an interesting idea
12:37eggsbyBut what i'm confused about is the use of the java interop "." . It uses the clojure compare on the result of applying the keyfunction to x and y
12:37eggsbybut where does the java interop come in?
12:37eggsbyit's saying (. compose (comparison of x and y)) right?
12:38replaca_I've got it working now with the .setDynamic, so I think I'll go that way (it's a yak shave anyway to get some debug printing in)
12:39replaca_raek: you're right, .setDynamic was a 1.3 innovation
12:39replaca_but I have a macro that covers that based on the clojure version
12:41vijaykiraneggsby:I think the comp in that line is Comparator
12:41vijaykiraneggsby: you are talking about this line - https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L2713 .. right ?
12:42eggsbyyes vijaykiran
12:43vijaykiraneggsby: AFAIU - it is like java.util.Comparator#compare(keyfn x, keyfny)
12:43vijaykiraneggsby: so comp here isn't clojure.core/comp :)
12:43eggsbyoh? how confusing!
12:43eggsbyso it has to do with the ^notation ?
12:44vijaykiraneggsby: yeah .. ^blah is a "type hint"
12:44eggsbyI'm a bit confused though because I thought the . notation you had the java method as the last parameter, in this case it is the first?
12:44eggsbylike (. 1 toString)
12:44eggsbyand here it is (. toString 1)
12:45eggsbyoh, I see. comp is clojure comp and compare is java's compare?
12:45vijaykiraneggsby: nope, (. target member)
12:45lucianand the shorthand is (.method ...)
12:45lucian(.method target ...)
12:46eggsbywhere target is our parameter to pass to the java method as 'member'?
12:46clgv&(.toString 1)
12:46lazybot⇒ "1"
12:46clgv&(. 1 (toString))
12:46lazybot⇒ "1"
12:46eggsbyso 'compare' in that context is java compare, right?
12:46vijaykiraneggsby: yeah, almost - comp is java.util.Comparator and compare is the method from java.util.comparator
12:46eggsby:o
12:46eggsbyokay, so one is done by typehinting, and the other is done by the java interop function?
12:47eggsbycomp by typehinting and compare by java interop "." ?
12:50ZokaHi guys - have a look at http://noirmon.herokuapp.com/ringmon/monview.html It is a web based interface to nREPL server running within a Noir based app on Heroku. It has color syntax editor (CodeMirror), command history and persistent sessions. Comcurent web users can communicate to each other using simple built in chat.
12:50clgveggsby: you can rewrite to: (sort (fn [x y] (.compare comp (keyfn x) (keyfn y))) coll)
12:50eggsbythat makes sense clgv
12:51eggsbyand in that context comp is typehinted as the java comp from the line [keyfn ^java.util.Comparator comp coll], correct?
12:51eggsbyor rather 'comp as java.util.Comparator'
12:51clgvZoka: where is te chat?
12:51nDuffAre there any suggestions re: minimally-invasive workarounds for CLJ-855 (wrapping of checked exceptions making them unhandleable without catching RuntimeException and unwrapping)?
12:53clgvZoka: seems you could use a sandbox ;)
12:54ZokaYou just type in REPL window and press 'Send'
12:54clgvhmm but it restarted at least ;)
12:54patrikkarlindo whe se each others code executions?
12:54patrikkarlinor only chat?
12:55clgvexecute something^^
12:55patrikkarlini se my own
12:55clgvI think I killed it with (System/exit -1) ;)
12:55ZokaNo, just chat, but you ca
12:56pandeiroclgv: that's a feature, you can turn off the server if it's bothering you while you're chatting
12:56patrikkarlin:D
12:57ZokaIt just comes back :)
12:57clgvZoka: you should consider using clojail ;)
12:57pandeiroit uses nREPL right?
12:57ZokaThi is just a demo for development tool
12:58ZokaSo it needs to be full featured
12:58ZokaAnd Heroku apps are indistructable
12:59clgvif I had some time I'd see which parts of the filesystem are accessible ;)
12:59patrikkarlinthink you can only read
12:59patrikkarlinon heroku ..
13:00technomancypatrikkarlin: that's actually only true of earlier heroku stacks
13:00technomancythe ruby-only ones
13:00ZokaEphemeral file system - you can kill it bit it comes back
13:04ZokaYou can write in your app current directory on Heroku, but those changes are gone on restart
13:08pandeiro(count (map ... coll)) should always be the same as (count coll)?
13:09patrikkarlinhave you seen something else?
13:09clojurebotTitim gan éirí ort.
13:09pandeiroi am doing some processing on a fairly large collection and i can't seem to realize it afterwards, the Thread dies, then when I count the number is different
13:11patrikkarlinthe thread where the collection whas behing "changed" died yet you have access to it?
13:12ldhi'm having trouble with clojure.data.json. read-json is throwing this error: IllegalArgumentException No implementation of method: :read-json-from of protocol: #'clojure.data.json/Read-JSON-From found for class: clojure.lang.PersistentArrayMap
13:12patrikkarlinor do you mean died as in it whas done not crached
13:12ldhcode here: https://gist.github.com/2149600
13:12technomancywell, the semantics of what happens when a lazy seq can't be realized are kind of funny
13:12pandeirowell the map returns a lazy collection so i can map it fine but i can't realize it
13:12pandeirotechnomancy: how do i know when to give up?
13:13technomancyI guess you could argue that count should throw an exception every time if realizing the seq can't happen
13:14technomancyit doesn't make sense to retry the function generating the seq, but I don't think it makes sense to return an empty seq either
13:15technomancythe best thing would probably be to attach the exception to the seq and re-throw it every time the seq is attempted to be realized
13:16pandeiroweird, when i kill the thread and count again the number is different... maybe that's a sign i just need to wait?
13:23cemerickZoka: looks like you're building a bit of a fanbase with ringmon :-)
13:23Zokayes
13:24ZokaIt eouild not work without nTRPL
13:24ZokaI mean nREPL
13:24cemerickYeah, hopefully shortly you'll be able to get rid of the hacks you needed to do in order to work around the lack of HTTP support.
13:25ZokaNo problem, I am very happy with it as is - everything work as advertised
13:26technomancyright now there's no command-line client that speaks HTTP yet, is there?
13:27cemerickit's simple enough that any HTTP client (curl, clj-http, etc) should do just fine
13:28cemerickThe existing nREPL client is general enough that clj-http slips right underneath.
13:28technomancycurl by itself isn't very repl-ish though
13:29cemerickoh *command line* client
13:29cemerickno
13:29ZokaIf you want to use nREPL on heroku tthere is problem of one server socket per web app restriction, so it goed browser->ajax->ring middleware->custom trasport (in JVM) -> nREPL
13:29cemerickI'm going to try to get Colin to add it as a connect option to reply (and therefore lein)
13:29technomancyslick
13:30cemerickZoka: right, the server side of the HTTP transport I'm working on is just another ring handler
13:30technomancycemerick: I may be able to help with that next week if needed
13:30Zokayes. it jist inject a web page and ajax uti
13:31Zokas /uti/uri/
13:33cemericktechnomancy: it's working fine already for simple interactions. I'm trying to figure out how fancy to get re: binary returns (multipart responses vs. some kind of scheme to refer to temporarily-cached auxiliary resources)
13:33technomancymultipart on the CLI? I would have figured that for a lost cause.
13:34cemerickwell, reply can not opt into such things
13:35cemerickbut simple stuff is totally doable without a GUI
13:42tomojmarginalia's choice of `foo` over <tt>foo</tt> makes me happy
13:56TimMcMarkdown: It's almost a real markup language!
14:22muhoowhat would you recommend for a simple, local-ish datastore?
14:22muhooi don't need datomic, and i don't want to have to deal with sql and schemas and jdbc, this is just clojure maps
14:22muhooand storing it all in a flat file kind of sucks
14:23aperiodicsqlite?
14:23RickInGAmongo?
14:24muhoomaybe mongo, i'll have to try it.
14:24muhooi'd rather avoid sql and jdbc
14:24RickInGAI have only done the simplest of examples, but congomongo looks pretty easy to use
14:24pandeiromuhoo: couchdb is pretty easy with clutch
14:24muhooah, thanks.
14:25technomancyanother vote for couch
14:25muhoothanks, that looks like the winner!
14:25patrikkarlinnot redis :(
14:25technomancymongodb worries me
14:25pandeiromuhoo: check out the clojurian semantics cemerick added wait i'll find a link
14:26muhoothis? https://github.com/ashafa/clutch
14:26RickInGAtechnomancy: pandeiro: what is the motivation for couch over mongo? (I don't know enough to have a preference either way)
14:26aperiodichmmm, repl-y doesn't work at all for me
14:26technomancyRickInGA: mongo's defaults are optimized for microbenchmarks over safety
14:27technomancyit's like mysql; it "wins" all the speed comparisons done by people who don't know any better, but as soon as you turn on all the features you need to actually make it a good database, it's no faster.
14:27antares_technomancy: what are you voting on?
14:27RickInGAtechnomancy: thanks, that is a pretty good answer :)
14:28antares_RickInGA: if you have reasons to use mongo, try https://github.com/michaelklishin/monger
14:28technomancyTBH mysql now has better defaults, but that's the stereotype it has from the early 200Xs
14:28mkwhat is a macro?
14:28antares_RickInGA: but mongodb java driver has crazy unsafe defaults (monger in part fixes that) and it is very fast only with low concurrency
14:28muhooi'm not concerned with seped
14:29muhoospeed eithher
14:29muhooi just want one step better than (spit (print-dup somestructure) "somefile.clj")
14:29mkthat is, are there any nice articles out there explaining what a macro is, and when they should be used?
14:29antares_ok. Well, query and secondary indexes in mongo are nice. But I personally will try to think hard about using PG and Riak in combination for some of my next projects.
14:30patrikkarlinanny one here have a project using core.logic on github i can look att
14:30cemerickmuhoo: pandeiro was looking for: https://github.com/clojure-clutch/clutch — look under "Experimental" for the Clojure-native type that makes interacting with a couch db feel like working with a map.
14:30mkthe articles I've seen either lose me, or claim it's too difficult to explain using a simple example
14:30muhoocemerick: thanks!
14:30technomancymk: this one is pretty decent: http://www.defmacro.org/ramblings/lisp.html
14:30pandeirothat's the one
14:31technomancymuhoo: recently postgres added hstore, which gets you schemaless tables and is pretty badass
14:31muhoonice
14:31technomancyI would be all over that except it's too new for the shared DBs on Heroku
14:31RickInGAinteresting
14:31antares_mk: macros are a way for your code to extend Clojure compiler, in Clojure itself.
14:31technomancybut if your postgres is 9.1+ then you should definitely give it a look
14:32RickInGAtechnomancy: do you expect heroku will support that in the future?
14:34jayunit100hi guys
14:34jayunit100 (:require [clojure.set :as set])
14:34technomancynot in the current implementation of shared DBs, but it might be possible in the future without a dedicated DB? I know apart from the fact that they understand it's something people really want
14:35mkI read that article before and it was very informative, but I think that when I came to the macros section it didn't all come together - I think I found it a bit brief
14:35jayunit100-----> java.lang.ClassNotFoundException: clojure.set (NO_SOURCE_FILE:17)
14:35jayunit100(at the repl , i cant load a dependency that lein loads just fine in my normal clojure program).
14:36mkantares_: I think I get that part, but I'm not sure how it works, or what it's used for
14:36RickInGAtechnomancy: is there any extra cost to using couchdb for a small project on heroku as opposed to shared postgres (not that that would be my only factor)
14:36technomancyRickInGA: https://addons.heroku.com/cloudant it's free under 250MB
14:37RickInGAtechnomancy: awesome, thanks!
14:37antares_mk: in simplest cases, for "code generation" that you do in clojure itself. Any intermediate uses all lead to DSLs
14:37technomancyjayunit100: (:require [...]) only works inside ns
14:37antares_mk: take a look at query DSL example here: https://github.com/michaelklishin/monger
14:37jayunit100oh...... ok
14:37antares_mk: it is done via macros, there is no other way to have this kind of DSL with just functions
14:38jayunit100so should i do (in-ns) when i fire up my repl?
14:38cemerickRickInGA: Cloudant is also free for some amount, heroku or not
14:38jayunit100or should i import set some other way ?
14:38cemerickmeh, you'd think I was getting a cut :-P
14:38antares_jayunit100: (require '[clojure.set :as cs]) should work
14:38technomancyclojurebot: the ns macro?
14:38clojurebotCool story bro.
14:38technomancyclojurebot: ns?
14:38clojurebotns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.
14:39technomancyjayunit100: ^^ highly recommended
14:39mkwhat's the distinction between intermediate and non-intermediate uses?
14:39antares_mk: basically, newcomers see it as a way to do "code generation at runtime"
14:39antares_mk: more experienced people build DSLs with it that drastically raise level of abstraction and declarativeness of your code
14:40mkis the code generation view something to avoid, or a needed step?
14:40antares_mk: so, you can build much more complex things quickier. Of course, DSL development takes effort and is not trivial either but it is a huge productivity boost in the end.
14:40antares_mk: I think it is a needed first step
14:41jayunit100some one should write a machine learning algorithm that randomly adds/removes ' and : chars from .clj files to get them working :)
14:41antares_mk: I would say, see monger, korma and clojure.java.jdbc for various uses of macros
14:41muhoois there a way to get the lein repl to listen on a different interface? i.e. not on localhost, or on * instead of just localhost?
14:41antares_mk: they vary from DSLs to much simpler code generation/duplication elimination uses
14:41technomancymuhoo: in lein1, you can bind LEIN_REPL_HOST I think
14:42muhoothanks
14:43mkantares_: I don't immediately follow what's going on with monger (under "powerful query dsl"), since I don't know what the alternative is or what exactly is being done (or as you say, why it can't be done in any other way)
14:43mkis there a clean example of when I'd need to generate code?
14:44antares_mk: take a look at mongodb shell or query docs, it will make it clearer
14:44antares_mk: you are building a query that has conditions, limit, offset and so on
14:44mklike, what sort of problem usually makes a lisp programmer think "I'm probably going to have to do some code gen here"?
14:44antares_mk: and those parts can be reused and compound
14:45antares_mk: when you see a lot of duplication, often structural duplication that a function won't help with
14:45antares_mk: or when you want to create a DSL for some particular problem. I believe last chapter in Clojure in Action explains that pretty well, with examples.
14:46mkwhat is structural duplication?
14:46y3dihas anyone used c2?
14:47technomancyonly the wiki
14:47mkI use if statements, and nested loops to iterate over 2d arrays - do those count?
14:49antares_mk: structured duplication is where you clearly see duplication between some piece of code but you cannot extract it using a function (or it won't make things any easier to understand).
14:49antares_mk: take a look at two examples here: https://gist.github.com/1a0449ded8ecded286d4
14:50technomancyI'd recommend learning more Clojure basics before picking up macros.
14:50antares_mk: this form of "first use let, then when/if on its only binding to do-something" is so common (regardless of what you do or what local name is) that clojure.core has a when-let and if-let macros
14:50technomancyonce you've used them a bit, writing them will make a lot more sense.
14:50technomancycourse if you're lucky, you won't need to.
14:51RickInGAantares_: not to nitpick, just making sure I understand in your example (do-something) actually should be (some-fn) right?
14:51antares_mk: this is a simple example where extracting this duplication with a function will only make things more complicated, but since your code structure is almost identical, you can make this piece more concise using a macro.
14:52antares_RickInGA: no
14:52antares_RickInGA: (some-fn) just returns a value of a
14:52antares_RickInGA: it can be anything
14:52RickInGAantares_: thanks
14:53antares_mk: another common example of basic macro usage is "with X" kind of macro
14:54antares_mk: consider a case when you want to store a value of, say, default DB connection, then change it to something, run some code and return to the original value
14:54antares_mk: say to use a separate DB but just once, w/o making it default
14:55antares_mk: with-* macros do exactly that, very concisely. Almost all clojure database and messaging clients have them in some shape or form, like here: https://github.com/michaelklishin/monger/blob/master/src/monger/core.clj#L88
14:56antares_mk: another case to consider. Imagine a code like this: (:street (:address (:profile person)))
14:56antares_that returns a street in person's profile address
14:56antares_it is a bit backwards, right?
14:56antares_a macro lets you make it more readable: (-> person :profile :address :street)
14:56pandeiroy3di: i'm starting to use it now
14:57mkI'm looking through the when-let example, I think I'm hung up on the fact that both let and when are themselves macros
14:57antares_mk: libraries like clj-time make things even more readable with it, for example (-> 2 hours ago) is probably self-explanatory to even not-so-technical people
14:57jayunit100hmmm this is another strange one :
14:57jayunit100ive removed ------ :main run.run ------- from project.clj
14:58jayunit100and am trying to simply launch the same project with
14:58antares_mk: yeah, don't focus on that part right now. Macros that use macros (deep macroexpansion) is possible and not uncommon but will only distract you
14:58jayunit100(user=> (use 'run.run :reload true)
14:58jayunit100but i get a dependency error in one of the clj files.
14:58jayunit100i guess lein's :main does more than just load a class
14:58antares_jayunit100: (use …) won't run your function
14:59mktechnomancy: you're probably right that it'll make more sense after working with the language for a bit, but it'd be nice to have that reward now, since understanding that would probably motivate
14:59antares_jayunit100: yes, it compiles it and executes it
14:59jayunit100i dont want to run it... just load run into the class path so i can run it manually.
14:59antares_mk: you will come to understand all aspects and features of Clojure over time
14:59technomancymk: macros are over-hyped by some
14:59RickInGAmk: I am in that situation to some extent, Graham tells us macros are awesome, but we have to go deep into lisp to grok them
15:00technomancythere are many more compelling features in Clojure that are much more practical for everyday use
15:00RickInGAmk: but as I have been learning Clojure, I am loving it and the way it is designed, and I don't know squat about macros
15:00antares_mk: don't rush or try to use features you do not fully understand. Each feature has a purpose and you will see the need for it later. When you think that something should be already available or trivial or common, ask here. Almost always there is something in clojure.core to help you or do exactly what you want.
15:01antares_I totally agree with technomancy. I do use macros quite a bit but I use things like protocols and higher-order functions much more.
15:01antares_a lot of macros make Java interop much more pleasant, like doto
15:01antares_but you don't have to be a macro writer to benefit from them
15:01jayunit100i wonder - why would ('use run.run) break in the repl even though (:main run.run) works fine?
15:02TimMcjayunit100: Because you're quoting the wrong thing.
15:02technomancyjayunit100: neither of those will work
15:02jayunit100i mean (use 'run.run :reload true)
15:02antares_jayunit100: use does soemthing very different from what you think it does
15:02muhoook, this nesting insanity is starting to look like jquery. https://refheap.com/paste/1258 i feel like i'm doing something wrong.
15:02pandeirotechnomancy: how can i run a clj file as a script from a lein project? is it possible?
15:03eggsbyif I have a vector of hashmaps and I want them sorted by the reverse of the first value in the hashmap, is (sort-by #(val (first %)) < coll) the idiomatic way to do that?
15:03antares_jayunit100: use imports (technically, refers) functions from a given namespace into the current one
15:03antares_jayunit100: it does not call functions
15:03technomancypandeiro: lein run -m my.ns # as long as you have a -main defn
15:03amalloyantares_: i don't like -> for that, most of the time. a macro can make things more readable (and -> often does), but here i really prefer (get-in person [:profile :adress :street])
15:03technomancynot having a -main is sketchy as hell
15:04TimMctechnomancy: FOr executable projects.
15:04pandeirotechnomancy: and i will be able to take from stdin like that?
15:04pandeiroor do i need to use trampoline?
15:04amalloyeggsby: the "first" value of the hashmap? those aren't really ordered, unless what you're saying is you don't actually care about the order at all
15:04mkyeah, the reason I'm asking about macros is because of pg's lisp advocacy
15:04antares_amalloy: sure, it's just an example
15:04jayunit100oh ok. so why would the import fail ? Im in a proper lein project. and ... as mentioned, the project.clj file has a :main entry with the same class as the one which im *Trying* to load functions from.
15:05antares_mk: PG was describing a different Lisp. While Clojure is a great Lisp, it has many other nice aspects that make macros slightly less commonly used (compared to other lisps)
15:05jayunit100(and - when i launch the repl with the :main entry, i can run the program)
15:05mkthe (poor) understanding of them that I have is that you can define various novel programming structures
15:05RickInGAmk: I am crawling my way through pg's 'On Lisp', the first few chapters are why functional programming is awesome. Translating those examples into Clojure, I have a new appreciation of how much better clojure is
15:05jayunit100Land of Lisp is good to
15:05eggsbywell amolloy I have a structure like [{:a 1} {:c 3} {:d 6}] and I want to sort-by the value of the map entry. since there is only one map entry in each hashmap in the vector I need to get at it by 'first' right?
15:06dnolenmk: are you familiar with HTML templating?
15:06dnolenmk: if so, macros are like HTML templates, but for your code.
15:06TimMcand beyond
15:07mk(sorry - I'm still replying to things said a page ago)
15:07muhoothe important thing i learned about macros is that i don't need them :-)
15:07mkthose comments about the other language features of clojure are reassuring
15:08mkhigher-order functions are functions which take functions?
15:08RickInGAmk: take or return
15:08antares_mk: correct, take or return (possibly create, too)
15:10RickInGAmk: if you want a good overview great clojure features, this video is really good: http://vimeo.com/10896148
15:10eggsbywill watch, ty RickInGA
15:10mkdnolen: that seems to be a helpful analogy
15:13mkI think my main issue with understanding macros is that I don't see how they do something that can't otherwise be done, but like the channel's been saying, this is probably best solved by actually working with clojure more
15:14jonasendnolen: Thanks for your comment on kibit#20. I'm writing a response but it might take a while. It's difficult to talk about core.logic when I know so little about it.
15:14Bronsamk: take cond
15:14mkRickInGA: thanks for the video
15:14Bronsayou couldn't implement it as a function
15:14dnolenjonasen: np
15:15TimMcmk: Macros do not make otherwise impossible things possible.
15:15fliebeljonasen: That's what logic programming does to your brain. You think endlessly about what to ask, rather than how to solve a problem.
15:15pandeirocan anyone show me a barebones example of reading from stdin?
15:15mkright - well, they make things easier, or clearer?
15:15fliebelpandeiro: (readline)
15:16fliebelor, (read-line) actually
15:16TimMcmk: Basically.
15:16emezeskemk: Macros are the last-resort boilerplate removal tool. Like when you have a bunch of code duplicated in two places and you just can't think of any other way to factor it out, macros might help.
15:17jonasendnolen: One quick (silly) question: What's created with (defne ...)? It's not a function - is it a "relation"? Is there a anonymous version of it like "(fn ...)"?
15:17emezeskemk: So in that sense, yes, they can make things easier/clearer.
15:17TimMcmk: Sometimes they make things possible that aren't *practical* with regular functions.
15:18TimMcs/make things possible/allow you to do things/
15:18pandeirook so (read-line) doesn't work from lein...
15:18mkBronsa: hmm, that's a good example. I'm imagining passing in pairs of functions or something to a cond, but that seems ugly and not right.
15:18fliebeljonasen: It's like (defn foo (matche ...)) me thinks
15:19pandeiroand trampoline sorts me out, great
15:20dnolenjonasen: what fliebel said. it's just sugar over tedious unifications.
15:20jonasendnolen: fliebel: so it's not wrong to call it an ordinary function
15:20dnolenjonasen: define (matche) expands out into a conde.
15:21dnolenjonasen: ordinary function that contains a conde
15:21mkall the explanations are very helpful, thanks. I won't worry so much about macros as a major reason to use clojure
15:21jonasenso it must be run in the (run* ..) macro
15:22dnolenjonasen: yes
15:22jonasendnolen: ok. Thanks.
15:25jayunit100sorry to bump my question but ......
15:26jayunit100Im in a proper lein project. and ... the project.clj file has a ((((:main run.run))) entry, and i can run it by launching a repl from the project root directory. But... If I try to (use 'run.run)
15:27jayunit100at the repl --- than I get a "Unable to resolve symbol: cell in this context (myfile.clj:71)" error.
15:28patrikkarlincore.logic question :D i have a "relation" (my-rel q) how do i easily make a list of that relation?
15:28jayunit100so its interesting b/c although run.run is loadable from repl ... I can't actually use the functions in run.run from the repl. maybe its a namespace issue.
15:29dnolenpatrikkarlin: what do you mean?
15:30patrikkarlinsay i have a number n and i whant a list of n numbers of items where they all are of my relation
15:30patrikkarlinmight not have my termenaligy right :p
15:35dnolenpatrikkarlin: if you query that relation you'll get back everything in it - (run [q] (rel q)), if you want n things, (run n [q] (rel q))
15:36tmciverjayunit100: will it run if you do 'lein run' in the project directory?
15:36patrikkarlino i dont whant n things i whant q to be a list of fresh variables bound to my real
15:37patrikkarlinw8 for some sudocode
15:37jayunit100good point
15:37jayunit100@tmciver
15:38patrikkarlin(defn list-of [list n]
15:38patrikkarlin (== list (take n (repeat (rel <fresh-variable>)))))
15:38yazirianjayunit100: it sounds like you might have specified too deeply, try (use 'run) which imports the 'run' function from the 'run' module. this might be more obvious if your main module and function name aren't both the same word :)
15:38tmciverjayunit100: so does it? If not, it sounds like you just have a bug in your code relating to the var/local 'cell'.
15:39jayunit100oh ok
15:39jayunit100tmciver : its a bug in the code
15:39jayunit100very sorry to spam you guys with my own mistake
15:39jayunit100:(
15:40jayunit100what is a "module" in clojure ?
15:40TimMcIt isn't.
15:41yazirianjayunit100: if you started from 'lein new myproject' then you would have had a 'src/myproject/core.clj' file created for you
15:41yazirianimporting myproject.core, that's a module
15:41dnolenpatrikkarlin: that's not going to work, I probably need some context to understand what you're actually trying to do.
15:43TimMcjayunit100, yazirian: Clojure has namespaces, not modules.
15:43jayunit100ok
15:43TimMcPerhaps it will get a module system in the future.
15:43jayunit100and what is a clj file ?
15:43jayunit100what place does that reserve in clojure code
15:44TimMcjayunit100: As far as you need to know at the moment, one file = one namespace. :-)
15:44jayunit100Like in java --- class files have a specific role - they define a static namespace, etc...
15:44jayunit100ok
15:44antares_jayunit100: namespaces are very similar to Java packages
15:45patrikkarlindnolen: so im trying to write a sudoko solver and i have a rel that is the number #{ 1 .. 9 } so my next step whuld be to make a row of items whit that rel and apply the != betwen them and by that have a valid row rel
15:45jayunit100but i think, with namespaces, they can be physically spread apart, unlike packages.
15:45antares_and most apps follow Java-like convention of "one namespaces per file"
15:45antares_jayunit100: correct
15:55sjlSo I made the mistake of running leiningen without an internet connection, and now it's blacklisted Central and Clojars. How do I tell it that that's probably not a good idea?
15:55mkamusing. That should be a bug report.
16:01TimMcsjl: Poke around in .lein I guess.
16:02sjlTimMc: yeah, I don't see anything in there that looks like a blacklist
16:02jayunit100wow
16:03mkmy .lein is empty
16:04arohnersjl: I don't that has any permanent side effects. It just means maven won't check that repo for the rest of the run
16:06rudyl313how can I download a specific version of lein?
16:06sjlarohner: hmm, maybe, but lein plugin install is definitely failing when trying to install cljs-template, and not checking clojars
16:07sjlwait a second
16:07sjlugh, it *says* "unable to find resource" but I think it actually succeeded
16:19TimMcyep
16:19TimMcFails on one repo, succeeds later on another.
16:19patrikkarlinlogic people is conde the best way to make multiple gools in a function or is there a simpler macro?
16:24muhooor multiple gaols
16:24dnolen_patrikkarlin: if by multiple goals you mean disjunction - yes.
16:24patrikkarlinand that macro is ?
16:24dnolen_patrikkarlin: I mean yes, if you want disjunction you need conde.
16:25patrikkarlini dont need branshing
16:25patrikkarlin(defn dist [i [h & t]]
16:25patrikkarlin (conde
16:25patrikkarlin ((!= i h)
16:25patrikkarlin (if (nil? t)
16:25patrikkarlin succeed
16:25patrikkarlin (dist i t)))))
16:25dnolen_patrikkarlin: please use gist, lisppaste, refheap, etc.
16:25patrikkarlini only have on branch but it has multiple goals
16:25patrikkarlinkk
16:26dnolen_patrikkarlin: you can put multiple goals in fresh: (fresh [] g1 g2 g2)
16:26patrikkarlino so i dont need to make new variables
16:27dnolen_patrikkarlin: no, you can also use all: (all g1 g2 g3 ...) which just sugar for (fresh [] ...)
16:27technomancysjl: yeah, repo blacklisting is just for a single run
16:27patrikkarlinnice
16:27technomancyi think in lein2 we'll have more control over output like that; a lot of the messages maven emits in lein1 are garbage
16:29hugoddnolen_: in core.match should ([& _] :seq) match a seq with arbitrary elements, or is there some other way to do that?
16:30dnolen_hugod: that should probably work, still mulling over seq / vector matching. but I need like a whole free week to sort it out.
16:31hugoddnolen_: it gives "No method in multimethod 'to-source' for dispatch value: class clojure.core.match.RestPattern" at the moment
16:32hugodI guess I'll try and find a work-around
16:32dnolen_hugod: feel free to open a ticket, that's probably an easy one.
16:32hugodok, will do
16:34dnolen_hugod: if it's easy I'll go ahead and fix that and cut a release.
16:35hugoddnolen_: thanks :)
16:36dnolen_hugod: note there will be a breaking change in the release, in prep for predicate dispatch. there are now predicates and guards.
16:36dnolen_code that uses :when will need to declare their predicates with defpred before using them.
16:37mkI just watched halloway's http://vimeo.com/10896148 - where can I find the second part presentation where he talks about state?
16:37hugodoo, I'll need to do some checking then
16:37dnolen_you can optionally switch :when to :guard to get the old behavior
16:37hugodok
16:38kalle__hey, I want to use rabbitmq from clojure. is there a suitable lib for that? clojure-rabbitmq hasn't had any commits in about two years as far as i can tell...
16:39mkfound it: http://vimeo.com/8672404
16:39dnolen_I'm realizing predicates will could be really. I think they can support arbitrary combinations of :and, :or, and :not
16:39antares_kalle__: github.com/michaelklishin/langohr is well maintained
16:39dnolen_really cool I mean.
16:39meliponeI have a lein question. Is there a way to rename a project? Should I just change the name of the directories?
16:39kalle__antares_: i'll take a look. thanks mate
16:40TimMcmelipone: That's what I do. :-/
16:40hugoddnolen_: http://dev.clojure.org/jira/browse/MATCH-55
16:40antares_kalle__: I am the maintainer in case you have questions. Sorry about the lack of docs but the README explains how Langohr learns from other clients and embraces AMQP model.
16:40hugoddnolen_: predicates sound interesting :)
16:41arohnermelipone: just rename the directories and change the name at the top of the defproject
16:41antares_kalle__: tests should work reasonably well as examples
16:41dnolen_hugod: yes, you could put a :not, and we can rewrite the following logical expression.
16:41arohnermelipone: and at the top of each ns
16:41meliponearohner: okay, thanks. Just checking if there was a better way.
16:41dnolen_hugod: thx
16:42kalle__antares_: great, thanks. I'm still learning clojure so I'm sure i'll get stuck on something. learning is half the fun... tests is usually where i look first anyway so i'll start there now as well.
16:46patrikkarlindnolen_: https://gist.github.com/2152689 there is a bether way to do this one right?
16:47meliponeI didn't get an answer for my (easy) question earlier. Which library has the trace tools now for clojure 1.3.0?
16:48fliebelmelipone: "the trace tools"?
16:49meliponefliebel: those that were in clojure.contrib.trace I guess
16:49meliponefliebel: deftrace
16:49fliebelmelipone: there is a wiki page with the new names.
16:50meliponefliebel: url please?
16:50hugoddnolen_: is defpred the best name for something that doesn't declare a top level var?
16:50fliebel$google clojure new contrib
16:50lazybot[Clojure Contrib - Clojure Documentation - Clojure Development] http://dev.clojure.org/display/doc/Clojure+Contrib
16:51meliponefliebel: okay, thx.
16:52dnolen_hugod: well at the moment it is a global lookup - kinda like default hierarchies for multimethods
16:53antares_melipone: https://github.com/clojure/tools.trace
16:53dnolen_hugod: do you have a better name in mind?
16:54dnolen_hugod: whatever we come up w/ should probably at least consider the possibility of multiple hierarchies.
16:54hugoddnolen_: not really, maybe just predicate
16:54hugodI am likely to want to use them in a non-global context
16:55dnolen_hugod: predicate is kind of a lot to type :) I'm imagining that core.match will ship with a large number of obvious predicates and derivations, also that you can load entire Java hierarchies.
16:55hugodI can easily live with defpred
16:56dnolen_hugod: I'll ruminate on it, I'll less concerned w/ changing the name later, we're still alpha and that's just a search & replace.
16:56hugodsure
17:02edw`Has anyone made any progress on an Emacs-in-Clojure? The time is ripe.
17:03technomancyedw`: waiting for the concurrency branch to get merged into emacs trunk
17:04edwtechnomancy: Are you joking? I asked the question partially in jest.
17:04dnolen_huh, sounds like Source Mapping in Chrome is 6 only weeks out, good news for CLJS
17:04technomancyedw: I haven't decided yet
17:05technomancyI don't have to decide whether I'm joking until the branch is actually merged.
17:06edwLooking at emacswiki.org. Contains e-mail excerpts from 1994...
17:07edwIs Emacs-in-Scheme going anywhere? technomancy, you thinking of writing an elisp interpreter/compiler in Clojure?
17:08edw(I like the sly lazy evaluation semi-joke, btw.)
17:08technomancyedw: I can't imagine it would be that difficult to adapt Nathan Sorensen's clojurescript for to elisp
17:08technomancyexcept for mutable strings; I have no idea what to do about those =\
17:08technomancybut at least it has integers! so it's a wash I guess.
17:09cemerickare there any cases where (not= (aget js-obj "foo") (.-foo js-obj))? (assuming "-foo" is a valid symbol, no spaces, etc)
17:09edwWhat got me thinking about this is that I have half of a browser Clojure data structure editor written, and I was going to support Emacs (and paredit) key bindings for it.
17:10edwBut it's in JS...
17:11technomancywell if you beat me to it, I won't be disappointed
17:12edwI think an Emacs-in-the-browser-in-CLJS would be pretty easy, for a generous definition of easy.
17:13technomancyoh, never mind
17:13technomancyyou're talking about going the other way
17:13edwAnd when I say "Emacs" I mean _an_ Emacs, something that acts like Emacs.
17:13technomancyyeah, I'm talking about elisp as a compilation target
17:14mkdo you mean an editor that is hooked up to clojure?
17:15mk(as html is to javascript)
17:15RaynesIn technomancy fantasy you'd be able to hack Emacs with Clojure.
17:15sjlAnyone know of any still-maintained clojure templating libraries I've missed here? https://gist.github.com/2022375
17:15edwmk: I mean an editor written in Clojure (or CLJS) that is to its core a structural editor. I've been thinking about this since I saw the video of the "Principle-based Development" talk.
17:16fliebeltechnomancy: It seems only "cosmetic changes" are required to hack cljs to compile to scheme, since elisp is also lisp, you're only a few more "cosmetic changes" away.
17:16technomancyfliebel: except for mutable strings
17:16TimMcedw: Someone had better get a surface-syntax reader going.
17:16technomancythat's a disaster that's just not going away =(
17:16amalloysjl: (fn [s] (str "<html><body>" s "</body></html>")) is a feature-rich one i just invented
17:16mkedw: link to talk?
17:16eggsbyedw: great talk
17:17TimMcamalloy: Needs moar doctype.
17:17eggsbymk: vimeo.com/36579366
17:17edweggsby: Thanks. Beat me.
17:17edwTimMc: surface-syntax?
17:17jimdueyWe need a structural editor with Vim key bindings written in Clojure. :)
17:17technomancyelisp strings are so crazy
17:18technomancythey're fixed-length, but you can still aset on them =(
17:18TimMc&(pr-str (read-string "#()")) ; edw: This does not preserve surface syntax.
17:18lazybot⇒ "(fn* [] ())"
17:19edwAh. Yes, I was planning on supporting that.
17:20TimMcA reader that can preserve comments, whitespace, and reader macros would be useful in many projects.
17:20pandeirois there a clever way to know the index with doseq?
17:20edwTimMc: But that's where I was going to lean on the browser: encoding the surface syntax in a DOM.
17:21TimMcI think there's a mismatch between those, nesting or not.
17:22edwHmm?
17:22TimMcThat is, I think the data models have a false similarity.
17:23TimMcI'm not prepared to defend that assertion, though.
17:25edwTimMc: I'm not thinking of a one-for-one mapping. For example, my toy version uses a pair DOM element inside of map elements to hold a key and a value element because I've noticed that odd numbers of elements inside a map are a problem I create. Similarly, I have a string element that holds strings; I don't depend on a bare text node.
17:29mkwhy is it worth pursuing such an editor in clojure, given that there are many other available editors?
17:29edwmk: There is one decent editor for Clojure.
17:29mkis it the repl?
17:29edwNo, it is Emacs.
17:30mkright :)
17:30mkwhat's the problem with emacs?
17:30rhcedw: with respect to editing clojure, how is it better than vim?
17:30RaynesI'm fine with Vim.
17:31edwI love BBEdit--I'm even in the credits page--but it's just not up to structural editing.
17:31edwrhc: Paredit.
17:31rhci was talking here yesterday about learning emacs
17:31aperiodicparedit.vim
17:31Raynesedw: Vim has paredit.
17:31edwAh. OK. In that case...
17:31rhckeeps track of your parens or what?
17:31lypanovah maybe i need to try that was missing it.
17:31Raynesedw: If you want to argue Emacs vs Vim, complain about VimL.
17:32edwBut Riasstradh would be the first to admit, paredit is ghetto.
17:32RaynesCompared to elisp it is pretty atrocious.
17:32RaynesWell, compared to anything really.
17:32edwI'm not a vi hater; I didn't realize "you" had paredit on vi.
17:32lypanovRaynes: i'd like to port vim to in browser clojurescript just as i once did for ruby
17:32TimMclypanov: paredit will blow your mind
17:33amalloylypanov: paredit does better than that
17:33lypanov(though for ruby i did that with curses not in browser)
17:33amalloyit takes some getting used to, though. as soon as you type (, the matching ) appears
17:33lypanovneat. thats what i need.
17:33edwOnce you have a sorta-structural editor, you want a real one.
17:34lypanovi'd actually like to "invent" a visual form of clojure so that ()s just disappear. but for the moment i'll just stick to paredit.vim
17:34muhoowow, couchdb is fantastic. thanks.
17:34edwI still manage to fuck up my buffers occasionally through improper killing and/or yanking.
17:35TimMcundo undo undo
17:35mkvisual representations of languages are interesting, but I've never seen it done well
17:37edwmk: The value of structural editing isn't that it's visual (ignoring for a moment the inherent visual nature of text...) but that it enforces syntax at all times.
17:37edwOr if not syntax, at least form.
17:37edw"Syntax...that'll take a while."
17:39mkedw: why is that important?
17:39lypanovmk: aye thats why i haven't bothered yet. i haven't even finished joy of clojure yet so i have no right making a visual rep of it :)
17:40rhclypanov: how do you like "joy of clojure"?
17:40edwBecause doing it manually is a huge PITA. And it allows what people who write in Blub call "refactoring" to be done very efficiently.
17:40mkI'm thinking of changing code from one arrangement to another - in between the two, it doesn't seem important that the code is coherent
17:40lypanovmk: i previously wanted it so that i could make an touch / iPad based ui for editing source but realized its a stupid idea eventually as no touch ui could ever allow quick data entry for known tokens, only exploration.
17:41lypanovrhc: loving it.
17:41lypanovrhc: but actual coding is getting in the way alas ;)
17:41mkedw: but refactoring can be done as long as there is a point in time when the syntax is fine - it doesn't have to always be enforced - or so it seems to me
17:42mklypanov: do you have any examples of what sort of visual exploration you're thinking of?
17:42lypanovfor lisp, why not enforce. nothing lost. semantically it can be incorrect but loss of syntax is silly with such minimal syntax.
17:43lypanovfor e.g. ruby yes, i agree.
17:43ivan___lypanov: i got the original ipad, which I used a lot as I just left my laptop at work, but then I changed jobs, and laptop is at home, and ipad sits there doing nothing... i will never git another tablet in the foresable future
17:43edwI can "write" a novel by clicking on pixels to spell out word with the pencil tool in MacPaint...or I can use a word processor.
17:43ivan___get*
17:43lypanovivan___: i have and hate my original laptop because the browser is just slow enough to make the device basically unusable. i've since bought a kindle and loooooove it.
17:44lypanovi'll buy an iPad 7 or whatever when they have e-ink. until then i don't want headaches anyway so won't touch one.
17:44lypanovum, original ipad*
17:44ivan___lazybot: well, i have a quad core i7 in my laptop, its faster than my equally expensive desktop heh
17:44ivan___or
17:44ivan___lol
17:44ivan___oh*
17:44mkI'm thinking of cases where you break syntax while moving between two valid versions of code. Imagine pasting one half of a snippet in, and then the other half
17:45ivan___lypanov: all this stuff about tablets replacing tv's, utter bs
17:45patrikkarlini dont have a tv ;P
17:45edwmk: I'm simply arguing that the tools we're using are deeply retarded.
17:45ivan___until they come up with a method to input via thinking in a fast and efficent way, tablets, wearable computers etc are all going to be limited in use
17:45lypanovedw: agreed.
17:46mkedw: I'm with you there, and I agree with your point about structure-awareness helping with that
17:47sjlSo of all the many "Clojure version of Parsec" projects out there, are there any that are actively maintained?
17:47dnolencemerick: you have to be careful with aget vs. property access, google advanced compilation will rename "static" properties making aget not work as expected.
17:47eggsbymr losh
17:47eggsbyparsotron or w/e, right?
17:47eggsbynate youngs project
17:47sjlParsatron is the one that looks like it has some recent activity a few months ago...
17:47sjleggsby: yeah
17:48eggsbyI would say that is your best bet
17:48cemerickdnolen: that makes things more interesting; I have an (aget obj "foo") that always works, and a (.-foo obj) that always returns nil.
17:48mkas for visual editors, yes, text is visual, but sometimes it just doesn't compare with a picture of some sort
17:48sjleggsby: ok, cool, that's what I guessed. Just wanted to make sure I wasn't missing one
17:50TimMcedw: Structure-awareness gives you basic syntactic correctness, yes -- but much more importantly it allows you to think in structures, not strings.
17:50sjleggsby: wasn't there a talk about it somewhere online, or am I thinking of something else?
17:50eggsbysjl: ya nate young gave a talk on it at strangeloop iirc
17:50eggsbysjl: http://www.infoq.com/presentations/Parser-Combinators
17:50sjlaha, found it http://www.infoq.com/presentations/Parser-Combinators
17:51eggsby:)
17:51sjlha
17:51mkTimMc: how does one think in strings?
17:51TimMcWhen editing JS, etc.
17:52mklike, passing to an eval?
17:52eggsbystructure seems more like the OO approach, doesn't it? Where engineering is likened to architecture, how would you visualize lisp?
17:52mkeggsby: a tree
17:52eggsbyHow would you visualize *verbs*
17:52eggsbymk: that would be really cool, ya
17:53eggsbyIf you could see the tree visualized real time
17:53mkeggsby: well, as far as the code goes, you somewhat do (you have the source)
17:54eggsbyya the code structure does mirror the tree structure, but I just mean visually the way we are used to seeing trees
17:54mkbut there are all sorts of interesting things missing - the data, various thread interactions, performance metrics
17:55eggsbyhttp://joelneely.files.wordpress.com/2011/03/foldtreeplain.jpg?w=312&amp;h=271
17:55eggsbylike if I could visually see something like this rendered alongside my editor
17:55mkeggsby: or if it was your editor
17:56edw`Right, that's where I was going. I want to be able to e.g. select a chunk of code and extract it into a named function.
17:57lypanoveggsby: while i like this for a repl. i don't think anything that departs from the presentation you edit in makes sense.
17:57mklypanov: make it the presentation you edit in
17:58mkedw`: you're thinking via mouse drag and drop?
17:58lypanovmk: i was more thinking nested rectangles with function name in the corner
17:59lypanovimo layout of the params can provide a sufficient differentiation that most code could be layer out
17:59lypanovactual layout is a bitch yes. heuristic hell. but still i believe its good enough.
17:59mklypanov: well, outlining functions in a way that you can pick out the 'visual space' the function takes up is a good thing
18:00mkthis is what paren coloring does, but you have to scan around for the other paren yourself. With a box around the whole thing it's much easier
18:00lypanov*nod*
18:01lypanovthough you don't actually need outer level boxes, they can be collapsed.
18:01edw`mk: I'm thinking of an Emacs-like approach (M-x extract-expr-as-func) for now; I don't really care about crap like DnD.
18:01lypanovonly structurally separating boxes need to actually be rendered. most can be delineated by color.
18:01lypanov(fill color i mean)
18:02mkit can be cursor sensitive. The point is that you lose something when you take a few milliseconds to scan for the other paren
18:02lypanovor when you screw up the parens ( as i'm doing frequently ) because indent isn't enforced.
18:03lypanovdoes paredit.vim enforce indent?
18:03mkedw`: gotcha
18:04aperiodiclypanov: VimClojure has good indenting rules for clojure
18:05lypanovaperiodic: i use vimclojure but it doesn't really seem to enforce them.
18:05lypanovi think i'd like completely auto-indent/style
18:06mksomething that's definitely missing is a mapping between what a programmer sees on the screen, and what's actually running
18:06aperiodiclypanov: mine auto-indents, but i can modify the indentation if i choose. not sure if that's what you want or not.
18:07lypanovaperiodic: yeah i mean after a ) having the entire block autoindent.
18:07TimMcHave y'all seen the code overview pane in Dr Racket?
18:08mkat this point, you start blurring the line between interface design and coding - if what you see is some sort of advanced repl, then what you do when you code is you design a programmer's interface to the process
18:08Rayneslypanov: =ab
18:08TimMchttp://3.bp.blogspot.com/_gJUvnpacURg/SI-cUBJB31I/AAAAAAAAADw/k434suYJVQI/s320/Picture%2B5.png
18:09TimMcNot the best pic of it, but good enough.
18:09lypanovRaynes: thank you.
18:10lypanovRaynes: for debugging wtf i did wrong that'll save me an insane amount of time. double thank you.
18:10mkyeah, that's in that... black-themed editor that occasionally pops up on hn. Seems like you'd no longer need the scroll bars
18:11TimMcOK, better version: http://plt-scheme.org/screenshots/drscheme-env.jpg
18:11mkfurthermore, why show all the code, anyway? Just show a heatmap of where you've been looking, and typing.
18:11clojurebotGabh mo leithscéal?
18:11lypanovmk: sublime text.
18:11mklypanov: yep, that's the one
18:12lypanovmy favorite editor, though not for a language i care for, is the code bubbles ui.
18:12jaenThis one java ide experiment?
18:12lypanovimo that sort of interaction, plus some touch ui is the "future".
18:12lypanovjaen: *nod*
18:13mkthe problem with the outlines is they tell you nothing about what the code is doing. You can't look at part of that code and say "that's probably something that messes with the data here"
18:13jaenIt looked pretty cool in vids, haven't tried that though; in fact I thought there was no publicly available version
18:16lypanovjaen: they went vs-y http://blogs.msdn.com/b/camerons/archive/2012/01/31/debugger-canvas-1-1-released.aspx
18:16sritchiecemerick: figured it OUT
18:16lypanov(makes sense tbh given the reach)
18:16sritchieit's a really odd bug
18:18jaenHuh, vs-y? Are those the same guys?
18:19jaenI had an impression code bubbles was for java. Did they switch the sides or I just had wrong impression?
18:19photexholy crap… power went out at work… workstation is back up, but now clojure-jack-in fails with SIGFPE :(
18:19sritchieibdknox: you offered critical help here, asynchronously
18:19photexlein repl works
18:19sritchieibdknox: with a little comment down here: https://github.com/ibdknox/live-cljs
18:19photexsomething in .emacs.d perhaps?
18:19photexlein swank works
18:19photexarrrrrrrrg
18:20mklypanov: I saw that a while ago, and it was interesting, but I think a lot of it was just rearranging various components of e.g. eclipse
18:20photexstupid southern california brown outs
18:20sritchiecemerick: it looks like the Clojurescript compiler gets AOT compiled under some conditions w/ Leiningen 1.7.0
18:20sritchienot sure sure how
18:20sritchiebut when it happens, the first time you try to save a view you get "assertion failed: can't recur here"
18:20sritchieand from then on the cljs compiler produces malformed cljs
18:20sritchies/cljs/javascript
18:20lypanovsritchie: possibly unrelated but noir-cljs disables aot
18:21emezeskesritchie: The clojurescript compiler will not work when AOT-ed
18:21lypanovah sorry now i see your ibdknox commentns
18:21photexerror is raised in clojure-mode.el
18:21sritchieemezeske: I needed to AOT compile my main method,
18:21photexfrom clojure-jack-in-sentinel
18:21emezeskesritchie: There's a bug where some metadata is not saved in the AOT files that the compiler needs to work correctly
18:21emezeskesritchie: A clojure bug that is
18:21sritchiewhich is transitively aot compiling the cljs compiler after a couple of hops
18:22lypanovjaen: they worked with m$ research on it. yes it was previously eclipse
18:22emezeskesritchie: Yeah, that is the exact thing that prompted me to write lein-cljsbuild
18:22lypanovjaen: m$ are doing f'n crazy crap lately.
18:22sritchieemezeske: the issue here is the cemerick is using the compiler to generate views for CouchDB
18:22sritchieand that happens in-project
18:22lypanov(visual studio 11 beta has things like "inspect element" like hover over in web apps -> shows view code)
18:22jaenWell, I prefer C# over Java language-wise and quite the contrary VM and ecosystem wise.
18:23jaenYeah, the web stuff in new VS is crazy ; d
18:23sritchieemezeske: lein-cljsbuild is great, I use it for my cljs
18:23emezeskesritchie: Ah, well then you're in a bind :/
18:23sritchieemezeske:
18:23sritchieyup
18:23sritchieluckily views only have to be created once....
18:23sritchieso I can just rm -rf classes/cljs
18:23sritchieemezeske: good to know, though, now I know what's up
18:24emezeskesritchie: I'm trying to track down the bug that breaks everything
18:24sritchieemezeske: it's a combo of that bug you described and clojure AOT compiling deps
18:25emezeskesritchie: http://dev.clojure.org/jira/browse/CLJ-130 is related I think
18:26emezeskesritchie: Yeah, exactly
18:27lypanovjaen: im(ns)ho m$ is getting a lot right lately.
18:28lypanovjaen: i was pushing for more of a binding style approach for apps when i found knockout which led to finding the major m$ push for functional reactive
18:28lypanovi'd really like to an idiomatic knockout port for clojurescript
18:28bsteuberthey better start doing something right :)
18:29jaenm$ is pushing for FRP? Now, that I didn't expect.
18:29lypanovjaen: majorly.
18:29lypanov*massive* push for async lately.
18:30lypanovbsteuber: they are. IE10. WP7. W8. etc. no clue what changed. but somehow...
18:30jaenThough they do have their ocaml knockoff
18:30lypanovf# 3.0 is adding some really sweet stuff.
18:30jaenSo maybe they do feel some functional vibe
18:30bsteuberto be fair, .net already moves into a good direction for quite a while
18:30lypanovc# is getting more and more functional.
18:30jaenAny lsit of the sweet stuff?
18:31bsteuberf# is pretty neatr, too
18:31bsteuberoh you already said that ^^
18:31lypanovjaen: i started watching http://channel9.msdn.com/, that has most of it
18:32jaenUh, videocasts : D I'm always looking for "transcript" buttons on such pages : D
18:32lypanovstill i wouldn't want it on my server platform. just think they have good ideas wrt languages and application building.
18:32lypanovjaen: i use mplayer at 1.7x while i tidy.
18:33bsteuberlypanov: Windows Phone is good now? hard to imagine..
18:33lypanovbsteuber: just bought a nokia lumia and really loving it. everything that iPhone sucks for lacking that android couldn't make usable.
18:33jaenAs for knockout.js - it seems like a really nice thing to me from cursory glances I had at it
18:33bsteuberI'm not sure whether I should be sad or confused M$ now makes more money from android than their own OS
18:33jaenAnd yes, it would be a nice thing to have a similar framework in idiomatic cljs
18:34lypanovjaen: using it in production and it led to 2x js code decrease.
18:34lypanovbsteuber: sad.
18:35lypanovjaen: i'll start on it whenever i finish JoC :)
18:35jaenSounds like a good plan ; )
18:36bsteuberknockout really seems cool
18:36bsteuberbut weird to use html attrs for programming, though :)
18:36lypanovthere are several others, e.g. backbone.
18:37lypanovbsteuber: i want haml style clojure view syntax eg blah{html-attrs}[ko-attrs]
18:37lypanovwill extend hiccup whenever i get irrationally bored
18:38bsteuberlypanov: what's wrong with hiccup?
18:38lypanovlack of data-bind integration. don't want to see data-bind and its extra nesting level.
18:38bsteuberah ok, thought sth. else in general
18:38lypanovno.
18:38bsteuberyes that would definitely rock
18:39lypanovi hated e.g. haml when i first saw it but eventually realized its the only sane pragmatic path
18:39jaenbsteuber: weird? From what I've seen recently everyone and his dog is using data attrs in JS since Rails proclaimed it the way ; D
18:40lypanovjaen: not just rails. its a html5 thang.
18:40lypanovquery was first imo.
18:40lypanovjquery*
18:40bsteuberjaen: must have missed that - but my web dev carrier is quite young..
18:40lypanov(though maybe someone else was before even that)
18:41lypanovbsteuber: in case you haven't already seen, i'd advise http://www.flapjax-lang.org/publications/
18:42bsteuberlypanov: thanks, I'll check it out
18:43bsteuberah that's the scheme guy
18:43bsteubershiriam krishnamurthi
18:44jaenAs for haml, it's really cool if you consider the usual templating stuff
18:44jaenBut since I've seen enlive I think it's even cooler
18:45bsteuberenlive always seemed too sophisticated for me
18:45bsteuberfunctions generating hiccup vecs are way simpler to use
18:46bsteuberwell of course if you have to manipulate external html enlive is just great
18:46bsteuberso maybe it depends on whether or not you outsource the html to a designer
18:46jaenBut then you loose all the potential webdesigners due to parenthesis angst ; D
18:46bsteuber^^
18:46jaenYeah, this.
18:47bsteuberwell in our project, we provide the html, and our designer does just css
18:47bsteuberworks pretty well
18:48muhooisn't cljs kind of the knockout/backbone thing?
18:48lypanovdesigners i know don't mind data-bind.
18:48jaenI find it really funny, that all the people at my university have parenthesis angst
18:48lypanovbsteuber: used to use pure.js
18:49bsteuberthe funny thing is, even lispers have it
18:49bsteuberI found that when talking about Clojure with CL geeks
18:49lypanovoverall i think designers dislike data-bind declarations with sane git usage less than they dislike having to add random class/id's on request
18:49bsteuber"uh, it has other types of parens, scary.."
18:49jaenI sort of have it too, I appreciate the power of LISP but still somewhat wish it to have the usual syntax ~~'
18:49jaenbsteuber: hahaha
18:50bsteuberjaen: for how long are you using lisps?
18:51jaenI have more of casual interest in lisp. I've read SICP but never used it for anything big.
18:51lypanovmuhoo: cljs has very little in common with those projects. its just a different source language for generating javascript. much like coffee script for example.
18:51bsteuberat least for most people, it goes away after a while
18:52lypanovbsteuber: took around 8 months of which 5 were practical
18:52jaenThough I'll be using Clojure for my neural network project this semester hoping I can learn it as I go along ; )
18:53lypanovnow clojure looks nicer to me than ruby. which since '00 has been my fave lang by far
18:53lypanovsorry i mean 8 months / 5 *weeks*
18:54bsteuberlypanov: I did have some fun with haskell between ruby and clj
18:54bsteuberbefore of which I did common lisp
18:55bsteuberbut clj is my favorite language for 2 years now, that's probably a record :)
18:55lypanovi played with factor and applescript (of all things) in between. and a bit of scala.
18:56muhooi've put in, so far, about 150 hours on clojure, and i'm finally starting to almost start thinking in it.
18:56bsteuber^^
18:56lypanovi actually had the experience of being 100% certain that scala was the Right Path.
18:56lypanovthen trying to use it practically and giving up after 3 days.
18:57bsteuberI couldn't decide whether to pick scala or clojure
18:57lypanovplayed with clojure again for the hell of it and everything Just Worked
18:57lypanovmostly thx to lein and clojars
18:57lypanovclojuredocs.org/ is also absolutely wonderful
18:57bsteuberfunny how things work out
18:58lypanovhelps that i don't believe in docs and prefer code.
18:58bsteuberor IDE's ^^
18:59bsteuberok without emacs I'd probably be a sclarian now oO
18:59lypanovi do believe in IDEs else i wouldn't discuss visual representations. :)
18:59lypanovi used intellij for scala.
18:59bsteuberbut back to reactive gui programming in cljs
18:59lypanovbut was able to stick with vim for clojure thanks to the wonderful work thats been done on the vimclojure project.
18:59bsteuberif I want that, which path would you recommend?
19:00bsteuberprobably just pick one js lib for that and generate the attrs nicely?
19:00lypanovbsteuber: a) wait until i figure it out, b) figure it out and i'll wait and you tell me
19:00bsteuberharr
19:00RaynesThree cheers for Meikel Brandmeyer.
19:00lypanovatm i have jquery/raphael/closure library experience
19:00lypanovRaynes: +++!
19:00lypanovand lots of ko.js + javascript.
19:01lypanovbut i never fitted the two together.
19:01lypanovthats my next step but a good 2-3 months away.
19:01bsteuberusually when I need something, ibdknox has it on github the next day
19:01lypanov:P
19:01lypanovnoir-cljs rocks.
19:01bsteuberso I'll just go to bed and check back tomorrow
19:01bsteuber^^
19:01bsteubernice
19:01bsteuberhow do you do css gen?
19:01bsteuberwe're still using compass
19:02lypanovi'm using less js
19:02lypanovcompass drives me absolutely crazy
19:02bsteuberbut of course I'd prefer clojureland
19:02jaenI like stylus quite a bit
19:02lypanovour app is RoR + clojurescript
19:02lypanovbut i'm making the move to RoR + clojure + clojurescript the last 2 weeks
19:02jaenSass/Scss put me off when I saw that variables don't have scopes in it ; d
19:03lypanovjaen: yeah thats ugly.
19:03lypanovi put me off when i realized that basically it simply doesn't work.
19:03lypanov:P
19:03lypanovit*
19:03lypanovi like lessjs. it does the job.
19:03eggsbyless seems to have the most momentum
19:03eggsbybut I prefer stylus as well, I use less however :p
19:03bsteubernever heard of it before, interesting evening for me :)
19:03lypanovi'm going to play with https://github.com/edgecase/dieter in the near future.
19:04lypanovnot a fan of old sass. prefer sass so stylus also not for me.
19:04lypanovlike just pasting.
19:05nDuffI'm trying to use AOT compilation to implement a plugin interface for a 3rd-party tool. When loading plugins, it creates a classloader pointing to their jar, and calls Class.forName(className, true, classloader). However, clojure.Lang.Namespace.findOrCreate fails in clojure.lang.Namespace.<init> unless the uberjar is in the system classpath (not just the local classloader). What should be done differently?
19:05bsteubersomehow embedding stuff like css compilation into ring middleware still seems strange to me
19:06bsteuberI would always prefer to have my build tool do this kind of stuff
19:06cemerickemezeske: won't work, as in, under no circumstances?
19:06lypanov:cache-mode :development ; or :production. :development disables cacheing
19:06weavejesterbsteuber: Clojure is compiled on the fly, so why not CSS? :)
19:06lypanovi'm assuming this means that dieter won't do it anyway on the actual production server
19:06lypanovif you preload the resources
19:07lypanovdoes something like unicorn exist for clojure?
19:07cemerickoh, namespace metadata
19:07bsteuberweavejester: not the clojure I deploy on our server :P
19:07lypanovallowing me to bind something to a socket and kill the old after a bit?
19:07weavejesterDieter's a little curious though, as it's basically a Ring wrapper around its own custom middleware system.
19:08weavejesterbsteuber: You AOT compile everything?
19:08lypanovi haven't any experience with it yet. it just popped up in search
19:08emezeskecemerick: Yeah, the clojurescript compiler inspects the :macros metadata on some Vars
19:08lypanovpersonally i use RoR assets at the moment and it precompiles all resources statically
19:08bsteuberweavejester: yes, but that's also because it's closed source
19:08lypanov(via closure compiler)
19:08jaenlypanov: stylus is pretty flexible about syntax - it can be anywhere between whitespace guided and css superset
19:08emezeskecemerick: Which apparently gets lost when AOTed
19:08cemerickemezeske: yup, http://dev.clojure.org/jira/browse/CLJ-130
19:08lypanovjaen: ah, then i like :)
19:08weavejesterbsteuber: Ohh
19:09lypanovjaen: superset is a real important feature for me
19:09cemerickreason #83 to avoid AOT
19:09emezeskecemerick: Yeah, that was my first real introduction to AOT pain
19:09emezeskecemerick: It would be nice if it were fixed though
19:09bsteuberweavejester: but I admit it might be nice not having to launch my watchers
19:09cemerickweavejester: thanks for taking in that pull req
19:10lypanovi shall kick myself to work faster on FRP now that i know there is interest
19:10lypanovat first it'll probably just be a lame externs file allowing knockout usage tho
19:10cemerickweavejester: I wonder if I can bug you enough to do an 0.6.2 release? That will make all the leiningen examples in the book compatible with 1.7 and 2.0. :-P
19:11bsteuberlypanov: so just using a plain js lib for this won't work?
19:11weavejestercemerick: I'll do it tonight.
19:11lypanovbsteuber: you still need an externs file for advanced closure compiler to work.
19:11cemerickemezeske: fixing AOT transitivity is probably an easier fix, though that's long-standing as well.
19:11cemerickweavejester: my hero :-)
19:11bsteuberlypanov: that seems acceptable
19:12bsteuberwell depending on the file size ^^
19:12emezeskecemerick: Yeah, that would be good too
19:13sandoveranyone have a handy example of using parsatron to do something real?
19:15lypanovbsteuber: ko is teeny.
19:16lypanovbsteuber: and we don't even locally have major issues with using non advanced as our base load never increases.
19:16bsteuberlypanov: so?
19:16lypanovbsteuber: (our site is a web app and not single-view driven)
19:17lypanovbut certainly for something else e.g. a content site you'll need full advanced setup.
19:17lypanovwife tells me its 12:15 even tho for some reason my irc client says its 11:15 so apparently i have to go to bed.
19:18bsteuberlypanov: oh, also CET?
19:18bsteubergermany here
19:18lypanovbsteuber / jaen et all: enjoyable chat. thx guys. will stick something on github at some point and mention something somewhere :)
19:18lypanovbsteuber: .nl
19:19bsteuberI always wanted o drop by amsterdam clj group :)
19:19bsteubermaybe one day I will
19:19bsteuberok, I'll go sleep as well
19:19bsteuber^^
19:19bsteuberbye everyone and thanks for the interesting links
19:23eggsbyGrr, I'm still struggling with java interop. In what ways are (. target member) and target/member notation different?
19:24dedeibel_eggsby: target/member is for static variable, like (Integer/parseInt "1")
19:24eggsbywhy can I call (. Math PI) and Math/PI and have it return the same thing, while (Character/isWhitespace \space) works though ((. Character isWhitespace) \space) returns a field not found error
19:25tmcivereggsby: target/member is for static member access.
19:25muhooany ideas why this is giving me fits? https://refheap.com/paste/1265
19:25muhooit returns an seq of #<user$eval337$fn__338 user$eval337$fn__338@c67a88>
19:25tmciveryou need (Math/PI) as PI is a static member of Math.
19:26dedeibel_eggsby: maybe (. can do more than / - Classes are just kind of objects too in some use cases
19:26muhoowhat is that usr#eval337 actually?
19:26muhoo<user$eval337$fn__337> yadda,
19:26amalloyyou have a sequence of ten functions
19:27muhoooh, they're not getting evaled
19:27muhoogot it
19:27amalloywell, ten copies of the same function
19:27amalloy&(doc repeatedly) ; muhoo
19:27lazybot⇒ "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
19:27muhoook, what i'm trying to get to happen, is for that function to get executed 10 times and return a seq of those return values
19:27Raynesamalloy works faster when you use refheap. That should be incentive enough for people to use refheap.
19:27muhoothanks!
19:28muhoo(not (= repeat repeatedly)), doh!
19:28muhooperfect, thanks amalloy!
19:31arohneris there an inverse of bean?
19:37TimMcSomeone was asking that...
19:37TimMcarohner: Ask gfrederi`
19:39TimMcarohner: https://github.com/fredericksgary/lib-2367 looks like it
19:39arohnerTimMc: thanks, but not quite what I'm looking for
19:40arohnerI have normal java classes that I call bean on, and I'd like to construct a new java instance from the map
19:44TimMcAnd that instance must implement certain interfaces, yes?
19:44TimMcOh, you want to use the same class, got it.
19:45TimMcbean should be called unbean, and the inverse should be rebean
19:49arohneris there a non-special form for calling a java constructor?
19:52TimMcMaking a macro?
19:53technomancyit'd be kinda cool if you could use into for that
19:55aperiodici remember someone providing an example of calling a constructor via the reflector
19:55arohnerTimMc: yes, I'm writing unbean/rebean
19:56aperiodicas an alternative to (eval `(ctor. ~@ctor-args))
19:56dnolenhuh, core.logic is nifty if you want to build wacky DSLs
19:56arohneraperiodic: I don't know the class name at compile time
19:56dnolenlike a macro that takes english and generates Clojure code
19:56aperiodicarohner: ah, no dice, then
19:56TimMcarohner: "new"
19:57TimMcbut again, only helpful if you're writing a macro
19:58TimMcoh hey
19:58TimMc&(.newInstance String)
19:58lazybot⇒ ""
19:58TimMcarohner: ^
19:59arohnerTimMc: aha, thanks
20:00arohnerlooks like java.lang.reflect.Constructor.newInstance() is also possible, if arguments to the constructor are necessary
20:00technomancyany aleph pros know if aleph uses netty for framing?
20:00amalloyclojure.lang.Reflector has helper methods for that kind of thing
20:02TimMc$inc amalloy
20:02lazybot⇒ 21
20:02TimMchaha, Util.sneakyThrow
20:08TimMc&(.getMethod String "contains" (into-array Class [String]))
20:08lazybotjava.lang.NoSuchMethodException: java.lang.String.contains(java.lang.String)
20:08TimMc&(.getMethod String "contains" (into-array Class [CharSequence]))
20:08lazybot⇒ #<Method public boolean java.lang.String.contains(java.lang.CharSequence)>
20:09TimMcI see, I thought Class.getMethod did reflective matching for you. Now I see why c.l.Reflector exists.
20:19RickInGAstyle question, I am writing a game similar to tic-tac-toe. I am representing game state in an atom called board. Many of my functions have to read the state of the board. Is it most appropriate to pass board, @board or not pass either, read it from global state?
20:20dnolenwacky DSL parsing with core.logic, https://github.com/jonase/kibit/pull/20
20:20amalloyRickInGA: have you considered writing it with no state at all? for a game as simple as tic tac toe that's not hard, and might be instructive
20:21technomancywell
20:21technomancykeeping state on the stack, no atom at all
20:22amalloywell, "stack". i'd mostly keep it in lazy sequences
20:22amalloy(drop-while not-done? (iterate next-turn the-board))
20:22RickInGAamalloy: never considered that. I am trying to envision it....
20:23RickInGAamalloy that will be a very interesting project.
20:24RickInGAtechnomancy: thanks for answer, going to stick with passing board for now.
20:25technomancythe other option is to (reduce next-move initial-board move-seq)
20:26RickInGAthat is such a cool idea I am going to have to do it. Good learning experience
20:27technomancyspoiler alert: assoc-in is your friend for dealing with vector-of-vector boards
20:28RickInGAits been a long time since I have written something that I knew I would look back on in horror 6 months from now, but you have to start somewhere
20:28technomancyif you're lucky, it's a project you can throw away
20:29technomancysome people end up haunted by it for years
20:29RickInGAgood point…
20:32muhooso when i connect to a repl using tcp, is that a separate thread of execution from the other repl in the shell?
20:45ataggartHas anyone actively used Avout? I've been working with it today, and my app will (randomly?) lock up after a number of swap!! calls.
21:06ZokaFor those of you have not seen it yesterday here it is again with bit more backgtound info:
21:06Zokahttp://noirmon.herokuapp.com/ringmon/monview.html
21:06ZokaA web based interface to Cemerick's nREPL server incorporated within a typical Clojure web based application
21:06Zoka(in this case a Noir Blog sample app by ibdknox). Since Heroku, allows only
21:06Zokaone server TCP port per web app, this port (80) has to be shared between
21:07Zokaregular app traffic and nREPL server. The REPL interface at the browser is similar to CCW Eclipse Clojure plugin,
21:07Zokait has 2 windows, one for submitting the Clojure forms and other (read only one) for nREPL responses.
21:07ZokaThere is also a simple chat facility between active sessions.
21:07ZokaThe REPL sessions are persistent, so if user goes offline, all his chat messages and accumulated
21:07ZokaClojure script output belonging to his sesion will be delivered on next visit. Script execution in most of the cases can be
21:07Zokastopped by 'Interrupt' button. There also tree alike monitoring data display for assorted JMX values, CPU load, and
21:07ZokaREPL sessions info.
21:07ZokaNote: this is not restricted environment like a Clojail - it is meant to be development tool and has
21:07Zokaa facility to hook in authentication function to control access in real-life usage. This is just a demo for
21:07Zokahttps://github.com/zoka/ringMon/ which is in fact just a Ring middleware.
21:07ZokaYou can kill it with one line of code, as somebody did yesterday :),
21:07Zokabut it will come back again in less than a minute. You can use a script to erase writeable files in app curent directory,
21:07Zokabut it will still come back again since Heroku uses ephemeral file system. Heroku apps are indistructable :)
21:07ZokaSorry for the long ramble.
21:07emezeskeZoka: I think you meant to put that in a blog post :)
21:08ZokaI will taje it from logs:)
21:08Zokas /taje/take/
21:08lstollZoka: that's awesome.
21:09technomancyZoka: definitely looking forward to trying that out soon
21:09ZokaThanks
21:09technomancyalso, your nick reminds me of http://zokacoffee.com, which is delicious
21:10ZokaNo relation
21:10technomancytoo bad, but I won't hold it against you =)
21:11RickInGAtechnomancy I told my gf about you bringing press and thermometer to session. she was really impressed with the thermometer
21:11brehauti find it really weird that press coffee is so popular in america
21:12brehautand that filter is run of the mill; over here its the other way round
21:14tmciverbrehaut: where's 'over here'? England?
21:14brehautNew Zealand
21:15tmciverit's gotta be late for you. What time is it?
21:15brehaut2:13PM
21:15lstollmiddle of the day
21:15brehautliving in the future
21:15lstollLiving in the future is awesome
21:16tmciveryou guys are so lucky. I can't wait till 2:13 tomorrow!
21:19wmealinglstoll, au ?
21:19lstollwmealing: yeah, melbourne.
21:21FrozenlockIs there a way in seesaw/flow-panel to make a newline? I have multiple input boxes and they all are on the same line, which is really ugly.
21:22FrozenlockI would like a new line between each item : (flow-panel :items [ item-1 item-2 item3..]
21:23RickInGAFrozenlock: I don't know your answer, but I do know that if you can't get an answer here, you can post to the seesaw google group. Dave Ray, keeps close tabs on that
21:24bytechunkyDoes the upcoming book "Clojure Programming" from Chas Emerick et al cover Clojure 1.3.0?
21:25FrozenlockRickInGA: Thanks!
21:26RickInGAbytechunky: yes, the book "expects 1.3.0 or higher"
21:28bytechunkyRickInGA: that's excellent!
21:29RickInGAbytechunky I have only looked at parts of it, but what I have read has been very helpful and very clear
21:30RickInGAI didn't understand the namespace macro until I read the explanation there
21:31bytechunkyRickInGA: i read the first chapters of Joy of Clojure which i found pretty awesome. But i wd like to read up on some of the new stuff like deftype, defrecord, futures, promises
21:41TakeVIs there a way to turn symbols into strings?
21:42apwalkname
21:42RickInGAI have a function with a let in it. If I write (let (fn1 … ) (for ….) (fn2…) fn1 and fn2 get called.
21:42RickInGAIf I write (let (fn1 …) (for …) fn1 and teh for loop get called
21:42TakeVapwalk: Thank you.
21:43RickInGAbut I can't seem to get fn1, for and fn2 to all get called
21:46tmciverRickInGA: I don't follow. Perhaps you can refheap some sample code.
21:48sjlAnyone know why this wouldn't work? https://refheap.com/paste/1269
21:48sjlIs this `thrown?` thing in a Clojure test magical and unable to be used in a macro or something?
21:50amalloyRickInGA: laziness
21:50tmciversjl: I'm not very good with macros but have you tried macroexpand-1 on a call to the macro?
21:50amalloysjl: yes
21:51RickInGAtmciver: it is verbose… but here it is: https://refheap.com/paste/1270
21:51sjlamalloy: hmm, is there any way I can do what I'm trying to do here (make a shortcut for ensuring that an exception is thrown) or am I out of luck?
21:51RickInGAamalloy: adding another function call after the 'for' causes the for to not be evaluated?
21:51amalloynot exactly
21:52amalloyyou're using `for` for side effects, which it is not designed for
21:52amalloyyou should use a doseq for that
21:52amalloy(now don't you wish you'd taken the advice to do this with pure functions)
21:52RickInGAamalloy: thanks, I will try that
21:52RickInGAamalloy: hehe, do you think tic-tac-toe has an "explode" function?
21:53amalloysjl: include the (is) in your macro
21:53sjlamalloy: I tried that -- same error (no such var: .../thrown?)
21:54amalloyoh
21:54amalloy~'thrown?
21:54clojurebotNo entiendo
21:54technomancybrehaut: I actually like the (hand-poured) filter better, it just doesn't travel as well
21:54RickInGAtechnomancy: kemex filter?
21:55technomancyRickInGA: yeah
21:55technomancyalso, aeropress is a lot nicer than french press IMO
21:55RickInGAtechnomancy: too funny, when I told gf the story, she said "I am surprised he doesn't use kemex"
21:56technomancyheh
21:56technomancyas long as you get the temp right aeropress is basically impossible to screw up; pour overs are a lot more temperamental.
21:56RickInGAdamn, now I want coffee, and its like 10pm :(
21:57pandeirois aeropress the italian style one that percolates up?
21:57technomancypandeiro: no, that's siphon
21:58brehauttechnomancy: yeah, hand poured filter is my preference too (ive got a small chemex)
21:59brehautand preferably with single origin beans
22:00technomancythat's the way to go
22:00brehautdefinately
22:01RickInGAI hope next year Clojurewest is in Seattle so I can find out what technomancy's favorite coffee is!
22:01brehautmy local roaster gets 'cup of excellence' beans for particular farms
22:01brehauts/for/from/
22:02technomancyI had a travel grinder for this trip, so that was nice
22:02pandeirohere in brazil the siphon is popular, i had a french press back in the states, but for me nothing beats instant
22:02technomancyheh
22:02brehaut~guards
22:02clojurebotSEIZE HIM!
22:03RickInGAshould be able to pass a parameter
22:03RickInGA~guards pandeiro
22:03clojurebotIt's greek to me.
22:03pandeirothe guards all drink instant, too RickInGA it's no use
22:04xeqisjl: that doesn't work because (is ..) has a special case when the first item in the list is 'thrown
22:04technomancymust be tough being an IRC guard
22:04xeqiand it does it as part of is's macroexpansion
22:04technomancysingle-ply toilet paper, instant coffee... at least you get a fast network connection
22:04xeqibefore parse-error would expand
22:04technomancyxeqi: that drives me nuts
22:04sjlxeqi: ahh
22:05technomancythrown needs to be its own defmacro; it's stupid to special-case it
22:05sjlxeqi: is there any way around that?
22:06brehauttechnomancy: what is siphon coffee like?
22:06xeqilooking/thinking
22:07technomancybrehaut: it's basically like a science experiment: https://twitter.com/#!/technomancy/media/slideshow?url=http%3A%2F%2Fyfrog.com%2Fo0s1ngj
22:07technomancybunsen burner and all
22:08brehauttechnomancy: amazing
22:08brehauthow does it taste?
22:08pandeirowait how's it different from a kettle? it's just a kettle with a coffee filter in it
22:08pandeirobrehaut: sedimenty \thats a word
22:09brehautit looks kinda like a stove top espresso but more complicated?
22:10pandeirocleaning it is the only complicated part
22:10technomancyit tastes like SCIENCE
22:10brehautbahaha
22:10pandeiroinstant?
22:10pandeiroinstant is science
22:11brehautenough of this instant trollery
22:13RickInGAoh? is instant karma going to get him?
22:13pandeiroi actually drank the stuff for about 2 months straight when i started drinking coffee again... it was a gateway drug ... after i'd been off the stuff for a couple years
22:14pandeiroi think the reason paper is best is the smell, at least with the italian one it doesnt fill the kitchen the same way
22:18RickInGAamalloy: thanks, doseq worked!
22:19FrozenlockIf I want to manipulate my local IP address (say to get a broadcast address), what would be the best way? (.getHostAddress (java.net.InetAddress/getLocalHost)) + some regexp replacement, or is there a more elegant way?
22:33xeqisjl: you could do something like https://refheap.com/paste/1271
22:34xeqiwhere you special case parse-error the same way as thrown
22:34xeqibut thats all I can think of
22:34sjlxeqi: ah... seems a bit ugly, but it works...
23:14technomancyZoka: lein pom && mvn dependency:tree should help you track down the hiccup dep
23:24xeqitechnomancy: pomegranate can figure out a dependency tree; know anyone working on a plugin for lein 2?
23:25xeqimight need to add that to my task list
23:28technomancyxeqi: cemerick has a gist, it's just not hooked up yet
23:28technomancyI'd like to add it to the deps task; maybe "lein deps :tree"
23:51rhcquestion about developing in the repl, if i have some long running thread and i want to update some event handler in the thread, should i just use a clojure ref while i'm doing development and update the ref in the repl with (require .. :reload) (dosync (ref-set ..)), or is there a better way so i dont have to add this wrapper only for repl dev?