2012-03-21
| 00:03 | amalloy | aperiodic: (comp not not x) is (comp boolean x) |
| 00:06 | aperiodic | amalloy: indeed it is. thanks for the tip. |
| 00:26 | fhd | I'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:28 | jayunit100 | hi ::> |
| 00:28 | jayunit100 | not sure what :main does in leiningen. |
| 00:28 | wmealing | says which function is the one to start ? |
| 00:29 | wmealing | when you execute the jar ? |
| 00:29 | wmealing | (just taking a punt, from what ive seen so far) |
| 00:29 | wmealing | s/execute/run |
| 00:29 | jayunit100 | oh ok |
| 00:30 | jayunit100 | well... kinda |
| 00:30 | jeremyheiler | https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L77 |
| 00:30 | jayunit100 | ahhh |
| 00:30 | jayunit100 | ok |
| 00:32 | jayunit100 | oh ... and another silly question. |
| 00:33 | jayunit100 | how do you exit the repl to restart it ? I am starting to feel bad about overusing Ctrl-C.... |
| 00:37 | _ato | nothing wrong with using Ctrl-C |
| 00:38 | amalloy | Ctrl-D, though, just like any well-behaved console app (Ctrl-Z on windows probably works) |
| 00:44 | arohner | jayunit100: you can also do (System/exit 0) if it makes you feel better. (but there's nothing wrong w/ Ctrl-c) |
| 00:46 | jayunit100 | cool. |
| 00:48 | jayunit100 | hmmmm okay.. heres another low hanging fruit :) |
| 00:48 | jayunit100 | if I have a list... than clearly, each element is a clojure.lang.Symbol |
| 00:48 | jayunit100 | (type (nth '(a v c) 0)) |
| 00:49 | jayunit100 | now -- can i search for a string which "looks" like one of those symbols ? |
| 00:55 | wmealing | jayunit100, you can iterate over them with a few different functions and write your own compare.. i guess |
| 00:59 | amalloy | jayunit100: your if/then strikes me as nonsensical |
| 00:59 | jayunit100 | ? |
| 01:00 | jayunit100 | oh haha |
| 01:00 | jayunit100 | yeah... my bad. |
| 01:00 | jayunit100 | if I have a list '(a b c) ... than clearly, each element is a clojure.lang.Symbol |
| 01:00 | jayunit100 | better @amalloy ? |
| 01:01 | amalloy | yep, sounds accurate |
| 01:15 | emezeske | Arrgg, I know the answer is "no" but can someone *please* un-moderate me on the clojure google group? |
| 01:15 | emezeske | I just biffed the tab and enter keys and posted half a message |
| 01:15 | emezeske | But I don't get to see it for ??? hours, so I can't post a reply that contains the rest of my message |
| 01:18 | wmealing | we've all done something equally stupid if not more so, don't be too hard on yourself. |
| 01:19 | emezeske | I'm not being hard on myself, I'm just frustrated that my message goes into a black hole for like 20+ hours now |
| 01:19 | emezeske | So I can't fix it |
| 01:19 | wmealing | ah |
| 01:39 | slyrus | is there a better svg lib then the freehep stuff these days? |
| 01:39 | slyrus | technomancy: you'll be pleased to hear that I finally got clojure-jack-in working :) |
| 01:44 | lynaghk | slyrus, if you just want to write svg itself, check out c2: http://keminglabs.com/c2/ |
| 01:45 | lynaghk | (or just use hiccup directly) |
| 01:52 | slyrus | lynaghk: thanks, but I need freehep's SVGGraphics2D |
| 02:24 | sorenmacbeth | is there a way to enumerate all of the bound vars in a namespace from the repl? |
| 02:30 | emezeske | ,(doc ns-publics) |
| 02:30 | clojurebot | "([ns]); Returns a map of the public intern mappings for the namespace." |
| 02:30 | emezeske | sorenmacbeth: ^ might be helpful? |
| 02:31 | aperiodic | there's also ns-aliases |
| 02:31 | aperiodic | hmm, that's not what i thought it was |
| 02:33 | aperiodic | (doc ns-maps) |
| 02:33 | clojurebot | Gabh mo leithscéal? |
| 02:33 | aperiodic | ,(doc ns-maps) |
| 02:33 | clojurebot | Excuse me? |
| 02:34 | hiredman_ | (doc ns-map) |
| 02:34 | clojurebot | "([ns]); Returns a map of all the mappings for the namespace." |
| 02:34 | aperiodic | thanks, hiredman_ |
| 02:47 | sorenmacbeth | hiredman: cheers |
| 02:50 | jtoy | hi tomoj I'm still playing around with your example, i get different results for some reason |
| 03:11 | tomoj | jtoy: are you using different data? |
| 03:11 | jtoy | tomoj: yeah |
| 03:13 | jtoy | tomoj: 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:16 | tomoj | good luck, gotta go |
| 03:16 | jtoy | tomoj: nice, i rechecked all my data and found the error is with my data |
| 03:16 | jtoy | thanks! |
| 04:22 | muhoo | muaahahaha https://refheap.com/paste/1247 |
| 04:23 | DerGuteMoritz | Raynes: thanks! |
| 04:59 | jtoy | how 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:04 | andrew_kndrtvch_ | you can check http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/time |
| 05:11 | jtoy | andrew_kndrtvch_: thanks |
| 05:30 | jtoy | why 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:31 | jtoy | the code is exactly the same, both pulled from git |
| 05:31 | ejackson | usually you need to run lein deps to get the lib dir populated |
| 05:31 | ejackson | then lein run will work |
| 05:32 | raek | jtoy: maybe you have an old version on the second machine |
| 05:32 | raek | deps is performed automatically if lib is empty in more recent versions |
| 05:32 | raek | versions of lein |
| 05:33 | jtoy | i just upgraded lein on both machines |
| 05:33 | jtoy | and still don't get lib on one machine |
| 05:33 | raek | do you get an error? |
| 05:34 | jtoy | no, just return immediately |
| 05:34 | jtoy | hmm |
| 05:34 | raek | which command? "lein repl"? |
| 05:34 | jtoy | the 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:34 | raek | in leiningen 2 the lib dir is not used |
| 05:35 | raek | the jars are used directly from .m2 instead |
| 05:35 | raek | but the program should behave the same |
| 05:35 | jtoy | hmm, how can i downgrade to the older one to see if that fixes it |
| 05:36 | raek | there are some breaking changes in lein 2 |
| 05:36 | raek | that's why I think most people keep both versions around |
| 05:37 | jtoy | im a clojure newbie |
| 05:40 | jtoy | I'm copying my old one over, thanks |
| 05:41 | babilen | jtoy: 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:42 | raek | version 2 has not officially been released yet, so it can be wise to stay with version 1 until it is released |
| 05:42 | jtoy | i had previsouly just followed the instructions on github |
| 05:49 | twem2 | the github instructions pointed to the preview version as well for a bit |
| 05:54 | Raynes | raek: lein 2 is generally stable enough for use. |
| 05:55 | Raynes | People using lein 1 just means more people that are confused and more projects to move when lein 2 final is released. |
| 05:56 | Raynes | The best bet is to install them both side by side and use lein 2 whenever possible, especially for new projects. |
| 05:56 | Raynes | But anyways, I need sleep. |
| 07:48 | pandeiro | is there an analog of filter, something that takes a fn and coll and returns any items that gave nil/false? |
| 07:52 | Hali_303 | hi! what is the easiest way to copy the sexp at the cursor to the clipboard in emacs? |
| 07:53 | xeqi | pandeiro: remove |
| 07:53 | Hali_303 | also, is there a shortcut for auto-formating? |
| 07:53 | dan_b | i use C-M-k C-y |
| 07:53 | dan_b | cursor at beginning of sexp |
| 07:54 | dan_b | also - C-M-t (transpose sexp) is the best thing ever |
| 07:54 | jakemcc` | Hali_303: if you are using emacs-starter-kit C-c n for indenting |
| 07:54 | dan_b | once you've acquired the habit, you will curse life evey time you're using a non-sexpy language that doesn't support it |
| 07:55 | Hali_303 | ok, i take that as a warning :) thanks! |
| 07:56 | pandeiro | xeqi: never woulda found it, thanks |
| 08:03 | clgv | $findfn odd? [1 2 3 4 5 6] [2 4 6] |
| 08:03 | lazybot | [clojure.core/remove] |
| 08:03 | clgv | pandeiro: ^^ |
| 08:12 | pandeiro | clgv: neat trick, findfn |
| 09:03 | yoklov | anybody 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:09 | nDuff | Do 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:14 | yoklov | i 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:19 | yoklov | so 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:25 | clgv | nDuff: Clojure's sorted-map is implemented as PersistentTreeMap |
| 09:26 | clgv | yoklov: you have a primitive binding in your loop-statement |
| 09:27 | yoklov | and that means I need to continuously cast to boolean when calling recur? |
| 09:28 | yoklov | I'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:31 | clgv | yoklov: can you ~paste the whole snippet? |
| 09:31 | clgv | ~paste |
| 09:31 | clojurebot | paste is http://gist.github.com/ |
| 09:33 | yoklov | its a fairly beastly function but here: https://gist.github.com/2146893 |
| 09:35 | clgv | yoklov: are you using clojure 1.3? |
| 09:35 | yoklov | yup |
| 09:37 | yoklov | changed it so it should be runnable, but honestly i'm not that concerned |
| 09:38 | yoklov | its annoying because wrapping (not= …) with (boolean) is ugly but if its whats needed thats fine. |
| 09:38 | andrew_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:40 | jkkramer | yoklov: just a guess, but it might be due to = being inlined while not= is not |
| 09:40 | clgv | 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:40 | jkkramer | jinx |
| 09:41 | clgv | :P |
| 09:42 | yoklov | huh. |
| 09:42 | yoklov | presumably not can't either? |
| 09:42 | yoklov | hrmmmm. nope |
| 09:43 | clgv | yoklow: 'not is no inline function either |
| 09:43 | pandeiro | searching through a large collection of maps for a value - is there a better way than filter? |
| 09:43 | yoklov | oh |
| 09:43 | yoklov | fixed it |
| 09:43 | yoklov | (= 0 (rand-int 2)) is the same as (not= 0 (rand-int 2)), but isn't a primitive |
| 09:44 | yoklov | awesome, thanks |
| 09:44 | jkkramer | yoklov: see 'zero?' |
| 09:44 | yoklov | oh, right |
| 09:45 | yoklov | but then it's (not (zero?…)) |
| 09:45 | clgv | hmmm, imo the doc-string should indicate :inline |
| 09:45 | jkkramer | forgoing zero? isn't a sin |
| 09:45 | yoklov | also zero? gives me the same problem as before |
| 09:46 | jkkramer | it's inlined too |
| 09:46 | yoklov | then i can't use it here |
| 09:46 | yoklov | for whatever reason |
| 09:47 | yoklov | in my defense this is a port from some oldish scheme code i wrote, where there's no 'zero?' |
| 09:47 | clgv | yoklov: (not= % 0) is equivalent to (> % 0) if you have only positive integers |
| 09:47 | yoklov | of course, but you don't think the first is slightly more readable? |
| 09:47 | yoklov | when that really is what you're checking |
| 09:48 | clgv | but '< and '> are inlined ^^ |
| 09:48 | jkkramer | pandeiro: filter or for are probably what you want, but depends on the circumstance |
| 09:48 | clgv | I guess there should be ticket to point at that issue. |
| 09:50 | yoklov | hm. i can fill one out later today, i actually have to run right now |
| 09:50 | yoklov | thanks for the help! |
| 09:51 | andrew_kndrtvch_ | so.. now can anybody help me ?) |
| 09:51 | andrew_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:55 | clgv | andrew_kndrtvch_: maybe you can add the leiningen standalone jar to your classpath manually. have you checked if it was downloaded? |
| 09:58 | andrew_kndrtvch_ | yes |
| 09:58 | andrew_kndrtvch_ | but it doesn't really contains this class |
| 09:58 | andrew_kndrtvch_ | so .. or there are some dependency exists or the script is wrong |
| 10:01 | clgv | andrew_kndrtvch_: the script seems wrong. in preview 2 of lein there is no leiningen/core.clj indeed |
| 10:03 | clgv | andrew_kndrtvch_: so this seems wrong then >> clojure.main -e "(use 'leiningen.core)(-main)" |
| 10:04 | clgv | andrew_kndrtvch_: the linux script has >> clojure.main -m leiningen.core.main |
| 10:05 | ericmoritz\0 | is there a easy way to read n bytes from a bufferedreader? |
| 10:10 | raek | ericmoritz\0: use a BufferedInputStream. readers are for textual data and input streams are for binary data. |
| 10:13 | pandeiro | jkkramer: 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:46 | Scorchin | Is there a curses-like library for Clojure available? E.g. to build my own REPL-like app |
| 10:50 | fdaoud | I'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:50 | ohpauleez | lynaghk: ping |
| 10:50 | fdaoud | the data still has to go "over the wire".. |
| 10:50 | fdaoud | and it is still ajax.. |
| 10:50 | fdaoud | so I'm having a bit of trouble wrapping my head around how that would work. |
| 10:51 | ejackson | fdaoud: I give an example of this on my blog: http://boss-level.com/?p=102 |
| 10:53 | ejackson | fdaoud: no, I'm lying.... it was somewhere else.... |
| 10:53 | TimMc | You just print/read, right? |
| 10:53 | ejackson | sorry: http://boss-level.com/?p=119 |
| 10:54 | fdaoud | ejackson: 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:54 | ejackson | Yeah, the second link is, I think, what you're after. Now I'll stop with the shameless self promotion. |
| 10:54 | fdaoud | TimMc: as a hello world maybe, but eventually want to render a view from the received data |
| 10:55 | TimMc | Not sure what you're asking, then. |
| 10:55 | TimMc | How is pr-str/read-string any different architecturally from toJSON/readJSON or whatever? |
| 10:56 | sparkleshy | why is throw a special form? ...couldn't it just be implemented with a bit of java? |
| 10:56 | ejackson | TimMc: saves you writing the serialisation functions more than once |
| 10:57 | fdaoud | ejackson: thanks! that's exactly what I was looking for. s/stop shameless self promotion/please continue helpful contributions/ ! |
| 10:57 | fdaoud | ejackson: trust me I googled.. just not for the right terms I guess :/ |
| 11:06 | TimMc | sparkleshy: If it were a function, it would itself show up in all the stack traces. |
| 11:07 | hhutch | fdaoud: the fetch library lets you do this pretty easily |
| 11:08 | fdaoud | hhtutch: from ibdknox? |
| 11:08 | hhutch | https://github.com/ibdknox/fetch the example there are passing clojure structures not json |
| 11:09 | fdaoud | hhutch: thanks-- and btw from all my googling I found your cljs-clojure-demos, thanks for putting those up |
| 11:09 | hhutch | fdaoud: :) |
| 11:09 | hhutch | i need to finish them |
| 11:13 | fdaoud | hhutch: 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:13 | Lajla | You're tearing up my heart when I'm with youuuuu |
| 11:13 | Lajla | but when we are apart I feel it tooooo |
| 11:13 | Lajla | And no matter what we do I feel the paaain |
| 11:14 | Lajla | with or without you |
| 11:14 | raek | sparkleshy: 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:15 | raek | but why not let the compiler generate the bytecode instruction for throw instead of a call to the throw funcion/method? |
| 11:16 | Lajla | raek, my love. |
| 11:16 | Lajla | &"I worship His Shadow" |
| 11:16 | lazybot | ⇒ "I worship His Shadow" |
| 11:17 | raek | but 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:21 | edw | This 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:28 | fdaoud | ejackson: what are pr-str and read-string? |
| 11:28 | TimMc | fdaoud: doc 'em |
| 11:29 | TimMc | edw: Cool. What industry? |
| 11:30 | ohpauleez | edw: Where in NYC are you? Tutorspree is all about the Clojure love |
| 11:30 | ohpauleez | also, the Clojure community here is pretty big |
| 11:31 | fdaoud | TimMc: yeah it wasn't working in my cljs repl |
| 11:31 | TimMc | sparkleshy: Actually, throw *can't* be a function, because it needs to have control over the evaluation of its body. |
| 11:31 | TimMc | fdaoud: (use 'clojure.repl) |
| 11:31 | TimMc | Are you in SLIME? |
| 11:31 | edw | Our office is in SoHo. (I live in West Village.) |
| 11:32 | edw | TimMc: Advertising, of course. |
| 11:32 | fdaoud | TimMc: no, just straight-up command line |
| 11:32 | edw | ohpauleez: Who/what is Tutorspree? |
| 11:33 | ohpauleez | We'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:33 | TimMc | fdaoud: Huh. Leiningen's repl should include that by default... |
| 11:33 | fdaoud | TimMc: 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:34 | TimMc | fdaoud: Anyway, pr is the Clojure serializer and read is the deserializer. pr-str and read-string are the string counterparts (instead of streams). |
| 11:34 | ohpauleez | edw: ^ 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:34 | TimMc | fdaoud: Using json limits your expressiveness and may require custom (de)serialization. |
| 11:36 | fdaoud | TimMc: 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:36 | fdaoud | very nice. |
| 11:37 | fdaoud | TimMc: thank you for your patience, I am just trying to wrap my head around it all.. |
| 11:37 | TimMc | fdaoud: More precisely, this is the native string representation of Clojure. |
| 11:37 | TimMc | &(pr-str '[1 2 (a :b #{c})]) |
| 11:37 | lazybot | ⇒ "[1 2 (a :b #{c})]" |
| 11:37 | edw | ohpauleez: 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:37 | raek | TimMc: does it? isn't <expr> in (throw <expr>) evaluated like any other expression? |
| 11:38 | ohpauleez | edw: Also TimMc is an AWESOME consideration is he's available :) |
| 11:38 | ohpauleez | edw: Awesome!!! |
| 11:38 | TimMc | raek, sparkleshy: Augh, I was thinking try for a moment instead of throw. Never mind... |
| 11:38 | fdaoud | TimMc: I see. And you're right, lein repl works properly. |
| 11:39 | fdaoud | for some reason I thought pr-str and read-string were clojurescript, not plain clojure, thus my confusion. |
| 11:39 | ejackson | edw: if you're interested in consultants, I might be able to help you out, check your PM |
| 11:41 | edw | ejackson: 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:41 | ejackson | no sweat, i intensely dislike employment situations :) |
| 11:42 | edw | Hey, I feel the same way about being employed anywhere but at a start-up. |
| 11:42 | edw | Otherwise, consultant city. |
| 11:43 | TimMc | My dad has been self-employed for a large portion of his life. |
| 11:43 | TimMc | Seems prety happy with that. :-) |
| 11:44 | ejackson | I've bene self employed only 18 mnths, but I'm loving it |
| 11:44 | TimMc | Does starting heirloom seed companies and selling them off count as being "in the startup business"? :-P |
| 11:45 | ejackson | most def' |
| 11:45 | TimMc | Even if it takes like a decade for each? |
| 11:46 | edw | I 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:46 | edw | TimMc: I'd like my _next_ "start-up" to be like that, more of a 37signals affair. |
| 11:53 | patrikkarlin | hej 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:56 | TimMc | edw: Have they actually sold anything off? |
| 11:56 | raek | patrikkarlin: 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:57 | patrikkarlin | from the file buffer |
| 11:57 | patrikkarlin | no it did no open |
| 11:57 | cap10morgan | morning dakrone. thanks again for the noir demo last night. |
| 11:58 | dakrone | cap10morgan: thanks for coming :) |
| 11:59 | clgv | cap10morgan, dakrone: did you talk about noir and cljs? is there any material online? |
| 11:59 | edw | TimMc: I was at Half.com from nearly day one. We sold to eBay for $350 million or so. |
| 11:59 | dakrone | clgv: noir on heroku, not much material; it was mostly a coding-example walkthrough |
| 12:00 | clgv | dakrone: ah ok. |
| 12:00 | raek | patrikkarlin: for me the buffer is called *slime-repl nil*. do you see any buffer like that if you press "C-x C-b"? |
| 12:00 | edw | TimMc: And I had a boutique consulting firm that I founded and sold to my partners back in late '08. |
| 12:01 | patrikkarlin | raek: no i have a slime events buffer tho and it dosent give me anny errors :( |
| 12:01 | ejackson | edw: busy man ! |
| 12:02 | tmciver | patrikkarlin: do you see a *swank* buffer? |
| 12:02 | patrikkarlin | tmciver: yea |
| 12:03 | raek | patrikkarlin: 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:04 | raek | patrikkarlin: also, what clojure related stuff have you installed in emacs? just clojure-mode? |
| 12:05 | patrikkarlin | Starting swank server... |
| 12:05 | patrikkarlin | Connecting to Swank on port 63441.. [2 times] |
| 12:05 | patrikkarlin | error in process filter: Symbol's function definition is void: slime-output-buffer [2 times] |
| 12:05 | patrikkarlin | Connected. May the source be with you! |
| 12:05 | patrikkarlin | theres an error |
| 12:05 | replaca_ | Q: does someone know how to do (def ^:dynamic ...) without using a reader macro? |
| 12:05 | raek | replaca_: like from a macro? |
| 12:05 | replaca_ | no, I want something that will work in all versions of clojure |
| 12:06 | pandeiro | patrikkarlin: i vaguely remember that being a version issue? look in ~/.lein/plugins? |
| 12:06 | patrikkarlin | i installed clojure-mode and clojurescript mode and lein-clojure i think |
| 12:06 | patrikkarlin | lein-clojurescript-1.1.0.jar swank-clojure-1.3.2.jar |
| 12:07 | raek | (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:07 | replaca_ | although, I could use a macro, if I could find a way to make it work |
| 12:07 | raek | replaca_: is this for maintaining compability with Clojure 1.1 and earlier? |
| 12:08 | patrikkarlin | raek: dosent seme logical that that whuld void out a function tho?? |
| 12:08 | lazybot | patrikkarlin: Uh, no. Why would you even ask? |
| 12:08 | replaca_ | raek: yeah, in autodoc |
| 12:08 | raek | oh, I see |
| 12:08 | pandeiro | patrikkarlin: ls -l your .emacs.d? |
| 12:09 | raek | maybe you could consider running autodoc in the leiningen clojure instance |
| 12:09 | patrikkarlin | 06 *** benares_98 JOIN |
| 12:09 | patrikkarlin | 17:06 <replaca_> raek: yeah, in autodoc |
| 12:09 | patrikkarlin | > init.el package package.el places swank |
| 12:09 | raek | it will be >= 1.2 |
| 12:10 | pandeiro | patrikkarlin: swank has the slime elisp files? |
| 12:10 | pandeiro | i think i had that problem when i accidentally deleted that folder or its contents |
| 12:10 | replaca_ | raek: that doesn't work for documenting, e.g. clojure itself |
| 12:11 | raek | replaca_: anyway, you can construct a symbol with {:dynamic true} metadat like this: (let [sym (acquire-symbol-somehow)] (vary-meta sym assoc :dynamic true)) |
| 12:11 | replaca_ | raek: yeah, that's about where I'd gotten to and I think it's the right approach |
| 12:11 | replaca_ | raek: thanks |
| 12:12 | patrikkarlin | it has slime files in it i asume this whas installed by the package maneger i dident install swank manualy |
| 12:12 | raek | replaca_: is the problem that the reader autodoc uses might not be able to read the source? |
| 12:12 | raek | sounds like a hard problem to solve |
| 12:13 | replaca_ | raek: at the core, autodoc is usingg whatever version of clojure that is involved in that program |
| 12:13 | raek | if the syntax changes is the only problem, maybe maintaining a separate 1.1 version is simpler |
| 12:13 | replaca_ | once I've dig out all the vars, protos and types, I switch back to clojure 1.3 |
| 12:13 | raek | ah |
| 12:14 | replaca_ | *dug |
| 12:14 | replaca_ | mostly it works pretty easily, at the cost of some copy and paste pattern |
| 12:15 | raek | patrikkarlin: have you seen this? https://github.com/technomancy/swank-clojure/issues/92 |
| 12:15 | pandeiro | patrikkarlin: 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:16 | raek | from that page it looks like there was a problem in swank-clojure 1.3.2, and that 1.3.3 should work |
| 12:16 | raek | 1.4.3 seems to be the latest stable version, though |
| 12:18 | raek | patrikkarlin: try removing all you installed plugins first (as pandeiro suggested, using "rm ~/.lein/plugins/*") |
| 12:18 | raek | and then "lein plugin install swank-clojure 1.4.3" |
| 12:19 | raek | also check that you _don't_ have swank-clojure mentioned in your project.clj file |
| 12:20 | patrikkarlin | i got a artifact missing error is that version not on clojars? |
| 12:22 | raek | hrm, did I spell it wrong? |
| 12:22 | patrikkarlin | i dident find it on the site |
| 12:22 | patrikkarlin | using the 1.5.0-SNAPSHOt |
| 12:23 | raek | ah, it's called lein-swank now |
| 12:24 | raek | patrikkarlin: "lein plugin install lein-swank 1.4.3" |
| 12:25 | raek | (I tested that on my box too, just to be sure) |
| 12:25 | sparkleshy | is there any way to overload + without damaging performance in the normal case? |
| 12:26 | patrikkarlin | THADA |
| 12:26 | raek | :) |
| 12:26 | patrikkarlin | kisses and hugs everyone who helped :D |
| 12:27 | raek | lycka till! |
| 12:27 | replaca_ | 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:27 | replaca_ | dunno if it works in 1.1 though |
| 12:28 | replaca_ | but I think I was conditionalize that |
| 12:28 | replaca_ | *was=>can |
| 12:28 | raek | are you generating code? |
| 12:28 | raek | or making code that should be readable in any clojure version? |
| 12:29 | raek | .setDynamic sounds like an invention of 1.3 |
| 12:30 | replaca_ | the latter |
| 12:30 | replaca_ | I agree that it sounds like a 1.2 or 1.3 thing, but I don't know for sure |
| 12:30 | replaca_ | but that's what macros are for :) |
| 12:33 | raek | replaca_: maybe you could (ab)use the eval reader macro: (def #=(vary-meta '*some-var* assoc :dynamic true) 123) |
| 12:34 | raek | then you can have metadata in the code without using "^" or "#^" |
| 12:36 | eggsby | Hi 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:36 | eggsby | " |
| 12:36 | melipone | what's the clojure library that has the trace tools in 1.3.0? |
| 12:36 | eggsby | So it's sorting the result of applying the anonymous function to the collection |
| 12:37 | replaca_ | raek: oh, that's an interesting idea |
| 12:37 | eggsby | But 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:37 | eggsby | but where does the java interop come in? |
| 12:37 | eggsby | it's saying (. compose (comparison of x and y)) right? |
| 12:38 | replaca_ | 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:39 | replaca_ | raek: you're right, .setDynamic was a 1.3 innovation |
| 12:39 | replaca_ | but I have a macro that covers that based on the clojure version |
| 12:41 | vijaykiran | eggsby:I think the comp in that line is Comparator |
| 12:41 | vijaykiran | eggsby: you are talking about this line - https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L2713 .. right ? |
| 12:42 | eggsby | yes vijaykiran |
| 12:43 | vijaykiran | eggsby: AFAIU - it is like java.util.Comparator#compare(keyfn x, keyfny) |
| 12:43 | vijaykiran | eggsby: so comp here isn't clojure.core/comp :) |
| 12:43 | eggsby | oh? how confusing! |
| 12:43 | eggsby | so it has to do with the ^notation ? |
| 12:44 | vijaykiran | eggsby: yeah .. ^blah is a "type hint" |
| 12:44 | eggsby | I'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:44 | eggsby | like (. 1 toString) |
| 12:44 | eggsby | and here it is (. toString 1) |
| 12:45 | eggsby | oh, I see. comp is clojure comp and compare is java's compare? |
| 12:45 | vijaykiran | eggsby: nope, (. target member) |
| 12:45 | lucian | and the shorthand is (.method ...) |
| 12:45 | lucian | (.method target ...) |
| 12:46 | eggsby | where target is our parameter to pass to the java method as 'member'? |
| 12:46 | clgv | &(.toString 1) |
| 12:46 | lazybot | ⇒ "1" |
| 12:46 | clgv | &(. 1 (toString)) |
| 12:46 | lazybot | ⇒ "1" |
| 12:46 | eggsby | so 'compare' in that context is java compare, right? |
| 12:46 | vijaykiran | eggsby: yeah, almost - comp is java.util.Comparator and compare is the method from java.util.comparator |
| 12:46 | eggsby | :o |
| 12:46 | eggsby | okay, so one is done by typehinting, and the other is done by the java interop function? |
| 12:47 | eggsby | comp by typehinting and compare by java interop "." ? |
| 12:50 | Zoka | Hi 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:50 | clgv | eggsby: you can rewrite to: (sort (fn [x y] (.compare comp (keyfn x) (keyfn y))) coll) |
| 12:50 | eggsby | that makes sense clgv |
| 12:51 | eggsby | and in that context comp is typehinted as the java comp from the line [keyfn ^java.util.Comparator comp coll], correct? |
| 12:51 | eggsby | or rather 'comp as java.util.Comparator' |
| 12:51 | clgv | Zoka: where is te chat? |
| 12:51 | nDuff | Are there any suggestions re: minimally-invasive workarounds for CLJ-855 (wrapping of checked exceptions making them unhandleable without catching RuntimeException and unwrapping)? |
| 12:53 | clgv | Zoka: seems you could use a sandbox ;) |
| 12:54 | Zoka | You just type in REPL window and press 'Send' |
| 12:54 | clgv | hmm but it restarted at least ;) |
| 12:54 | patrikkarlin | do whe se each others code executions? |
| 12:54 | patrikkarlin | or only chat? |
| 12:55 | clgv | execute something^^ |
| 12:55 | patrikkarlin | i se my own |
| 12:55 | clgv | I think I killed it with (System/exit -1) ;) |
| 12:55 | Zoka | No, just chat, but you ca |
| 12:56 | pandeiro | clgv: that's a feature, you can turn off the server if it's bothering you while you're chatting |
| 12:56 | patrikkarlin | :D |
| 12:57 | Zoka | It just comes back :) |
| 12:57 | clgv | Zoka: you should consider using clojail ;) |
| 12:57 | pandeiro | it uses nREPL right? |
| 12:57 | Zoka | Thi is just a demo for development tool |
| 12:58 | Zoka | So it needs to be full featured |
| 12:58 | Zoka | And Heroku apps are indistructable |
| 12:59 | clgv | if I had some time I'd see which parts of the filesystem are accessible ;) |
| 12:59 | patrikkarlin | think you can only read |
| 12:59 | patrikkarlin | on heroku .. |
| 13:00 | technomancy | patrikkarlin: that's actually only true of earlier heroku stacks |
| 13:00 | technomancy | the ruby-only ones |
| 13:00 | Zoka | Ephemeral file system - you can kill it bit it comes back |
| 13:04 | Zoka | You can write in your app current directory on Heroku, but those changes are gone on restart |
| 13:08 | pandeiro | (count (map ... coll)) should always be the same as (count coll)? |
| 13:09 | patrikkarlin | have you seen something else? |
| 13:09 | clojurebot | Titim gan éirí ort. |
| 13:09 | pandeiro | i 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:11 | patrikkarlin | the thread where the collection whas behing "changed" died yet you have access to it? |
| 13:12 | ldh | i'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:12 | patrikkarlin | or do you mean died as in it whas done not crached |
| 13:12 | ldh | code here: https://gist.github.com/2149600 |
| 13:12 | technomancy | well, the semantics of what happens when a lazy seq can't be realized are kind of funny |
| 13:12 | pandeiro | well the map returns a lazy collection so i can map it fine but i can't realize it |
| 13:12 | pandeiro | technomancy: how do i know when to give up? |
| 13:13 | technomancy | I guess you could argue that count should throw an exception every time if realizing the seq can't happen |
| 13:14 | technomancy | it 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:15 | technomancy | the 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:16 | pandeiro | weird, when i kill the thread and count again the number is different... maybe that's a sign i just need to wait? |
| 13:23 | cemerick | Zoka: looks like you're building a bit of a fanbase with ringmon :-) |
| 13:23 | Zoka | yes |
| 13:24 | Zoka | It eouild not work without nTRPL |
| 13:24 | Zoka | I mean nREPL |
| 13:24 | cemerick | Yeah, 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:25 | Zoka | No problem, I am very happy with it as is - everything work as advertised |
| 13:26 | technomancy | right now there's no command-line client that speaks HTTP yet, is there? |
| 13:27 | cemerick | it's simple enough that any HTTP client (curl, clj-http, etc) should do just fine |
| 13:28 | cemerick | The existing nREPL client is general enough that clj-http slips right underneath. |
| 13:28 | technomancy | curl by itself isn't very repl-ish though |
| 13:29 | cemerick | oh *command line* client |
| 13:29 | cemerick | no |
| 13:29 | Zoka | If 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:29 | cemerick | I'm going to try to get Colin to add it as a connect option to reply (and therefore lein) |
| 13:29 | technomancy | slick |
| 13:30 | cemerick | Zoka: right, the server side of the HTTP transport I'm working on is just another ring handler |
| 13:30 | technomancy | cemerick: I may be able to help with that next week if needed |
| 13:30 | Zoka | yes. it jist inject a web page and ajax uti |
| 13:31 | Zoka | s /uti/uri/ |
| 13:33 | cemerick | technomancy: 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:33 | technomancy | multipart on the CLI? I would have figured that for a lost cause. |
| 13:34 | cemerick | well, reply can not opt into such things |
| 13:35 | cemerick | but simple stuff is totally doable without a GUI |
| 13:42 | tomoj | marginalia's choice of `foo` over <tt>foo</tt> makes me happy |
| 13:56 | TimMc | Markdown: It's almost a real markup language! |
| 14:22 | muhoo | what would you recommend for a simple, local-ish datastore? |
| 14:22 | muhoo | i 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:22 | muhoo | and storing it all in a flat file kind of sucks |
| 14:23 | aperiodic | sqlite? |
| 14:23 | RickInGA | mongo? |
| 14:24 | muhoo | maybe mongo, i'll have to try it. |
| 14:24 | muhoo | i'd rather avoid sql and jdbc |
| 14:24 | RickInGA | I have only done the simplest of examples, but congomongo looks pretty easy to use |
| 14:24 | pandeiro | muhoo: couchdb is pretty easy with clutch |
| 14:24 | muhoo | ah, thanks. |
| 14:25 | technomancy | another vote for couch |
| 14:25 | muhoo | thanks, that looks like the winner! |
| 14:25 | patrikkarlin | not redis :( |
| 14:25 | technomancy | mongodb worries me |
| 14:25 | pandeiro | muhoo: check out the clojurian semantics cemerick added wait i'll find a link |
| 14:26 | muhoo | this? https://github.com/ashafa/clutch |
| 14:26 | RickInGA | technomancy: pandeiro: what is the motivation for couch over mongo? (I don't know enough to have a preference either way) |
| 14:26 | aperiodic | hmmm, repl-y doesn't work at all for me |
| 14:26 | technomancy | RickInGA: mongo's defaults are optimized for microbenchmarks over safety |
| 14:27 | technomancy | it'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:27 | antares_ | technomancy: what are you voting on? |
| 14:27 | RickInGA | technomancy: thanks, that is a pretty good answer :) |
| 14:28 | antares_ | RickInGA: if you have reasons to use mongo, try https://github.com/michaelklishin/monger |
| 14:28 | technomancy | TBH mysql now has better defaults, but that's the stereotype it has from the early 200Xs |
| 14:28 | mk | what is a macro? |
| 14:28 | antares_ | RickInGA: but mongodb java driver has crazy unsafe defaults (monger in part fixes that) and it is very fast only with low concurrency |
| 14:28 | muhoo | i'm not concerned with seped |
| 14:29 | muhoo | speed eithher |
| 14:29 | muhoo | i just want one step better than (spit (print-dup somestructure) "somefile.clj") |
| 14:29 | mk | that is, are there any nice articles out there explaining what a macro is, and when they should be used? |
| 14:29 | antares_ | 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:30 | patrikkarlin | anny one here have a project using core.logic on github i can look att |
| 14:30 | cemerick | muhoo: 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:30 | mk | the articles I've seen either lose me, or claim it's too difficult to explain using a simple example |
| 14:30 | muhoo | cemerick: thanks! |
| 14:30 | technomancy | mk: this one is pretty decent: http://www.defmacro.org/ramblings/lisp.html |
| 14:30 | pandeiro | that's the one |
| 14:31 | technomancy | muhoo: recently postgres added hstore, which gets you schemaless tables and is pretty badass |
| 14:31 | muhoo | nice |
| 14:31 | technomancy | I would be all over that except it's too new for the shared DBs on Heroku |
| 14:31 | RickInGA | interesting |
| 14:31 | antares_ | mk: macros are a way for your code to extend Clojure compiler, in Clojure itself. |
| 14:31 | technomancy | but if your postgres is 9.1+ then you should definitely give it a look |
| 14:32 | RickInGA | technomancy: do you expect heroku will support that in the future? |
| 14:34 | jayunit100 | hi guys |
| 14:34 | jayunit100 | (:require [clojure.set :as set]) |
| 14:34 | technomancy | not 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:35 | mk | I 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:35 | jayunit100 | -----> java.lang.ClassNotFoundException: clojure.set (NO_SOURCE_FILE:17) |
| 14:35 | jayunit100 | (at the repl , i cant load a dependency that lein loads just fine in my normal clojure program). |
| 14:36 | mk | antares_: I think I get that part, but I'm not sure how it works, or what it's used for |
| 14:36 | RickInGA | technomancy: 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:36 | technomancy | RickInGA: https://addons.heroku.com/cloudant it's free under 250MB |
| 14:37 | RickInGA | technomancy: awesome, thanks! |
| 14:37 | antares_ | mk: in simplest cases, for "code generation" that you do in clojure itself. Any intermediate uses all lead to DSLs |
| 14:37 | technomancy | jayunit100: (:require [...]) only works inside ns |
| 14:37 | antares_ | mk: take a look at query DSL example here: https://github.com/michaelklishin/monger |
| 14:37 | jayunit100 | oh...... ok |
| 14:37 | antares_ | mk: it is done via macros, there is no other way to have this kind of DSL with just functions |
| 14:38 | jayunit100 | so should i do (in-ns) when i fire up my repl? |
| 14:38 | cemerick | RickInGA: Cloudant is also free for some amount, heroku or not |
| 14:38 | jayunit100 | or should i import set some other way ? |
| 14:38 | cemerick | meh, you'd think I was getting a cut :-P |
| 14:38 | antares_ | jayunit100: (require '[clojure.set :as cs]) should work |
| 14:38 | technomancy | clojurebot: the ns macro? |
| 14:38 | clojurebot | Cool story bro. |
| 14:38 | technomancy | clojurebot: ns? |
| 14:38 | clojurebot | ns 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:39 | technomancy | jayunit100: ^^ highly recommended |
| 14:39 | mk | what's the distinction between intermediate and non-intermediate uses? |
| 14:39 | antares_ | mk: basically, newcomers see it as a way to do "code generation at runtime" |
| 14:39 | antares_ | mk: more experienced people build DSLs with it that drastically raise level of abstraction and declarativeness of your code |
| 14:40 | mk | is the code generation view something to avoid, or a needed step? |
| 14:40 | antares_ | 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:40 | antares_ | mk: I think it is a needed first step |
| 14:41 | jayunit100 | some one should write a machine learning algorithm that randomly adds/removes ' and : chars from .clj files to get them working :) |
| 14:41 | antares_ | mk: I would say, see monger, korma and clojure.java.jdbc for various uses of macros |
| 14:41 | muhoo | is 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:41 | antares_ | mk: they vary from DSLs to much simpler code generation/duplication elimination uses |
| 14:41 | technomancy | muhoo: in lein1, you can bind LEIN_REPL_HOST I think |
| 14:42 | muhoo | thanks |
| 14:43 | mk | antares_: 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:43 | mk | is there a clean example of when I'd need to generate code? |
| 14:44 | antares_ | mk: take a look at mongodb shell or query docs, it will make it clearer |
| 14:44 | antares_ | mk: you are building a query that has conditions, limit, offset and so on |
| 14:44 | mk | like, what sort of problem usually makes a lisp programmer think "I'm probably going to have to do some code gen here"? |
| 14:44 | antares_ | mk: and those parts can be reused and compound |
| 14:45 | antares_ | mk: when you see a lot of duplication, often structural duplication that a function won't help with |
| 14:45 | antares_ | 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:46 | mk | what is structural duplication? |
| 14:46 | y3di | has anyone used c2? |
| 14:47 | technomancy | only the wiki |
| 14:47 | mk | I use if statements, and nested loops to iterate over 2d arrays - do those count? |
| 14:49 | antares_ | 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:49 | antares_ | mk: take a look at two examples here: https://gist.github.com/1a0449ded8ecded286d4 |
| 14:50 | technomancy | I'd recommend learning more Clojure basics before picking up macros. |
| 14:50 | antares_ | 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:50 | technomancy | once you've used them a bit, writing them will make a lot more sense. |
| 14:50 | technomancy | course if you're lucky, you won't need to. |
| 14:51 | RickInGA | antares_: not to nitpick, just making sure I understand in your example (do-something) actually should be (some-fn) right? |
| 14:51 | antares_ | 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:52 | antares_ | RickInGA: no |
| 14:52 | antares_ | RickInGA: (some-fn) just returns a value of a |
| 14:52 | antares_ | RickInGA: it can be anything |
| 14:52 | RickInGA | antares_: thanks |
| 14:53 | antares_ | mk: another common example of basic macro usage is "with X" kind of macro |
| 14:54 | antares_ | 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:54 | antares_ | mk: say to use a separate DB but just once, w/o making it default |
| 14:55 | antares_ | 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:56 | antares_ | mk: another case to consider. Imagine a code like this: (:street (:address (:profile person))) |
| 14:56 | antares_ | that returns a street in person's profile address |
| 14:56 | antares_ | it is a bit backwards, right? |
| 14:56 | antares_ | a macro lets you make it more readable: (-> person :profile :address :street) |
| 14:56 | pandeiro | y3di: i'm starting to use it now |
| 14:57 | mk | I'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:57 | antares_ | 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:57 | jayunit100 | hmmm this is another strange one : |
| 14:57 | jayunit100 | ive removed ------ :main run.run ------- from project.clj |
| 14:58 | jayunit100 | and am trying to simply launch the same project with |
| 14:58 | antares_ | 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:58 | jayunit100 | (user=> (use 'run.run :reload true) |
| 14:58 | jayunit100 | but i get a dependency error in one of the clj files. |
| 14:58 | jayunit100 | i guess lein's :main does more than just load a class |
| 14:58 | antares_ | jayunit100: (use …) won't run your function |
| 14:59 | mk | technomancy: 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:59 | antares_ | jayunit100: yes, it compiles it and executes it |
| 14:59 | jayunit100 | i dont want to run it... just load run into the class path so i can run it manually. |
| 14:59 | antares_ | mk: you will come to understand all aspects and features of Clojure over time |
| 14:59 | technomancy | mk: macros are over-hyped by some |
| 14:59 | RickInGA | mk: 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:00 | technomancy | there are many more compelling features in Clojure that are much more practical for everyday use |
| 15:00 | RickInGA | mk: 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:00 | antares_ | 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:01 | antares_ | 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:01 | antares_ | a lot of macros make Java interop much more pleasant, like doto |
| 15:01 | antares_ | but you don't have to be a macro writer to benefit from them |
| 15:01 | jayunit100 | i wonder - why would ('use run.run) break in the repl even though (:main run.run) works fine? |
| 15:02 | TimMc | jayunit100: Because you're quoting the wrong thing. |
| 15:02 | technomancy | jayunit100: neither of those will work |
| 15:02 | jayunit100 | i mean (use 'run.run :reload true) |
| 15:02 | antares_ | jayunit100: use does soemthing very different from what you think it does |
| 15:02 | muhoo | ok, this nesting insanity is starting to look like jquery. https://refheap.com/paste/1258 i feel like i'm doing something wrong. |
| 15:02 | pandeiro | technomancy: how can i run a clj file as a script from a lein project? is it possible? |
| 15:03 | eggsby | if 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:03 | antares_ | jayunit100: use imports (technically, refers) functions from a given namespace into the current one |
| 15:03 | antares_ | jayunit100: it does not call functions |
| 15:03 | technomancy | pandeiro: lein run -m my.ns # as long as you have a -main defn |
| 15:03 | amalloy | antares_: 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:03 | technomancy | not having a -main is sketchy as hell |
| 15:04 | TimMc | technomancy: FOr executable projects. |
| 15:04 | pandeiro | technomancy: and i will be able to take from stdin like that? |
| 15:04 | pandeiro | or do i need to use trampoline? |
| 15:04 | amalloy | eggsby: 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:04 | mk | yeah, the reason I'm asking about macros is because of pg's lisp advocacy |
| 15:04 | antares_ | amalloy: sure, it's just an example |
| 15:04 | jayunit100 | oh 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:05 | antares_ | 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:05 | jayunit100 | (and - when i launch the repl with the :main entry, i can run the program) |
| 15:05 | mk | the (poor) understanding of them that I have is that you can define various novel programming structures |
| 15:05 | RickInGA | mk: 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:05 | jayunit100 | Land of Lisp is good to |
| 15:05 | eggsby | well 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:06 | dnolen | mk: are you familiar with HTML templating? |
| 15:06 | dnolen | mk: if so, macros are like HTML templates, but for your code. |
| 15:06 | TimMc | and beyond |
| 15:07 | mk | (sorry - I'm still replying to things said a page ago) |
| 15:07 | muhoo | the important thing i learned about macros is that i don't need them :-) |
| 15:07 | mk | those comments about the other language features of clojure are reassuring |
| 15:08 | mk | higher-order functions are functions which take functions? |
| 15:08 | RickInGA | mk: take or return |
| 15:08 | antares_ | mk: correct, take or return (possibly create, too) |
| 15:10 | RickInGA | mk: if you want a good overview great clojure features, this video is really good: http://vimeo.com/10896148 |
| 15:10 | eggsby | will watch, ty RickInGA |
| 15:10 | mk | dnolen: that seems to be a helpful analogy |
| 15:13 | mk | I 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:14 | jonasen | dnolen: 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:14 | Bronsa | mk: take cond |
| 15:14 | mk | RickInGA: thanks for the video |
| 15:14 | Bronsa | you couldn't implement it as a function |
| 15:14 | dnolen | jonasen: np |
| 15:15 | TimMc | mk: Macros do not make otherwise impossible things possible. |
| 15:15 | fliebel | jonasen: That's what logic programming does to your brain. You think endlessly about what to ask, rather than how to solve a problem. |
| 15:15 | pandeiro | can anyone show me a barebones example of reading from stdin? |
| 15:15 | mk | right - well, they make things easier, or clearer? |
| 15:15 | fliebel | pandeiro: (readline) |
| 15:16 | fliebel | or, (read-line) actually |
| 15:16 | TimMc | mk: Basically. |
| 15:16 | emezeske | mk: 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:17 | jonasen | dnolen: 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:17 | emezeske | mk: So in that sense, yes, they can make things easier/clearer. |
| 15:17 | TimMc | mk: Sometimes they make things possible that aren't *practical* with regular functions. |
| 15:18 | TimMc | s/make things possible/allow you to do things/ |
| 15:18 | pandeiro | ok so (read-line) doesn't work from lein... |
| 15:18 | mk | Bronsa: 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:18 | fliebel | jonasen: It's like (defn foo (matche ...)) me thinks |
| 15:19 | pandeiro | and trampoline sorts me out, great |
| 15:20 | dnolen | jonasen: what fliebel said. it's just sugar over tedious unifications. |
| 15:20 | jonasen | dnolen: fliebel: so it's not wrong to call it an ordinary function |
| 15:20 | dnolen | jonasen: define (matche) expands out into a conde. |
| 15:21 | dnolen | jonasen: ordinary function that contains a conde |
| 15:21 | mk | all the explanations are very helpful, thanks. I won't worry so much about macros as a major reason to use clojure |
| 15:21 | jonasen | so it must be run in the (run* ..) macro |
| 15:22 | dnolen | jonasen: yes |
| 15:22 | jonasen | dnolen: ok. Thanks. |
| 15:25 | jayunit100 | sorry to bump my question but ...... |
| 15:26 | jayunit100 | Im 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:27 | jayunit100 | at the repl --- than I get a "Unable to resolve symbol: cell in this context (myfile.clj:71)" error. |
| 15:28 | patrikkarlin | core.logic question :D i have a "relation" (my-rel q) how do i easily make a list of that relation? |
| 15:28 | jayunit100 | so 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:29 | dnolen | patrikkarlin: what do you mean? |
| 15:30 | patrikkarlin | say i have a number n and i whant a list of n numbers of items where they all are of my relation |
| 15:30 | patrikkarlin | might not have my termenaligy right :p |
| 15:35 | dnolen | patrikkarlin: 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:36 | tmciver | jayunit100: will it run if you do 'lein run' in the project directory? |
| 15:36 | patrikkarlin | o i dont whant n things i whant q to be a list of fresh variables bound to my real |
| 15:37 | patrikkarlin | w8 for some sudocode |
| 15:37 | jayunit100 | good point |
| 15:37 | jayunit100 | @tmciver |
| 15:38 | patrikkarlin | (defn list-of [list n] |
| 15:38 | patrikkarlin | (== list (take n (repeat (rel <fresh-variable>))))) |
| 15:38 | yazirian | jayunit100: 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:38 | tmciver | jayunit100: so does it? If not, it sounds like you just have a bug in your code relating to the var/local 'cell'. |
| 15:39 | jayunit100 | oh ok |
| 15:39 | jayunit100 | tmciver : its a bug in the code |
| 15:39 | jayunit100 | very sorry to spam you guys with my own mistake |
| 15:39 | jayunit100 | :( |
| 15:40 | jayunit100 | what is a "module" in clojure ? |
| 15:40 | TimMc | It isn't. |
| 15:41 | yazirian | jayunit100: if you started from 'lein new myproject' then you would have had a 'src/myproject/core.clj' file created for you |
| 15:41 | yazirian | importing myproject.core, that's a module |
| 15:41 | dnolen | patrikkarlin: that's not going to work, I probably need some context to understand what you're actually trying to do. |
| 15:43 | TimMc | jayunit100, yazirian: Clojure has namespaces, not modules. |
| 15:43 | jayunit100 | ok |
| 15:43 | TimMc | Perhaps it will get a module system in the future. |
| 15:43 | jayunit100 | and what is a clj file ? |
| 15:43 | jayunit100 | what place does that reserve in clojure code |
| 15:44 | TimMc | jayunit100: As far as you need to know at the moment, one file = one namespace. :-) |
| 15:44 | jayunit100 | Like in java --- class files have a specific role - they define a static namespace, etc... |
| 15:44 | jayunit100 | ok |
| 15:44 | antares_ | jayunit100: namespaces are very similar to Java packages |
| 15:45 | patrikkarlin | dnolen: 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:45 | jayunit100 | but i think, with namespaces, they can be physically spread apart, unlike packages. |
| 15:45 | antares_ | and most apps follow Java-like convention of "one namespaces per file" |
| 15:45 | antares_ | jayunit100: correct |
| 15:55 | sjl | So 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:55 | mk | amusing. That should be a bug report. |
| 16:01 | TimMc | sjl: Poke around in .lein I guess. |
| 16:02 | sjl | TimMc: yeah, I don't see anything in there that looks like a blacklist |
| 16:02 | jayunit100 | wow |
| 16:03 | mk | my .lein is empty |
| 16:04 | arohner | sjl: 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:06 | rudyl313 | how can I download a specific version of lein? |
| 16:06 | sjl | arohner: hmm, maybe, but lein plugin install is definitely failing when trying to install cljs-template, and not checking clojars |
| 16:07 | sjl | wait a second |
| 16:07 | sjl | ugh, it *says* "unable to find resource" but I think it actually succeeded |
| 16:19 | TimMc | yep |
| 16:19 | TimMc | Fails on one repo, succeeds later on another. |
| 16:19 | patrikkarlin | logic people is conde the best way to make multiple gools in a function or is there a simpler macro? |
| 16:24 | muhoo | or multiple gaols |
| 16:24 | dnolen_ | patrikkarlin: if by multiple goals you mean disjunction - yes. |
| 16:24 | patrikkarlin | and that macro is ? |
| 16:24 | dnolen_ | patrikkarlin: I mean yes, if you want disjunction you need conde. |
| 16:25 | patrikkarlin | i dont need branshing |
| 16:25 | patrikkarlin | (defn dist [i [h & t]] |
| 16:25 | patrikkarlin | (conde |
| 16:25 | patrikkarlin | ((!= i h) |
| 16:25 | patrikkarlin | (if (nil? t) |
| 16:25 | patrikkarlin | succeed |
| 16:25 | patrikkarlin | (dist i t))))) |
| 16:25 | dnolen_ | patrikkarlin: please use gist, lisppaste, refheap, etc. |
| 16:25 | patrikkarlin | i only have on branch but it has multiple goals |
| 16:25 | patrikkarlin | kk |
| 16:26 | dnolen_ | patrikkarlin: you can put multiple goals in fresh: (fresh [] g1 g2 g2) |
| 16:26 | patrikkarlin | o so i dont need to make new variables |
| 16:27 | dnolen_ | patrikkarlin: no, you can also use all: (all g1 g2 g3 ...) which just sugar for (fresh [] ...) |
| 16:27 | technomancy | sjl: yeah, repo blacklisting is just for a single run |
| 16:27 | patrikkarlin | nice |
| 16:27 | technomancy | i think in lein2 we'll have more control over output like that; a lot of the messages maven emits in lein1 are garbage |
| 16:29 | hugod | dnolen_: in core.match should ([& _] :seq) match a seq with arbitrary elements, or is there some other way to do that? |
| 16:30 | dnolen_ | hugod: that should probably work, still mulling over seq / vector matching. but I need like a whole free week to sort it out. |
| 16:31 | hugod | dnolen_: it gives "No method in multimethod 'to-source' for dispatch value: class clojure.core.match.RestPattern" at the moment |
| 16:32 | hugod | I guess I'll try and find a work-around |
| 16:32 | dnolen_ | hugod: feel free to open a ticket, that's probably an easy one. |
| 16:32 | hugod | ok, will do |
| 16:34 | dnolen_ | hugod: if it's easy I'll go ahead and fix that and cut a release. |
| 16:35 | hugod | dnolen_: thanks :) |
| 16:36 | dnolen_ | hugod: note there will be a breaking change in the release, in prep for predicate dispatch. there are now predicates and guards. |
| 16:36 | dnolen_ | code that uses :when will need to declare their predicates with defpred before using them. |
| 16:37 | mk | I just watched halloway's http://vimeo.com/10896148 - where can I find the second part presentation where he talks about state? |
| 16:37 | hugod | oo, I'll need to do some checking then |
| 16:37 | dnolen_ | you can optionally switch :when to :guard to get the old behavior |
| 16:37 | hugod | ok |
| 16:38 | kalle__ | 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:39 | mk | found it: http://vimeo.com/8672404 |
| 16:39 | dnolen_ | I'm realizing predicates will could be really. I think they can support arbitrary combinations of :and, :or, and :not |
| 16:39 | antares_ | kalle__: github.com/michaelklishin/langohr is well maintained |
| 16:39 | dnolen_ | really cool I mean. |
| 16:39 | melipone | I have a lein question. Is there a way to rename a project? Should I just change the name of the directories? |
| 16:39 | kalle__ | antares_: i'll take a look. thanks mate |
| 16:40 | TimMc | melipone: That's what I do. :-/ |
| 16:40 | hugod | dnolen_: http://dev.clojure.org/jira/browse/MATCH-55 |
| 16:40 | antares_ | 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:40 | hugod | dnolen_: predicates sound interesting :) |
| 16:41 | arohner | melipone: just rename the directories and change the name at the top of the defproject |
| 16:41 | antares_ | kalle__: tests should work reasonably well as examples |
| 16:41 | dnolen_ | hugod: yes, you could put a :not, and we can rewrite the following logical expression. |
| 16:41 | arohner | melipone: and at the top of each ns |
| 16:41 | melipone | arohner: okay, thanks. Just checking if there was a better way. |
| 16:41 | dnolen_ | hugod: thx |
| 16:42 | kalle__ | 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:46 | patrikkarlin | dnolen_: https://gist.github.com/2152689 there is a bether way to do this one right? |
| 16:47 | melipone | I didn't get an answer for my (easy) question earlier. Which library has the trace tools now for clojure 1.3.0? |
| 16:48 | fliebel | melipone: "the trace tools"? |
| 16:49 | melipone | fliebel: those that were in clojure.contrib.trace I guess |
| 16:49 | melipone | fliebel: deftrace |
| 16:49 | fliebel | melipone: there is a wiki page with the new names. |
| 16:50 | melipone | fliebel: url please? |
| 16:50 | hugod | dnolen_: is defpred the best name for something that doesn't declare a top level var? |
| 16:50 | fliebel | $google clojure new contrib |
| 16:50 | lazybot | [Clojure Contrib - Clojure Documentation - Clojure Development] http://dev.clojure.org/display/doc/Clojure+Contrib |
| 16:51 | melipone | fliebel: okay, thx. |
| 16:52 | dnolen_ | hugod: well at the moment it is a global lookup - kinda like default hierarchies for multimethods |
| 16:53 | antares_ | melipone: https://github.com/clojure/tools.trace |
| 16:53 | dnolen_ | hugod: do you have a better name in mind? |
| 16:54 | dnolen_ | hugod: whatever we come up w/ should probably at least consider the possibility of multiple hierarchies. |
| 16:54 | hugod | dnolen_: not really, maybe just predicate |
| 16:54 | hugod | I am likely to want to use them in a non-global context |
| 16:55 | dnolen_ | 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:55 | hugod | I can easily live with defpred |
| 16:56 | dnolen_ | 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:56 | hugod | sure |
| 17:02 | edw` | Has anyone made any progress on an Emacs-in-Clojure? The time is ripe. |
| 17:03 | technomancy | edw`: waiting for the concurrency branch to get merged into emacs trunk |
| 17:04 | edw | technomancy: Are you joking? I asked the question partially in jest. |
| 17:04 | dnolen_ | huh, sounds like Source Mapping in Chrome is 6 only weeks out, good news for CLJS |
| 17:04 | technomancy | edw: I haven't decided yet |
| 17:05 | technomancy | I don't have to decide whether I'm joking until the branch is actually merged. |
| 17:06 | edw | Looking at emacswiki.org. Contains e-mail excerpts from 1994... |
| 17:07 | edw | Is Emacs-in-Scheme going anywhere? technomancy, you thinking of writing an elisp interpreter/compiler in Clojure? |
| 17:08 | edw | (I like the sly lazy evaluation semi-joke, btw.) |
| 17:08 | technomancy | edw: I can't imagine it would be that difficult to adapt Nathan Sorensen's clojurescript for to elisp |
| 17:08 | technomancy | except for mutable strings; I have no idea what to do about those =\ |
| 17:08 | technomancy | but at least it has integers! so it's a wash I guess. |
| 17:09 | cemerick | are there any cases where (not= (aget js-obj "foo") (.-foo js-obj))? (assuming "-foo" is a valid symbol, no spaces, etc) |
| 17:09 | edw | What 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:10 | edw | But it's in JS... |
| 17:11 | technomancy | well if you beat me to it, I won't be disappointed |
| 17:12 | edw | I think an Emacs-in-the-browser-in-CLJS would be pretty easy, for a generous definition of easy. |
| 17:13 | technomancy | oh, never mind |
| 17:13 | technomancy | you're talking about going the other way |
| 17:13 | edw | And when I say "Emacs" I mean _an_ Emacs, something that acts like Emacs. |
| 17:13 | technomancy | yeah, I'm talking about elisp as a compilation target |
| 17:14 | mk | do you mean an editor that is hooked up to clojure? |
| 17:15 | mk | (as html is to javascript) |
| 17:15 | Raynes | In technomancy fantasy you'd be able to hack Emacs with Clojure. |
| 17:15 | sjl | Anyone know of any still-maintained clojure templating libraries I've missed here? https://gist.github.com/2022375 |
| 17:15 | edw | mk: 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:16 | fliebel | technomancy: 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:16 | technomancy | fliebel: except for mutable strings |
| 17:16 | TimMc | edw: Someone had better get a surface-syntax reader going. |
| 17:16 | technomancy | that's a disaster that's just not going away =( |
| 17:16 | amalloy | sjl: (fn [s] (str "<html><body>" s "</body></html>")) is a feature-rich one i just invented |
| 17:16 | mk | edw: link to talk? |
| 17:16 | eggsby | edw: great talk |
| 17:17 | TimMc | amalloy: Needs moar doctype. |
| 17:17 | eggsby | mk: vimeo.com/36579366 |
| 17:17 | edw | eggsby: Thanks. Beat me. |
| 17:17 | edw | TimMc: surface-syntax? |
| 17:17 | jimduey | We need a structural editor with Vim key bindings written in Clojure. :) |
| 17:17 | technomancy | elisp strings are so crazy |
| 17:18 | technomancy | they're fixed-length, but you can still aset on them =( |
| 17:18 | TimMc | &(pr-str (read-string "#()")) ; edw: This does not preserve surface syntax. |
| 17:18 | lazybot | ⇒ "(fn* [] ())" |
| 17:19 | edw | Ah. Yes, I was planning on supporting that. |
| 17:20 | TimMc | A reader that can preserve comments, whitespace, and reader macros would be useful in many projects. |
| 17:20 | pandeiro | is there a clever way to know the index with doseq? |
| 17:20 | edw | TimMc: But that's where I was going to lean on the browser: encoding the surface syntax in a DOM. |
| 17:21 | TimMc | I think there's a mismatch between those, nesting or not. |
| 17:22 | edw | Hmm? |
| 17:22 | TimMc | That is, I think the data models have a false similarity. |
| 17:23 | TimMc | I'm not prepared to defend that assertion, though. |
| 17:25 | edw | TimMc: 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:29 | mk | why is it worth pursuing such an editor in clojure, given that there are many other available editors? |
| 17:29 | edw | mk: There is one decent editor for Clojure. |
| 17:29 | mk | is it the repl? |
| 17:29 | edw | No, it is Emacs. |
| 17:30 | mk | right :) |
| 17:30 | mk | what's the problem with emacs? |
| 17:30 | rhc | edw: with respect to editing clojure, how is it better than vim? |
| 17:30 | Raynes | I'm fine with Vim. |
| 17:31 | edw | I love BBEdit--I'm even in the credits page--but it's just not up to structural editing. |
| 17:31 | edw | rhc: Paredit. |
| 17:31 | rhc | i was talking here yesterday about learning emacs |
| 17:31 | aperiodic | paredit.vim |
| 17:31 | Raynes | edw: Vim has paredit. |
| 17:31 | edw | Ah. OK. In that case... |
| 17:31 | rhc | keeps track of your parens or what? |
| 17:31 | lypanov | ah maybe i need to try that was missing it. |
| 17:31 | Raynes | edw: If you want to argue Emacs vs Vim, complain about VimL. |
| 17:32 | edw | But Riasstradh would be the first to admit, paredit is ghetto. |
| 17:32 | Raynes | Compared to elisp it is pretty atrocious. |
| 17:32 | Raynes | Well, compared to anything really. |
| 17:32 | edw | I'm not a vi hater; I didn't realize "you" had paredit on vi. |
| 17:32 | lypanov | Raynes: i'd like to port vim to in browser clojurescript just as i once did for ruby |
| 17:32 | TimMc | lypanov: paredit will blow your mind |
| 17:33 | amalloy | lypanov: paredit does better than that |
| 17:33 | lypanov | (though for ruby i did that with curses not in browser) |
| 17:33 | amalloy | it takes some getting used to, though. as soon as you type (, the matching ) appears |
| 17:33 | lypanov | neat. thats what i need. |
| 17:33 | edw | Once you have a sorta-structural editor, you want a real one. |
| 17:34 | lypanov | i'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:34 | muhoo | wow, couchdb is fantastic. thanks. |
| 17:34 | edw | I still manage to fuck up my buffers occasionally through improper killing and/or yanking. |
| 17:35 | TimMc | undo undo undo |
| 17:35 | mk | visual representations of languages are interesting, but I've never seen it done well |
| 17:37 | edw | mk: 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:37 | edw | Or if not syntax, at least form. |
| 17:37 | edw | "Syntax...that'll take a while." |
| 17:39 | mk | edw: why is that important? |
| 17:39 | lypanov | mk: 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:40 | rhc | lypanov: how do you like "joy of clojure"? |
| 17:40 | edw | Because doing it manually is a huge PITA. And it allows what people who write in Blub call "refactoring" to be done very efficiently. |
| 17:40 | mk | I'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:40 | lypanov | mk: 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:41 | lypanov | rhc: loving it. |
| 17:41 | lypanov | rhc: but actual coding is getting in the way alas ;) |
| 17:41 | mk | edw: 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:42 | mk | lypanov: do you have any examples of what sort of visual exploration you're thinking of? |
| 17:42 | lypanov | for lisp, why not enforce. nothing lost. semantically it can be incorrect but loss of syntax is silly with such minimal syntax. |
| 17:43 | lypanov | for e.g. ruby yes, i agree. |
| 17:43 | ivan___ | 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:43 | edw | I 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:43 | ivan___ | get* |
| 17:43 | lypanov | ivan___: 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:44 | lypanov | i'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:44 | lypanov | um, original ipad* |
| 17:44 | ivan___ | lazybot: well, i have a quad core i7 in my laptop, its faster than my equally expensive desktop heh |
| 17:44 | ivan___ | or |
| 17:44 | ivan___ | lol |
| 17:44 | ivan___ | oh* |
| 17:44 | mk | I'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:45 | ivan___ | lypanov: all this stuff about tablets replacing tv's, utter bs |
| 17:45 | patrikkarlin | i dont have a tv ;P |
| 17:45 | edw | mk: I'm simply arguing that the tools we're using are deeply retarded. |
| 17:45 | ivan___ | 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:45 | lypanov | edw: agreed. |
| 17:46 | mk | edw: I'm with you there, and I agree with your point about structure-awareness helping with that |
| 17:47 | sjl | So of all the many "Clojure version of Parsec" projects out there, are there any that are actively maintained? |
| 17:47 | dnolen | cemerick: you have to be careful with aget vs. property access, google advanced compilation will rename "static" properties making aget not work as expected. |
| 17:47 | eggsby | mr losh |
| 17:47 | eggsby | parsotron or w/e, right? |
| 17:47 | eggsby | nate youngs project |
| 17:47 | sjl | Parsatron is the one that looks like it has some recent activity a few months ago... |
| 17:47 | sjl | eggsby: yeah |
| 17:48 | eggsby | I would say that is your best bet |
| 17:48 | cemerick | dnolen: that makes things more interesting; I have an (aget obj "foo") that always works, and a (.-foo obj) that always returns nil. |
| 17:48 | mk | as for visual editors, yes, text is visual, but sometimes it just doesn't compare with a picture of some sort |
| 17:48 | sjl | eggsby: ok, cool, that's what I guessed. Just wanted to make sure I wasn't missing one |
| 17:50 | TimMc | edw: Structure-awareness gives you basic syntactic correctness, yes -- but much more importantly it allows you to think in structures, not strings. |
| 17:50 | sjl | eggsby: wasn't there a talk about it somewhere online, or am I thinking of something else? |
| 17:50 | eggsby | sjl: ya nate young gave a talk on it at strangeloop iirc |
| 17:50 | eggsby | sjl: http://www.infoq.com/presentations/Parser-Combinators |
| 17:50 | sjl | aha, found it http://www.infoq.com/presentations/Parser-Combinators |
| 17:51 | eggsby | :) |
| 17:51 | sjl | ha |
| 17:51 | mk | TimMc: how does one think in strings? |
| 17:51 | TimMc | When editing JS, etc. |
| 17:52 | mk | like, passing to an eval? |
| 17:52 | eggsby | structure seems more like the OO approach, doesn't it? Where engineering is likened to architecture, how would you visualize lisp? |
| 17:52 | mk | eggsby: a tree |
| 17:52 | eggsby | How would you visualize *verbs* |
| 17:52 | eggsby | mk: that would be really cool, ya |
| 17:53 | eggsby | If you could see the tree visualized real time |
| 17:53 | mk | eggsby: well, as far as the code goes, you somewhat do (you have the source) |
| 17:54 | eggsby | ya the code structure does mirror the tree structure, but I just mean visually the way we are used to seeing trees |
| 17:54 | mk | but there are all sorts of interesting things missing - the data, various thread interactions, performance metrics |
| 17:55 | eggsby | http://joelneely.files.wordpress.com/2011/03/foldtreeplain.jpg?w=312&h=271 |
| 17:55 | eggsby | like if I could visually see something like this rendered alongside my editor |
| 17:55 | mk | eggsby: or if it was your editor |
| 17:56 | edw` | 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:57 | lypanov | eggsby: while i like this for a repl. i don't think anything that departs from the presentation you edit in makes sense. |
| 17:57 | mk | lypanov: make it the presentation you edit in |
| 17:58 | mk | edw`: you're thinking via mouse drag and drop? |
| 17:58 | lypanov | mk: i was more thinking nested rectangles with function name in the corner |
| 17:59 | lypanov | imo layout of the params can provide a sufficient differentiation that most code could be layer out |
| 17:59 | lypanov | actual layout is a bitch yes. heuristic hell. but still i believe its good enough. |
| 17:59 | mk | lypanov: well, outlining functions in a way that you can pick out the 'visual space' the function takes up is a good thing |
| 18:00 | mk | this 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:00 | lypanov | *nod* |
| 18:01 | lypanov | though you don't actually need outer level boxes, they can be collapsed. |
| 18:01 | edw` | 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:01 | lypanov | only structurally separating boxes need to actually be rendered. most can be delineated by color. |
| 18:01 | lypanov | (fill color i mean) |
| 18:02 | mk | it can be cursor sensitive. The point is that you lose something when you take a few milliseconds to scan for the other paren |
| 18:02 | lypanov | or when you screw up the parens ( as i'm doing frequently ) because indent isn't enforced. |
| 18:03 | lypanov | does paredit.vim enforce indent? |
| 18:03 | mk | edw`: gotcha |
| 18:04 | aperiodic | lypanov: VimClojure has good indenting rules for clojure |
| 18:05 | lypanov | aperiodic: i use vimclojure but it doesn't really seem to enforce them. |
| 18:05 | lypanov | i think i'd like completely auto-indent/style |
| 18:06 | mk | something that's definitely missing is a mapping between what a programmer sees on the screen, and what's actually running |
| 18:06 | aperiodic | lypanov: mine auto-indents, but i can modify the indentation if i choose. not sure if that's what you want or not. |
| 18:07 | lypanov | aperiodic: yeah i mean after a ) having the entire block autoindent. |
| 18:07 | TimMc | Have y'all seen the code overview pane in Dr Racket? |
| 18:08 | mk | at 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:08 | Raynes | lypanov: =ab |
| 18:08 | TimMc | http://3.bp.blogspot.com/_gJUvnpacURg/SI-cUBJB31I/AAAAAAAAADw/k434suYJVQI/s320/Picture%2B5.png |
| 18:09 | TimMc | Not the best pic of it, but good enough. |
| 18:09 | lypanov | Raynes: thank you. |
| 18:10 | lypanov | Raynes: for debugging wtf i did wrong that'll save me an insane amount of time. double thank you. |
| 18:10 | mk | yeah, that's in that... black-themed editor that occasionally pops up on hn. Seems like you'd no longer need the scroll bars |
| 18:11 | TimMc | OK, better version: http://plt-scheme.org/screenshots/drscheme-env.jpg |
| 18:11 | mk | furthermore, why show all the code, anyway? Just show a heatmap of where you've been looking, and typing. |
| 18:11 | clojurebot | Gabh mo leithscéal? |
| 18:11 | lypanov | mk: sublime text. |
| 18:11 | mk | lypanov: yep, that's the one |
| 18:12 | lypanov | my favorite editor, though not for a language i care for, is the code bubbles ui. |
| 18:12 | jaen | This one java ide experiment? |
| 18:12 | lypanov | imo that sort of interaction, plus some touch ui is the "future". |
| 18:12 | lypanov | jaen: *nod* |
| 18:13 | mk | the 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:13 | jaen | It looked pretty cool in vids, haven't tried that though; in fact I thought there was no publicly available version |
| 18:16 | lypanov | jaen: they went vs-y http://blogs.msdn.com/b/camerons/archive/2012/01/31/debugger-canvas-1-1-released.aspx |
| 18:16 | sritchie | cemerick: figured it OUT |
| 18:16 | lypanov | (makes sense tbh given the reach) |
| 18:16 | sritchie | it's a really odd bug |
| 18:18 | jaen | Huh, vs-y? Are those the same guys? |
| 18:19 | jaen | I had an impression code bubbles was for java. Did they switch the sides or I just had wrong impression? |
| 18:19 | photex | holy crap… power went out at work… workstation is back up, but now clojure-jack-in fails with SIGFPE :( |
| 18:19 | sritchie | ibdknox: you offered critical help here, asynchronously |
| 18:19 | photex | lein repl works |
| 18:19 | sritchie | ibdknox: with a little comment down here: https://github.com/ibdknox/live-cljs |
| 18:19 | photex | something in .emacs.d perhaps? |
| 18:19 | photex | lein swank works |
| 18:19 | photex | arrrrrrrrg |
| 18:20 | mk | lypanov: 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:20 | photex | stupid southern california brown outs |
| 18:20 | sritchie | cemerick: it looks like the Clojurescript compiler gets AOT compiled under some conditions w/ Leiningen 1.7.0 |
| 18:20 | sritchie | not sure sure how |
| 18:20 | sritchie | but when it happens, the first time you try to save a view you get "assertion failed: can't recur here" |
| 18:20 | sritchie | and from then on the cljs compiler produces malformed cljs |
| 18:20 | sritchie | s/cljs/javascript |
| 18:20 | lypanov | sritchie: possibly unrelated but noir-cljs disables aot |
| 18:21 | emezeske | sritchie: The clojurescript compiler will not work when AOT-ed |
| 18:21 | lypanov | ah sorry now i see your ibdknox commentns |
| 18:21 | photex | error is raised in clojure-mode.el |
| 18:21 | sritchie | emezeske: I needed to AOT compile my main method, |
| 18:21 | photex | from clojure-jack-in-sentinel |
| 18:21 | emezeske | sritchie: There's a bug where some metadata is not saved in the AOT files that the compiler needs to work correctly |
| 18:21 | emezeske | sritchie: A clojure bug that is |
| 18:21 | sritchie | which is transitively aot compiling the cljs compiler after a couple of hops |
| 18:22 | lypanov | jaen: they worked with m$ research on it. yes it was previously eclipse |
| 18:22 | emezeske | sritchie: Yeah, that is the exact thing that prompted me to write lein-cljsbuild |
| 18:22 | lypanov | jaen: m$ are doing f'n crazy crap lately. |
| 18:22 | sritchie | emezeske: the issue here is the cemerick is using the compiler to generate views for CouchDB |
| 18:22 | sritchie | and that happens in-project |
| 18:22 | lypanov | (visual studio 11 beta has things like "inspect element" like hover over in web apps -> shows view code) |
| 18:22 | jaen | Well, I prefer C# over Java language-wise and quite the contrary VM and ecosystem wise. |
| 18:23 | jaen | Yeah, the web stuff in new VS is crazy ; d |
| 18:23 | sritchie | emezeske: lein-cljsbuild is great, I use it for my cljs |
| 18:23 | emezeske | sritchie: Ah, well then you're in a bind :/ |
| 18:23 | sritchie | emezeske: |
| 18:23 | sritchie | yup |
| 18:23 | sritchie | luckily views only have to be created once.... |
| 18:23 | sritchie | so I can just rm -rf classes/cljs |
| 18:23 | sritchie | emezeske: good to know, though, now I know what's up |
| 18:24 | emezeske | sritchie: I'm trying to track down the bug that breaks everything |
| 18:24 | sritchie | emezeske: it's a combo of that bug you described and clojure AOT compiling deps |
| 18:25 | emezeske | sritchie: http://dev.clojure.org/jira/browse/CLJ-130 is related I think |
| 18:26 | emezeske | sritchie: Yeah, exactly |
| 18:27 | lypanov | jaen: im(ns)ho m$ is getting a lot right lately. |
| 18:28 | lypanov | jaen: 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:28 | lypanov | i'd really like to an idiomatic knockout port for clojurescript |
| 18:28 | bsteuber | they better start doing something right :) |
| 18:29 | jaen | m$ is pushing for FRP? Now, that I didn't expect. |
| 18:29 | lypanov | jaen: majorly. |
| 18:29 | lypanov | *massive* push for async lately. |
| 18:30 | lypanov | bsteuber: they are. IE10. WP7. W8. etc. no clue what changed. but somehow... |
| 18:30 | jaen | Though they do have their ocaml knockoff |
| 18:30 | lypanov | f# 3.0 is adding some really sweet stuff. |
| 18:30 | jaen | So maybe they do feel some functional vibe |
| 18:30 | bsteuber | to be fair, .net already moves into a good direction for quite a while |
| 18:30 | lypanov | c# is getting more and more functional. |
| 18:30 | jaen | Any lsit of the sweet stuff? |
| 18:31 | bsteuber | f# is pretty neatr, too |
| 18:31 | bsteuber | oh you already said that ^^ |
| 18:31 | lypanov | jaen: i started watching http://channel9.msdn.com/, that has most of it |
| 18:32 | jaen | Uh, videocasts : D I'm always looking for "transcript" buttons on such pages : D |
| 18:32 | lypanov | still i wouldn't want it on my server platform. just think they have good ideas wrt languages and application building. |
| 18:32 | lypanov | jaen: i use mplayer at 1.7x while i tidy. |
| 18:33 | bsteuber | lypanov: Windows Phone is good now? hard to imagine.. |
| 18:33 | lypanov | bsteuber: just bought a nokia lumia and really loving it. everything that iPhone sucks for lacking that android couldn't make usable. |
| 18:33 | jaen | As for knockout.js - it seems like a really nice thing to me from cursory glances I had at it |
| 18:33 | bsteuber | I'm not sure whether I should be sad or confused M$ now makes more money from android than their own OS |
| 18:33 | jaen | And yes, it would be a nice thing to have a similar framework in idiomatic cljs |
| 18:34 | lypanov | jaen: using it in production and it led to 2x js code decrease. |
| 18:34 | lypanov | bsteuber: sad. |
| 18:35 | lypanov | jaen: i'll start on it whenever i finish JoC :) |
| 18:35 | jaen | Sounds like a good plan ; ) |
| 18:36 | bsteuber | knockout really seems cool |
| 18:36 | bsteuber | but weird to use html attrs for programming, though :) |
| 18:36 | lypanov | there are several others, e.g. backbone. |
| 18:37 | lypanov | bsteuber: i want haml style clojure view syntax eg blah{html-attrs}[ko-attrs] |
| 18:37 | lypanov | will extend hiccup whenever i get irrationally bored |
| 18:38 | bsteuber | lypanov: what's wrong with hiccup? |
| 18:38 | lypanov | lack of data-bind integration. don't want to see data-bind and its extra nesting level. |
| 18:38 | bsteuber | ah ok, thought sth. else in general |
| 18:38 | lypanov | no. |
| 18:38 | bsteuber | yes that would definitely rock |
| 18:39 | lypanov | i hated e.g. haml when i first saw it but eventually realized its the only sane pragmatic path |
| 18:39 | jaen | bsteuber: 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:40 | lypanov | jaen: not just rails. its a html5 thang. |
| 18:40 | lypanov | query was first imo. |
| 18:40 | lypanov | jquery* |
| 18:40 | bsteuber | jaen: must have missed that - but my web dev carrier is quite young.. |
| 18:40 | lypanov | (though maybe someone else was before even that) |
| 18:41 | lypanov | bsteuber: in case you haven't already seen, i'd advise http://www.flapjax-lang.org/publications/ |
| 18:42 | bsteuber | lypanov: thanks, I'll check it out |
| 18:43 | bsteuber | ah that's the scheme guy |
| 18:43 | bsteuber | shiriam krishnamurthi |
| 18:44 | jaen | As for haml, it's really cool if you consider the usual templating stuff |
| 18:44 | jaen | But since I've seen enlive I think it's even cooler |
| 18:45 | bsteuber | enlive always seemed too sophisticated for me |
| 18:45 | bsteuber | functions generating hiccup vecs are way simpler to use |
| 18:46 | bsteuber | well of course if you have to manipulate external html enlive is just great |
| 18:46 | bsteuber | so maybe it depends on whether or not you outsource the html to a designer |
| 18:46 | jaen | But then you loose all the potential webdesigners due to parenthesis angst ; D |
| 18:46 | bsteuber | ^^ |
| 18:46 | jaen | Yeah, this. |
| 18:47 | bsteuber | well in our project, we provide the html, and our designer does just css |
| 18:47 | bsteuber | works pretty well |
| 18:48 | muhoo | isn't cljs kind of the knockout/backbone thing? |
| 18:48 | lypanov | designers i know don't mind data-bind. |
| 18:48 | jaen | I find it really funny, that all the people at my university have parenthesis angst |
| 18:48 | lypanov | bsteuber: used to use pure.js |
| 18:49 | bsteuber | the funny thing is, even lispers have it |
| 18:49 | bsteuber | I found that when talking about Clojure with CL geeks |
| 18:49 | lypanov | overall 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:49 | bsteuber | "uh, it has other types of parens, scary.." |
| 18:49 | jaen | I sort of have it too, I appreciate the power of LISP but still somewhat wish it to have the usual syntax ~~' |
| 18:49 | jaen | bsteuber: hahaha |
| 18:50 | bsteuber | jaen: for how long are you using lisps? |
| 18:51 | jaen | I have more of casual interest in lisp. I've read SICP but never used it for anything big. |
| 18:51 | lypanov | muhoo: 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:51 | bsteuber | at least for most people, it goes away after a while |
| 18:52 | lypanov | bsteuber: took around 8 months of which 5 were practical |
| 18:52 | jaen | Though I'll be using Clojure for my neural network project this semester hoping I can learn it as I go along ; ) |
| 18:53 | lypanov | now clojure looks nicer to me than ruby. which since '00 has been my fave lang by far |
| 18:53 | lypanov | sorry i mean 8 months / 5 *weeks* |
| 18:54 | bsteuber | lypanov: I did have some fun with haskell between ruby and clj |
| 18:54 | bsteuber | before of which I did common lisp |
| 18:55 | bsteuber | but clj is my favorite language for 2 years now, that's probably a record :) |
| 18:55 | lypanov | i played with factor and applescript (of all things) in between. and a bit of scala. |
| 18:56 | muhoo | i've put in, so far, about 150 hours on clojure, and i'm finally starting to almost start thinking in it. |
| 18:56 | bsteuber | ^^ |
| 18:56 | lypanov | i actually had the experience of being 100% certain that scala was the Right Path. |
| 18:56 | lypanov | then trying to use it practically and giving up after 3 days. |
| 18:57 | bsteuber | I couldn't decide whether to pick scala or clojure |
| 18:57 | lypanov | played with clojure again for the hell of it and everything Just Worked |
| 18:57 | lypanov | mostly thx to lein and clojars |
| 18:57 | lypanov | clojuredocs.org/ is also absolutely wonderful |
| 18:57 | bsteuber | funny how things work out |
| 18:58 | lypanov | helps that i don't believe in docs and prefer code. |
| 18:58 | bsteuber | or IDE's ^^ |
| 18:59 | bsteuber | ok without emacs I'd probably be a sclarian now oO |
| 18:59 | lypanov | i do believe in IDEs else i wouldn't discuss visual representations. :) |
| 18:59 | lypanov | i used intellij for scala. |
| 18:59 | bsteuber | but back to reactive gui programming in cljs |
| 18:59 | lypanov | but was able to stick with vim for clojure thanks to the wonderful work thats been done on the vimclojure project. |
| 18:59 | bsteuber | if I want that, which path would you recommend? |
| 19:00 | bsteuber | probably just pick one js lib for that and generate the attrs nicely? |
| 19:00 | lypanov | bsteuber: a) wait until i figure it out, b) figure it out and i'll wait and you tell me |
| 19:00 | bsteuber | harr |
| 19:00 | Raynes | Three cheers for Meikel Brandmeyer. |
| 19:00 | lypanov | atm i have jquery/raphael/closure library experience |
| 19:00 | lypanov | Raynes: +++! |
| 19:00 | lypanov | and lots of ko.js + javascript. |
| 19:01 | lypanov | but i never fitted the two together. |
| 19:01 | lypanov | thats my next step but a good 2-3 months away. |
| 19:01 | bsteuber | usually when I need something, ibdknox has it on github the next day |
| 19:01 | lypanov | :P |
| 19:01 | lypanov | noir-cljs rocks. |
| 19:01 | bsteuber | so I'll just go to bed and check back tomorrow |
| 19:01 | bsteuber | ^^ |
| 19:01 | bsteuber | nice |
| 19:01 | bsteuber | how do you do css gen? |
| 19:01 | bsteuber | we're still using compass |
| 19:02 | lypanov | i'm using less js |
| 19:02 | lypanov | compass drives me absolutely crazy |
| 19:02 | bsteuber | but of course I'd prefer clojureland |
| 19:02 | jaen | I like stylus quite a bit |
| 19:02 | lypanov | our app is RoR + clojurescript |
| 19:02 | lypanov | but i'm making the move to RoR + clojure + clojurescript the last 2 weeks |
| 19:02 | jaen | Sass/Scss put me off when I saw that variables don't have scopes in it ; d |
| 19:03 | lypanov | jaen: yeah thats ugly. |
| 19:03 | lypanov | i put me off when i realized that basically it simply doesn't work. |
| 19:03 | lypanov | :P |
| 19:03 | lypanov | it* |
| 19:03 | lypanov | i like lessjs. it does the job. |
| 19:03 | eggsby | less seems to have the most momentum |
| 19:03 | eggsby | but I prefer stylus as well, I use less however :p |
| 19:03 | bsteuber | never heard of it before, interesting evening for me :) |
| 19:03 | lypanov | i'm going to play with https://github.com/edgecase/dieter in the near future. |
| 19:04 | lypanov | not a fan of old sass. prefer sass so stylus also not for me. |
| 19:04 | lypanov | like just pasting. |
| 19:05 | nDuff | I'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:05 | bsteuber | somehow embedding stuff like css compilation into ring middleware still seems strange to me |
| 19:06 | bsteuber | I would always prefer to have my build tool do this kind of stuff |
| 19:06 | cemerick | emezeske: won't work, as in, under no circumstances? |
| 19:06 | lypanov | :cache-mode :development ; or :production. :development disables cacheing |
| 19:06 | weavejester | bsteuber: Clojure is compiled on the fly, so why not CSS? :) |
| 19:06 | lypanov | i'm assuming this means that dieter won't do it anyway on the actual production server |
| 19:06 | lypanov | if you preload the resources |
| 19:07 | lypanov | does something like unicorn exist for clojure? |
| 19:07 | cemerick | oh, namespace metadata |
| 19:07 | bsteuber | weavejester: not the clojure I deploy on our server :P |
| 19:07 | lypanov | allowing me to bind something to a socket and kill the old after a bit? |
| 19:07 | weavejester | Dieter's a little curious though, as it's basically a Ring wrapper around its own custom middleware system. |
| 19:08 | weavejester | bsteuber: You AOT compile everything? |
| 19:08 | lypanov | i haven't any experience with it yet. it just popped up in search |
| 19:08 | emezeske | cemerick: Yeah, the clojurescript compiler inspects the :macros metadata on some Vars |
| 19:08 | lypanov | personally i use RoR assets at the moment and it precompiles all resources statically |
| 19:08 | bsteuber | weavejester: yes, but that's also because it's closed source |
| 19:08 | lypanov | (via closure compiler) |
| 19:08 | jaen | lypanov: stylus is pretty flexible about syntax - it can be anywhere between whitespace guided and css superset |
| 19:08 | emezeske | cemerick: Which apparently gets lost when AOTed |
| 19:08 | cemerick | emezeske: yup, http://dev.clojure.org/jira/browse/CLJ-130 |
| 19:08 | lypanov | jaen: ah, then i like :) |
| 19:08 | weavejester | bsteuber: Ohh |
| 19:09 | lypanov | jaen: superset is a real important feature for me |
| 19:09 | cemerick | reason #83 to avoid AOT |
| 19:09 | emezeske | cemerick: Yeah, that was my first real introduction to AOT pain |
| 19:09 | emezeske | cemerick: It would be nice if it were fixed though |
| 19:09 | bsteuber | weavejester: but I admit it might be nice not having to launch my watchers |
| 19:09 | cemerick | weavejester: thanks for taking in that pull req |
| 19:10 | lypanov | i shall kick myself to work faster on FRP now that i know there is interest |
| 19:10 | lypanov | at first it'll probably just be a lame externs file allowing knockout usage tho |
| 19:10 | cemerick | weavejester: 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:11 | bsteuber | lypanov: so just using a plain js lib for this won't work? |
| 19:11 | weavejester | cemerick: I'll do it tonight. |
| 19:11 | lypanov | bsteuber: you still need an externs file for advanced closure compiler to work. |
| 19:11 | cemerick | emezeske: fixing AOT transitivity is probably an easier fix, though that's long-standing as well. |
| 19:11 | cemerick | weavejester: my hero :-) |
| 19:11 | bsteuber | lypanov: that seems acceptable |
| 19:12 | bsteuber | well depending on the file size ^^ |
| 19:12 | emezeske | cemerick: Yeah, that would be good too |
| 19:13 | sandover | anyone have a handy example of using parsatron to do something real? |
| 19:15 | lypanov | bsteuber: ko is teeny. |
| 19:16 | lypanov | bsteuber: and we don't even locally have major issues with using non advanced as our base load never increases. |
| 19:16 | bsteuber | lypanov: so? |
| 19:16 | lypanov | bsteuber: (our site is a web app and not single-view driven) |
| 19:17 | lypanov | but certainly for something else e.g. a content site you'll need full advanced setup. |
| 19:17 | lypanov | wife 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:18 | bsteuber | lypanov: oh, also CET? |
| 19:18 | bsteuber | germany here |
| 19:18 | lypanov | bsteuber / jaen et all: enjoyable chat. thx guys. will stick something on github at some point and mention something somewhere :) |
| 19:18 | lypanov | bsteuber: .nl |
| 19:19 | bsteuber | I always wanted o drop by amsterdam clj group :) |
| 19:19 | bsteuber | maybe one day I will |
| 19:19 | bsteuber | ok, I'll go sleep as well |
| 19:19 | bsteuber | ^^ |
| 19:19 | bsteuber | bye everyone and thanks for the interesting links |
| 19:23 | eggsby | Grr, I'm still struggling with java interop. In what ways are (. target member) and target/member notation different? |
| 19:24 | dedeibel_ | eggsby: target/member is for static variable, like (Integer/parseInt "1") |
| 19:24 | eggsby | why 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:25 | tmciver | eggsby: target/member is for static member access. |
| 19:25 | muhoo | any ideas why this is giving me fits? https://refheap.com/paste/1265 |
| 19:25 | muhoo | it returns an seq of #<user$eval337$fn__338 user$eval337$fn__338@c67a88> |
| 19:25 | tmciver | you need (Math/PI) as PI is a static member of Math. |
| 19:26 | dedeibel_ | eggsby: maybe (. can do more than / - Classes are just kind of objects too in some use cases |
| 19:26 | muhoo | what is that usr#eval337 actually? |
| 19:26 | muhoo | <user$eval337$fn__337> yadda, |
| 19:26 | amalloy | you have a sequence of ten functions |
| 19:27 | muhoo | oh, they're not getting evaled |
| 19:27 | muhoo | got it |
| 19:27 | amalloy | well, ten copies of the same function |
| 19:27 | amalloy | &(doc repeatedly) ; muhoo |
| 19:27 | lazybot | ⇒ "([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:27 | muhoo | ok, 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:27 | Raynes | amalloy works faster when you use refheap. That should be incentive enough for people to use refheap. |
| 19:27 | muhoo | thanks! |
| 19:28 | muhoo | (not (= repeat repeatedly)), doh! |
| 19:28 | muhoo | perfect, thanks amalloy! |
| 19:31 | arohner | is there an inverse of bean? |
| 19:37 | TimMc | Someone was asking that... |
| 19:37 | TimMc | arohner: Ask gfrederi` |
| 19:39 | TimMc | arohner: https://github.com/fredericksgary/lib-2367 looks like it |
| 19:39 | arohner | TimMc: thanks, but not quite what I'm looking for |
| 19:40 | arohner | I have normal java classes that I call bean on, and I'd like to construct a new java instance from the map |
| 19:44 | TimMc | And that instance must implement certain interfaces, yes? |
| 19:44 | TimMc | Oh, you want to use the same class, got it. |
| 19:45 | TimMc | bean should be called unbean, and the inverse should be rebean |
| 19:49 | arohner | is there a non-special form for calling a java constructor? |
| 19:52 | TimMc | Making a macro? |
| 19:53 | technomancy | it'd be kinda cool if you could use into for that |
| 19:55 | aperiodic | i remember someone providing an example of calling a constructor via the reflector |
| 19:55 | arohner | TimMc: yes, I'm writing unbean/rebean |
| 19:56 | aperiodic | as an alternative to (eval `(ctor. ~@ctor-args)) |
| 19:56 | dnolen | huh, core.logic is nifty if you want to build wacky DSLs |
| 19:56 | arohner | aperiodic: I don't know the class name at compile time |
| 19:56 | dnolen | like a macro that takes english and generates Clojure code |
| 19:56 | aperiodic | arohner: ah, no dice, then |
| 19:56 | TimMc | arohner: "new" |
| 19:57 | TimMc | but again, only helpful if you're writing a macro |
| 19:58 | TimMc | oh hey |
| 19:58 | TimMc | &(.newInstance String) |
| 19:58 | lazybot | ⇒ "" |
| 19:58 | TimMc | arohner: ^ |
| 19:59 | arohner | TimMc: aha, thanks |
| 20:00 | arohner | looks like java.lang.reflect.Constructor.newInstance() is also possible, if arguments to the constructor are necessary |
| 20:00 | technomancy | any aleph pros know if aleph uses netty for framing? |
| 20:00 | amalloy | clojure.lang.Reflector has helper methods for that kind of thing |
| 20:02 | TimMc | $inc amalloy |
| 20:02 | lazybot | ⇒ 21 |
| 20:02 | TimMc | haha, Util.sneakyThrow |
| 20:08 | TimMc | &(.getMethod String "contains" (into-array Class [String])) |
| 20:08 | lazybot | java.lang.NoSuchMethodException: java.lang.String.contains(java.lang.String) |
| 20:08 | TimMc | &(.getMethod String "contains" (into-array Class [CharSequence])) |
| 20:08 | lazybot | ⇒ #<Method public boolean java.lang.String.contains(java.lang.CharSequence)> |
| 20:09 | TimMc | I see, I thought Class.getMethod did reflective matching for you. Now I see why c.l.Reflector exists. |
| 20:19 | RickInGA | style 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:20 | dnolen | wacky DSL parsing with core.logic, https://github.com/jonase/kibit/pull/20 |
| 20:20 | amalloy | RickInGA: 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:21 | technomancy | well |
| 20:21 | technomancy | keeping state on the stack, no atom at all |
| 20:22 | amalloy | well, "stack". i'd mostly keep it in lazy sequences |
| 20:22 | amalloy | (drop-while not-done? (iterate next-turn the-board)) |
| 20:22 | RickInGA | amalloy: never considered that. I am trying to envision it.... |
| 20:23 | RickInGA | amalloy that will be a very interesting project. |
| 20:24 | RickInGA | technomancy: thanks for answer, going to stick with passing board for now. |
| 20:25 | technomancy | the other option is to (reduce next-move initial-board move-seq) |
| 20:26 | RickInGA | that is such a cool idea I am going to have to do it. Good learning experience |
| 20:27 | technomancy | spoiler alert: assoc-in is your friend for dealing with vector-of-vector boards |
| 20:28 | RickInGA | its 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:28 | technomancy | if you're lucky, it's a project you can throw away |
| 20:29 | technomancy | some people end up haunted by it for years |
| 20:29 | RickInGA | good point… |
| 20:32 | muhoo | so when i connect to a repl using tcp, is that a separate thread of execution from the other repl in the shell? |
| 20:45 | ataggart | Has 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:06 | Zoka | For those of you have not seen it yesterday here it is again with bit more backgtound info: |
| 21:06 | Zoka | http://noirmon.herokuapp.com/ringmon/monview.html |
| 21:06 | Zoka | A web based interface to Cemerick's nREPL server incorporated within a typical Clojure web based application |
| 21:06 | Zoka | (in this case a Noir Blog sample app by ibdknox). Since Heroku, allows only |
| 21:06 | Zoka | one server TCP port per web app, this port (80) has to be shared between |
| 21:07 | Zoka | regular app traffic and nREPL server. The REPL interface at the browser is similar to CCW Eclipse Clojure plugin, |
| 21:07 | Zoka | it has 2 windows, one for submitting the Clojure forms and other (read only one) for nREPL responses. |
| 21:07 | Zoka | There is also a simple chat facility between active sessions. |
| 21:07 | Zoka | The REPL sessions are persistent, so if user goes offline, all his chat messages and accumulated |
| 21:07 | Zoka | Clojure script output belonging to his sesion will be delivered on next visit. Script execution in most of the cases can be |
| 21:07 | Zoka | stopped by 'Interrupt' button. There also tree alike monitoring data display for assorted JMX values, CPU load, and |
| 21:07 | Zoka | REPL sessions info. |
| 21:07 | Zoka | Note: this is not restricted environment like a Clojail - it is meant to be development tool and has |
| 21:07 | Zoka | a facility to hook in authentication function to control access in real-life usage. This is just a demo for |
| 21:07 | Zoka | https://github.com/zoka/ringMon/ which is in fact just a Ring middleware. |
| 21:07 | Zoka | You can kill it with one line of code, as somebody did yesterday :), |
| 21:07 | Zoka | but it will come back again in less than a minute. You can use a script to erase writeable files in app curent directory, |
| 21:07 | Zoka | but it will still come back again since Heroku uses ephemeral file system. Heroku apps are indistructable :) |
| 21:07 | Zoka | Sorry for the long ramble. |
| 21:07 | emezeske | Zoka: I think you meant to put that in a blog post :) |
| 21:08 | Zoka | I will taje it from logs:) |
| 21:08 | Zoka | s /taje/take/ |
| 21:08 | lstoll | Zoka: that's awesome. |
| 21:09 | technomancy | Zoka: definitely looking forward to trying that out soon |
| 21:09 | Zoka | Thanks |
| 21:09 | technomancy | also, your nick reminds me of http://zokacoffee.com, which is delicious |
| 21:10 | Zoka | No relation |
| 21:10 | technomancy | too bad, but I won't hold it against you =) |
| 21:11 | RickInGA | technomancy I told my gf about you bringing press and thermometer to session. she was really impressed with the thermometer |
| 21:11 | brehaut | i find it really weird that press coffee is so popular in america |
| 21:12 | brehaut | and that filter is run of the mill; over here its the other way round |
| 21:14 | tmciver | brehaut: where's 'over here'? England? |
| 21:14 | brehaut | New Zealand |
| 21:15 | tmciver | it's gotta be late for you. What time is it? |
| 21:15 | brehaut | 2:13PM |
| 21:15 | lstoll | middle of the day |
| 21:15 | brehaut | living in the future |
| 21:15 | lstoll | Living in the future is awesome |
| 21:16 | tmciver | you guys are so lucky. I can't wait till 2:13 tomorrow! |
| 21:19 | wmealing | lstoll, au ? |
| 21:19 | lstoll | wmealing: yeah, melbourne. |
| 21:21 | Frozenlock | Is 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:22 | Frozenlock | I would like a new line between each item : (flow-panel :items [ item-1 item-2 item3..] |
| 21:23 | RickInGA | Frozenlock: 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:24 | bytechunky | Does the upcoming book "Clojure Programming" from Chas Emerick et al cover Clojure 1.3.0? |
| 21:25 | Frozenlock | RickInGA: Thanks! |
| 21:26 | RickInGA | bytechunky: yes, the book "expects 1.3.0 or higher" |
| 21:28 | bytechunky | RickInGA: that's excellent! |
| 21:29 | RickInGA | bytechunky I have only looked at parts of it, but what I have read has been very helpful and very clear |
| 21:30 | RickInGA | I didn't understand the namespace macro until I read the explanation there |
| 21:31 | bytechunky | RickInGA: 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:41 | TakeV | Is there a way to turn symbols into strings? |
| 21:42 | apwalk | name |
| 21:42 | RickInGA | I have a function with a let in it. If I write (let (fn1 … ) (for ….) (fn2…) fn1 and fn2 get called. |
| 21:42 | RickInGA | If I write (let (fn1 …) (for …) fn1 and teh for loop get called |
| 21:42 | TakeV | apwalk: Thank you. |
| 21:43 | RickInGA | but I can't seem to get fn1, for and fn2 to all get called |
| 21:46 | tmciver | RickInGA: I don't follow. Perhaps you can refheap some sample code. |
| 21:48 | sjl | Anyone know why this wouldn't work? https://refheap.com/paste/1269 |
| 21:48 | sjl | Is this `thrown?` thing in a Clojure test magical and unable to be used in a macro or something? |
| 21:50 | amalloy | RickInGA: laziness |
| 21:50 | tmciver | sjl: I'm not very good with macros but have you tried macroexpand-1 on a call to the macro? |
| 21:50 | amalloy | sjl: yes |
| 21:51 | RickInGA | tmciver: it is verbose… but here it is: https://refheap.com/paste/1270 |
| 21:51 | sjl | amalloy: 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:51 | RickInGA | amalloy: adding another function call after the 'for' causes the for to not be evaluated? |
| 21:51 | amalloy | not exactly |
| 21:52 | amalloy | you're using `for` for side effects, which it is not designed for |
| 21:52 | amalloy | you should use a doseq for that |
| 21:52 | amalloy | (now don't you wish you'd taken the advice to do this with pure functions) |
| 21:52 | RickInGA | amalloy: thanks, I will try that |
| 21:52 | RickInGA | amalloy: hehe, do you think tic-tac-toe has an "explode" function? |
| 21:53 | amalloy | sjl: include the (is) in your macro |
| 21:53 | sjl | amalloy: I tried that -- same error (no such var: .../thrown?) |
| 21:54 | amalloy | oh |
| 21:54 | amalloy | ~'thrown? |
| 21:54 | clojurebot | No entiendo |
| 21:54 | technomancy | brehaut: I actually like the (hand-poured) filter better, it just doesn't travel as well |
| 21:54 | RickInGA | technomancy: kemex filter? |
| 21:55 | technomancy | RickInGA: yeah |
| 21:55 | technomancy | also, aeropress is a lot nicer than french press IMO |
| 21:55 | RickInGA | technomancy: too funny, when I told gf the story, she said "I am surprised he doesn't use kemex" |
| 21:56 | technomancy | heh |
| 21:56 | technomancy | as long as you get the temp right aeropress is basically impossible to screw up; pour overs are a lot more temperamental. |
| 21:56 | RickInGA | damn, now I want coffee, and its like 10pm :( |
| 21:57 | pandeiro | is aeropress the italian style one that percolates up? |
| 21:57 | technomancy | pandeiro: no, that's siphon |
| 21:58 | brehaut | technomancy: yeah, hand poured filter is my preference too (ive got a small chemex) |
| 21:59 | brehaut | and preferably with single origin beans |
| 22:00 | technomancy | that's the way to go |
| 22:00 | brehaut | definately |
| 22:01 | RickInGA | I hope next year Clojurewest is in Seattle so I can find out what technomancy's favorite coffee is! |
| 22:01 | brehaut | my local roaster gets 'cup of excellence' beans for particular farms |
| 22:01 | brehaut | s/for/from/ |
| 22:02 | technomancy | I had a travel grinder for this trip, so that was nice |
| 22:02 | pandeiro | here in brazil the siphon is popular, i had a french press back in the states, but for me nothing beats instant |
| 22:02 | technomancy | heh |
| 22:02 | brehaut | ~guards |
| 22:02 | clojurebot | SEIZE HIM! |
| 22:03 | RickInGA | should be able to pass a parameter |
| 22:03 | RickInGA | ~guards pandeiro |
| 22:03 | clojurebot | It's greek to me. |
| 22:03 | pandeiro | the guards all drink instant, too RickInGA it's no use |
| 22:04 | xeqi | sjl: that doesn't work because (is ..) has a special case when the first item in the list is 'thrown |
| 22:04 | technomancy | must be tough being an IRC guard |
| 22:04 | xeqi | and it does it as part of is's macroexpansion |
| 22:04 | technomancy | single-ply toilet paper, instant coffee... at least you get a fast network connection |
| 22:04 | xeqi | before parse-error would expand |
| 22:04 | technomancy | xeqi: that drives me nuts |
| 22:04 | sjl | xeqi: ahh |
| 22:05 | technomancy | thrown needs to be its own defmacro; it's stupid to special-case it |
| 22:05 | sjl | xeqi: is there any way around that? |
| 22:06 | brehaut | technomancy: what is siphon coffee like? |
| 22:06 | xeqi | looking/thinking |
| 22:07 | technomancy | brehaut: it's basically like a science experiment: https://twitter.com/#!/technomancy/media/slideshow?url=http%3A%2F%2Fyfrog.com%2Fo0s1ngj |
| 22:07 | technomancy | bunsen burner and all |
| 22:08 | brehaut | technomancy: amazing |
| 22:08 | brehaut | how does it taste? |
| 22:08 | pandeiro | wait how's it different from a kettle? it's just a kettle with a coffee filter in it |
| 22:08 | pandeiro | brehaut: sedimenty \thats a word |
| 22:09 | brehaut | it looks kinda like a stove top espresso but more complicated? |
| 22:10 | pandeiro | cleaning it is the only complicated part |
| 22:10 | technomancy | it tastes like SCIENCE |
| 22:10 | brehaut | bahaha |
| 22:10 | pandeiro | instant? |
| 22:10 | pandeiro | instant is science |
| 22:11 | brehaut | enough of this instant trollery |
| 22:13 | RickInGA | oh? is instant karma going to get him? |
| 22:13 | pandeiro | i 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:14 | pandeiro | i think the reason paper is best is the smell, at least with the italian one it doesnt fill the kitchen the same way |
| 22:18 | RickInGA | amalloy: thanks, doseq worked! |
| 22:19 | Frozenlock | If 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:33 | xeqi | sjl: you could do something like https://refheap.com/paste/1271 |
| 22:34 | xeqi | where you special case parse-error the same way as thrown |
| 22:34 | xeqi | but thats all I can think of |
| 22:34 | sjl | xeqi: ah... seems a bit ugly, but it works... |
| 23:14 | technomancy | Zoka: lein pom && mvn dependency:tree should help you track down the hiccup dep |
| 23:24 | xeqi | technomancy: pomegranate can figure out a dependency tree; know anyone working on a plugin for lein 2? |
| 23:25 | xeqi | might need to add that to my task list |
| 23:28 | technomancy | xeqi: cemerick has a gist, it's just not hooked up yet |
| 23:28 | technomancy | I'd like to add it to the deps task; maybe "lein deps :tree" |
| 23:51 | rhc | question 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? |