2012-03-20
| 00:00 | muhoo | speaking of dubstep, bassnectar apparently had a hand in designing that controller. |
| 00:01 | muhoo | gfredericks: it's a device you use to trigger overtone :-) |
| 00:01 | gfredericks | oh so it's like a repl |
| 00:03 | muhoo | i had a bit of a revelation when i realized that a kline in supercollider is basically a lazy seq |
| 00:06 | TimMc | muhoo: I'm still trying to figure out synth vs. inst |
| 00:19 | rhc | Raynes: (if you care.. or anyone else) here is what i was working on as a learning exercise: https://github.com/matthavener/KrailjOS |
| 00:26 | muhoo | i really should dive in to overtone. i suspect that instead of feeling like a total idiot, as i do in for example 4clojure, i might be on familiar territory working with oscillators, filters, synths, control voltages and midi and such. |
| 00:48 | muhoo | supercollider running, connected to my existing jackd setup. repl launched. overtone in the hizzy. |
| 01:04 | scottj | arohner: couldn't the pdf of your slides, don't know if it's only my machine. |
| 01:05 | Raynes | rhc: Nice! |
| 01:05 | arohner | scottj: accidentally the whole word? |
| 01:05 | Raynes | rhc: Did you have any problems with irclj? |
| 01:06 | arohner | scottj: hrm. I'm getting an error too. I'll try re-uploading |
| 01:14 | arohner | scottj: I've re-uploaded, here https://github.com/arohner/clojurewest2012-slides/commit/584ea79a0280278a0b11091b04b8fb4086e6a2d3 |
| 01:15 | scottj | arohner: works, thanks |
| 01:32 | aphyr | Got an opinion question; should a network client (just a wrapper around a socket with open/do-some-io/close operations) be an immutable or mutable object? |
| 01:34 | aphyr | IMHO it will make multi-caller coordination easier if I handle locking within the client itself and allow it to be mutable |
| 01:34 | aphyr | But I want to check and see if there's a preferred, immutable pattern. |
| 01:34 | tomoj | what do you mean by "mutable"? |
| 01:34 | tomoj | in clojure/java terms |
| 01:35 | aphyr | Mutable in the sense that a client object has internal, changeable state like which socket it wraps. |
| 01:35 | tomoj | e.g. do you mean implementing some mutable object in java and using it from clojure? |
| 01:35 | aphyr | I was thinking about writing it as a deftype, actually. |
| 01:35 | tomoj | using that funky option that lets you go mutable? |
| 01:35 | tomoj | or just using e.g. atoms? |
| 01:35 | aphyr | Probably atoms. |
| 01:36 | aphyr | Though maybe I'll just write a mutable java client and wrap it with a clojure protocol. |
| 01:36 | aphyr | Just curious what the pure-clojure approach would look like |
| 01:37 | tomoj | I can't really imagine what you are imagining, so I'm not sure, but if you did stick atoms in a deftype, you don't have to handle locking, and it's not exactly mutable |
| 01:38 | groovemonkey | I just want to say that I LOVE Clojure. |
| 01:38 | groovemonkey | Good night! |
| 01:39 | aphyr | (let [opened (open client)] (send opened some-msg) (close client)) |
| 01:39 | aphyr | vs |
| 01:39 | aphyr | (open client) (send client some-msg) (close client) |
| 01:40 | aphyr | Basically a question of where the responsibility for coordinating access belongs; with the callers, or with the client itself, I guess. |
| 01:40 | tomoj | synchronous io? |
| 01:41 | aphyr | The underlying socket ops do have to be synchronized. |
| 01:41 | aphyr | (just to prevent parallel invocations from writing their messages over each other) |
| 01:42 | _ato | (with-open [conn (open "someserver")] (send conn "hello!")) |
| 01:42 | tomoj | and the threads all block on writes/reads |
| 01:42 | aphyr | Strictly speaking no, the protocol supports both synchronous and async operations. |
| 01:43 | tomoj | the interfaces above wouldn't work for async, would they? |
| 01:43 | aphyr | No, that's a simple example. |
| 01:43 | aphyr | The async version would probably return a future from (send client) |
| 01:44 | tomoj | if you need to support async io you might look at aleph/lamina |
| 01:44 | aphyr | I'm writing this to replace an aleph client. :) |
| 01:44 | aphyr | Performance issues. |
| 01:44 | tomoj | ah, just curious, which version were you using? |
| 01:44 | aphyr | latest snapshot |
| 01:45 | aphyr | ztellman and I were talking a couple weeks ago, know he's made significant improvements to lamina but aleph is on the back burner ATM |
| 01:45 | tomoj | I was trying to remember recently whether the perf rewrite of lamina already is in place for that aleph snapshot.. do you happen to know? |
| 01:45 | tomoj | ah |
| 01:46 | aphyr | Basically I want to implement this sucker in java, in pure clojure, and on top of aleph |
| 01:46 | aphyr | Then I can benchmark and determine which is worth supporting |
| 01:46 | tomoj | hmm.. "pure clojure" |
| 01:46 | aphyr | <sigh> |
| 01:46 | tomoj | that means writing a new netty wrapper or bare nio? |
| 01:46 | aphyr | Yeah, either a netty handler or on top of DatagramSocket & friends |
| 01:47 | aphyr | I've already got my netty UDP server written and it smokes the pants off lamina |
| 01:47 | tomoj | in pure clojure? |
| 01:47 | aphyr | by like 2 orders of magnitude, haha |
| 01:47 | aphyr | Clojure wrapping netty handler with proxy, yeah |
| 01:47 | tomoj | cool |
| 01:47 | aphyr | I figure that's a pretty good tradeoff for my sanity vs performance |
| 01:48 | aphyr | 620K ops/sec |
| 01:49 | tomoj | so here you have multiple client threads sharing one udp socket? |
| 01:49 | aphyr | Yeah. Well, later it's gonna be a connection pool |
| 01:49 | aphyr | But for now one socket |
| 01:50 | tomoj | I guess it is still unclear how to do this kind of stuff in pure clojure.. |
| 01:51 | aphyr | Yeah, in fact most of the clojure IO I see in the wild is just calling into mutable java objects |
| 01:51 | tomoj | I mean, lamina is one attempt, and there are a few others, but I've gotten the impression that people think the design problem hasn't really been solved well yet |
| 01:51 | aphyr | Which I think makes sense, for performance and code clarity |
| 01:52 | aphyr | Yeah, and lamina is the other big one. I think Lamina itself has a ton of potential, even if aleph is immature at present. |
| 01:53 | tomoj | have you seen cljque? |
| 01:53 | aphyr | No! *googles |
| 01:53 | tomoj | https://github.com/stuartsierra/cljque/ |
| 01:54 | tomoj | I don't know what a client looks like there |
| 01:54 | tomoj | or.. would look like? not sure if it's even that far yet |
| 01:54 | aphyr | Yeah... the discussion on async events is fascinating too |
| 01:55 | tomoj | I tried to grok cljque a while back but gave up for now |
| 01:56 | aphyr | urrrgh, more problems than answers, haha |
| 01:56 | aphyr | Maybe I'll dive into the pure-java client for now, see if that clears my mind any |
| 01:58 | tomoj | I really want to understand conal elliot's frp, and I see some similarity to cljque in it, but he's way above my head |
| 02:08 | devn | cljque is a lot of thinking |
| 02:08 | devn | lamina is a lot of thinking |
| 02:08 | devn | cljque has inspirations that stem from the RX framework a la Erik Meijer |
| 02:10 | tomoj | we have a partial rx port floating around here |
| 02:10 | tomoj | I don't really like the idea of a direct port |
| 02:10 | devn | clojurescript one has some FRP in it |
| 02:10 | clojurebot | Titim gan éirí ort. |
| 02:11 | tomoj | as in, events and behaviors? |
| 02:12 | devn | *nod* |
| 02:12 | devn | it's *inspired* by FRP |
| 02:12 | devn | that doesnt mean it embodies it exactly, mind you |
| 02:14 | muhoo | the aliens have landed |
| 02:14 | muhoo | (demo 60 (sin-osc [(mouse-x 500 5000) (mouse-y 100 1000)])) |
| 02:15 | tomoj | whereabouts? |
| 02:15 | muhoo | on the moon http://www.youtube.com/watch?v=eJDJ1ALa9Eo |
| 02:15 | tomoj | heh, I mean, where is the frp in one? |
| 02:16 | tomoj | oh, dispatch.cljs? |
| 02:16 | muhoo | frp? |
| 02:16 | muhoo | fiberglas-reinforced plastic? |
| 02:17 | tomoj | so just events, no behaviors |
| 02:17 | tomoj | the ways in which behaviors would be useful are still mostly obscure to me |
| 02:28 | emezeske | muhoo: functional reactive programming |
| 02:54 | muhoo | emezeske: thanks |
| 04:36 | sorenmacbeth | could someone help me out calling this macro from a function |
| 04:36 | sorenmacbeth | https://gist.github.com/39313f6f35935a2e27a3 |
| 04:37 | sorenmacbeth | the class-name var in the let binding isn't getting eval'd |
| 04:37 | sorenmacbeth | when passed to the macro. I know it has something to do with compile time vs macro expansion time |
| 04:37 | sorenmacbeth | but I can't figure out how to make it work |
| 05:00 | Sindikat | hello everyone! i try to do 'clojure-jack-in' in Emacs, but get errors "Debugger entered--Lisp error: (error "Could not start swank server: ;;; Bootstrapping bundled version of SLIME; please wait...". Emacs version 24.0.94.1 |
| 05:12 | Sindikat | i previously did "lein plugin install swank-clojure 1.3.4" |
| 05:15 | hoeck | sorenmacbeth: so the task of bootstrap-schema is to define a couple of defn's? Should that happen at the time you start the application? |
| 05:16 | sorenmacbeth | yes |
| 05:16 | sorenmacbeth | hoeck: correct |
| 05:17 | hoeck | sorenmacbeth: so it depends on the programs input at startup, or is it always the same? |
| 05:18 | sorenmacbeth | hoeck: it depends on a some Java classes that may change |
| 05:19 | Sindikat | nevermind i found the solution |
| 05:21 | hoeck | sorenmacbeth: then I think mk-property-tap should be a function returning the taps, and bootstrap-schema should be a macro calling mk-property-tap, emitting these defs |
| 05:23 | sorenmacbeth | hoeck: that might be fine expect that mk-property-tap is naming the functions it's defining names on the params, which a defn can't do |
| 05:24 | hoeck | sorenmacbeth: mk-property-tap should return the code for these defns |
| 05:25 | sorenmacbeth | hoeck: ah, return an anonymous fn and then name it in bootstrap-schema you mean |
| 05:25 | hoeck | no, just the code |
| 05:25 | hoeck | and then, in a macro, call the function (which returns the code) |
| 05:26 | tomoj | sorenmacbeth: what is it exactly a defn can't do? |
| 05:26 | tomoj | use `/~/~@? |
| 05:26 | hoeck | $((fn [x] `(defn ~x [] 'foo)) 'a) |
| 05:27 | hoeck | where are the bots? |
| 05:27 | Sindikat | how to find documentation on defproject macro using clojure repl? |
| 05:27 | sorenmacbeth | Sindikat: defproject is part of leiningen |
| 05:27 | clgv | ,((fn [x] `(defn ~x [] 'foo)) 'a) |
| 05:27 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT> |
| 05:28 | clgv | &((fn [x] `(defn ~x [] 'foo)) 'a) |
| 05:28 | lazybot | ⇒ (clojure.core/defn a [] (quote clojure.core/foo)) |
| 05:28 | clgv | clojurebot seems to be ill, still |
| 05:28 | hoeck | sorenmacbeth: you don't have to wrap all your code-generating functions as macros. Just write a function which returns the code and then use a defmacro to call this function at compiletime |
| 05:28 | hoeck | &((fn [x] `(defn ~x [] 'foo)) 'a) |
| 05:28 | lazybot | ⇒ (clojure.core/defn a [] (quote clojure.core/foo)) |
| 05:29 | sorenmacbeth | hoeck: ok, I think I understand |
| 05:29 | sorenmacbeth | hoeck: thanks for the help |
| 05:29 | hoeck | sorenmacbeth: youre welcome |
| 05:30 | Sindikat | hmm |
| 05:30 | Sindikat | when i try to 'clojure-jack-in' in Emacs, i get this error: "error in process filter: Symbol's value as variable is void: slime-clj" what does that mean? |
| 05:33 | sorenmacbeth | hoeck: ha, all I had to do was change mk-property-tap to defn instead of defmacro and it worked fine |
| 05:34 | hoeck | sorenmacbeth: great, thats actually good style, generating code with a couple of small functions and only use the defmacro to call them |
| 05:34 | jtoy | I'm a clojure newb, i am just testing my code with leon repl and vim, when I change the code, i must quit the repl and reload it to see my changes, how do i fix this? |
| 05:42 | llasram | jtoy: For your current env, check out the the :reload and :reload-all flags to require |
| 05:43 | llasram | jtoy: But you'll probably want to integrate vim with your REPL |
| 05:43 | jtoy | llasram: ok, thanks, ill research some more |
| 05:51 | jtoy | silly question, how do I tell clojure to return a list of 1? (1) doesn't work |
| 05:52 | llasram | Idiomatically, you usually will want a vector: &[1] |
| 05:52 | llasram | Er, |
| 05:52 | llasram | [1] |
| 05:53 | llasram | But you can quote a list: '(1) |
| 06:11 | tomoj | I forgot about cucumber in clojure |
| 06:12 | Sindikat | why doesn't (require 'clojure.contrib) work in repl? |
| 06:13 | llasram | lazybot: contrib? |
| 06:13 | llasram | Man, I wish I remembered how to trigger it's snippet |
| 06:14 | clgv | ~contrib |
| 06:14 | clojurebot | Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go |
| 06:14 | llasram | Ah! |
| 06:14 | llasram | Thank you, clgv :-) |
| 06:14 | clgv | topics on clojurebot are always via ~ |
| 06:14 | llasram | Got it |
| 06:14 | raek | Sindikat: there is no namespace called "clojure.contrib" |
| 06:14 | Sindikat | does that render all references to (require 'clojure.contrib) in Programming Clojure unusable? :) |
| 06:15 | clgv | Sindikat: no, not at all. just use clojure 1.2.1 and contrib 1.2.0 and play with those examples |
| 06:15 | raek | you have to require the specific namespace you want to use, for instance clojure.contrib.base64 |
| 06:16 | raek | Sindikat: are you using leiningen? if not, you should. you can tell it to use the older versions of clojure and contrib for your project. |
| 06:16 | Sindikat | raek: i try to (require 'clojure.contrib.str-utils), says it's not in classpath |
| 06:16 | raek | Sindikat: then you can follow the tutorial or book you are reading |
| 06:16 | raek | Sindikat: how did you start clojure? |
| 06:16 | raek | (contrib is not included in clojure itself) |
| 06:16 | Sindikat | i did |
| 06:17 | raek | Sindikat: you use leiningen? |
| 06:17 | Sindikat | lein plugin install swank-clojure 1.3.4 then in emacs clojure-jack-in |
| 06:17 | raek | Sindikat: ok, you need to add clojure-contrib to the project.clj file |
| 06:17 | raek | the default project.clj template does not include it |
| 06:18 | raek | Sindikat: also, clojure.contrib.str-utils has been deprecated in favor of clojure.string since clojure 1.2 |
| 06:18 | Sindikat | now it looks like :dependencies [[org.clojure/clojure "1.3.0"][org.clojure/clojure-contrib "1.3.0"]]) |
| 06:18 | raek | Sindikat: there is no monolithic contrib for clojure 1.3 |
| 06:18 | raek | monolithic contrib has been split up into separate projects |
| 06:19 | Sindikat | anyway, i want to have the latest code, i can manage inconsistencies |
| 06:19 | raek | so you can either adapt to the new approach (recommended if you are writing something new) or use an older version of clojure and contrib (perhaps easier if you want to follow a book, etc) |
| 06:20 | raek | Sindikat: as clgv mentioned, this page lists the new projects: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go |
| 06:21 | Sindikat | raek: so what is the recommended behavior? list dependencies in project.clj then run lein deps? |
| 06:21 | raek | yes |
| 06:22 | Sindikat | btw, why does 'lein search foo' takes forever? i have lein 1.7.0 |
| 06:22 | raek | does it say that it is downloading the index? |
| 06:23 | raek | it has to download the maven index once, and that takes a *long* time |
| 06:23 | Sindikat | yep |
| 06:24 | raek | the latest [group/artifact "version"] info should be mentioned in the readme of the dependency |
| 06:33 | Sindikat | trying to find anything about (doc) function on clojure.org, nothing |
| 06:34 | llasram | Sindikat: It's unfortunate, but the clojure.org site isn't all that useful. For annotated online documentation, I recommend http://clojuredocs.org/ |
| 06:35 | llasram | Although it doesn't have any more than the doc tring for `doc', unfortunately http://clojuredocs.org/clojure_core/clojure.repl/doc |
| 06:36 | Sindikat | llasram: in slime repl (doc ...) doesn't work: "Unable to resolve symbol: doc in this context" |
| 06:36 | _ato | I think it was moved to clojure.repl in 1.3 |
| 06:36 | _ato | http://clojure.github.com/clojure/clojure.repl-api.html#clojure.repl/doc |
| 06:36 | llasram | Ah, try first: (use '[clojure.repl :only [doc]]) |
| 06:37 | llasram | Or maybe even just (use 'clojure.repl) |
| 06:37 | Sindikat | why doesn't (require 'clojure.repl) (clojure.repl.doc 'clojure.string) work? |
| 06:38 | _ato | clojure.repl/doc |
| 06:39 | Sindikat | cool, thanks |
| 06:48 | _ato | Clojure uses "namespace/name", similar I guess to the way some other languages might write it "Clojure::REPL.doc". Whereas Java tends to use "." for everything, like "clojure.repl.doc" which is sort of weird when you think about as there's no way to distinguish where the package ends and the class begins (hence I guess the capitalized class naming scheme). The whole "clojure.repl" could be a class or just the "clojure" could be a class and "repl" a static field |
| 06:51 | kij | Hey, could this: http://www.youtube.com/watch?v=-xJl22Kvgjg (source maps) work with clojurescript ? |
| 06:57 | _ato | kij: I think that's been on the clojurescript todo list from the beginning, it was mentioned a lot around the initial release. Probably nobody has implemented it yet as the browser support didn't exist (until now?) |
| 07:36 | solussd | any suggestions for a compelling example of clojure multimethods to demonstrate to a group of c# programmers? |
| 07:48 | si14 | is there any reasonable library for dealing with datetime objects in clojurescript? |
| 08:05 | si14 | and yes, it looks like there aren't ordered maps in cljs. |
| 08:07 | si14 | it's very, very sad. |
| 08:10 | jaen | solussd: can't think of anything else than writing an equivalent of a visitor pattern with multimethods, dunno if that's compelling |
| 08:10 | sharat87 | si14, what aspect of Date objects are you concerned with, won't any js libraries (with a few macros) do? |
| 08:11 | solussd | yeah… problem is showing the feature off without also introducing several other clojure features that would only serve to confuse/distract from the main point |
| 08:12 | solussd | currently ripping off the 'coerce' example from 'programming clojure' (thanks stuart!) |
| 08:12 | sharat87 | solussd, also, there is a good one in the "Joy of Clojure" book |
| 08:13 | llasram | solussd: My go-to example is usually serialization. You can have multiple serializer functions which are all independent from each other and from their implementations for any given type. All completely orthogonal through multimethods or protocols |
| 08:13 | solussd | llasram: hah. yeah, I'm actually using serialization to demonstrate protocols and records |
| 08:14 | llasram | Ah, ok :-) |
| 08:15 | raek | solussd: you could make a simple expression evaluator |
| 08:16 | raek | something like (eval-expr '(- (* a 2) 1) {'a 3}) => 5 |
| 08:16 | raek | it doesn't treally make use of the "multi" part of multimethods |
| 08:17 | solussd | hmm. how does that take advantage of multimethods though |
| 08:17 | solussd | yeah |
| 08:17 | llasram | solussd: If you're already explaining protocols, then you could just hand-wave multimethods as a complete generalization of argument-based polymorphic dispatch with similarly independent implementations. But I guess you want a concrete example? |
| 08:18 | solussd | llasram: yeah, I think the coerce example will work fine |
| 08:36 | solussd | how can I get a list of java interfaces implemented by a type in clojure? |
| 08:37 | raek | solussd: call supers on the class |
| 08:37 | raek | &(supers (class '(1 2 3))) |
| 08:37 | lazybot | ⇒ #{clojure.lang.ASeq java.util.Collection clojure.lang.Sequential java.lang.Object clojure.lang.Seqable clojure.lang.IPersistentCollection clojure.lang.Counted java.util.List java.io.Serializable clojure.lang.ISeq clojure.lang.IPersistentList clojure.lang.IPersistent... https://refheap.com/paste/1231 |
| 08:37 | solussd | thanks |
| 08:38 | raek | in my expression example the relevant types are java.lang.Number, clojure.lang.Symbol, and clojure.lang.ISeq |
| 08:54 | si14 | sharat87: ok, maybe it will be enough. |
| 08:54 | si14 | sharat87: just wondering if there is something already done. |
| 08:55 | sharat87 | si14, cljs is fairly new, so there is a small chance that would exist. I haven't used cljs seriously enough, so I wouldn't know. Maybe you should make one ;) |
| 09:19 | true_droid | :as works only in let? I get an error when trying to define a function like this: (defn fun ([x y :as lst] …)) |
| 09:21 | raek | true_droid: yes. you can compare (fn [x y z] ...) to (let [x ... y ... z ...] ...). the parameters are destructured separately |
| 09:22 | raek | true_droid: but you can also use & |
| 09:23 | raek | (defn fun [&[x y :as lst]] ...) |
| 09:23 | llasram | ooh, nice hack |
| 09:23 | raek | then the function can also take any number of arguments (not only 2) |
| 09:24 | raek | including zero and one arguments |
| 09:27 | true_droid | raek: it's a nice syntax, but the semantic changes depending on the ways args are passed |
| 09:27 | true_droid | http://pastebin.com/N6fijqat |
| 09:30 | llasram | true_droid: The normal multi-implementation dispatch is based on number of arguments. You're circumventing that by taking any number of arguments as a seq so you can destructure it. If you need both, you'll need to write your own dispatch logic using multimethods |
| 09:30 | llasram | But that wouldn't be too difficult |
| 09:33 | true_droid | llasram: I see, thanks for the explanation |
| 09:34 | true_droid | could anyone take a look at this implementation of mergesort and point out obvious blunders? https://gist.github.com/2135276 |
| 09:38 | true_droid | I've just found one myself: I should split-at into vectors prior to (map mergesort …) so that each recursive call gets a vector that can be counted in O(1) |
| 09:39 | true_droid | but, it might take an O(n) to put a seq into a vector, right? |
| 09:40 | true_droid | these seqs are tricky to get right |
| 09:55 | clgv | true_droid: not that tricky. putting the seq in the vector means realizing completely. Hence, O(n) effort. |
| 09:57 | true_droid | clgv: yeah, it makes sense. I guess it's better to pass the input seq to a subfunction which in turn takes an additional 'count' argument |
| 09:58 | true_droid | we can then perform arithmetics on that argument and leave the sequence alone |
| 09:59 | clgv | true_droid: (if (seq xs) ...) is the idiomatic version of (if (nil? (next xs)) ...) |
| 09:59 | clgv | true_droid: ah well you have to switch the then and else case |
| 09:59 | raek | (empty? xs) is also defined as (not (seq xs)) |
| 10:00 | clgv | true_droid: you can shorten that 'if to (when (seq xs) ...do...sorting...) |
| 10:00 | clgv | except if you really need to return an empty seq if 'xs was empty |
| 10:01 | true_droid | thanks, raek and clgv, I'll remember that |
| 10:01 | clojurebot | I don't understand. |
| 10:01 | clgv | clojurebot: why? |
| 10:01 | clojurebot | Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone |
| 10:16 | rhc | Raynes: no problems so far, though I did notice there's no way to distinguish between a user saying ACTION something and a user doing /me ACTION |
| 10:44 | lynaghk | pandeiro: C2's basic (unify!) function works in ClojureScript, but there are some issues with clojure/clojurescript code sharing that I need to work out for the helpers (scales, &c.) |
| 10:45 | lynaghk | Also, the CLJS isn't packaged in the snapshot JAR, so if you want to use it you'll need to include it as a lein checkout. |
| 10:46 | gfredericks | is there a clean way to created a namespaced keyword dynamically? |
| 10:46 | rhc | Raynes: err, ACTION something and /me something |
| 10:46 | gfredericks | i.e., without repeating the ns-name as a fragile string literal |
| 10:46 | gfredericks | I assume (keyword (str *ns*) "foo") wouldn't work |
| 10:46 | pandeiro | lynaghk: i copied the cljs src straight into my project's src dir, the problem is the cassowary dep -- i think c2.layout needs it? |
| 10:48 | lynaghk | yes, but everything in c2.layout is within a big (comment) block = ) |
| 10:48 | pandeiro | lynaghk: oh am i using stale c2? :) |
| 10:48 | lynaghk | pandeiro, yeah, it sounds like you might be. |
| 10:49 | clgv | gfredericks: why not? |
| 10:49 | lynaghk | CLJS stuff will hopefully be much cleaner within the next fortnight or so. |
| 10:49 | clgv | &(keyword (str *ns*) "foo") |
| 10:49 | lazybot | ⇒ :sandbox6997/foo |
| 10:49 | pandeiro | lynaghk: hmm, actually the ns declares the dep |
| 10:49 | pandeiro | that's what's tripping of the google compiler |
| 10:49 | pandeiro | lynaghk: dont worry bout it |
| 10:49 | pandeiro | i figured youd be documenting the cljs side of things soon |
| 10:50 | TimMc | &(with-meta :foo {:bar true}) |
| 10:50 | lazybot | java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to clojure.lang.IObj |
| 10:50 | lynaghk | pandeiro: I just pushed a fix. |
| 10:50 | TimMc | OK, good. |
| 10:50 | lynaghk | pandeiro: we're using c2 on two client projects right now, so any cljs cleanup will be for purely selfish motives don't worry = ) |
| 10:51 | pandeiro | lynaghk: well allow me to reap the benefits then :) |
| 10:51 | pandeiro | lynaghk: any idea what i'd need to change to modify the choropleth example to a map of brazil? |
| 10:52 | pandeiro | i got the shapefiles i needed, turned them into lean ("lean") geoJSON |
| 10:52 | lynaghk | There is a world map in the Vomnibus depedency |
| 10:52 | lynaghk | oh, if you already have that then you're pretty much set. |
| 10:52 | pandeiro | yah i needed municipal data |
| 10:52 | pandeiro | yeah i got it |
| 10:52 | pandeiro | but the problem i have are the coordinates |
| 10:52 | pandeiro | is that just as simple as modifying one of the vals in alpers? |
| 10:52 | pandeiro | eg coordinates? |
| 10:52 | lynaghk | if you can do it in clj, that would be cleaner since it is all working in there. |
| 10:52 | gfredericks | clgv: I assume that when you call that function from another namespace that *ns* would not be what you expect |
| 10:52 | pandeiro | lynaghk: sure i will do it there |
| 10:52 | pandeiro | my problem is that brazil shows up way down south in the svg |
| 10:53 | pandeiro | since the alpersUsa is oriented to show the US at its lat/lng i imagine |
| 10:53 | clgv | gfredericks: what exactly are you doing? you can also do (keyword any-string "foo") |
| 10:53 | lynaghk | in c2.geo.core there is a (geo->svg) function that will take a projection and a geoJSON structure (in clojure, not JSON) and return SVG path data (for use with svg path's d attribute) |
| 10:53 | pandeiro | lynaghk: cool i will check that out first |
| 10:54 | lynaghk | pandeiro: the albers constructor takes kwargs for origin and parallels, so you can centre it on brazil |
| 10:54 | gfredericks | clgv: just assembling a ::foo dynamically to avoid repetition; but just realized I know a way to run it at code-load time instead of every time the function is called, so that'll be good enough |
| 10:54 | TimMc | gfredericks: *ns* is a var -- it should take the value of the top-level namespace. |
| 10:54 | pandeiro | lynaghk: beautiful that's what i needed, thanks |
| 10:55 | lynaghk | pandeiro: np. If you do anything particularly clever with it be sure to send me a link so I can start collecting a community-examples page. |
| 10:55 | gfredericks | TimMc: so if I say (ns foo) (defn make-keyword [] (keyword (str *ns*) "haha")) (ns bar) (make-keyword); what'll I get? |
| 10:55 | TimMc | &(require '[clojure.string :as s]) |
| 10:55 | lazybot | ⇒ nil |
| 10:55 | gfredericks | well |
| 10:55 | TimMc | &::s/foo |
| 10:55 | lazybot | java.lang.RuntimeException: Invalid token: ::s/foo |
| 10:55 | pandeiro | lynaghk: i'm just starting out with vis but i got some interesting data from the brazil 2010 pop census i am going to be playing with |
| 10:55 | gfredericks | (ns bar (:use foo)) I should have said |
| 10:55 | pandeiro | i'll definitely show you what i come up with |
| 10:56 | lynaghk | pandeiro: rad, good luck |
| 10:56 | TimMc | gfredericks: Try it and tell me! |
| 10:56 | gfredericks | TimMc: you betcha! |
| 10:57 | gfredericks | did you know that before computers the word "repl" referred to a person? |
| 10:57 | TimMc | ha |
| 10:57 | gfredericks | version control required a whole team of secretaries |
| 10:58 | RickInGA | if & triggers lazybot and , triggers clojurebot, what is the prefix to trigger TimMcbot? |
| 10:58 | gfredericks | TimMc: yes indeed the *ns* has changed to bar |
| 10:58 | TimMc | CHOCOLATE |
| 10:58 | RickInGA | CHOCOLATE(+ 1 2) |
| 10:58 | gfredericks | so the function returns :bar/haha |
| 10:59 | TimMc | RickInGA: 3 |
| 11:00 | RickInGA | nice... kind of high latency though |
| 11:00 | TimMc | It's greek to me. |
| 11:00 | gfredericks | TimMc: spin up another instance of TimMcBot for higher throughput |
| 11:00 | TimMc | Oh, sorry - I thought you were addressing me. |
| 11:03 | clgv | gfredericks: I still dont get what your actual problem is^^ |
| 11:03 | gfredericks | clgv: so what I will end up doing is creating a helper function like (def make-keyword (partial keyword (str *ns*))) |
| 11:04 | gfredericks | which has a different behavior from (defn make-keyword [s] (keyword (str *ns*) s)) |
| 11:24 | clgv | gfredericks: thats because partial is a function. so the current value at definition time is passed to partial and not the variable *ns* |
| 11:25 | gfredericks | clgv: yes; my original question was how do I avoid the behavior of the latter |
| 11:25 | clojurebot | Cool story bro. |
| 11:25 | clgv | gfredericks: defn ^^ |
| 11:26 | gfredericks | clgv: I was hoping there was a simpler way to get the compile-time namespace |
| 11:26 | gfredericks | but it seems a helper function or macro is the only way |
| 11:27 | clgv | compile-time namespace of what? you have different compilation times in your scenario: compilation of the helper and compilation of the call to the helper... |
| 11:27 | gfredericks | clgv: of the helper |
| 11:28 | gfredericks | the namespace of the file I'm creating the keyword in |
| 11:28 | gfredericks | there's really only one namespace I'm concerned about, I just know that by runtime *ns* will be something else |
| 11:28 | TimMc | Man, a bare #= does weird things on the REPL. |
| 11:28 | gfredericks | so I can't get anything interesting from *ns* at runtime |
| 11:29 | clgv | gfredericks: and why do you have to use *ns* then. you could also just use partial with the string of the only *ns* you consider for that |
| 11:29 | gfredericks | CHOCOLATE#=(str "foo") |
| 11:29 | gfredericks | clgv: you mean with a string literal? |
| 11:29 | clgv | yeah |
| 11:30 | gfredericks | clgv: I wanted to avoid the repetition; avoid bugs that would creep in if I ever changed the ns |
| 11:30 | clgv | ah kk |
| 11:30 | pelleb | My oauth2 provider library is starting to reach a usable state. I'd really love feedback. https://github.com/pelle/clauth |
| 11:31 | TimMc | gfredericks: SANBOX DENIED |
| 11:49 | gfredericks | technomancy: where are all your fabeled alternate paredit bindings? they don't seem to be in your dotfiles repo |
| 12:06 | juhu_chapa | Hi clojurians, Any help to use leiningen with a socks proxy? |
| 12:16 | sritchie | cemerick: sent you a pull request |
| 12:16 | sritchie | cljs views worked great, btw |
| 12:16 | sritchie | cemerick: ad-hoc-views seems broken, unfortunately |
| 12:16 | cemerick | on cloudant, you mean? |
| 12:16 | cemerick | or everywhere? |
| 12:16 | sritchie | cemerick: locally as well |
| 12:17 | sritchie | I filed a ticket with my error |
| 12:17 | cemerick | hum; ok |
| 12:17 | sritchie | using the cljs maven artifact works great, though |
| 12:17 | cemerick | thanks for the pull req, I'll take a look tomorrowish |
| 12:21 | cemerick | dammit, fliebel had a pull req on the same topic a month ago, but I never got an email for it, either |
| 12:21 | cemerick | github notifications are so g.d. broken |
| 12:21 | fliebel | cemerick: ?? |
| 12:21 | lazybot | fliebel: What are you, crazy? Of course not! |
| 12:21 | ibdknox | cemerick: yeah they are :( |
| 12:22 | cemerick | fliebel: the pull req you sent a month ago on cluch-clojurescript: I didn't know about it, because I didn't get a mail about it |
| 12:22 | fliebel | cemerick: I didn;t know about it either, let me check what i did :) |
| 12:22 | cemerick | sritchie just redid it likely for no reason |
| 12:23 | sritchie | fliebel: whoops, didn't see htat |
| 12:23 | cemerick | ibdknox: it was one thing when I was getting spammed, it's another when I don't even know about pull reqs and people end up duplicating work unnecessarily. |
| 12:23 | fliebel | cemerick: Oh, that, right... |
| 12:24 | ibdknox | we used github at RFZ, and most of the time it worked great, but it was never clear what would and would not send an email |
| 12:24 | ibdknox | so things ended up misplaced at times :/ |
| 12:25 | cemerick | fliebel, sritchie: I'm sorry for the snafu. |
| 12:26 | sritchie | better be, you bastard |
| 12:26 | fliebel | snafu? |
| 12:26 | cemerick | ibdknox: I've got all the notification checkboxes on, nothing in the spams, and I get other less valuable github emails constantly. |
| 12:26 | sritchie | cemerick: just kidding, deleting a few directories is no problem :) |
| 12:27 | cemerick | well, it's unnecessary |
| 12:27 | cemerick | Contributions are too valuable to lose to not getting an email out to the repo owner. |
| 12:28 | fliebel | I wonder if it's just broken, or part of some magic workflow... In case your name is Linus Tovalds. |
| 12:32 | Karl_dscc | hi, i have a question... is it correct that the funktion 'into acts this way: http://pastebin.com/WtU9ZxER ? ...i am just confused that it handles a vector different to a list |
| 12:33 | sritchie | Karl_dscc: looks like it's conjing each element of the second list onto the first |
| 12:33 | sritchie | ,(conj '(1 2 3) 4) |
| 12:33 | Hali_303 | hi! |
| 12:34 | clojurebot | (4 1 2 3) |
| 12:34 | raek | Karl_dscc: yes. (into x y) is the same as (reduce conj x y), and conj will do different thing depdending on the type of x |
| 12:34 | gfredericks | Karl_dscc: I think it's somewhat the point of into that it treats different structures differently |
| 12:35 | raek | also, the type of the second argument to 'into' is not relevant, except that it must be seqable |
| 12:35 | Hali_303 | I've got a series of tests and if a test passes I'd like to add a key-val to a map. Are there some built-in function that will help me implement this? |
| 12:35 | raek | Hali_303: try 'assoc' |
| 12:36 | raek | &(assoc {:a 1, :b 2} :c 3) |
| 12:36 | lazybot | ⇒ {:c 3, :a 1, :b 2} |
| 12:36 | TimMc | Hali_303: and or |
| 12:36 | TimMc | or rather, and |
| 12:36 | raek | for the conditional part, use if |
| 12:36 | TimMc | Hali_303: What happens if a test fails? |
| 12:37 | raek | (if some-test (assoc m ....) m) |
| 12:37 | Hali_303 | the rest should be still evaluated and added |
| 12:37 | Hali_303 | so I was thinking about using the -> operator, I just don't know how to combine the if into the assoc |
| 12:38 | raek | -> is just a shorthand notation. you need to be able to express it without -> first |
| 12:38 | Hali_303 | raek: oh I see, i should just return the input map |
| 12:38 | Hali_303 | ok, thanks :) |
| 12:38 | Hali_303 | I'll try |
| 12:39 | raek | you can do something like (let [m0 ..., m1 (if x (assoc m0 ...) m0), m2 (if y (assoc m1 ...) m1)] ...m2...) |
| 12:39 | raek | this resembles assignment in imperative languages a bit |
| 12:40 | dgrnbrg | how do i set the JVM that lein uses? |
| 12:40 | technomancy | dgrnbrg: JAVA_CMD |
| 12:40 | technomancy | environment var |
| 12:40 | kurtharriger | When using emacs and clojure-jack-in is it possible to have it automatically run a clj file to do common tasks like (use 'clojure.repl) and define few helper functions? |
| 12:40 | dgrnbrg | technomancy: thanks |
| 12:40 | Hali_303 | yes.. I guess i still think imperatively, because I forgot to think about the case when if returns the map unchanged :) |
| 12:41 | dgrnbrg | technomancy: I point that at java, and it'll pick up javac too? |
| 12:41 | technomancy | I don't know; maybe |
| 12:41 | ibdknox | java logging is retarded |
| 12:42 | RickInGA | ibdknox: have you ever used korma with a .dbf? |
| 12:43 | ibdknox | what's a .dbf? |
| 12:43 | RickInGA | foxpro free table |
| 12:43 | RickInGA | I take it that's a no :) |
| 12:43 | technomancy | kurtharriger: it should run the :repl-init ns, but it can't affect *ns* |
| 12:43 | ibdknox | haha no :) |
| 12:43 | ibdknox | RickInGA: in theory, if there's a jdbc driver for it, it would maybe work |
| 12:44 | RickInGA | what keys are acceptable for defdb? will :connectionstring work? |
| 12:44 | clgv | technomancy: is a 1.7 update with the "(if (windows?)" patch out yet? |
| 12:45 | technomancy | clgv: waiting to see if anyone else has other issues that should make it in, but should be out by the end of the week |
| 12:46 | Hali_303 | if there some setting in paredit to show the pair of the parenthesis the cursor is currently on? |
| 12:47 | ibdknox | RickInGA: it needs these: https://refheap.com/paste/1235 |
| 12:47 | raek | Hali_303: does show-paren-mode do what you want? |
| 12:48 | gfredericks | raek: it does what _I_ want! |
| 12:48 | Hali_303 | raek: yes :) thanks |
| 12:49 | Hali_303 | I tought that paredit will do it by itself |
| 12:50 | RickInGA | ibdknox: I found an example for connecting to .dbf in java here: http://stackoverflow.com/questions/8064937/what-is-the-best-opensource-dbf-driver-for-java |
| 12:51 | RickInGA | ibdknox: I am not sure how fox specifications translate to Korma. I may have to get it working without korma first, and then try and adapt later |
| 12:51 | ibdknox | RickInGA: subprotocol: odbc:Driver={Microsoft dBASE Driver (*.dbf)};DefaultDir=E |
| 12:51 | ibdknox | RickInGA: subname: \\db |
| 12:52 | ibdknox | I think |
| 12:52 | RickInGA | ibdknox: thanks, I will try that |
| 12:53 | clgv | technomancy: good to hear :) |
| 13:00 | pandeiro | ibdknox: i went and hacked the cljs-template to use noir 1.3 beta 1 and it breaks because of hiccup i think... stacktrace is weird though |
| 13:00 | pandeiro | i changed out the requirements in views/common and main and still it is looking for hiccup.page-helpers |
| 13:00 | ibdknox | pandeiro: ah, I should go change that for the latest hiccup, but yes that's probably the issue |
| 13:01 | pandeiro | wish i could help but i'm kinda stumped by this, stacktrace points to app.server:1 |
| 13:02 | ibdknox | pandeiro: just change hiccup.page-helpers to hiccup.page |
| 13:02 | pandeiro | ibdknox: yeah did that |
| 13:02 | ibdknox | still broken? hm |
| 13:02 | ibdknox | one sec |
| 13:04 | technomancy | clgv: https://github.com/technomancy/leiningen/issues/455 is also blocking 1.7.1 |
| 13:06 | clgv | technomancy: just tried that one on Ubuntu and cant reproduce |
| 13:07 | technomancy | clgv: apparently it's specific to java7 |
| 13:07 | ibdknox | pandeiro: ah, the issue is in noir-cljs |
| 13:07 | ibdknox | pandeiro: fixing |
| 13:08 | clgv | technomancy: that might be the cause. I am still using java 6 |
| 13:08 | pandeiro | ibdknox: interesting, i was thinking it might be somewhere in noir |
| 13:12 | ibdknox | pandeiro: use noir-cljs 0.3.0 |
| 13:14 | pandeiro | ibdknox: you put it on clojars before even updating github? |
| 13:14 | RickInGA | ibdknox: looks like I am running into a driver issue unrelated to korma. I think when (if) I get my driver fixed, I should be able to use what you told me to work with Korma. Thanks for the help. |
| 13:14 | pandeiro | ibdknox: nm :) |
| 13:15 | ibdknox | sometimes I do |
| 13:18 | pandeiro | it would be cool if grep could look through jars |
| 13:19 | dan_b | unzip -c foo.jar | grep # ? |
| 13:19 | dan_b | actualyl -p might be better than -c |
| 13:20 | pandeiro | dan_b: yeah but no comparison between that and `grep -r needle` |
| 13:20 | dan_b | true |
| 13:24 | hagna | can I write to #<URL jar:file:...> or should I not bother |
| 13:26 | hagna | seemed like a good place for application configuration data |
| 13:35 | sorenmacbeth | can someone tell me how to get this function to actually execute the Cons, instead of just returning it? |
| 13:35 | sorenmacbeth | https://gist.github.com/a3445412323faa490f3a |
| 13:36 | TimMc | sorenmacbeth: defmacro |
| 13:37 | TimMc | (defmacro def-edge-tap ...) |
| 13:38 | sorenmacbeth | TimMc: I make it a defn because the params I'm passing to mk-edge-tap are inside a let binding, so it passes in the vars themselves and not their eval'd equivalents |
| 13:39 | TimMc | sorenmacbeth: So put that (let [md ...]) inside the syntax quote. |
| 13:39 | TimMc | Make sure to gensym# the bindings. |
| 13:40 | sorenmacbeth | TimMc: ahhh, I see |
| 13:40 | sorenmacbeth | TimMc: I'll try that |
| 13:40 | sorenmacbeth | TimMc: cheers |
| 13:40 | TimMc | :-) |
| 13:48 | Hali_303 | is there any article on error handling in clojure? eg. if there is a function that cannot calculate any result, should I throw an exception or return nil? |
| 13:49 | Hali_303 | eg. the function parses a string, but the parse fails |
| 13:51 | emezeske | Hali_303: The idiomatic thing to do is almost always to return nil I think |
| 13:51 | emezeske | Hali_303: It's much easier to do an "if-let" when calling a function than to do a try..catch |
| 13:52 | hagna | emezeske: yeah no kidding |
| 13:54 | Hali_303 | emezeske: true |
| 13:56 | raek | Hali_303: in some cases it makes sense to return nil, but when it doesn't, use the "slingshot" library |
| 13:56 | raek | something like it will probably be merged into clojure eventually |
| 13:57 | raek | I think parsing is a case where it makes sense |
| 13:58 | cemerick | raek: did you ever end up writing an openid auth library/wrapper? |
| 13:58 | ibdknox | cemerick: Raynes has something I thikn |
| 13:58 | raek | cemerick: no, are you sure it was me? |
| 13:58 | cemerick | ibdknox: I think he opted for BrowserId; but hey, if Raynes has something, I'm all ears. |
| 13:59 | ibdknox | ah |
| 13:59 | raek | (I did think about it at some point, though) |
| 13:59 | cemerick | raek: http://clojure-log.n01se.net/date/2010-07-25.html |
| 13:59 | ibdknox | I think you're right |
| 14:00 | cemerick | I'd very much like to avoid trying to integrate spring-security with ring-jetty-adapter |
| 14:08 | pandeiro | ibdknox: is there any need for the lein-cljsbuild plugin when using the cljs-template? |
| 14:09 | ibdknox | pandeiro: if you're doing crossovers, yeah. I mainly included it for ease of starting a repl, though I added a repl ns that makes that painless |
| 14:10 | pandeiro | ah it already has a repl ns? |
| 14:11 | ibdknox | (noir.cljs.repl/browser) |
| 14:11 | ibdknox | run that from a normal lein repl |
| 14:11 | ibdknox | and you're off to the races |
| 14:12 | pandeiro | would it be possible for me to add that to :repl-init in the project.clj i wonder |
| 14:15 | pandeiro | cool that works |
| 14:17 | ibdknox | that would be neat with profiles |
| 14:17 | pandeiro | how do you mean? |
| 14:17 | ibdknox | create a cljs profile that runs that whenever you start the repl |
| 14:17 | ibdknox | lein2's profiles |
| 14:18 | ibdknox | then I could add that to the template by default |
| 14:18 | ibdknox | and you could start either a cljs repl or a normal one depending on which profile you use |
| 14:19 | pandeiro | how do you specify that? in the project clj? |
| 14:20 | ibdknox | are you using lein2? |
| 14:20 | pandeiro | nope not yet |
| 14:20 | pandeiro | do you recommend making the jump already? |
| 14:20 | ibdknox | ah, it's only for lein2. But yeah, you'd just specify it in the project.clj |
| 14:20 | ibdknox | not quite yet |
| 14:20 | ibdknox | you could install it side-by-side |
| 14:20 | pandeiro | ibdknox: imo it's simple enough to have a (browser) invocation to jump from clj to cljs repl |
| 14:21 | ibdknox | yep |
| 14:21 | ibdknox | I agree for now :) |
| 14:21 | pandeiro | i just like not having to change namespace |
| 14:21 | pandeiro | (and remember which namespace the repl fns are in) |
| 14:23 | sorenmacbeth | in the following macro, how can I get fn-name# to expand to in binding? |
| 14:23 | sorenmacbeth | https://gist.github.com/6e5207df3c22fc7db19e |
| 14:23 | sorenmacbeth | I don't what the name of the defn to be fn-name__auto__234234 |
| 14:24 | sorenmacbeth | s/what/want/ |
| 14:25 | sorenmacbeth | I want to be the symbol that fn-name# is bound to |
| 14:25 | tomoj | ~fn-name# ? |
| 14:25 | clojurebot | Excuse me? |
| 14:26 | tomoj | hmm |
| 14:26 | tomoj | that won't work though, eh |
| 14:26 | sorenmacbeth | tomoj: it says it can't resolve fn-name# |
| 14:26 | tomoj | I feel vaguely like there's a ` in the wrong place |
| 14:27 | tomoj | should the (let [md# ..]) be quoted? I feel vaguely like it should be unquoted |
| 14:28 | dnolen | sorenmacbeth: manual gensym outside syntax-quote |
| 14:28 | tomoj | no need for a gensym? |
| 14:28 | dnolen | sorenmacbeth: you don't want fn-name to be gensym, then don't |
| 14:29 | sorenmacbeth | dnolen: I think I follow you |
| 14:30 | sorenmacbeth | dnolen: know of an example I could look at off-hand? |
| 14:32 | tomoj | sorenmacbeth: this seems closer https://gist.github.com/f8fb9171f39fb4ebf5d2 |
| 14:32 | tomoj | still at least a bit wrong |
| 14:32 | tomoj | (with a (list* 'do (for ...)) it should be good? |
| 14:33 | sorenmacbeth | tomoj: that doesn't work (was near my first attempt) because the params I'm passing to the macro are inside a let binding |
| 14:33 | sorenmacbeth | dnolen: I need ~property-class to be inside the syntax-quote because the param is passed inside a let binding in some cases |
| 14:34 | tomoj | you mean that property-class needs to be evaluated? |
| 14:34 | sorenmacbeth | tomoj: yeah |
| 14:38 | Hali_303 | this is strange: in clj-time, there is a function called interval, that accepts two datetimes. however, it does not accept a datetime and a duration, as the original java library. is this intended? |
| 14:38 | dnolen | Hali_303: oversight probably |
| 14:51 | Hali_303 | back to error handling in clojure: if I signal an error by returning nil, how does the developer know where/what is causing the problem without firing up a debugger? |
| 14:53 | dnolen | Hali_303: signaling an error by returning nil probably not a good idea, use another unique value and document it. |
| 14:53 | dnolen | Hali_303: if the developer doesn't handle it, it's not your problem - you documented it |
| 14:55 | Hali_303 | dnolen: what do you mean by unique value? |
| 14:55 | dnolen | Hali_303: ::my-unique-value, or if you're paranoid (def my-unqiue-value (Object.)) |
| 14:55 | Hali_303 | dnolen: oh i see |
| 14:58 | Hali_303 | dnolen: actually by reading the clojure library sources, i had the same feeling, that usually functions dont care if they fail. The problem is, how to debug what is causing the actualy problem? maybe i'm not used to reading enough clojure stack traces.. |
| 14:58 | gfredericks | is the who-calls function in swank-clojure supposed to be working? |
| 14:58 | sorenmacbeth | dnolen: I'm still stuck. If you get a chance to whip up an example or something to push me along the way, I'm be very grateful. |
| 14:58 | devn | gfredericks: i believe so... |
| 14:59 | dnolen | Hali_303: there's a lot of noise in Clojure stacktraces but they are very precise. |
| 14:59 | technomancy | gfredericks: well... |
| 14:59 | technomancy | sorta |
| 14:59 | gfredericks | I get "error in process filter: Wrong type argument: char-or-string-p, nil" |
| 14:59 | technomancy | it's not really much smarter than grep |
| 14:59 | gfredericks | I tried loading the file as well, same thing |
| 15:01 | Hali_303 | dnolen: i see, well.. |
| 15:01 | gfredericks | technomancy: "slightly smarter than grep" is probably good enough for me |
| 15:02 | Hali_303 | thank you all, cu l8r |
| 15:02 | technomancy | gfredericks: no, I think you need "slightly smarter than grep and not broken". |
| 15:02 | gfredericks | technomancy: what? do they make those??! |
| 15:06 | tomoj | sorenmacbeth: well, I'm stumped |
| 15:07 | sorenmacbeth | tomoj: me too. thanks for taking a shot at it |
| 15:07 | tomoj | I think I ended up giving up and doing some hack with eval when I was in a situation somewhat like yours, with protobuf |
| 15:08 | tomoj | yep: ";; TODO eval?!" |
| 15:09 | TimMc | sorenmacbeth: What's the latest paste URL? |
| 15:09 | TimMc | Oh, found it. |
| 15:09 | sorenmacbeth | https://gist.github.com/6e5207df3c22fc7db19e |
| 15:12 | TimMc | Ah, I see. You've got a defn inside a for block. That can't end well. |
| 15:13 | TimMc | sorenmacbeth: Does (macroexpand-1 '(mk-property-tap ...)) give a reasonable result, or does it error? |
| 15:13 | sorenmacbeth | TimMc: it doesn't error |
| 15:14 | TimMc | Anyhow, you're trying to mix expansion time and runtime stuff. |
| 15:14 | sritchie | sorenmacbeth: we hacked w/ eval as well |
| 15:14 | tomoj | huh, is there no way around it or it's just hard? |
| 15:14 | sorenmacbeth | TimMc: yeah |
| 15:14 | sritchie | not sure, that was nathanmarz when he was learning clj |
| 15:15 | TimMc | sorenmacbeth: That for block depends on a value, but it's goingto run outside the macro (that is, at runtime) |
| 15:15 | sritchie | sorenmacbeth: you'll probably have to quote those cascalog symbols |
| 15:17 | tomoj | maybe it's not a hack to use eval to reflect on thrift |
| 15:17 | sritchie | sorenmacbeth: use ~'?symbol-name or ~'_ for cascalog symbols |
| 15:18 | sorenmacbeth | sritchie: I though so too, but it seems to work |
| 15:18 | sritchie | cool |
| 15:18 | sorenmacbeth | sritchie: I'm not sure how to go about hacking this up with eval |
| 15:20 | TimMc | sorenmacbeth: Looks like you need runtime values from md, f, val-id, val-name, and fn-nme |
| 15:20 | TimMc | so the syntax-quote needs to get pushed down to just be around teh defn again |
| 15:20 | sorenmacbeth | TimMc: what I'm doing now is moving the entire for loop out of the macro and into the calling fn |
| 15:21 | TimMc | Not sure that helps... |
| 15:21 | tomoj | if you (eval property-class) etc, it seems to get easier? |
| 15:21 | sorenmacbeth | TimMc: yeah, so now the syntax-quote is just around defn and there is no let |
| 15:21 | tomoj | but that seems funny |
| 15:21 | TimMc | sorenmacbeth: Re: moving the for loop... you're still trying to mix runtime and expand-time info without eval. |
| 15:22 | TimMc | The macro expand will happen before that for loop ever runs. |
| 15:22 | tomoj | huh, doing eval'ing property-class etc would just be like making it into a function instead of a macro, no? |
| 15:22 | sorenmacbeth | TimMc: like so: https://gist.github.com/899a400cd837369d306d |
| 15:23 | dsantiago | Is it possible to hint a function to return a primitive? |
| 15:24 | pjstadig | dsantiago: i think only as long or double |
| 15:24 | ferd | hey... Anybody knows how to configure swank/slime to show metadata con macro expansion? I tried (set! *print-meta* true) on the slime repl to no avail |
| 15:24 | dsantiago | That's fine. |
| 15:26 | ferd | dsantiago: hey: sell me clojure-csv. Why would I use it over clojure/data.csv? (honestly, I haven't tried them, but was just about to) |
| 15:27 | technomancy | you can contribute to it without signing paperwork |
| 15:27 | sorenmacbeth | TimMc: here is the macro and the calling fn: https://gist.github.com/899a400cd837369d306d |
| 15:27 | Bronsa | lol |
| 15:28 | TimMc | sorenmacbeth: mk-prop-tap is going to get 'id 'name 'val-id 'val-name, the symbols |
| 15:28 | dsantiago | ferd: I don't know. I've maintained clojure-csv since 2009, and offered it for inclusion in contrib. I was ignored, and they later wrote their own thing to put in. I believe clojure-csv has more configurability in what inputs it accepts. |
| 15:28 | Raynes | technomancy: Hahaha |
| 15:28 | dsantiago | I'm actually working on performance enhancements as we speak. |
| 15:29 | rindolf | Hi all. I'm getting an exception with this program - how can I fix it? http://paste.debian.net/160439/ |
| 15:29 | sorenmacbeth | TimMc: even though they are unquoted inside the syntax quote? |
| 15:29 | ferd | dsantiago: thanks. From the docs, looks like clojure-csv will be my first pick |
| 15:29 | TimMc | sorenmacbeth: Doesn't matter. The macro receives syntax, not data values. |
| 15:30 | sorenmacbeth | TimMc: damn, right. |
| 15:30 | dsantiago | ferd: Send me a note or file an issue on github if you have any problems, I can usually turn things around pretty quickly. |
| 15:31 | ferd | dsantiago: awesome. Thanks again |
| 15:32 | sorenmacbeth | TimMc: so is what I'm trying to do impossible? |
| 15:33 | TimMc | Semi-impossible. |
| 15:33 | sorenmacbeth | TimMc: I need to write a defn and use eval all over the place |
| 15:34 | TimMc | Dunno, I'd have to study the problem in context. :-/ |
| 15:37 | sorenmacbeth | TimMc: no worries, that's for the help |
| 15:37 | sorenmacbeth | tomoj: do you have an example of hacking something like that up using veal's? |
| 15:37 | sorenmacbeth | evals |
| 15:38 | sorenmacbeth | but veals would be cool too |
| 15:48 | joegallo | I can't believe anybody would do programming with veals. Those little baby lambdas shouldn't be cooped up and killed young just so you can program! |
| 15:48 | rindolf | Hi all. I'm getting an exception with this program - how can I fix it? http://paste.debian.net/160439/ |
| 15:48 | sorenmacbeth | joegallo: lulz |
| 15:49 | joegallo | rindolf: i think you are trying to set the root binding of a var with set!. it doesn't work like that. |
| 15:49 | rindolf | joegallo: OK. |
| 15:49 | rindolf | joegallo: then how can I have mutable state? |
| 15:50 | amalloy | joegallo: you act like you've never questioned where the meat in #() sandwiches comes from. you are yourself a prime beneficiary of lambda veal! |
| 15:50 | joegallo | well, the simplest change to your program would be to put an atom in that var, and turn off the dyanmic. |
| 15:50 | Raynes | You can use refs or atoms, but you aren't even close to needing mutable state for this. |
| 15:50 | joegallo | Raynes++ |
| 15:51 | rindolf | :-S |
| 15:51 | eggsby | lol |
| 15:51 | eggsby | I'm noticing that the code I write in clojure isn't as pretty or elegant as the code others write in clojure, very sad |
| 15:51 | eggsby | on the other hand I set up autoexpect and it makes tdd a joy |
| 15:52 | jakemcc` | glad you like it |
| 15:52 | Raynes | rindolf: (doseq [s (repeatedly read-line)] (println s)) |
| 15:54 | rindolf | Raynes: thanks! That works. |
| 15:55 | Raynes | (loop [] (let [s (read-line)] (println s) (recur))) is another way to do it. You don't have to modify a anything. Even better: (loop [] (println (read-line)) (recur)). |
| 15:55 | amalloy | (repeatedly #(println (read-line))) |
| 15:56 | rindolf | How do I terminate on end-of-file? |
| 15:58 | tomoj | (while (when-let [l (read-line)] (println l) l)) ? :/ |
| 15:58 | tomoj | I think I've probably used while like 3 times total |
| 15:59 | Raynes | amalloy: Yeah, dunno why but the doseq felt 'better' there. I guess I'm used to separating side effects and functions that generate sequences, but they're the same in this case. |
| 15:59 | tomoj | sorenmacbeth: nope, sorry, my eval hack is in a significantly different context |
| 16:00 | tomoj | I mean.. same basic problem of tangled eval/expand scopes probably caused by basically the same situation (reflecting on protobuf instead of thrift), but they're tangled up in different ways |
| 16:01 | sorenmacbeth | tomoj: ok, I'm off to learn about veal then ;-) |
| 16:13 | melipone | how can I convert from a java array I created with make-array to a list of vectors so that I can make an incanter matrix? |
| 16:17 | TimMc | melipone: 2D array? |
| 16:17 | TimMc | (map seq ...) oughtta be enough |
| 16:18 | melipone | TimMc: yes |
| 16:19 | melipone | TimMc: okay, thanks, that works |
| 16:24 | licoresse | ~reify |
| 16:24 | clojurebot | excusez-moi |
| 17:08 | pandeiro | is there a lib that can match similar (not identical) strings? |
| 17:09 | TimMc | E.g. Levenshtein distance? |
| 17:10 | pandeiro | TimMc: no idea but sounds promising :) |
| 17:10 | lynaghk | pandeiro: I've used this in the past, dunno if there is a clojure wrapper: http://secondstring.sourceforge.net/ |
| 17:11 | technomancy | incanter has a levenshtein implementation in like 20 lines |
| 17:11 | Raynes | I sure wish there was an oauth library that wasn't abandoned. |
| 17:11 | technomancy | Raynes: oauth1? |
| 17:11 | Raynes | oauth2 |
| 17:12 | technomancy | there was a talk at clojure/west on clj-oauth2 |
| 17:12 | technomancy | it sounded pretty happenin'. |
| 17:12 | Raynes | What the shit |
| 17:12 | Raynes | Where the bloody hell did this come from? |
| 17:12 | Raynes | I've googled so far and so long. |
| 17:13 | technomancy | everyone knows you can't trust google |
| 17:13 | technomancy | trusting google is what leads people to riddell.us tutorials |
| 17:13 | lazybot | The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.tutorials |
| 17:13 | Raynes | DerGuteMoritz: Dude. Why didn't you tell me you had an oauth library? You should have known I needed one. |
| 17:16 | Raynes | Looks like Pat Patterson is maintaining it. |
| 17:16 | technomancy | yeah, he's the guy who gave the talk |
| 17:17 | Raynes | Also the guy who hasn't released anything. :< |
| 17:21 | technomancy | I think he's just contributing; he doesn't have push rights to clojars at least. |
| 17:27 | Raynes | technomancy: Yeah, he is. |
| 17:27 | Raynes | But complain I shall. |
| 17:28 | Raynes | Wow, it uses lazytest. |
| 17:28 | Raynes | Classic. |
| 17:28 | DerGuteMoritz | Raynes: I apologize |
| 17:29 | DerGuteMoritz | wait I do have push rights at clojars |
| 17:29 | technomancy | DerGuteMoritz: I meant patterson didn't |
| 17:29 | Raynes | We were talking about Pat. |
| 17:29 | DerGuteMoritz | ah yeah |
| 17:29 | DerGuteMoritz | he sent me some patches so it works with salesforce's ancient oauth2 implementation |
| 17:30 | DerGuteMoritz | also a ring middleware which I will include soon |
| 17:30 | DerGuteMoritz | what about lazytest? |
| 17:30 | Raynes | I don't think it's maintained anymore. |
| 17:30 | Raynes | Last commit was a year ago. |
| 17:31 | TimMc | Raynes: That is because it has reached perfection. |
| 17:31 | Raynes | I'm sure. |
| 17:31 | DerGuteMoritz | heh |
| 17:31 | DerGuteMoritz | yeah I've stopped using it for new stuff, too |
| 17:31 | technomancy | Raynes: well neither is clojure.test =P |
| 17:32 | Raynes | Fair enough, but the former is at least doesn't depend on contrib alpha4. |
| 17:32 | DerGuteMoritz | back when I started with clj-oauth2 lazytest was the only one with autotesting |
| 17:32 | DerGuteMoritz | lazytest has far too many badly composing macros |
| 17:33 | technomancy | youch |
| 17:33 | Raynes | It looks like your tests could easily be changed to clojure.test or midje. |
| 17:33 | DerGuteMoritz | which sentence? |
| 17:33 | Raynes | The one I slaughtered. |
| 17:33 | DerGuteMoritz | yeah I should rewite them some day |
| 17:33 | DerGuteMoritz | when I have too much time on my hands! |
| 17:34 | Raynes | How do you run lazytest tests? |
| 17:34 | DerGuteMoritz | with clojure 2.0 |
| 17:34 | Raynes | Never had occasion to do it before. |
| 17:34 | DerGuteMoritz | I have this autotest thingy |
| 17:35 | DerGuteMoritz | not sure about the original name, my shell alias is called clj-autolazy |
| 17:35 | DerGuteMoritz | but lein test should probably work |
| 17:35 | Raynes | Doesn't seem to do anything, sadly. |
| 17:36 | Raynes | I think I'll take a shot at moving these tests. |
| 17:36 | Raynes | Doesn't look that bad. |
| 17:36 | DerGuteMoritz | nice! |
| 17:36 | DerGuteMoritz | feel free |
| 17:36 | DerGuteMoritz | (brb) |
| 17:40 | DerGuteMoritz | re |
| 17:41 | DerGuteMoritz | so how was pat's talk? will there be a video? |
| 17:45 | daaku | i saw some post a few days ago about disabling locals clearing in 1.4 -- is there a way to backport that to 1.3 or something to make debugging easier? |
| 17:45 | aperiodic | DerGuteMoritz: I think there's gonna be a video for every talk (I didn't go to one that wasn't recorded), but I have no idea when they'll be up |
| 17:55 | DerGuteMoritz | aperiodic: alright, thanks for the info! |
| 18:16 | hagna | in clojure why can I do java.io.FileInputStream without explicitly importing first? |
| 18:16 | raek | hagna: 'import' does not cause the class to be loaded, it just gives it a shorter name |
| 18:16 | amalloy | because that's how the jvm works. importing classes is just for programmer convenience |
| 18:17 | raek | hagna: the JVM automatically loads classes when they are used the first time |
| 18:18 | Raynes | amalloy: Man, this font size is not working when using this tv as a monitor. I thought you said "is just for brogrammer convenience". I was already heading to #4clojure to make fun of you. |
| 18:18 | amalloy | ugh, brogrammer and progamer. two words i wish would die |
| 18:18 | Raynes | You and me both, pal. |
| 18:22 | eggsby | write some source codes brah |
| 18:25 | jodaro | is there a brogamer too? |
| 18:26 | ssideris | all gamers are bros |
| 18:26 | aperiodic | not at all true |
| 18:27 | rahcola | if i'm using lein ring war to create a servlet, who can i access the init-params in web.xml in my handler-fn? |
| 18:28 | rahcola | do I have access to the Servlet object so I could use .getInitParameter()? |
| 18:29 | eggsby | is anyone itc bored enough to do a style review of my simple clojure script? I feel like I'm doing things Wrong(tm) |
| 18:35 | hagna | raek, amalloy ok thanks didn't know that |
| 18:36 | aperiodic | eggsby: i'd recommend posting a link along with your invitation (promising a style review creates expectations, whereas just posting a link allows people to take a look before deciding to say anything or not) |
| 18:39 | eggsby | hahah sorry :) |
| 18:39 | eggsby | http://pastie.org/3637090 I'm just wondering if there is anything glaringly obviously wrong |
| 18:39 | aperiodic | no problem, just trying to help you get feedback :) |
| 18:39 | eggsby | but I will take any tips anyone has to give, I'm a clojure babby |
| 18:42 | Raynes | https://refheap.com/paste/1240 For people who are put off by pastie's atrocious Clojure syntax highlighting. |
| 18:43 | Raynes | Holy crap, that font looks terrible on this monitor. |
| 18:44 | Raynes | Or, I guess it's just how far I'm sitting away from the screen. |
| 18:44 | Raynes | I really hate bothering with fonts. Nothing I choose ever satisfies everyone. |
| 18:47 | aperiodic | I'm one of the most typographically picky people I know, and I think it's fine |
| 18:47 | Raynes | Yeah, it looks fine on my laptop monitor. |
| 18:51 | lynaghk | aperiodic: I hope I'm up there on your typographically picky list |
| 18:52 | Raynes | aperiodic: I actually use anonymous pro in my editor. A small poll led me to believe that Deja Vu is more likely to appease the more people than my favorite. |
| 18:53 | lynaghk | Anonymous pro is rad, if you can actually get it to line up with physical pixels correctly |
| 18:54 | lynaghk | I used it for years at 7 pt on a netbook |
| 18:54 | aperiodic | lynaghk: definitely! your presentation at clojure/west was my favorite in terms of typography (though BG's came close) |
| 18:54 | aperiodic | i'm using inconsolata-dz these days |
| 18:54 | Raynes | Yeah, it isn't pixilated at all for me on this computer. I even used it on refheap briefly, but everybody complained that it was pixilated and proved it with screenshots. I don't know enough about typefaces to understand what the difference between me and them is. |
| 18:55 | lynaghk | aperiodic: thanks. Eurostile is the offical Keming Labs font, but there is also some Caecilia in there too. |
| 18:55 | Lajla | Raynes, my love |
| 18:55 | Lajla | Let us worship His Shadow together. |
| 18:55 | aperiodic | ooh, Anonymous pro looks pretty nice |
| 18:57 | aperiodic | lynaghk: definitely a fan of the Caecilia |
| 18:57 | lynaghk | aperiodic: if you ever need to give a presentation, http://zachholman.com/posts/slide-design-for-developers/ |
| 18:57 | nDuff | Where did clojure.contrib.str-utils go? I don't see it in https://github.com/clojure |
| 18:57 | Raynes | clojure.string |
| 18:57 | Raynes | But it isn't a copy. |
| 18:58 | Raynes | Not everything made it through. |
| 18:58 | Raynes | And things that did are likely renamed. |
| 18:58 | nDuff | ahh; thanks! |
| 18:59 | Zoka | Social REPL-ing web based REPL with built in chat http://noirmon.herokuapp.com/ringmon/monview.html |
| 19:01 | sritchie | cemerick, I'm seeing this now: |
| 19:01 | sritchie | <<"compilation_error">>, |
| 19:01 | sritchie | <<"Expression does not eval to a function. ( |
| 19:01 | sritchie | cemerick: not sure how this worked this morning |
| 19:01 | cemerick | sritchie: you can gist if you want; but if it's the same view, then… |
| 19:02 | sritchie | I rebuilt the view |
| 19:02 | cemerick | I mean, if it's the same view code, then something wonky must be going on. |
| 19:02 | sritchie | cemerick: https://gist.github.com/2142226 |
| 19:02 | sritchie | had a buddy confirm on another machine, same issue |
| 19:03 | sritchie | this "new String" thing is confusing to me -- |
| 19:03 | sritchie | "and this is just some of the error, it prints out the whole view function) |
| 19:03 | sritchie | is it getting wrapped in a new String() call somehow? |
| 19:03 | cemerick | looks like the gist is truncated? |
| 19:04 | sritchie | okay, I'll gist it all |
| 19:04 | sritchie | one sec |
| 19:04 | sritchie | there |
| 19:04 | sritchie | full error on the gist, sorry about that |
| 19:05 | sritchie | cemerick: I rebuilt the view this aft |
| 19:05 | cemerick | yeah, that new String bit is bizarre; nothing like that in the cljs-views ns |
| 19:06 | cemerick | I'm 6 months away from the code, but that doesn't strike me as right. |
| 19:06 | sritchie | cemerick: do you have a small example view that works w/ clutch-clojurescript? |
| 19:07 | sritchie | this is couchdb 1.1.1 |
| 19:12 | cemerick | sritchie: OK, so that new String business is entirely spurious |
| 19:13 | sritchie | I can't see it in the design doc |
| 19:13 | sritchie | cemerick: https://gist.github.com/2adf9a5eb778f54b40fe |
| 19:14 | cemerick | ok, well, that's something |
| 19:14 | cemerick | what's up with the intermediate cake key? |
| 19:14 | cemerick | yeah, that's your problem |
| 19:14 | cemerick | https://gist.github.com/2142292 |
| 19:14 | sritchie | that's the name of the view |
| 19:15 | sritchie | my view name was :cake |
| 19:15 | cemerick | hrm, right |
| 19:15 | sritchie | is that diff than https://gist.github.com/2142226? |
| 19:15 | cemerick | ok, well, the just-gisted snippet worksforme |
| 19:16 | sritchie | trying it now |
| 19:16 | cemerick | it looks isomorphic |
| 19:16 | sritchie | cemerick: what couchdb version are you on? |
| 19:17 | cemerick | 1.1.3 |
| 19:17 | cemerick | yikes, I'd hope that's not it |
| 19:17 | cemerick | 1.1.3 / couchbase single |
| 19:18 | sritchie | couchbase single isn't made anymore |
| 19:18 | sritchie | they deprecated it |
| 19:18 | sritchie | not just deprecated, it's just not available anymore |
| 19:19 | sritchie | I also get a "can't recur here" error sometimes |
| 19:19 | sritchie | from the cljs compiler |
| 19:19 | cemerick | the latter sounds like a cljs error? |
| 19:19 | cemerick | yeah, ok |
| 19:20 | cemerick | huh, didn't realize they stopped distributing the thing |
| 19:21 | lynaghk | Is there any way to read the metadata from a form without evaling it? |
| 19:21 | sritchie | cemerick: on cloudant I get: JSON error (end-of-file) |
| 19:21 | sritchie | [Thrown class java.io.EOFException] |
| 19:21 | lynaghk | Like I have (def ^:xyz a 1) in a file |
| 19:21 | sritchie | dpetrovics might have some more info |
| 19:21 | sritchie | cemerick, gotta run for now, but I'm working with dpetrovics so if you find anything he'll note it |
| 19:22 | dpetrovics | hey guys |
| 19:22 | gfredericks | lynaghk: just using the reader should get you the metadata |
| 19:22 | gfredericks | though in that particular case you'll have to pull out the 'a symbol and check on that |
| 19:23 | lynaghk | gfredericks, how do you mean? |
| 19:23 | gfredericks | lessee if the bots let me read |
| 19:23 | lynaghk | (meta (read-string "(def ^:clj a 1)")) gives nil |
| 19:23 | gfredericks | &(-> "(def ^:xyz a 1)" read-string second meta) |
| 19:23 | lazybot | ⇒ {:xyz true} |
| 19:23 | dpetrovics | cemerick: i missed the begging of the conversation, but the issue seemed to be with getting a view, I can save them just fine |
| 19:23 | lynaghk | ah, I see |
| 19:23 | gfredericks | lynaghk: because the metadata isn't on the list, it's on the symbol |
| 19:24 | lynaghk | gfredericks, that makes sense. Reading the second should work, eh? that covers def and defn |
| 19:24 | cemerick | dpetrovics: yeah, it's either a cljs compilation issue or some previously-unknown couchdb rev incompatibility |
| 19:24 | gfredericks | yeah I think so |
| 19:24 | sritchie | cemerick: btw, this is with [org.clojure/clojurescript "0.0-993"] |
| 19:25 | dpetrovics | cemerick: ok, bizarre that it worked for sritchie this morning |
| 19:25 | sritchie | that might be it |
| 19:25 | gfredericks | &(read-string "(def #^{:fine (def foo 'bar)} baz 12)") |
| 19:25 | lazybot | ⇒ (def baz 12) |
| 19:25 | gfredericks | &foo |
| 19:25 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: foo in this context |
| 19:25 | sritchie | dpetrovics: yeah, I don't know what was different about this AM, not worth worrying about until I think of it |
| 19:26 | cemerick | sritchie: ok, I've not moved up to that rev yet; that may be the cause of the whole thing? |
| 19:26 | sritchie | might be it |
| 19:26 | sritchie | are you on 971? |
| 19:26 | cemerick | What I have here works well on cloudant |
| 19:26 | cemerick | I'm still using the old rev I bundled |
| 19:26 | sritchie | got it |
| 19:26 | sritchie | that was just one of the git commits? |
| 19:27 | cemerick | yeah, that was pre-release |
| 19:27 | cemerick | maybe roll back to that and see how that fares for you |
| 19:27 | sritchie | dpetrovics, try removing clojurescript from our deps and adding this: |
| 19:27 | sritchie | [com.cemerick/clutch-clojurescript "0.0.1-SNAPSHOT"] |
| 19:27 | sritchie | then redeps, etc |
| 19:27 | sritchie | gotta run, guy |
| 19:27 | sritchie | s |
| 19:27 | sritchie | cemerick, thanks for the help |
| 19:27 | cemerick | sritchie: sure; if you or dpetrovics still have issues tomorrow, you know where to find me :-) |
| 19:28 | dpetrovics | cemerick: thanks, appreciate it |
| 19:29 | dgrnbrg | does clojure support binary literals? |
| 19:29 | gfredericks | no |
| 19:31 | cemerick | gfredericks is right; the reader is text only |
| 19:31 | technomancy | well |
| 19:31 | dgrnbrg | So I should implement a reader macro for binary literals, right? |
| 19:31 | technomancy | it supports base 2 numbers |
| 19:32 | gfredericks | technomancy: I knew there'd be something... |
| 19:32 | technomancy | those are binary literals =) |
| 19:32 | dgrnbrg | assuming i have a codebase that requires tons of them |
| 19:32 | dgrnbrg | ,(identity 0b0011_1010) |
| 19:32 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 0b0011_1010> |
| 19:32 | dgrnbrg | :( |
| 19:32 | technomancy | ,2r011 |
| 19:32 | clojurebot | 3 |
| 19:33 | dgrnbrg | in 1.3? |
| 19:33 | emezeske | Nice, can you set any radix? |
| 19:33 | emezeske | ,7r070301532 |
| 19:33 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: For input string: "70301532"> |
| 19:33 | dgrnbrg | ,2r0000_0110 |
| 19:33 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 2r0000_0110> |
| 19:33 | emezeske | ,7r123 |
| 19:33 | gfredericks | emezeske: not if you violate it :P |
| 19:33 | clojurebot | 66 |
| 19:33 | technomancy | I don't think it's particularly new |
| 19:33 | gfredericks | ,Ar100 |
| 19:33 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Ar100 in this context, compiling:(NO_SOURCE_PATH:0)> |
| 19:33 | gfredericks | ,10r100 |
| 19:33 | dgrnbrg | Where could I propose making underscore an ignored in numbers? |
| 19:33 | clojurebot | 100 |
| 19:33 | emezeske | gfredericks: I guess I don't have a feel for how many digits of base 7 fit in an int :P |
| 19:34 | emezeske | 17rg |
| 19:34 | emezeske | ,17rg |
| 19:34 | clojurebot | 16 |
| 19:34 | gfredericks | emezeske: it wasn't that the number was too large it was that you used a '7' digit |
| 19:34 | emezeske | gfredericks: DERP |
| 19:34 | emezeske | ,42rx |
| 19:34 | Raynes | DerGuteMoritz: Pull request sent. |
| 19:34 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Radix out of range> |
| 19:35 | tmciver | emezeske: your first base 7 example failed because it had a 7 in it. |
| 19:35 | nDuff | What ever happened to pods? I'm trying to write an interface to non-a Java library |
| 19:35 | nDuff | er |
| 19:35 | nDuff | non-thread-safe, mutating Java library, and IIRC they would have been useful |
| 19:35 | emezeske | tmciver: Yeah... :( |
| 19:35 | tmciver | ,7r060301532 |
| 19:36 | clojurebot | 4992290 |
| 19:36 | emezeske | ,36rz |
| 19:36 | clojurebot | 35 |
| 19:36 | tmciver | that's cool though, I wasn't aware of that. |
| 19:36 | emezeske | ,37r1 |
| 19:36 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Radix out of range> |
| 19:36 | gfredericks | emezeske: bet you'll never make that mistake again though |
| 19:36 | emezeske | I guess that makes sense ^_^ |
| 19:36 | emezeske | gfredericks: Likely not, but only because I will never use a base 7 literal ^:) |
| 19:36 | gfredericks | my grandma always told me to mind my base seven literals... |
| 19:42 | muhoo | hmm, i wonder if this ever got integrated into incanter: http://jakemccrary.com/blog/2010/02/21/plotting-time-series-data-with-incanter/ |
| 19:42 | muhoo | ah, i see, it does |
| 19:42 | choffstein | what is the best way to iterate over a list if you want to call a function that performs side-effects. For example, I want to iterate over a list and delete all the objects from the database with that id. I can do a "map" -- but it feels sort of silly to end up with a resulting list of nils |
| 19:42 | muhoo | nm |
| 19:43 | lynaghk | choffstein: doseq |
| 19:43 | choffstein | perfect. thanks lynaghk. |
| 19:45 | aperiodic | technomancy: is there any way to define lein's order of compilation? |
| 19:46 | technomancy | aperiodic: more than just :aot [ns.one ns.two] ? |
| 19:47 | aperiodic | technomancy: derp. i was using regexes. |
| 19:48 | aperiodic | thanks |
| 19:48 | technomancy | sure |
| 19:56 | aperiodic | technomancy: so, it seems that the ordering in the :aot vector is not preserved if there's regexes in it |
| 19:58 | technomancy | aperiodic: ah, tricky |
| 19:59 | aperiodic | this may be my chance to earn a leiningen sticker |
| 20:00 | technomancy | go for it =) |
| 20:00 | wmealing | there are stickers ? |
| 20:03 | wmealing | i'm using lein midje --lazytest , v nice. |
| 20:05 | aperiodic | wmealing: http://twitpic.com/2e33r1 |
| 20:06 | technomancy | aperiodic: ohhoho; the new stickers are way better than that |
| 20:06 | aperiodic | oh really? |
| 20:06 | aperiodic | pics or they don't exist |
| 20:07 | technomancy | https://twitter.com/#!/technomancy/media/slideshow?url=pic.twitter.com%2FxpIrqEBf |
| 20:07 | wmealing | brace yourselves, jpegs is coming. |
| 20:07 | aperiodic | awesome |
| 20:07 | aperiodic | you should update the link in the readme |
| 20:08 | technomancy | aha; yes |
| 20:09 | ibdknox | I should get cool stickers |
| 20:09 | dgrnbrg | I'm trying to write a reader macro but I keep getting "exceptionininitializererror"--what causes that? |
| 20:09 | dgrnbrg | None of my code is in the stacktrace |
| 20:09 | dgrnbrg | just compiler internals |
| 20:10 | dgrnbrg | and I know the dispatch fn is called, b/c it prints to stdout |
| 20:11 | technomancy | ibdknox: need a logo first. |
| 20:11 | technomancy | I know a guy... =) |
| 20:11 | ibdknox | haha |
| 20:14 | dgrnbrg | Oh I see--the reader macro needs to return a syntax fragment |
| 20:24 | aperiodic | technomancy: it seems to be fixed in lein2 (ran into the issue on 1.7) |
| 20:26 | technomancy | aperiodic: ah, ok. I'd still take a patch for 1.7.1 if you like. |
| 20:32 | ibdknox | lol: 499 watchers on Noir. |
| 20:32 | ibdknox | oh the torment |
| 20:33 | brehaut | 500 |
| 20:33 | ibdknox | haha |
| 20:33 | ibdknox | wooohooo! |
| 20:34 | amalloy | quick, someone unwatch so he can get that feeling again |
| 20:34 | aperiodic | technomancy: cool; i'll open an issue and get cracking on it after work this evening |
| 20:34 | ibdknox | lol |
| 20:37 | technomancy | great |
| 20:37 | mk | are there any talks online from clojure west? |
| 20:38 | qbg | mk: There are slides |
| 20:39 | lynaghk | mk: There's a month-old draft of my talk at a SECRET YOUTUBE URL: http://www.youtube.com/watch?v=T83P3PVSy_8 |
| 20:40 | mk | slides are good, though I prefer audio |
| 20:41 | qbg | https://github.com/strangeloop/clojurewest2012-slides |
| 20:41 | mk | lynaghk: great, thanks - the title is already interesting |
| 20:42 | lynaghk | mk: unfortunately there wasn't much time to talk about composability; I'll be giving a longer talk at the Joint Statiscians Meeting in July |
| 20:43 | mk | lynaghk: any major errata/additions to that youtube version? |
| 20:44 | lynaghk | The slides at the link qbg gave have some extra example screenshots |
| 20:44 | lynaghk | and the code changed a bit (unify no longer provides the mapping function with idx for each datum) |
| 20:44 | lynaghk | but otherwise no, it's basically the same as the talk I gave on Saturday. |
| 20:46 | ibdknox | lynaghk: had I known the value of this secret, I would've been selling this precious commodity for many monies |
| 20:47 | lynaghk | ibdknox: next conference get me a few whiskeys and I'll tell you about the brotherhood of the charts. |
| 20:47 | ibdknox | haha |
| 20:49 | TimMc | technomancy: The stickers were surprisingly translucent? |
| 20:50 | technomancy | yeah, that was unintentional |
| 20:50 | technomancy | looks fine on an aluminium surface, but crappy on a dark background |
| 20:51 | technomancy | but they're much bigger than the old ones |
| 21:04 | TimMc | WELP. Guess I'm getting a Mac then! |
| 21:05 | technomancy | hah |
| 21:05 | technomancy | it looks fine if you place it on a white label first |
| 21:36 | muhoo | before i go trying to reinvent the wheel, has anyone done a real-time graph using incanter, like an oscilloscope-style plot? |
| 21:37 | muhoo | i'm digging into the dynamic-xy-plot macro, trying to figure out how to dynamically update the data without using sliders, and thought "this is probably the hard way" |
| 21:38 | tomoj | are you hooking this to overtone? |
| 21:39 | mk | lynaghk: that was a good talk, thanks for the link |
| 21:46 | muhoo | tomoj: actually, no, but that'd be fun :-) |
| 21:47 | muhoo | overtone already has a scope function anyway though |
| 21:47 | muhoo | no, i just need a rolling plot of data, updated at a regular interval for now, but ultimately to be fed by a lazy seq, from a data collection device |
| 21:48 | tomoj | right, just making sure you didn't miss the overtone/sc scope |
| 21:48 | tomoj | unfortunately I couldn't get that to work on linux :( |
| 21:48 | muhoo | i did. it was cool, but glitchy when resizing the window |
| 21:49 | muhoo | *sigh*, ok, back to trying to macroexpand dynamic-xy-plot :-/ |
| 22:08 | muhoo | aha! add-points :-) |
| 22:08 | muhoo | it's mutable :-P |
| 22:09 | eggsby | what does (. comp ..) do? |
| 22:09 | eggsby | specifically the leading . |
| 22:09 | eggsby | or what would I look up to research it? |
| 22:11 | Raynes | It is the Java interop form. It calls a Java method. |
| 22:11 | Raynes | &(.contains [1] 1) |
| 22:11 | lazybot | ⇒ true |
| 22:12 | Raynes | &(. [1] contains 1) |
| 22:12 | lazybot | ⇒ true |
| 22:12 | Raynes | The former is sugar for the latter and what you should usually use. |
| 22:12 | Raynes | You call a static method with ##(Character/isUpperCase \c) |
| 22:12 | lazybot | ⇒ false |
| 22:30 | wmealing | what is the closest thing to clojure, not on the jvm ? |
| 22:30 | Iceland_jack | Eh, Haskell? Racket? Common Lisp? |
| 22:30 | xeqi | clojurescript? |
| 22:30 | clojurebot | ClojureScript is https://github.com/clojure/clojurescript |
| 22:30 | Iceland_jack | Depends on what you mean by closest |
| 22:31 | wmealing | haskell doesn't do infix notation, does it ? |
| 22:31 | Iceland_jack | infix notation? it does |
| 22:31 | wmealing | i mean syntax, and form behavior |
| 22:31 | amalloy | (. comp ..)? i would be astonished if that ever did anything good |
| 22:31 | Iceland_jack | so you basically want Lisp syntax |
| 22:32 | Iceland_jack | Liskell ;) |
| 22:32 | wmealing | and, its a real project |
| 22:33 | wmealing | i'm currently evaluating clojure, its not bad, but my main goal is to know that if things close up shop , i have something else to work with. |
| 22:34 | wmealing | Iceland_jack, can liskell do the metadata trickery too ? |
| 22:35 | Iceland_jack | metadata is not a Lisp thing, rather a Clojure thing |
| 22:35 | wmealing | ah ok |
| 22:36 | eggsby | thank you Raynes |
| 22:42 | aperiodic | is there a good reason why there isn't an "any?" function in core that i'm missing? |
| 22:42 | xeqi | aperiodic: some |
| 22:42 | aperiodic | xeqi: that doesn't have quite the same semantics |
| 22:43 | aperiodic | xeqi: it returns non-nil or nil, when i'd like a boolean |
| 22:43 | eggsby | just ask nil? then :p |
| 22:44 | aperiodic | i mean, i can just (def any? (comp not not-any?)) when i want it, i was mainly curious if i was missing something obvious |
| 22:45 | eggsby | you could define any? I guess by nil? + some |
| 22:45 | eggsby | then just ask for the complement of any?, right? |
| 22:47 | xeqi | its just standard to return a value/nil then booleans |
| 22:47 | xeqi | *rather than |
| 22:47 | aperiodic | yeah, or the (comp not not-any?) from my previous comment ("not-any?" *does* exist in core, which is the most confusing part) |
| 22:48 | aperiodic | xeqi: why have every? and not-any? return booleans, then? |
| 22:48 | xeqi | which value from the seq would you choose for every? |
| 22:49 | eggsby | you might be used to nil punning, here we have bool punning! |
| 22:49 | eggsby | :p |
| 22:51 | xeqi | I suppose not-any? could return the first one that failed the predicate |
| 22:51 | xeqi | but that just sounds akward to code |
| 22:51 | aperiodic | it doesn't, though |
| 22:52 | aperiodic | i guess my real question is why there's a "not-any?" but no "any?" |
| 22:52 | aperiodic | seems backwards to me, but this conversation is descending into bikeshed territory anyways |
| 22:53 | xeqi | https://github.com/clojure/clojure/blob/14428c296de483ea666bd874701046e7088e545c/src/clj/clojure/core.clj#L2398 |
| 22:53 | xeqi | prolly just an ease of coding thing |
| 22:55 | aperiodic | i guess someone felt silly writing (def any? (comp not not some)) |
| 22:55 | aperiodic | not me, though! |
| 22:56 | eggsby | not not me |
| 22:58 | tmciver | Ha! |
| 23:09 | jtoy | if i use a gui editor, what should i use as a code reload mechanism for the repl? |
| 23:12 | aperiodic | (require :reload ...) |
| 23:14 | juhu_chapa | what is the difference between (defn f [& arg]) and (def f [& [arg]]) |
| 23:14 | juhu_chapa | what is the difference between (defn f [& arg]) and (defn f [& [arg]]) |
| 23:16 | xeqi | ,((fn [& args] args) 1 2 3) |
| 23:16 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT> |
| 23:16 | xeqi | heh |
| 23:16 | xeqi | &((fn [& args] args) 1 2 3) |
| 23:16 | lazybot | ⇒ (1 2 3) |
| 23:17 | xeqi | &((fn [& [args]] args) 1 2 3) |
| 23:17 | lazybot | ⇒ 1 |
| 23:20 | juhu_chapa | xeqi: i do not understand it yet. |
| 23:21 | xeqi | the second one binds [args] to [1 2 3], which binds args to the first element |
| 23:21 | xeqi | in this case, 1 |
| 23:21 | xeqi | &((fn [& [arg1 arg2]] [arg1 arg2]) 1 2 3) |
| 23:21 | lazybot | ⇒ [1 2] |
| 23:23 | tmciver | I'd like to visit each node of a nested map tree data structure and add a key whose value is an integer that is incremented for each node visited. Is there an idiomatic way to do this? |
| 23:26 | aperiodic | juhu_chapa: if you're unfamiliar with destructuring syntax, you should read over "http://clojure.org/special_forms#Special Forms--(let [bindings* ] exprs*)" |
| 23:27 | juhu_chapa | thanks a lot: xeqi, aperiodic. |
| 23:27 | aperiodic | quite welcome |
| 23:31 | rhc | if i already know vim well, it is worthwhile to learn emacs for editing clojure coe |
| 23:31 | rhc | code? |
| 23:32 | tmciver | rhc: I'm not a vim user but there are plenty of Clojurians that are and there seems to be plenty of suuport for it. I'd stick with vim. |
| 23:33 | rhc | tmciver: ok, thanks, do you use emacs? |
| 23:33 | tmciver | rhc: yup |
| 23:33 | tmciver | rhc: I love it but there's definitely a learning curve if you've never used it. |
| 23:33 | Zoka | I use jEdit with Clojure plugin |
| 23:33 | rhc | whats the repl integration like? |
| 23:35 | tmciver | If you use swank it's very good, imo. |
| 23:36 | xeqi | rhc: I hear slimv is a good slime/swank for vim |
| 23:37 | rhc | interesting, thank you |
| 23:37 | aperiodic | rhc: there's a fork of it specifically for clojure at https://bitbucket.org/sjl/slimv/overview |
| 23:38 | apwalk | rhc: I'd also try out vim w/ tslime through tmux |
| 23:38 | aperiodic | nah, slimv is better |
| 23:39 | aperiodic | unless there's parts to tslime i didn't know about |
| 23:39 | rhc | aperiodic: ah cool |
| 23:39 | rhc | im gonna check out one of these screencasts/tutorials |
| 23:39 | rhc | i feel like i don't even know whats possible :) |
| 23:40 | apwalk | aperiodic: it's simple and effective, without quirks, but not emacs. i use it with paredit borrowed from slimv |
| 23:41 | aperiodic | apwalk: tslime is just for sending text from vim to other tmux panes, right? |
| 23:41 | apwalk | yeah |
| 23:41 | aperiodic | rhc: me neither. i didn't even know about slimv until a few days ago, when someone showed me at clojure/west |
| 23:43 | aperiodic | apwalk: slimv gives you much more. e.g., there are commands eval current form/defn, eval the whole buffer, look up docs |
| 23:44 | aperiodic | s/commands/commands to/ |
| 23:44 | rhc | so when i'm working with something like C++, i write -> build -> run -> test -> goto 1, but do people in clojure leave the repl open and re-(use) their code as they build up functionality? |
| 23:44 | tmciver_ | rhc: goto considered harmful! |
| 23:45 | rhc | excuse me, (recur) :P |
| 23:45 | tmciver_ | better! ;) |
| 23:47 | tmciver_ | rhc: I believe that it's typical to (use :reload ...) your code in the repl unless you're using something special (like swank-clojure). |
| 23:47 | daaku | rhc: if nothing else, the slow boot time for jvm/clojure combined makes it worth it to have the repl running |