#clojure logs

2012-03-20

00:00muhoospeaking of dubstep, bassnectar apparently had a hand in designing that controller.
00:01muhoogfredericks: it's a device you use to trigger overtone :-)
00:01gfredericksoh so it's like a repl
00:03muhooi had a bit of a revelation when i realized that a kline in supercollider is basically a lazy seq
00:06TimMcmuhoo: I'm still trying to figure out synth vs. inst
00:19rhcRaynes: (if you care.. or anyone else) here is what i was working on as a learning exercise: https://github.com/matthavener/KrailjOS
00:26muhooi 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:48muhoosupercollider running, connected to my existing jackd setup. repl launched. overtone in the hizzy.
01:04scottjarohner: couldn't the pdf of your slides, don't know if it's only my machine.
01:05Raynesrhc: Nice!
01:05arohnerscottj: accidentally the whole word?
01:05Raynesrhc: Did you have any problems with irclj?
01:06arohnerscottj: hrm. I'm getting an error too. I'll try re-uploading
01:14arohnerscottj: I've re-uploaded, here https://github.com/arohner/clojurewest2012-slides/commit/584ea79a0280278a0b11091b04b8fb4086e6a2d3
01:15scottjarohner: works, thanks
01:32aphyrGot 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:34aphyrIMHO it will make multi-caller coordination easier if I handle locking within the client itself and allow it to be mutable
01:34aphyrBut I want to check and see if there's a preferred, immutable pattern.
01:34tomojwhat do you mean by "mutable"?
01:34tomojin clojure/java terms
01:35aphyrMutable in the sense that a client object has internal, changeable state like which socket it wraps.
01:35tomoje.g. do you mean implementing some mutable object in java and using it from clojure?
01:35aphyrI was thinking about writing it as a deftype, actually.
01:35tomojusing that funky option that lets you go mutable?
01:35tomojor just using e.g. atoms?
01:35aphyrProbably atoms.
01:36aphyrThough maybe I'll just write a mutable java client and wrap it with a clojure protocol.
01:36aphyrJust curious what the pure-clojure approach would look like
01:37tomojI 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:38groovemonkeyI just want to say that I LOVE Clojure.
01:38groovemonkeyGood night!
01:39aphyr(let [opened (open client)] (send opened some-msg) (close client))
01:39aphyrvs
01:39aphyr(open client) (send client some-msg) (close client)
01:40aphyrBasically a question of where the responsibility for coordinating access belongs; with the callers, or with the client itself, I guess.
01:40tomojsynchronous io?
01:41aphyrThe underlying socket ops do have to be synchronized.
01:41aphyr(just to prevent parallel invocations from writing their messages over each other)
01:42_ato(with-open [conn (open "someserver")] (send conn "hello!"))
01:42tomojand the threads all block on writes/reads
01:42aphyrStrictly speaking no, the protocol supports both synchronous and async operations.
01:43tomojthe interfaces above wouldn't work for async, would they?
01:43aphyrNo, that's a simple example.
01:43aphyrThe async version would probably return a future from (send client)
01:44tomojif you need to support async io you might look at aleph/lamina
01:44aphyrI'm writing this to replace an aleph client. :)
01:44aphyrPerformance issues.
01:44tomojah, just curious, which version were you using?
01:44aphyrlatest snapshot
01:45aphyrztellman 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:45tomojI 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:45tomojah
01:46aphyrBasically I want to implement this sucker in java, in pure clojure, and on top of aleph
01:46aphyrThen I can benchmark and determine which is worth supporting
01:46tomojhmm.. "pure clojure"
01:46aphyr<sigh>
01:46tomojthat means writing a new netty wrapper or bare nio?
01:46aphyrYeah, either a netty handler or on top of DatagramSocket & friends
01:47aphyrI've already got my netty UDP server written and it smokes the pants off lamina
01:47tomojin pure clojure?
01:47aphyrby like 2 orders of magnitude, haha
01:47aphyrClojure wrapping netty handler with proxy, yeah
01:47tomojcool
01:47aphyrI figure that's a pretty good tradeoff for my sanity vs performance
01:48aphyr620K ops/sec
01:49tomojso here you have multiple client threads sharing one udp socket?
01:49aphyrYeah. Well, later it's gonna be a connection pool
01:49aphyrBut for now one socket
01:50tomojI guess it is still unclear how to do this kind of stuff in pure clojure..
01:51aphyrYeah, in fact most of the clojure IO I see in the wild is just calling into mutable java objects
01:51tomojI 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:51aphyrWhich I think makes sense, for performance and code clarity
01:52aphyrYeah, and lamina is the other big one. I think Lamina itself has a ton of potential, even if aleph is immature at present.
01:53tomojhave you seen cljque?
01:53aphyrNo! *googles
01:53tomojhttps://github.com/stuartsierra/cljque/
01:54tomojI don't know what a client looks like there
01:54tomojor.. would look like? not sure if it's even that far yet
01:54aphyrYeah... the discussion on async events is fascinating too
01:55tomojI tried to grok cljque a while back but gave up for now
01:56aphyrurrrgh, more problems than answers, haha
01:56aphyrMaybe I'll dive into the pure-java client for now, see if that clears my mind any
01:58tomojI 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:08devncljque is a lot of thinking
02:08devnlamina is a lot of thinking
02:08devncljque has inspirations that stem from the RX framework a la Erik Meijer
02:10tomojwe have a partial rx port floating around here
02:10tomojI don't really like the idea of a direct port
02:10devnclojurescript one has some FRP in it
02:10clojurebotTitim gan éirí ort.
02:11tomojas in, events and behaviors?
02:12devn*nod*
02:12devnit's *inspired* by FRP
02:12devnthat doesnt mean it embodies it exactly, mind you
02:14muhoothe aliens have landed
02:14muhoo(demo 60 (sin-osc [(mouse-x 500 5000) (mouse-y 100 1000)]))
02:15tomojwhereabouts?
02:15muhooon the moon http://www.youtube.com/watch?v=eJDJ1ALa9Eo
02:15tomojheh, I mean, where is the frp in one?
02:16tomojoh, dispatch.cljs?
02:16muhoofrp?
02:16muhoofiberglas-reinforced plastic?
02:17tomojso just events, no behaviors
02:17tomojthe ways in which behaviors would be useful are still mostly obscure to me
02:28emezeskemuhoo: functional reactive programming
02:54muhooemezeske: thanks
04:36sorenmacbethcould someone help me out calling this macro from a function
04:36sorenmacbethhttps://gist.github.com/39313f6f35935a2e27a3
04:37sorenmacbeththe class-name var in the let binding isn't getting eval'd
04:37sorenmacbethwhen passed to the macro. I know it has something to do with compile time vs macro expansion time
04:37sorenmacbethbut I can't figure out how to make it work
05:00Sindikathello 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:12Sindikati previously did "lein plugin install swank-clojure 1.3.4"
05:15hoecksorenmacbeth: 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:16sorenmacbethyes
05:16sorenmacbethhoeck: correct
05:17hoecksorenmacbeth: so it depends on the programs input at startup, or is it always the same?
05:18sorenmacbethhoeck: it depends on a some Java classes that may change
05:19Sindikatnevermind i found the solution
05:21hoecksorenmacbeth: 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:23sorenmacbethhoeck: 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:24hoecksorenmacbeth: mk-property-tap should return the code for these defns
05:25sorenmacbethhoeck: ah, return an anonymous fn and then name it in bootstrap-schema you mean
05:25hoeckno, just the code
05:25hoeckand then, in a macro, call the function (which returns the code)
05:26tomojsorenmacbeth: what is it exactly a defn can't do?
05:26tomojuse `/~/~@?
05:26hoeck$((fn [x] `(defn ~x [] 'foo)) 'a)
05:27hoeckwhere are the bots?
05:27Sindikathow to find documentation on defproject macro using clojure repl?
05:27sorenmacbethSindikat: defproject is part of leiningen
05:27clgv,((fn [x] `(defn ~x [] 'foo)) 'a)
05:27clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
05:28clgv&((fn [x] `(defn ~x [] 'foo)) 'a)
05:28lazybot⇒ (clojure.core/defn a [] (quote clojure.core/foo))
05:28clgvclojurebot seems to be ill, still
05:28hoecksorenmacbeth: 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:28hoeck&((fn [x] `(defn ~x [] 'foo)) 'a)
05:28lazybot⇒ (clojure.core/defn a [] (quote clojure.core/foo))
05:29sorenmacbethhoeck: ok, I think I understand
05:29sorenmacbethhoeck: thanks for the help
05:29hoecksorenmacbeth: youre welcome
05:30Sindikathmm
05:30Sindikatwhen 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:33sorenmacbethhoeck: ha, all I had to do was change mk-property-tap to defn instead of defmacro and it worked fine
05:34hoecksorenmacbeth: great, thats actually good style, generating code with a couple of small functions and only use the defmacro to call them
05:34jtoyI'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:42llasramjtoy: For your current env, check out the the :reload and :reload-all flags to require
05:43llasramjtoy: But you'll probably want to integrate vim with your REPL
05:43jtoyllasram: ok, thanks, ill research some more
05:51jtoysilly question, how do I tell clojure to return a list of 1? (1) doesn't work
05:52llasramIdiomatically, you usually will want a vector: &[1]
05:52llasramEr,
05:52llasram[1]
05:53llasramBut you can quote a list: '(1)
06:11tomojI forgot about cucumber in clojure
06:12Sindikatwhy doesn't (require 'clojure.contrib) work in repl?
06:13llasramlazybot: contrib?
06:13llasramMan, I wish I remembered how to trigger it's snippet
06:14clgv~contrib
06:14clojurebotMonolithic 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:14llasramAh!
06:14llasramThank you, clgv :-)
06:14clgvtopics on clojurebot are always via ~
06:14llasramGot it
06:14raekSindikat: there is no namespace called "clojure.contrib"
06:14Sindikatdoes that render all references to (require 'clojure.contrib) in Programming Clojure unusable? :)
06:15clgvSindikat: no, not at all. just use clojure 1.2.1 and contrib 1.2.0 and play with those examples
06:15raekyou have to require the specific namespace you want to use, for instance clojure.contrib.base64
06:16raekSindikat: 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:16Sindikatraek: i try to (require 'clojure.contrib.str-utils), says it's not in classpath
06:16raekSindikat: then you can follow the tutorial or book you are reading
06:16raekSindikat: how did you start clojure?
06:16raek(contrib is not included in clojure itself)
06:16Sindikati did
06:17raekSindikat: you use leiningen?
06:17Sindikatlein plugin install swank-clojure 1.3.4 then in emacs clojure-jack-in
06:17raekSindikat: ok, you need to add clojure-contrib to the project.clj file
06:17raekthe default project.clj template does not include it
06:18raekSindikat: also, clojure.contrib.str-utils has been deprecated in favor of clojure.string since clojure 1.2
06:18Sindikatnow it looks like :dependencies [[org.clojure/clojure "1.3.0"][org.clojure/clojure-contrib "1.3.0"]])
06:18raekSindikat: there is no monolithic contrib for clojure 1.3
06:18raekmonolithic contrib has been split up into separate projects
06:19Sindikatanyway, i want to have the latest code, i can manage inconsistencies
06:19raekso 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:20raekSindikat: as clgv mentioned, this page lists the new projects: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
06:21Sindikatraek: so what is the recommended behavior? list dependencies in project.clj then run lein deps?
06:21raekyes
06:22Sindikatbtw, why does 'lein search foo' takes forever? i have lein 1.7.0
06:22raekdoes it say that it is downloading the index?
06:23raekit has to download the maven index once, and that takes a *long* time
06:23Sindikatyep
06:24raekthe latest [group/artifact "version"] info should be mentioned in the readme of the dependency
06:33Sindikattrying to find anything about (doc) function on clojure.org, nothing
06:34llasramSindikat: It's unfortunate, but the clojure.org site isn't all that useful. For annotated online documentation, I recommend http://clojuredocs.org/
06:35llasramAlthough it doesn't have any more than the doc tring for `doc', unfortunately http://clojuredocs.org/clojure_core/clojure.repl/doc
06:36Sindikatllasram: in slime repl (doc ...) doesn't work: "Unable to resolve symbol: doc in this context"
06:36_atoI think it was moved to clojure.repl in 1.3
06:36_atohttp://clojure.github.com/clojure/clojure.repl-api.html#clojure.repl/doc
06:36llasramAh, try first: (use '[clojure.repl :only [doc]])
06:37llasramOr maybe even just (use 'clojure.repl)
06:37Sindikatwhy doesn't (require 'clojure.repl) (clojure.repl.doc 'clojure.string) work?
06:38_atoclojure.repl/doc
06:39Sindikatcool, thanks
06:48_atoClojure 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:51kijHey, could this: http://www.youtube.com/watch?v=-xJl22Kvgjg (source maps) work with clojurescript ?
06:57_atokij: 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:36solussdany suggestions for a compelling example of clojure multimethods to demonstrate to a group of c# programmers?
07:48si14is there any reasonable library for dealing with datetime objects in clojurescript?
08:05si14and yes, it looks like there aren't ordered maps in cljs.
08:07si14it's very, very sad.
08:10jaensolussd: can't think of anything else than writing an equivalent of a visitor pattern with multimethods, dunno if that's compelling
08:10sharat87si14, what aspect of Date objects are you concerned with, won't any js libraries (with a few macros) do?
08:11solussdyeah… 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:12solussdcurrently ripping off the 'coerce' example from 'programming clojure' (thanks stuart!)
08:12sharat87solussd, also, there is a good one in the "Joy of Clojure" book
08:13llasramsolussd: 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:13solussdllasram: hah. yeah, I'm actually using serialization to demonstrate protocols and records
08:14llasramAh, ok :-)
08:15raeksolussd: you could make a simple expression evaluator
08:16raeksomething like (eval-expr '(- (* a 2) 1) {'a 3}) => 5
08:16raekit doesn't treally make use of the "multi" part of multimethods
08:17solussdhmm. how does that take advantage of multimethods though
08:17solussdyeah
08:17llasramsolussd: 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:18solussdllasram: yeah, I think the coerce example will work fine
08:36solussdhow can I get a list of java interfaces implemented by a type in clojure?
08:37raeksolussd: call supers on the class
08:37raek&(supers (class '(1 2 3)))
08:37lazybot⇒ #{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:37solussdthanks
08:38raekin my expression example the relevant types are java.lang.Number, clojure.lang.Symbol, and clojure.lang.ISeq
08:54si14sharat87: ok, maybe it will be enough.
08:54si14sharat87: just wondering if there is something already done.
08:55sharat87si14, 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:19true_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:21raektrue_droid: yes. you can compare (fn [x y z] ...) to (let [x ... y ... z ...] ...). the parameters are destructured separately
09:22raektrue_droid: but you can also use &
09:23raek(defn fun [&[x y :as lst]] ...)
09:23llasramooh, nice hack
09:23raekthen the function can also take any number of arguments (not only 2)
09:24raekincluding zero and one arguments
09:27true_droidraek: it's a nice syntax, but the semantic changes depending on the ways args are passed
09:27true_droidhttp://pastebin.com/N6fijqat
09:30llasramtrue_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:30llasramBut that wouldn't be too difficult
09:33true_droidllasram: I see, thanks for the explanation
09:34true_droidcould anyone take a look at this implementation of mergesort and point out obvious blunders? https://gist.github.com/2135276
09:38true_droidI'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:39true_droidbut, it might take an O(n) to put a seq into a vector, right?
09:40true_droidthese seqs are tricky to get right
09:55clgvtrue_droid: not that tricky. putting the seq in the vector means realizing completely. Hence, O(n) effort.
09:57true_droidclgv: 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:58true_droidwe can then perform arithmetics on that argument and leave the sequence alone
09:59clgvtrue_droid: (if (seq xs) ...) is the idiomatic version of (if (nil? (next xs)) ...)
09:59clgvtrue_droid: ah well you have to switch the then and else case
09:59raek(empty? xs) is also defined as (not (seq xs))
10:00clgvtrue_droid: you can shorten that 'if to (when (seq xs) ...do...sorting...)
10:00clgvexcept if you really need to return an empty seq if 'xs was empty
10:01true_droidthanks, raek and clgv, I'll remember that
10:01clojurebotI don't understand.
10:01clgvclojurebot: why?
10:01clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
10:16rhcRaynes: 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:44lynaghkpandeiro: 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:45lynaghkAlso, 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:46gfredericksis there a clean way to created a namespaced keyword dynamically?
10:46rhcRaynes: err, ACTION something and /me something
10:46gfredericksi.e., without repeating the ns-name as a fragile string literal
10:46gfredericksI assume (keyword (str *ns*) "foo") wouldn't work
10:46pandeirolynaghk: 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:48lynaghkyes, but everything in c2.layout is within a big (comment) block = )
10:48pandeirolynaghk: oh am i using stale c2? :)
10:48lynaghkpandeiro, yeah, it sounds like you might be.
10:49clgvgfredericks: why not?
10:49lynaghkCLJS stuff will hopefully be much cleaner within the next fortnight or so.
10:49clgv&(keyword (str *ns*) "foo")
10:49lazybot⇒ :sandbox6997/foo
10:49pandeirolynaghk: hmm, actually the ns declares the dep
10:49pandeirothat's what's tripping of the google compiler
10:49pandeirolynaghk: dont worry bout it
10:49pandeiroi figured youd be documenting the cljs side of things soon
10:50TimMc&(with-meta :foo {:bar true})
10:50lazybotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to clojure.lang.IObj
10:50lynaghkpandeiro: I just pushed a fix.
10:50TimMcOK, good.
10:50lynaghkpandeiro: we're using c2 on two client projects right now, so any cljs cleanup will be for purely selfish motives don't worry = )
10:51pandeirolynaghk: well allow me to reap the benefits then :)
10:51pandeirolynaghk: any idea what i'd need to change to modify the choropleth example to a map of brazil?
10:52pandeiroi got the shapefiles i needed, turned them into lean ("lean") geoJSON
10:52lynaghkThere is a world map in the Vomnibus depedency
10:52lynaghkoh, if you already have that then you're pretty much set.
10:52pandeiroyah i needed municipal data
10:52pandeiroyeah i got it
10:52pandeirobut the problem i have are the coordinates
10:52pandeirois that just as simple as modifying one of the vals in alpers?
10:52pandeiroeg coordinates?
10:52lynaghkif you can do it in clj, that would be cleaner since it is all working in there.
10:52gfredericksclgv: I assume that when you call that function from another namespace that *ns* would not be what you expect
10:52pandeirolynaghk: sure i will do it there
10:52pandeiromy problem is that brazil shows up way down south in the svg
10:53pandeirosince the alpersUsa is oriented to show the US at its lat/lng i imagine
10:53clgvgfredericks: what exactly are you doing? you can also do (keyword any-string "foo")
10:53lynaghkin 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:53pandeirolynaghk: cool i will check that out first
10:54lynaghkpandeiro: the albers constructor takes kwargs for origin and parallels, so you can centre it on brazil
10:54gfredericksclgv: 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:54TimMcgfredericks: *ns* is a var -- it should take the value of the top-level namespace.
10:54pandeirolynaghk: beautiful that's what i needed, thanks
10:55lynaghkpandeiro: 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:55gfredericksTimMc: so if I say (ns foo) (defn make-keyword [] (keyword (str *ns*) "haha")) (ns bar) (make-keyword); what'll I get?
10:55TimMc&(require '[clojure.string :as s])
10:55lazybot⇒ nil
10:55gfrederickswell
10:55TimMc&::s/foo
10:55lazybotjava.lang.RuntimeException: Invalid token: ::s/foo
10:55pandeirolynaghk: 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:55gfredericks(ns bar (:use foo)) I should have said
10:55pandeiroi'll definitely show you what i come up with
10:56lynaghkpandeiro: rad, good luck
10:56TimMcgfredericks: Try it and tell me!
10:56gfredericksTimMc: you betcha!
10:57gfredericksdid you know that before computers the word "repl" referred to a person?
10:57TimMcha
10:57gfredericksversion control required a whole team of secretaries
10:58RickInGAif & triggers lazybot and , triggers clojurebot, what is the prefix to trigger TimMcbot?
10:58gfredericksTimMc: yes indeed the *ns* has changed to bar
10:58TimMcCHOCOLATE
10:58RickInGACHOCOLATE(+ 1 2)
10:58gfredericksso the function returns :bar/haha
10:59TimMcRickInGA: 3
11:00RickInGAnice... kind of high latency though
11:00TimMcIt's greek to me.
11:00gfredericksTimMc: spin up another instance of TimMcBot for higher throughput
11:00TimMcOh, sorry - I thought you were addressing me.
11:03clgvgfredericks: I still dont get what your actual problem is^^
11:03gfredericksclgv: so what I will end up doing is creating a helper function like (def make-keyword (partial keyword (str *ns*)))
11:04gfrederickswhich has a different behavior from (defn make-keyword [s] (keyword (str *ns*) s))
11:24clgvgfredericks: thats because partial is a function. so the current value at definition time is passed to partial and not the variable *ns*
11:25gfredericksclgv: yes; my original question was how do I avoid the behavior of the latter
11:25clojurebotCool story bro.
11:25clgvgfredericks: defn ^^
11:26gfredericksclgv: I was hoping there was a simpler way to get the compile-time namespace
11:26gfredericksbut it seems a helper function or macro is the only way
11:27clgvcompile-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:27gfredericksclgv: of the helper
11:28gfredericksthe namespace of the file I'm creating the keyword in
11:28gfredericksthere's really only one namespace I'm concerned about, I just know that by runtime *ns* will be something else
11:28TimMcMan, a bare #= does weird things on the REPL.
11:28gfredericksso I can't get anything interesting from *ns* at runtime
11:29clgvgfredericks: 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:29gfredericksCHOCOLATE#=(str "foo")
11:29gfredericksclgv: you mean with a string literal?
11:29clgvyeah
11:30gfredericksclgv: I wanted to avoid the repetition; avoid bugs that would creep in if I ever changed the ns
11:30clgvah kk
11:30pellebMy oauth2 provider library is starting to reach a usable state. I'd really love feedback. https://github.com/pelle/clauth
11:31TimMcgfredericks: SANBOX DENIED
11:49gfrederickstechnomancy: where are all your fabeled alternate paredit bindings? they don't seem to be in your dotfiles repo
12:06juhu_chapaHi clojurians, Any help to use leiningen with a socks proxy?
12:16sritchiecemerick: sent you a pull request
12:16sritchiecljs views worked great, btw
12:16sritchiecemerick: ad-hoc-views seems broken, unfortunately
12:16cemerickon cloudant, you mean?
12:16cemerickor everywhere?
12:16sritchiecemerick: locally as well
12:17sritchieI filed a ticket with my error
12:17cemerickhum; ok
12:17sritchieusing the cljs maven artifact works great, though
12:17cemerickthanks for the pull req, I'll take a look tomorrowish
12:21cemerickdammit, fliebel had a pull req on the same topic a month ago, but I never got an email for it, either
12:21cemerickgithub notifications are so g.d. broken
12:21fliebelcemerick: ??
12:21lazybotfliebel: What are you, crazy? Of course not!
12:21ibdknoxcemerick: yeah they are :(
12:22cemerickfliebel: 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:22fliebelcemerick: I didn;t know about it either, let me check what i did :)
12:22cemericksritchie just redid it likely for no reason
12:23sritchiefliebel: whoops, didn't see htat
12:23cemerickibdknox: 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:23fliebelcemerick: Oh, that, right...
12:24ibdknoxwe 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:24ibdknoxso things ended up misplaced at times :/
12:25cemerickfliebel, sritchie: I'm sorry for the snafu.
12:26sritchiebetter be, you bastard
12:26fliebelsnafu?
12:26cemerickibdknox: I've got all the notification checkboxes on, nothing in the spams, and I get other less valuable github emails constantly.
12:26sritchiecemerick: just kidding, deleting a few directories is no problem :)
12:27cemerickwell, it's unnecessary
12:27cemerickContributions are too valuable to lose to not getting an email out to the repo owner.
12:28fliebelI wonder if it's just broken, or part of some magic workflow... In case your name is Linus Tovalds.
12:32Karl_dscchi, 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:33sritchieKarl_dscc: looks like it's conjing each element of the second list onto the first
12:33sritchie,(conj '(1 2 3) 4)
12:33Hali_303hi!
12:34clojurebot(4 1 2 3)
12:34raekKarl_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:34gfredericksKarl_dscc: I think it's somewhat the point of into that it treats different structures differently
12:35raekalso, the type of the second argument to 'into' is not relevant, except that it must be seqable
12:35Hali_303I'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:35raekHali_303: try 'assoc'
12:36raek&(assoc {:a 1, :b 2} :c 3)
12:36lazybot⇒ {:c 3, :a 1, :b 2}
12:36TimMcHali_303: and or
12:36TimMcor rather, and
12:36raekfor the conditional part, use if
12:36TimMcHali_303: What happens if a test fails?
12:37raek(if some-test (assoc m ....) m)
12:37Hali_303the rest should be still evaluated and added
12:37Hali_303so I was thinking about using the -> operator, I just don't know how to combine the if into the assoc
12:38raek-> is just a shorthand notation. you need to be able to express it without -> first
12:38Hali_303raek: oh I see, i should just return the input map
12:38Hali_303ok, thanks :)
12:38Hali_303I'll try
12:39raekyou can do something like (let [m0 ..., m1 (if x (assoc m0 ...) m0), m2 (if y (assoc m1 ...) m1)] ...m2...)
12:39raekthis resembles assignment in imperative languages a bit
12:40dgrnbrghow do i set the JVM that lein uses?
12:40technomancydgrnbrg: JAVA_CMD
12:40technomancyenvironment var
12:40kurtharrigerWhen 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:40dgrnbrgtechnomancy: thanks
12:40Hali_303yes.. I guess i still think imperatively, because I forgot to think about the case when if returns the map unchanged :)
12:41dgrnbrgtechnomancy: I point that at java, and it'll pick up javac too?
12:41technomancyI don't know; maybe
12:41ibdknoxjava logging is retarded
12:42RickInGAibdknox: have you ever used korma with a .dbf?
12:43ibdknoxwhat's a .dbf?
12:43RickInGAfoxpro free table
12:43RickInGAI take it that's a no :)
12:43technomancykurtharriger: it should run the :repl-init ns, but it can't affect *ns*
12:43ibdknoxhaha no :)
12:43ibdknoxRickInGA: in theory, if there's a jdbc driver for it, it would maybe work
12:44RickInGAwhat keys are acceptable for defdb? will :connectionstring work?
12:44clgvtechnomancy: is a 1.7 update with the "(if (windows?)" patch out yet?
12:45technomancyclgv: 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:46Hali_303if there some setting in paredit to show the pair of the parenthesis the cursor is currently on?
12:47ibdknoxRickInGA: it needs these: https://refheap.com/paste/1235
12:47raekHali_303: does show-paren-mode do what you want?
12:48gfredericksraek: it does what _I_ want!
12:48Hali_303raek: yes :) thanks
12:49Hali_303I tought that paredit will do it by itself
12:50RickInGAibdknox: 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:51RickInGAibdknox: 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:51ibdknoxRickInGA: subprotocol: odbc:Driver={Microsoft dBASE Driver (*.dbf)};DefaultDir=E
12:51ibdknoxRickInGA: subname: \\db
12:52ibdknoxI think
12:52RickInGAibdknox: thanks, I will try that
12:53clgvtechnomancy: good to hear :)
13:00pandeiroibdknox: 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:00pandeiroi changed out the requirements in views/common and main and still it is looking for hiccup.page-helpers
13:00ibdknoxpandeiro: ah, I should go change that for the latest hiccup, but yes that's probably the issue
13:01pandeirowish i could help but i'm kinda stumped by this, stacktrace points to app.server:1
13:02ibdknoxpandeiro: just change hiccup.page-helpers to hiccup.page
13:02pandeiroibdknox: yeah did that
13:02ibdknoxstill broken? hm
13:02ibdknoxone sec
13:04technomancyclgv: https://github.com/technomancy/leiningen/issues/455 is also blocking 1.7.1
13:06clgv technomancy: just tried that one on Ubuntu and cant reproduce
13:07technomancyclgv: apparently it's specific to java7
13:07ibdknoxpandeiro: ah, the issue is in noir-cljs
13:07ibdknoxpandeiro: fixing
13:08clgv technomancy: that might be the cause. I am still using java 6
13:08pandeiroibdknox: interesting, i was thinking it might be somewhere in noir
13:12ibdknoxpandeiro: use noir-cljs 0.3.0
13:14pandeiroibdknox: you put it on clojars before even updating github?
13:14RickInGAibdknox: 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:14pandeiroibdknox: nm :)
13:15ibdknoxsometimes I do
13:18pandeiroit would be cool if grep could look through jars
13:19dan_bunzip -c foo.jar | grep # ?
13:19dan_bactualyl -p might be better than -c
13:20pandeirodan_b: yeah but no comparison between that and `grep -r needle`
13:20dan_btrue
13:24hagnacan I write to #<URL jar:file:...> or should I not bother
13:26hagnaseemed like a good place for application configuration data
13:35sorenmacbethcan someone tell me how to get this function to actually execute the Cons, instead of just returning it?
13:35sorenmacbethhttps://gist.github.com/a3445412323faa490f3a
13:36TimMcsorenmacbeth: defmacro
13:37TimMc(defmacro def-edge-tap ...)
13:38sorenmacbethTimMc: 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:39TimMcsorenmacbeth: So put that (let [md ...]) inside the syntax quote.
13:39TimMcMake sure to gensym# the bindings.
13:40sorenmacbethTimMc: ahhh, I see
13:40sorenmacbethTimMc: I'll try that
13:40sorenmacbethTimMc: cheers
13:40TimMc:-)
13:48Hali_303is 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:49Hali_303eg. the function parses a string, but the parse fails
13:51emezeskeHali_303: The idiomatic thing to do is almost always to return nil I think
13:51emezeskeHali_303: It's much easier to do an "if-let" when calling a function than to do a try..catch
13:52hagnaemezeske: yeah no kidding
13:54Hali_303emezeske: true
13:56raekHali_303: in some cases it makes sense to return nil, but when it doesn't, use the "slingshot" library
13:56raeksomething like it will probably be merged into clojure eventually
13:57raekI think parsing is a case where it makes sense
13:58cemerickraek: did you ever end up writing an openid auth library/wrapper?
13:58ibdknoxcemerick: Raynes has something I thikn
13:58raekcemerick: no, are you sure it was me?
13:58cemerickibdknox: I think he opted for BrowserId; but hey, if Raynes has something, I'm all ears.
13:59ibdknoxah
13:59raek(I did think about it at some point, though)
13:59cemerickraek: http://clojure-log.n01se.net/date/2010-07-25.html
13:59ibdknoxI think you're right
14:00cemerickI'd very much like to avoid trying to integrate spring-security with ring-jetty-adapter
14:08pandeiroibdknox: is there any need for the lein-cljsbuild plugin when using the cljs-template?
14:09ibdknoxpandeiro: 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:10pandeiroah it already has a repl ns?
14:11ibdknox(noir.cljs.repl/browser)
14:11ibdknoxrun that from a normal lein repl
14:11ibdknoxand you're off to the races
14:12pandeirowould it be possible for me to add that to :repl-init in the project.clj i wonder
14:15pandeirocool that works
14:17ibdknoxthat would be neat with profiles
14:17pandeirohow do you mean?
14:17ibdknoxcreate a cljs profile that runs that whenever you start the repl
14:17ibdknoxlein2's profiles
14:18ibdknoxthen I could add that to the template by default
14:18ibdknoxand you could start either a cljs repl or a normal one depending on which profile you use
14:19pandeirohow do you specify that? in the project clj?
14:20ibdknoxare you using lein2?
14:20pandeironope not yet
14:20pandeirodo you recommend making the jump already?
14:20ibdknoxah, it's only for lein2. But yeah, you'd just specify it in the project.clj
14:20ibdknoxnot quite yet
14:20ibdknoxyou could install it side-by-side
14:20pandeiroibdknox: imo it's simple enough to have a (browser) invocation to jump from clj to cljs repl
14:21ibdknoxyep
14:21ibdknoxI agree for now :)
14:21pandeiroi just like not having to change namespace
14:21pandeiro(and remember which namespace the repl fns are in)
14:23sorenmacbethin the following macro, how can I get fn-name# to expand to in binding?
14:23sorenmacbethhttps://gist.github.com/6e5207df3c22fc7db19e
14:23sorenmacbethI don't what the name of the defn to be fn-name__auto__234234
14:24sorenmacbeths/what/want/
14:25sorenmacbethI want to be the symbol that fn-name# is bound to
14:25tomoj~fn-name# ?
14:25clojurebotExcuse me?
14:26tomojhmm
14:26tomojthat won't work though, eh
14:26sorenmacbethtomoj: it says it can't resolve fn-name#
14:26tomojI feel vaguely like there's a ` in the wrong place
14:27tomojshould the (let [md# ..]) be quoted? I feel vaguely like it should be unquoted
14:28dnolensorenmacbeth: manual gensym outside syntax-quote
14:28tomojno need for a gensym?
14:28dnolensorenmacbeth: you don't want fn-name to be gensym, then don't
14:29sorenmacbethdnolen: I think I follow you
14:30sorenmacbethdnolen: know of an example I could look at off-hand?
14:32tomojsorenmacbeth: this seems closer https://gist.github.com/f8fb9171f39fb4ebf5d2
14:32tomojstill at least a bit wrong
14:32tomoj(with a (list* 'do (for ...)) it should be good?
14:33sorenmacbethtomoj: that doesn't work (was near my first attempt) because the params I'm passing to the macro are inside a let binding
14:33sorenmacbethdnolen: I need ~property-class to be inside the syntax-quote because the param is passed inside a let binding in some cases
14:34tomojyou mean that property-class needs to be evaluated?
14:34sorenmacbethtomoj: yeah
14:38Hali_303this 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:38dnolenHali_303: oversight probably
14:51Hali_303back 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:53dnolenHali_303: signaling an error by returning nil probably not a good idea, use another unique value and document it.
14:53dnolenHali_303: if the developer doesn't handle it, it's not your problem - you documented it
14:55Hali_303dnolen: what do you mean by unique value?
14:55dnolenHali_303: ::my-unique-value, or if you're paranoid (def my-unqiue-value (Object.))
14:55Hali_303dnolen: oh i see
14:58Hali_303dnolen: 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:58gfredericksis the who-calls function in swank-clojure supposed to be working?
14:58sorenmacbethdnolen: 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:58devngfredericks: i believe so...
14:59dnolenHali_303: there's a lot of noise in Clojure stacktraces but they are very precise.
14:59technomancygfredericks: well...
14:59technomancysorta
14:59gfredericksI get "error in process filter: Wrong type argument: char-or-string-p, nil"
14:59technomancyit's not really much smarter than grep
14:59gfredericksI tried loading the file as well, same thing
15:01Hali_303dnolen: i see, well..
15:01gfrederickstechnomancy: "slightly smarter than grep" is probably good enough for me
15:02Hali_303thank you all, cu l8r
15:02technomancygfredericks: no, I think you need "slightly smarter than grep and not broken".
15:02gfrederickstechnomancy: what? do they make those??!
15:06tomojsorenmacbeth: well, I'm stumped
15:07sorenmacbethtomoj: me too. thanks for taking a shot at it
15:07tomojI think I ended up giving up and doing some hack with eval when I was in a situation somewhat like yours, with protobuf
15:08tomojyep: ";; TODO eval?!"
15:09TimMcsorenmacbeth: What's the latest paste URL?
15:09TimMcOh, found it.
15:09sorenmacbethhttps://gist.github.com/6e5207df3c22fc7db19e
15:12TimMcAh, I see. You've got a defn inside a for block. That can't end well.
15:13TimMcsorenmacbeth: Does (macroexpand-1 '(mk-property-tap ...)) give a reasonable result, or does it error?
15:13sorenmacbethTimMc: it doesn't error
15:14TimMcAnyhow, you're trying to mix expansion time and runtime stuff.
15:14sritchiesorenmacbeth: we hacked w/ eval as well
15:14tomojhuh, is there no way around it or it's just hard?
15:14sorenmacbethTimMc: yeah
15:14sritchienot sure, that was nathanmarz when he was learning clj
15:15TimMcsorenmacbeth: That for block depends on a value, but it's goingto run outside the macro (that is, at runtime)
15:15sritchiesorenmacbeth: you'll probably have to quote those cascalog symbols
15:17tomojmaybe it's not a hack to use eval to reflect on thrift
15:17sritchiesorenmacbeth: use ~'?symbol-name or ~'_ for cascalog symbols
15:18sorenmacbethsritchie: I though so too, but it seems to work
15:18sritchiecool
15:18sorenmacbethsritchie: I'm not sure how to go about hacking this up with eval
15:20TimMcsorenmacbeth: Looks like you need runtime values from md, f, val-id, val-name, and fn-nme
15:20TimMcso the syntax-quote needs to get pushed down to just be around teh defn again
15:20sorenmacbethTimMc: what I'm doing now is moving the entire for loop out of the macro and into the calling fn
15:21TimMcNot sure that helps...
15:21tomojif you (eval property-class) etc, it seems to get easier?
15:21sorenmacbethTimMc: yeah, so now the syntax-quote is just around defn and there is no let
15:21tomojbut that seems funny
15:21TimMcsorenmacbeth: Re: moving the for loop... you're still trying to mix runtime and expand-time info without eval.
15:22TimMcThe macro expand will happen before that for loop ever runs.
15:22tomojhuh, doing eval'ing property-class etc would just be like making it into a function instead of a macro, no?
15:22sorenmacbethTimMc: like so: https://gist.github.com/899a400cd837369d306d
15:23dsantiagoIs it possible to hint a function to return a primitive?
15:24pjstadigdsantiago: i think only as long or double
15:24ferdhey... 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:24dsantiagoThat's fine.
15:26ferddsantiago: 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:27technomancyyou can contribute to it without signing paperwork
15:27sorenmacbethTimMc: here is the macro and the calling fn: https://gist.github.com/899a400cd837369d306d
15:27Bronsalol
15:28TimMcsorenmacbeth: mk-prop-tap is going to get 'id 'name 'val-id 'val-name, the symbols
15:28dsantiagoferd: 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:28Raynestechnomancy: Hahaha
15:28dsantiagoI'm actually working on performance enhancements as we speak.
15:29rindolfHi all. I'm getting an exception with this program - how can I fix it? http://paste.debian.net/160439/
15:29sorenmacbethTimMc: even though they are unquoted inside the syntax quote?
15:29ferddsantiago: thanks. From the docs, looks like clojure-csv will be my first pick
15:29TimMcsorenmacbeth: Doesn't matter. The macro receives syntax, not data values.
15:30sorenmacbethTimMc: damn, right.
15:30dsantiagoferd: Send me a note or file an issue on github if you have any problems, I can usually turn things around pretty quickly.
15:31ferddsantiago: awesome. Thanks again
15:32sorenmacbethTimMc: so is what I'm trying to do impossible?
15:33TimMcSemi-impossible.
15:33sorenmacbethTimMc: I need to write a defn and use eval all over the place
15:34TimMcDunno, I'd have to study the problem in context. :-/
15:37sorenmacbethTimMc: no worries, that's for the help
15:37sorenmacbethtomoj: do you have an example of hacking something like that up using veal's?
15:37sorenmacbethevals
15:38sorenmacbethbut veals would be cool too
15:48joegalloI 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:48rindolfHi all. I'm getting an exception with this program - how can I fix it? http://paste.debian.net/160439/
15:48sorenmacbethjoegallo: lulz
15:49joegallorindolf: i think you are trying to set the root binding of a var with set!. it doesn't work like that.
15:49rindolfjoegallo: OK.
15:49rindolfjoegallo: then how can I have mutable state?
15:50amalloyjoegallo: you act like you've never questioned where the meat in #() sandwiches comes from. you are yourself a prime beneficiary of lambda veal!
15:50joegallowell, the simplest change to your program would be to put an atom in that var, and turn off the dyanmic.
15:50RaynesYou can use refs or atoms, but you aren't even close to needing mutable state for this.
15:50joegalloRaynes++
15:51rindolf:-S
15:51eggsbylol
15:51eggsbyI'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:51eggsbyon the other hand I set up autoexpect and it makes tdd a joy
15:52jakemcc`glad you like it
15:52Raynesrindolf: (doseq [s (repeatedly read-line)] (println s))
15:54rindolfRaynes: thanks! That works.
15:55Raynes(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:55amalloy(repeatedly #(println (read-line)))
15:56rindolfHow do I terminate on end-of-file?
15:58tomoj(while (when-let [l (read-line)] (println l) l)) ? :/
15:58tomojI think I've probably used while like 3 times total
15:59Raynesamalloy: 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:59tomojsorenmacbeth: nope, sorry, my eval hack is in a significantly different context
16:00tomojI 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:01sorenmacbethtomoj: ok, I'm off to learn about veal then ;-)
16:13meliponehow 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:17TimMcmelipone: 2D array?
16:17TimMc(map seq ...) oughtta be enough
16:18meliponeTimMc: yes
16:19meliponeTimMc: okay, thanks, that works
16:24licoresse~reify
16:24clojurebotexcusez-moi
17:08pandeirois there a lib that can match similar (not identical) strings?
17:09TimMcE.g. Levenshtein distance?
17:10pandeiroTimMc: no idea but sounds promising :)
17:10lynaghkpandeiro: I've used this in the past, dunno if there is a clojure wrapper: http://secondstring.sourceforge.net/
17:11technomancyincanter has a levenshtein implementation in like 20 lines
17:11RaynesI sure wish there was an oauth library that wasn't abandoned.
17:11technomancyRaynes: oauth1?
17:11Raynesoauth2
17:12technomancythere was a talk at clojure/west on clj-oauth2
17:12technomancyit sounded pretty happenin'.
17:12RaynesWhat the shit
17:12RaynesWhere the bloody hell did this come from?
17:12RaynesI've googled so far and so long.
17:13technomancyeveryone knows you can't trust google
17:13technomancytrusting google is what leads people to riddell.us tutorials
17:13lazybotThe 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:13RaynesDerGuteMoritz: Dude. Why didn't you tell me you had an oauth library? You should have known I needed one.
17:16RaynesLooks like Pat Patterson is maintaining it.
17:16technomancyyeah, he's the guy who gave the talk
17:17RaynesAlso the guy who hasn't released anything. :<
17:21technomancyI think he's just contributing; he doesn't have push rights to clojars at least.
17:27Raynestechnomancy: Yeah, he is.
17:27RaynesBut complain I shall.
17:28RaynesWow, it uses lazytest.
17:28RaynesClassic.
17:28DerGuteMoritzRaynes: I apologize
17:29DerGuteMoritzwait I do have push rights at clojars
17:29technomancyDerGuteMoritz: I meant patterson didn't
17:29RaynesWe were talking about Pat.
17:29DerGuteMoritzah yeah
17:29DerGuteMoritzhe sent me some patches so it works with salesforce's ancient oauth2 implementation
17:30DerGuteMoritzalso a ring middleware which I will include soon
17:30DerGuteMoritzwhat about lazytest?
17:30RaynesI don't think it's maintained anymore.
17:30RaynesLast commit was a year ago.
17:31TimMcRaynes: That is because it has reached perfection.
17:31RaynesI'm sure.
17:31DerGuteMoritzheh
17:31DerGuteMoritzyeah I've stopped using it for new stuff, too
17:31technomancyRaynes: well neither is clojure.test =P
17:32RaynesFair enough, but the former is at least doesn't depend on contrib alpha4.
17:32DerGuteMoritzback when I started with clj-oauth2 lazytest was the only one with autotesting
17:32DerGuteMoritzlazytest has far too many badly composing macros
17:33technomancyyouch
17:33RaynesIt looks like your tests could easily be changed to clojure.test or midje.
17:33DerGuteMoritzwhich sentence?
17:33RaynesThe one I slaughtered.
17:33DerGuteMoritzyeah I should rewite them some day
17:33DerGuteMoritzwhen I have too much time on my hands!
17:34RaynesHow do you run lazytest tests?
17:34DerGuteMoritzwith clojure 2.0
17:34RaynesNever had occasion to do it before.
17:34DerGuteMoritzI have this autotest thingy
17:35DerGuteMoritznot sure about the original name, my shell alias is called clj-autolazy
17:35DerGuteMoritzbut lein test should probably work
17:35RaynesDoesn't seem to do anything, sadly.
17:36RaynesI think I'll take a shot at moving these tests.
17:36RaynesDoesn't look that bad.
17:36DerGuteMoritznice!
17:36DerGuteMoritzfeel free
17:36DerGuteMoritz(brb)
17:40DerGuteMoritzre
17:41DerGuteMoritzso how was pat's talk? will there be a video?
17:45daakui 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:45aperiodicDerGuteMoritz: 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:55DerGuteMoritzaperiodic: alright, thanks for the info!
18:16hagnain clojure why can I do java.io.FileInputStream without explicitly importing first?
18:16raekhagna: 'import' does not cause the class to be loaded, it just gives it a shorter name
18:16amalloybecause that's how the jvm works. importing classes is just for programmer convenience
18:17raekhagna: the JVM automatically loads classes when they are used the first time
18:18Raynesamalloy: 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:18amalloyugh, brogrammer and progamer. two words i wish would die
18:18RaynesYou and me both, pal.
18:22eggsbywrite some source codes brah
18:25jodarois there a brogamer too?
18:26ssiderisall gamers are bros
18:26aperiodicnot at all true
18:27rahcolaif 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:28rahcolado I have access to the Servlet object so I could use .getInitParameter()?
18:29eggsbyis anyone itc bored enough to do a style review of my simple clojure script? I feel like I'm doing things Wrong(tm)
18:35hagnaraek, amalloy ok thanks didn't know that
18:36aperiodiceggsby: 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:39eggsbyhahah sorry :)
18:39eggsbyhttp://pastie.org/3637090 I'm just wondering if there is anything glaringly obviously wrong
18:39aperiodicno problem, just trying to help you get feedback :)
18:39eggsbybut I will take any tips anyone has to give, I'm a clojure babby
18:42Rayneshttps://refheap.com/paste/1240 For people who are put off by pastie's atrocious Clojure syntax highlighting.
18:43RaynesHoly crap, that font looks terrible on this monitor.
18:44RaynesOr, I guess it's just how far I'm sitting away from the screen.
18:44RaynesI really hate bothering with fonts. Nothing I choose ever satisfies everyone.
18:47aperiodicI'm one of the most typographically picky people I know, and I think it's fine
18:47RaynesYeah, it looks fine on my laptop monitor.
18:51lynaghkaperiodic: I hope I'm up there on your typographically picky list
18:52Raynesaperiodic: 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:53lynaghkAnonymous pro is rad, if you can actually get it to line up with physical pixels correctly
18:54lynaghkI used it for years at 7 pt on a netbook
18:54aperiodiclynaghk: definitely! your presentation at clojure/west was my favorite in terms of typography (though BG's came close)
18:54aperiodici'm using inconsolata-dz these days
18:54RaynesYeah, 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:55lynaghkaperiodic: thanks. Eurostile is the offical Keming Labs font, but there is also some Caecilia in there too.
18:55LajlaRaynes, my love
18:55LajlaLet us worship His Shadow together.
18:55aperiodicooh, Anonymous pro looks pretty nice
18:57aperiodiclynaghk: definitely a fan of the Caecilia
18:57lynaghkaperiodic: if you ever need to give a presentation, http://zachholman.com/posts/slide-design-for-developers/
18:57nDuffWhere did clojure.contrib.str-utils go? I don't see it in https://github.com/clojure
18:57Raynesclojure.string
18:57RaynesBut it isn't a copy.
18:58RaynesNot everything made it through.
18:58RaynesAnd things that did are likely renamed.
18:58nDuffahh; thanks!
18:59ZokaSocial REPL-ing web based REPL with built in chat http://noirmon.herokuapp.com/ringmon/monview.html
19:01sritchiecemerick, I'm seeing this now:
19:01sritchie<<"compilation_error">>,
19:01sritchie <<"Expression does not eval to a function. (
19:01sritchiecemerick: not sure how this worked this morning
19:01cemericksritchie: you can gist if you want; but if it's the same view, then…
19:02sritchieI rebuilt the view
19:02cemerickI mean, if it's the same view code, then something wonky must be going on.
19:02sritchiecemerick: https://gist.github.com/2142226
19:02sritchiehad a buddy confirm on another machine, same issue
19:03sritchiethis "new String" thing is confusing to me --
19:03sritchie"and this is just some of the error, it prints out the whole view function)
19:03sritchieis it getting wrapped in a new String() call somehow?
19:03cemericklooks like the gist is truncated?
19:04sritchieokay, I'll gist it all
19:04sritchieone sec
19:04sritchiethere
19:04sritchiefull error on the gist, sorry about that
19:05sritchiecemerick: I rebuilt the view this aft
19:05cemerickyeah, that new String bit is bizarre; nothing like that in the cljs-views ns
19:06cemerickI'm 6 months away from the code, but that doesn't strike me as right.
19:06sritchiecemerick: do you have a small example view that works w/ clutch-clojurescript?
19:07sritchiethis is couchdb 1.1.1
19:12cemericksritchie: OK, so that new String business is entirely spurious
19:13sritchieI can't see it in the design doc
19:13sritchiecemerick: https://gist.github.com/2adf9a5eb778f54b40fe
19:14cemerickok, well, that's something
19:14cemerickwhat's up with the intermediate cake key?
19:14cemerickyeah, that's your problem
19:14cemerickhttps://gist.github.com/2142292
19:14sritchiethat's the name of the view
19:15sritchiemy view name was :cake
19:15cemerickhrm, right
19:15sritchieis that diff than https://gist.github.com/2142226?
19:15cemerickok, well, the just-gisted snippet worksforme
19:16sritchietrying it now
19:16cemerickit looks isomorphic
19:16sritchiecemerick: what couchdb version are you on?
19:17cemerick1.1.3
19:17cemerickyikes, I'd hope that's not it
19:17cemerick1.1.3 / couchbase single
19:18sritchiecouchbase single isn't made anymore
19:18sritchiethey deprecated it
19:18sritchienot just deprecated, it's just not available anymore
19:19sritchieI also get a "can't recur here" error sometimes
19:19sritchiefrom the cljs compiler
19:19cemerickthe latter sounds like a cljs error?
19:19cemerickyeah, ok
19:20cemerickhuh, didn't realize they stopped distributing the thing
19:21lynaghkIs there any way to read the metadata from a form without evaling it?
19:21sritchiecemerick: on cloudant I get: JSON error (end-of-file)
19:21sritchie [Thrown class java.io.EOFException]
19:21lynaghkLike I have (def ^:xyz a 1) in a file
19:21sritchiedpetrovics might have some more info
19:21sritchiecemerick, gotta run for now, but I'm working with dpetrovics so if you find anything he'll note it
19:22dpetrovicshey guys
19:22gfrederickslynaghk: just using the reader should get you the metadata
19:22gfredericksthough in that particular case you'll have to pull out the 'a symbol and check on that
19:23lynaghkgfredericks, how do you mean?
19:23gfrederickslessee if the bots let me read
19:23lynaghk(meta (read-string "(def ^:clj a 1)")) gives nil
19:23gfredericks&(-> "(def ^:xyz a 1)" read-string second meta)
19:23lazybot⇒ {:xyz true}
19:23dpetrovicscemerick: i missed the begging of the conversation, but the issue seemed to be with getting a view, I can save them just fine
19:23lynaghkah, I see
19:23gfrederickslynaghk: because the metadata isn't on the list, it's on the symbol
19:24lynaghkgfredericks, that makes sense. Reading the second should work, eh? that covers def and defn
19:24cemerickdpetrovics: yeah, it's either a cljs compilation issue or some previously-unknown couchdb rev incompatibility
19:24gfredericksyeah I think so
19:24sritchiecemerick: btw, this is with [org.clojure/clojurescript "0.0-993"]
19:25dpetrovicscemerick: ok, bizarre that it worked for sritchie this morning
19:25sritchiethat might be it
19:25gfredericks&(read-string "(def #^{:fine (def foo 'bar)} baz 12)")
19:25lazybot⇒ (def baz 12)
19:25gfredericks&foo
19:25lazybotjava.lang.RuntimeException: Unable to resolve symbol: foo in this context
19:25sritchiedpetrovics: yeah, I don't know what was different about this AM, not worth worrying about until I think of it
19:26cemericksritchie: ok, I've not moved up to that rev yet; that may be the cause of the whole thing?
19:26sritchiemight be it
19:26sritchieare you on 971?
19:26cemerickWhat I have here works well on cloudant
19:26cemerickI'm still using the old rev I bundled
19:26sritchiegot it
19:26sritchiethat was just one of the git commits?
19:27cemerickyeah, that was pre-release
19:27cemerickmaybe roll back to that and see how that fares for you
19:27sritchiedpetrovics, try removing clojurescript from our deps and adding this:
19:27sritchie[com.cemerick/clutch-clojurescript "0.0.1-SNAPSHOT"]
19:27sritchiethen redeps, etc
19:27sritchiegotta run, guy
19:27sritchies
19:27sritchiecemerick, thanks for the help
19:27cemericksritchie: sure; if you or dpetrovics still have issues tomorrow, you know where to find me :-)
19:28dpetrovicscemerick: thanks, appreciate it
19:29dgrnbrgdoes clojure support binary literals?
19:29gfredericksno
19:31cemerickgfredericks is right; the reader is text only
19:31technomancywell
19:31dgrnbrgSo I should implement a reader macro for binary literals, right?
19:31technomancyit supports base 2 numbers
19:32gfrederickstechnomancy: I knew there'd be something...
19:32technomancythose are binary literals =)
19:32dgrnbrgassuming i have a codebase that requires tons of them
19:32dgrnbrg,(identity 0b0011_1010)
19:32clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 0b0011_1010>
19:32dgrnbrg:(
19:32technomancy,2r011
19:32clojurebot3
19:33dgrnbrgin 1.3?
19:33emezeskeNice, can you set any radix?
19:33emezeske,7r070301532
19:33clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: For input string: "70301532">
19:33dgrnbrg,2r0000_0110
19:33clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 2r0000_0110>
19:33emezeske,7r123
19:33gfredericksemezeske: not if you violate it :P
19:33clojurebot66
19:33technomancyI don't think it's particularly new
19:33gfredericks,Ar100
19:33clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Ar100 in this context, compiling:(NO_SOURCE_PATH:0)>
19:33gfredericks,10r100
19:33dgrnbrgWhere could I propose making underscore an ignored in numbers?
19:33clojurebot100
19:33emezeskegfredericks: I guess I don't have a feel for how many digits of base 7 fit in an int :P
19:34emezeske17rg
19:34emezeske,17rg
19:34clojurebot16
19:34gfredericksemezeske: it wasn't that the number was too large it was that you used a '7' digit
19:34emezeskegfredericks: DERP
19:34emezeske,42rx
19:34RaynesDerGuteMoritz: Pull request sent.
19:34clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Radix out of range>
19:35tmciveremezeske: your first base 7 example failed because it had a 7 in it.
19:35nDuffWhat ever happened to pods? I'm trying to write an interface to non-a Java library
19:35nDuffer
19:35nDuffnon-thread-safe, mutating Java library, and IIRC they would have been useful
19:35emezesketmciver: Yeah... :(
19:35tmciver,7r060301532
19:36clojurebot4992290
19:36emezeske,36rz
19:36clojurebot35
19:36tmciverthat's cool though, I wasn't aware of that.
19:36emezeske,37r1
19:36clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Radix out of range>
19:36gfredericksemezeske: bet you'll never make that mistake again though
19:36emezeskeI guess that makes sense ^_^
19:36emezeskegfredericks: Likely not, but only because I will never use a base 7 literal ^:)
19:36gfredericksmy grandma always told me to mind my base seven literals...
19:42muhoohmm, i wonder if this ever got integrated into incanter: http://jakemccrary.com/blog/2010/02/21/plotting-time-series-data-with-incanter/
19:42muhooah, i see, it does
19:42choffsteinwhat 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:42muhoonm
19:43lynaghkchoffstein: doseq
19:43choffsteinperfect. thanks lynaghk.
19:45aperiodictechnomancy: is there any way to define lein's order of compilation?
19:46technomancyaperiodic: more than just :aot [ns.one ns.two] ?
19:47aperiodictechnomancy: derp. i was using regexes.
19:48aperiodicthanks
19:48technomancysure
19:56aperiodictechnomancy: so, it seems that the ordering in the :aot vector is not preserved if there's regexes in it
19:58technomancyaperiodic: ah, tricky
19:59aperiodicthis may be my chance to earn a leiningen sticker
20:00technomancygo for it =)
20:00wmealingthere are stickers ?
20:03wmealingi'm using lein midje --lazytest , v nice.
20:05aperiodicwmealing: http://twitpic.com/2e33r1
20:06technomancyaperiodic: ohhoho; the new stickers are way better than that
20:06aperiodicoh really?
20:06aperiodicpics or they don't exist
20:07technomancyhttps://twitter.com/#!/technomancy/media/slideshow?url=pic.twitter.com%2FxpIrqEBf
20:07wmealingbrace yourselves, jpegs is coming.
20:07aperiodicawesome
20:07aperiodicyou should update the link in the readme
20:08technomancyaha; yes
20:09ibdknoxI should get cool stickers
20:09dgrnbrgI'm trying to write a reader macro but I keep getting "exceptionininitializererror"--what causes that?
20:09dgrnbrgNone of my code is in the stacktrace
20:09dgrnbrgjust compiler internals
20:10dgrnbrgand I know the dispatch fn is called, b/c it prints to stdout
20:11technomancyibdknox: need a logo first.
20:11technomancyI know a guy... =)
20:11ibdknoxhaha
20:14dgrnbrgOh I see--the reader macro needs to return a syntax fragment
20:24aperiodictechnomancy: it seems to be fixed in lein2 (ran into the issue on 1.7)
20:26technomancyaperiodic: ah, ok. I'd still take a patch for 1.7.1 if you like.
20:32ibdknoxlol: 499 watchers on Noir.
20:32ibdknoxoh the torment
20:33brehaut500
20:33ibdknoxhaha
20:33ibdknoxwooohooo!
20:34amalloyquick, someone unwatch so he can get that feeling again
20:34aperiodictechnomancy: cool; i'll open an issue and get cracking on it after work this evening
20:34ibdknoxlol
20:37technomancygreat
20:37mkare there any talks online from clojure west?
20:38qbgmk: There are slides
20:39lynaghkmk: There's a month-old draft of my talk at a SECRET YOUTUBE URL: http://www.youtube.com/watch?v=T83P3PVSy_8
20:40mkslides are good, though I prefer audio
20:41qbghttps://github.com/strangeloop/clojurewest2012-slides
20:41mklynaghk: great, thanks - the title is already interesting
20:42lynaghkmk: 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:43mklynaghk: any major errata/additions to that youtube version?
20:44lynaghkThe slides at the link qbg gave have some extra example screenshots
20:44lynaghkand the code changed a bit (unify no longer provides the mapping function with idx for each datum)
20:44lynaghkbut otherwise no, it's basically the same as the talk I gave on Saturday.
20:46ibdknoxlynaghk: had I known the value of this secret, I would've been selling this precious commodity for many monies
20:47lynaghkibdknox: next conference get me a few whiskeys and I'll tell you about the brotherhood of the charts.
20:47ibdknoxhaha
20:49TimMctechnomancy: The stickers were surprisingly translucent?
20:50technomancyyeah, that was unintentional
20:50technomancylooks fine on an aluminium surface, but crappy on a dark background
20:51technomancybut they're much bigger than the old ones
21:04TimMcWELP. Guess I'm getting a Mac then!
21:05technomancyhah
21:05technomancyit looks fine if you place it on a white label first
21:36muhoobefore i go trying to reinvent the wheel, has anyone done a real-time graph using incanter, like an oscilloscope-style plot?
21:37muhooi'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:38tomojare you hooking this to overtone?
21:39mklynaghk: that was a good talk, thanks for the link
21:46muhootomoj: actually, no, but that'd be fun :-)
21:47muhooovertone already has a scope function anyway though
21:47muhoono, 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:48tomojright, just making sure you didn't miss the overtone/sc scope
21:48tomojunfortunately I couldn't get that to work on linux :(
21:48muhooi did. it was cool, but glitchy when resizing the window
21:49muhoo*sigh*, ok, back to trying to macroexpand dynamic-xy-plot :-/
22:08muhooaha! add-points :-)
22:08muhooit's mutable :-P
22:09eggsbywhat does (. comp ..) do?
22:09eggsbyspecifically the leading .
22:09eggsbyor what would I look up to research it?
22:11RaynesIt is the Java interop form. It calls a Java method.
22:11Raynes&(.contains [1] 1)
22:11lazybot⇒ true
22:12Raynes&(. [1] contains 1)
22:12lazybot⇒ true
22:12RaynesThe former is sugar for the latter and what you should usually use.
22:12RaynesYou call a static method with ##(Character/isUpperCase \c)
22:12lazybot⇒ false
22:30wmealingwhat is the closest thing to clojure, not on the jvm ?
22:30Iceland_jackEh, Haskell? Racket? Common Lisp?
22:30xeqiclojurescript?
22:30clojurebotClojureScript is https://github.com/clojure/clojurescript
22:30Iceland_jackDepends on what you mean by closest
22:31wmealinghaskell doesn't do infix notation, does it ?
22:31Iceland_jackinfix notation? it does
22:31wmealingi mean syntax, and form behavior
22:31amalloy(. comp ..)? i would be astonished if that ever did anything good
22:31Iceland_jackso you basically want Lisp syntax
22:32Iceland_jackLiskell ;)
22:32wmealingand, its a real project
22:33wmealingi'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:34wmealingIceland_jack, can liskell do the metadata trickery too ?
22:35Iceland_jackmetadata is not a Lisp thing, rather a Clojure thing
22:35wmealingah ok
22:36eggsbythank you Raynes
22:42aperiodicis there a good reason why there isn't an "any?" function in core that i'm missing?
22:42xeqiaperiodic: some
22:42aperiodicxeqi: that doesn't have quite the same semantics
22:43aperiodicxeqi: it returns non-nil or nil, when i'd like a boolean
22:43eggsbyjust ask nil? then :p
22:44aperiodici 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:45eggsbyyou could define any? I guess by nil? + some
22:45eggsbythen just ask for the complement of any?, right?
22:47xeqiits just standard to return a value/nil then booleans
22:47xeqi*rather than
22:47aperiodicyeah, or the (comp not not-any?) from my previous comment ("not-any?" *does* exist in core, which is the most confusing part)
22:48aperiodicxeqi: why have every? and not-any? return booleans, then?
22:48xeqiwhich value from the seq would you choose for every?
22:49eggsbyyou might be used to nil punning, here we have bool punning!
22:49eggsby:p
22:51xeqiI suppose not-any? could return the first one that failed the predicate
22:51xeqibut that just sounds akward to code
22:51aperiodicit doesn't, though
22:52aperiodici guess my real question is why there's a "not-any?" but no "any?"
22:52aperiodicseems backwards to me, but this conversation is descending into bikeshed territory anyways
22:53xeqihttps://github.com/clojure/clojure/blob/14428c296de483ea666bd874701046e7088e545c/src/clj/clojure/core.clj#L2398
22:53xeqiprolly just an ease of coding thing
22:55aperiodici guess someone felt silly writing (def any? (comp not not some))
22:55aperiodicnot me, though!
22:56eggsbynot not me
22:58tmciverHa!
23:09jtoyif i use a gui editor, what should i use as a code reload mechanism for the repl?
23:12aperiodic(require :reload ...)
23:14juhu_chapawhat is the difference between (defn f [& arg]) and (def f [& [arg]])
23:14juhu_chapawhat is the difference between (defn f [& arg]) and (defn f [& [arg]])
23:16xeqi,((fn [& args] args) 1 2 3)
23:16clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
23:16xeqiheh
23:16xeqi&((fn [& args] args) 1 2 3)
23:16lazybot⇒ (1 2 3)
23:17xeqi&((fn [& [args]] args) 1 2 3)
23:17lazybot⇒ 1
23:20juhu_chapaxeqi: i do not understand it yet.
23:21xeqithe second one binds [args] to [1 2 3], which binds args to the first element
23:21xeqiin this case, 1
23:21xeqi&((fn [& [arg1 arg2]] [arg1 arg2]) 1 2 3)
23:21lazybot⇒ [1 2]
23:23tmciverI'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:26aperiodicjuhu_chapa: if you're unfamiliar with destructuring syntax, you should read over "http://clojure.org/special_forms#Special Forms--(let [bindings* ] exprs*)"
23:27juhu_chapathanks a lot: xeqi, aperiodic.
23:27aperiodicquite welcome
23:31rhcif i already know vim well, it is worthwhile to learn emacs for editing clojure coe
23:31rhccode?
23:32tmciverrhc: 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:33rhctmciver: ok, thanks, do you use emacs?
23:33tmciverrhc: yup
23:33tmciverrhc: I love it but there's definitely a learning curve if you've never used it.
23:33ZokaI use jEdit with Clojure plugin
23:33rhcwhats the repl integration like?
23:35tmciverIf you use swank it's very good, imo.
23:36xeqirhc: I hear slimv is a good slime/swank for vim
23:37rhcinteresting, thank you
23:37aperiodicrhc: there's a fork of it specifically for clojure at https://bitbucket.org/sjl/slimv/overview
23:38apwalkrhc: I'd also try out vim w/ tslime through tmux
23:38aperiodicnah, slimv is better
23:39aperiodicunless there's parts to tslime i didn't know about
23:39rhcaperiodic: ah cool
23:39rhcim gonna check out one of these screencasts/tutorials
23:39rhci feel like i don't even know whats possible :)
23:40apwalkaperiodic: it's simple and effective, without quirks, but not emacs. i use it with paredit borrowed from slimv
23:41aperiodicapwalk: tslime is just for sending text from vim to other tmux panes, right?
23:41apwalkyeah
23:41aperiodicrhc: me neither. i didn't even know about slimv until a few days ago, when someone showed me at clojure/west
23:43aperiodicapwalk: slimv gives you much more. e.g., there are commands eval current form/defn, eval the whole buffer, look up docs
23:44aperiodics/commands/commands to/
23:44rhcso 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:44tmciver_rhc: goto considered harmful!
23:45rhcexcuse me, (recur) :P
23:45tmciver_better! ;)
23:47tmciver_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:47daakurhc: if nothing else, the slow boot time for jvm/clojure combined makes it worth it to have the repl running