#clojure logs

2010-06-13

00:54scottjDid the compojure switch to strings for keywords on form-params etc mess up anyone else's apps that use congomongo or other things that use keywords for keywords on maps? There's no destructing that handles either :keys or :strs is there?
00:55KirinDavehttp://queue.acm.org/detail.cfm?id=1814327
00:55KirinDaveReally interestng.
02:13Blackfootcan i use drop-while to find the number in a sequence such that it the sum of the preceding numbers is above N
09:09bkpattisonIs it possible to change the directory that clojure looks for .clj files? Instead of "src" I would like for it to look in a path that I specify.
09:13hoeckbkpattison: only by setting the classpath
09:16bkpattisonhoeck: okay, thanks. i was hope for something programmatic (set-path ...)
09:17hoeckbkpattison: yeah, thats what the jvm requires, but ideally your IDE or dependency tool should take care of managing the classpath
09:21bkpattisonhoeck: make sense, i'll just have make sure i have all my needed directories on the classpath prior starting java instead of trying to do it programmatically after the fact
09:26hoeckbkpattison: there is also add-classpath, but its marked as deprecated and its use is strongly discouraged
09:27bkpattisonhoeck: ah. i'll avoid that. i just need to be smarter about how i invoke cloure with appropriate classpath
11:49quotemstrWhy is Clojure under the Eclipse license of all things? Is the GPL incompatibility deliberate?
11:52LauJensenquotemstr: I dont think so. The EPL was chosen for maximum freedom and to avoid clashes with other licenses
11:52quotemstrWouldn't the BSD/X11 license have been the appropriate choice in that csae?
11:52Chousukewith the constraint of reciprocality, so BSD-style licences were out
11:53LauJensenChousuke: Could you elaborate on that please
11:53quotemstrChousuke: So the Clojure people *did* want a copyleft license --- why not the LGPL?
11:54Chousukequotemstr: I don't know. I think it has some trouble with macros etc.
11:54quotemstrI don't suppose there's any chance Clojure would be dual-licensed under the LGPL as well then.
11:55ChousukeWell it's technically possible but you'd have to convince rhickey, not me :)
11:57datkaare any of you using lazytest in a 1.2 project? If so, what branch are you using? I tried the v4 branch, but am getting the error that it can't find the 'it' macro
12:02ChousukeLauJensen: Hm, I think the idea behind choosing EPL is to disallow people from making their own version of Clojure and not sharing the changes with the community
12:03Chousukeyou can embed clojure itself in a closed-source offering but if you make any modifications, those need to be distributed.
12:13OForerohi
12:13OForerois there a name convention for protocols?
12:14Licensercoookies
12:14Chousukehmm
12:14OForeroIMyProtocol ?
12:14Chousukenot I
12:14ChousukeI is for interfaces
12:14OForerobut the I looks not great
12:14ChousukeI think they're usually without a prefix at all
12:15OForerobut there are no Interfaces in clj
12:15Chousukejust Sequential or Foo or whatever.
12:15OForerook
12:15ChousukeOForero: there's definterface :)
12:15Chousukebut it's java interop, of course
12:15OForeroand if a protocol and a record have kind of the same name
12:15ChousukeI think generally they shouldn't
12:17OForerodefinterface?
12:17Chousukeyeah
12:17Chousukegenerates a java interface
12:17OForerowhere is it?
12:17OForerois not in core is it?
12:18OForeroif it is I probably need a pause and an spresso
12:22OForerommh is probably new in 1.2 ... is not even in the GH docu from RH
12:27OForerowhat would be the difference between a protocol and an interface?
12:27datkaprotocols are cooler
12:29datkaif I remember right, you can add new protocols in a way that you can't do with interfaces
12:41chouserdatka: right
12:42chouserOForero: that's the main difference -- you can create a new protocol and extend it to an existing class, even a final class.
12:43chouseralso, protocol functions are namespaced independently of the class you extend them to, unlike monkey patching.
12:43OForerothanks
13:01dsantiagochouser: How exactly does that extending work?
13:04chouserdsantiago: the protocol functions are regular Clojure functions, but they know which protocol they belong to
13:05chouserthe protocol itself keeps track of the classes it's extending
13:05datkadoesn't it work similar to a multimethod, but faster
13:05dsantiagoAh. So is that still done with the same performance as if the functions are defined in the deftype?
13:06chouserLast I checked it was still somewhat faster to define the methods inside the deftype or defrecord form
13:07chouserbut extending is still quite fast compared to other options, like doing something similar yourself without clojure compiler support, or using multimethods.
13:07dsantiagoOK, thanks.
13:07dsantiagoBeen wondering that.
13:09mebaran151if I was wondering
13:10mebaran151*I was wondering if extend was AOT compiled
13:10mebaran151I'm thinking about doing some android experiments, and I would like to try to strip out all the compiler stuff that won't work anyway
13:14LauJensen Chousuke: Okay, thanks for educating
13:21anonymouse89is it possible to define default values for keys in defstruct?
13:34LauJensenanonymouse89: Not sure if there's a way already, but if not a macro with a wrapping 'binding' should do the trick
13:45anonymouse89LauJensen: thanks for the tip, that makes sense.
13:56anonymouse89is there a range fn that returns a list of floats instead of integers?
13:57LauJensen(defn frange [x] (map float (range x))) ?
13:58defn:)
13:59defnLauJensen: do you need to edit the arity of frange to make range work in all cases?
13:59LauJensenyes
14:01anonymouse89LauJensen: okay, sorry for the silly questions, I just never know if those kind of things are already built-in or not
14:01LauJensennp thats what we're here for
14:02anonymouse89LauJensen: do most clojurians (?) save all these little fns and macros in a toolbox(.clj)?
14:02defnanonymouse89: you can have a user.clj
14:02anonymouse89or is that kind of looked down on for decreasing readability
14:02LauJensenanonymouse89: I dont think so. Most of it goes into contrib eventually, and eventually the really useful stuff makes it into core
14:02LauJensenI dont think user.clj is the best way to handle it
14:03defni agree it's not the best way, but it's not "bad", IMO
14:03defnyou just need to be careful you're not using something home-baked which may be done much better in contrib
14:03anonymouse89is there some sort of magic that happens by naming it "user.clj" specifically or is that just convention?
14:03defnanonymouse89: if it's on your classpath it will be autoloaded
14:04defn'user.clj' that is
14:04anonymouse89defn: right, I don't mean anything too crazy or even with that much logic, just convenience functions
14:04anonymouse89ok
14:06LauJensenanonymouse89: I dont think Ive never needed anything like frange, and the project you're working on might be the last one in 6 months for you as well :) However, if you're the first guy to come up with 'partition' or 'take-while', then you should try to get it in Contrib :)
14:06anonymouse89actually I'm trying to do this:
14:06defnLauJensen: i've never used the user.clj thing myself, but i do often end up opening other projects ive started to take a look at a function i wrote
14:06anonymouse89'(take 10 (cycle '(0)))
14:07anonymouse89,(take 10 (cycle '(0)))
14:07clojurebot(0 0 0 0 0 0 0 0 0 0)
14:07defnive also seen stuart halloway has a "code pad" in his emacs where he keeps snippets
14:07anonymouse89is there a better way?
14:07LauJensendefn: you mean *scratch* ? :)
14:07defnas long as user.clj is confined in a namespace i dont see any issue
14:07defnLauJensen: well, yeah :)
14:07anonymouse89defn: that's a good idea
14:07LauJensen$(take 10 (repeat 0))
14:07sexpbot=> (0 0 0 0 0 0 0 0 0 0)
14:07anonymouse89ah, repeat
14:08defnanonymouse89: there is also repeatedly, but that's more heavy lifting than you need
14:08anonymouse89$(take 10 (repeat 0.0))
14:08sexpbot=> (0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:09LauJensen$(take 10 (repeatedly (fn [] 0.0)))
14:09sexpbot=> (0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:09LauJensenone is for values, the other for fns
14:09anonymouse89just looked at the api entry for repeatedly, seems cool
14:10anonymouse89so I could 'take' from a repeatedly?
14:11LauJensenI just did
14:11defn:)
14:11anonymouse89right, I should just be learning by doing
14:12defn$(take 10 (iterate + 0.0))
14:12sexpbotjava.lang.ClassNotFoundException: clojure.core$iterate$fn__3752
14:12LauJensenanonymouse89: no you should just read what im writing :)
14:13LauJensen$(take 10 (iterate (partial + 0.1) 0))
14:13sexpbotjava.lang.NoClassDefFoundError: clojure/core$iterate$fn__3752
14:13LauJensen,(take 10 (iterate (partial + 0.1) 0))
14:13clojurebot(0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999999999999999 0.8999999999999999)
14:14defn$(take 10 (iterate #(+ %) 0.0)) ;;?
14:14sexpbotjava.lang.NoClassDefFoundError: clojure/core$iterate$fn__3752
14:14LauJensendefn: sexpbot doesnt have iterate for some reason
14:14defnah
14:14defn,(take 10 (iterate + 0.0))
14:14clojurebot(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:19defnooo, even better..
14:19defn$(repeat 10 0.0)
14:19sexpbot=> (0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:26Licenserlies!
14:27LauJensenwell, the simplest way is still
14:27LauJensen,(-> 9 inc (repeat 0.0))
14:27clojurebot(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:27tomoj:D
14:28LauJensensorry, no, I overcomplicated
14:28LauJensen,(-> \tab int inc (repeat 0.0))
14:28clojurebot(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
14:44anonymouse89defn: nice, I'll be using (repeat 10 0.0)
15:02LauJensen$mail Raynes Your bot does not support 'iterate'
15:02sexpbotMessage saved.
15:02anonymouse89would logbitp ever be something that would make it into contrib?
15:07Twey,(let [is (iterate #(+ 1 %) 0)] (take 5 is))
15:07clojurebot(0 1 2 3 4)
15:07Twey,(iterate #(+ 1 %) 0)
15:07Twey,(let [is (iterate #(+ 1 %) 0)] (take 5 is))
15:07clojurebot(0 1 2 3 4)
15:08clojurebotExecution Timed Out
15:08TweyHuh.
15:14anonymouse89iterate returns a lazy sequence (i think?)
15:14LauJensenyep
15:16anonymouse89is there any way to override functional style and have mutable structs?
15:17LauJensenanonymouse89: There are a few ways, but are you sure you dont want to be functional ?
15:17anonymouse89no I'm not sure
15:17LauJensenWhats the challenge?
15:17anonymouse89but at the moment I'm translating a lisp program that uses the CLOS to clojure
15:18qbgYou could wrap the mutable items in an atom or ref, but eww...
15:18tomojwhy bother unless you're going to make it functional?
15:18anonymouse89so it'd be easiest to do a more "direct" translation (if that makes sense) and then convert to functional later
15:18LauJensenanonymouse89: Not necessarily - If I were you I would try to grasp the functional concepts and apply them directly
15:18LauJensenIn most cases you can make it 99.9% functional without any headaches
15:19qbgInstead of fighting the language and then doing some nasty refactoring, just do it right the first time.
15:20datkadoes anyone know what happened with the latest rc of leiningen that made it so that lein-run is no longer working?
15:20anonymouse89qbg: thanks, I know that's the right thing to do, just needed to have someone else confirm
15:22anonymouse89on a related note, is there a way to return a struct with all values the same except one?
15:22qbgYou should be able to use assoc
15:22LauJensen'dissoc' you mean
15:22dakroneyep, use assoc
15:22LauJensen,(dissoc :two {:one 1 :two 2 :three 3})
15:22clojurebotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to clojure.lang.IPersistentMap
15:23LauJensen,(dissoc {:one 1 :two 2 :three 3} :two)
15:23clojurebot{:one 1, :three 3}
15:23dakroneanonymouse89: did you mean leaving 1 value out, or changing just 1 value?
15:24anonymouse89dakrone: changing just 1 value (or however many)
15:24dakroneuse assoc then
15:24dakrone,(assoc {:name "foo" :age 10} :age 20)
15:24clojurebot{:name "foo", :age 20}
15:26anonymouse89dakrone: perfect, thanks!
15:26dakroneanonymouse89: you're welcome, good luck with the translation
15:26dnolen,(update-in {:name "foo" :age 10} [:age] #(+ % 10))
15:26clojurebot{:name "foo", :age 20}
15:28anonymouse89dnolen: not helpful in my case, but good to know
15:33tomojI sometimes wonder why we have assoc/assoc-in but not update/update-in
15:34qbgupdate would only save you two characters...
15:38tomojI guess the variadic case for update would be uncommon
16:03silveencan anyone help me figure out what(doseq [entity @collection :when
16:04silveenwhat's wrong with my* (doseq [entity @collection :when (contains? (entity :key) avalue)] ?
16:05naeuhey there, I have a Java question if anyone's interested in helping out: what does the ... signify in lines such as: static public IPersistentVector createOwning(Object... items){
16:05silveennaeu: it means you can send a variable number of arguments
16:05naeusilveen: wow, Java has that feature?
16:05silveenlike createOwning( a, b, c)
16:05silveenyes
16:05silveenyou get it as an array and can loop thru them like normal
16:05naeunice
16:06naeusilveen: thanks
16:06silveenbe sure to check for lengt > 0 (as passing zero arguments is pefectly valid)
16:06silveennaeu: you're welcome :)
16:07naeusilveen: I'll not be checking anything right now, I'm currently just reading the Clojure source
16:07naeuand treating it as immutable ;-)
16:07silveenaah
16:18tomojsilveen: what do you think contains? does?
16:18silveenit check if the first argument, which is a list, contains the second argument
16:18silveenit worked before, but I can't figure out what's diffrent
16:19tomoj,(contains? '[foo bar baz] 1)
16:19clojurebottrue
16:19tomoj,(contains? '[foo bar baz] 'bar)
16:19clojurebotfalse
16:19silveen,(contains? ([15 2] [15 3]) [15 2])
16:19clojurebotjava.lang.IllegalArgumentException: Key must be integer
16:19tomojmaybe you're looking for (doseq [entity @collection :when (some #{avalue} (:key entity))] ...) ?
16:20tomoj,(doc contains?)
16:20clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."
16:22silveenhmm, yeah that works if I do it like ... (entity :key)
16:22silveen,(contains? [foo bar] 1)
16:22clojurebotjava.lang.Exception: Unable to resolve symbol: foo in this context
16:23silveen,(contains? [10 20] 1)
16:23clojurebottrue
16:23silveen,(contains? [10 20] 3)
16:23clojurebotfalse
16:23silveenhmm, now I see how that works
16:24tomojsilveen: (entity :key) works but (:key entity) doesn't?
16:24tomojwhat kind of thing is entity?
16:24silveenyupp
16:24silveenit's a struct
16:25silveenor, whatever it's called (only been doing clojure, or "lisp" for about a week)
16:25tomoj,(:foo (struct (create-struct :foo) 3))
16:25clojurebot3
16:25tomoj,((struct (create-struct :foo) 3) :foo)
16:25clojurebot3
16:26tomoj(:key struct) is the idiomatic way
16:27silveen,(some? #{3} (struct (create-struct :foo) [1 2 3] :foo))
16:27clojurebotjava.lang.Exception: Unable to resolve symbol: some? in this context
16:27silveen,(some #{3} (struct (create-struct :foo) [1 2 3] :foo))
16:27clojurebotjava.lang.IllegalArgumentException: Too many arguments to struct constructor
16:28tomoj,(some #{3} (:foo (struct (create-struct :foo) [1 2 3])))
16:28clojurebot3
16:28silveenbaah, really is it? I've never done it like that, I think because it didn't work out for me in the begining
16:28tomoj(:key foo) when foo is something like an object (e.g. structs)
16:29tomoj(foo :key) when foo is a collection
16:29tomojas in, not a fixed set of keys
16:30silveenokey, kinda confusing but okey
16:32tomoj(:key foo) is also faster on certain kinds of things, and won't blow up if foo is nil
16:33silveenhmm'kay, will try to think of that from now on :
16:34silveenbut it's really strange that it doens't work here
16:36silveenah, because it was a ref
16:36silveen(:key @entity) works
16:37silveenthat might explain why that way of typing didn't work for me earlier
16:37Twey.ue coi .tomoj.
16:38silveenthanks tomoj
16:41tomojcoi .tuein.
16:41Tweyba ma do pilno la .klojyr.
16:57Lajla,(+)
16:57clojurebot0
16:57Lajla,(/)
16:57clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$-SLASH-
16:57Lajla,(/ 1 2 3 4 5)
16:57clojurebot1/120
16:58rhallhi all
16:58rhallanyone up for a newbie question? :)
16:58qbgSure
16:59rhallthx... I'm playing around with counterclockwise
16:59Lajlarhall, yes, but if I can't answer it, I will assasinate you.
16:59rhallearlier I could run things like "(show show)"
16:59rhallLajla: I work best under pressure
17:00rhallbut now in response to (show show)... I get... 1:11 user=> (show show)
17:00rhalljava.lang.Exception: Unable to resolve symbol: show in this context (repl-1:11)
17:01rhallis "show" part of clojure core, or do I need to load something else? I don't remember doing anything earlier
17:01rhallit just worked
17:02qbgYou need to use clojure.contrib.repl-utils
17:02qbg(use 'clojure.contrib.repl-utils)
17:02rhallqbg: thx... I suspected something like that... wonder if I screwed up my eclipse launcher somehow and knocked that out
17:03rhallhmm... no go...
17:03rhall1:12 user=> (use 'clojure.contrib.repl-utils)
17:03rhalljava.lang.IllegalStateException: source already refers to: #'clojure.repl/source in namespace: user (repl-1:12)
17:03rhall1:13 user=> (show show)
17:03rhall1:14 user=> java.lang.Exception: Unable to resolve symbol: show in this context (repl-1:13)
17:04qbgI would just do (require '[clojure.contrib.repl-utils :as repl])
17:04qbgand then you can do (repl/show repl/show)
17:06rhallthat works
17:06rhallso I guess my namespace is polluted somehow?
17:06rhallbut then restarting should fix it, I'd assume
17:06qbgYes, clojure.repl defines source and so does clojure.contrib.repl-utils, so they conflict
17:07rhallah, ok, I see
17:07rhallthx for that
18:15dnolenrhickey: another prim bug? http://gist.github.com/437046
18:16rhickey_dnolen: no, limitation, right now static can't be protocol call sites
18:55vinwhy does this give a nullpointerexception, i dont see it... http://sprunge.us/ZPYa
18:57qbgvin: Instead of ((print ...) ...) you want (do (print ...) ...)
18:58vin(do you have a link that explains) why
18:58Ankouhi, I think I found a bug in dgraph but maybe someone who actually used this library can tell me if it I missunderstand something and if it behaves like it should. Here are some lines I entered in the the REPL: http://ankou.pastebin.com/gRHjgCUg
18:58qbgBecause (print ...) will return nil, and you are trying to call nil
19:00qbgAlso, do to your use of recursion, the code will fail on long input
19:00qbg*due
19:02qbgI think a solution using doseq would be better.
19:03TweyHas Clojure tail recursion optimisation?
19:03quotemstrTwey: No.
19:03quotemstrBut it does have RECUR.
19:03TweyDamn :-\
19:03TweyOh?
19:03qbgYou also have trampoline
19:06TweyHm
19:06qbgBlame java
20:26vIkSiThmm quick lein question.
20:26vIkSiTin project.clj - the :main option - does that refer to the filename, or the namespace?
20:28tomojnamespace
20:28vIkSiTfor instance, I've got project.clj with :main myproject.core, and my src dir looks like src/myproject/core.clj, with the ns as myproject.core
20:28vIkSiTnow, this doesn't work.
20:29vIkSiToh. maybe gen-class.
20:31vIkSiTah taht was the problem
20:31vIkSiTtomoj, do you connect to a lein swank instance through slime?
20:31tomojno, I use maven
20:32vIkSiTah
20:32vIkSiTbut that brings up a swank instance that you connect to through slime?
20:33tomojyep
20:33vIkSiTmy issue was - when I connect to a swank instance, how do I "load" all the code into that session?
20:33tomojC-c C-k a file
20:33vIkSiToh i see. there's no way to load all the files in in one go?
20:33tomojI don't know of a way to load all the files, no
20:33tomojbut it's not really necessary imo
20:33vIkSiThmm
20:33tomojwhen you C-c C-k a file, all the files it depends on will be loaded
20:34vIkSiTah gotcha. so I can always use a :require or something in the main file
20:34tomojyep
20:35vIkSiTso, how is it different from just firing up a normal slime instance and then doing stuff manually?
20:35vIkSiTI figured that doing it from within a project dir would atleast load all the ns's that exist within the project
20:36tomojit's different just because lein is creating the swank server instead of emacs
20:39vIkSiTah i see
20:40vIkSiToh brilliant.
20:41vIkSiTlooks like swank-clojure from ELPA isn't compatible with slime201004
20:41vIkSiTaaargh.
20:41vIkSiTthis is like red hat's dependency hell from 1996
20:45tomojyou use other lisps?
20:46vIkSiTsbcl for some stuff
20:47vIkSiTlein swank is increasingly looking like a good option
20:47vIkSiTall i need is slime-connect on the emacs side
21:52defnlein swank was deprecated in favor of swank-clojure i thought
21:52defnyou can use swank-clojure-project, or lein swank in the project dir + slime-connect
21:54tomojswank-clojure provides lein swank, doesn't it?
22:10defnyes
22:10defnit does now
22:10defnas of 1.2.1
22:20TimMcA curiosity:
22:20TimMc,((fn [&] 4))
22:20clojurebot4
22:21TimMc.((fn [&] 4) 5 6 7)
22:22TimMc,((fn [&] 4) 5 6 7)
22:22clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--9669$fn
22:26tomojwould you expect it to be variadic but ignore its arguments?
22:39jrpis there a particularly good clojure introduction that people here would recommend?
22:45TimMctomoj: I wasn't sure what to expect, really. :-P
22:46TimMcjrp: I have really been enjoying Stuart Halloway's book "Programing Clojure" -- I pirated it, then bought it. :-)
22:46bmasonthis is a good page: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips
22:46TimMcYou can buy the eBook online in an open format.
22:47jrpcool, thank you
22:53mabesjrp: this is another good overview of clojure: http://java.ociweb.com/mark/clojure/article.html
22:54mabesoh, I guess that is linked to on the wiki page. :) nm
22:54jrpwill these cover the function programming aspect? Ive been programming for 10 years more or less, but mostly in C style languages
22:58mabesjrp: yeah, most of the articles assume you're coming from a java-like background.. so you should be okay.
22:58jrpfantastic, thanks. This channel is quite helpful
23:22TimMctomoj: What do you make of it? Syntactic corner-case, or potentially meaningful form?
23:27tomojisn't it equivalent to the shorter and less curious (fn [] ..)?
23:28TimMcPresumably.
23:28TimMcI can't think of any way it could differ in behavior.
23:29tomojso.. why use it? :)
23:32TimMcAh, the compiler treats them the say way:
23:32TimMc,(fn ([] 4) ([&] 5))
23:32clojurebotjava.lang.Exception: Can't have 2 overloads with same arity
23:32TimMc*same
23:32TimMcI suppose it would only be good for Obfuscated Clojure contests. :-P
23:34tomojI wonder why assert-args in core.clj isn't public, it seems like it would be useful
23:35quotemstrTimMc: Wouldn't Obfuscated $LISP_DIALECT contests be too easy? :-)
23:35tomojI imagine submitting a 200 line -> form or something
23:36quotemstrtomoj: Use the Y combinator. For everything.
23:36quotemstrtomoj: You can write unlambda is any functional language. :-)
23:38rbarraud,
23:38clojurebotEOF while reading
23:38rbarraud,
23:38clojurebotEOF while reading
23:38rbarraudfoo
23:38TeXnomancydoto with non-java-interop forms is always a nice obfuscation technique
23:38quotemstr,(+ 1 2)
23:38clojurebot3
23:39TeXnomancydefn: lein swank + slime-connect is actually the recommended way to go now.
23:39TeXnomancyoh, lein-swank the dependency got merged into swank-clojure, if that's what you meant.
23:41quotemstr,(macroexpand '(-> (a) (b) (c)))
23:41clojurebot(c (clojure.core/-> (a) (b)))
23:41quotemstr,macroexpand-all
23:41clojurebot#<walk$macroexpand_all__6949 clojure.walk$macroexpand_all__6949@1636d54>
23:41quotemstr,(macroexpand-all '(-> (a) (b) (c)))
23:41clojurebot(c (b (a)))
23:41quotemstrAh.
23:54LuminousMonkeyAnyone know if it's possible to step through two sequences at once? For example, you have something like (cycle [1 2]) as one sequence, and just a normal finite sequence, and they step together?
23:55rdsrluminousMonkey: a map won't do?
23:56TeXnomancy,(map identity [1 2 3] [:a :b :c])
23:56clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$identity
23:57TeXnomancy,(map + [1 2 3] [4 5 6])
23:57clojurebot(5 7 9)
23:57LuminousMonkeyI'm doing some PDF work, and making a PDF table. I've written up a function to process the tables, and I pass the info like ([{:name "Header 1" :align :left} {:name "Header 2" :align :right}] ["Data1" "Data2"] ["Data3" "Data4"])
23:58LuminousMonkeyI need to get the correct :align for the column, so I know if I need to set the alignment for the cell.