#clojure log - Oct 14 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:10 doomlord_: does clojure come with opengl bindings out of the box

0:13 ChongLi: no

0:13 you use a java library

0:13 such as lwjgl

0:13 doomlord_: ok; i'll google, thanks. i've not touched java

0:14 ChongLi: clojure makes it really easy to integrate java libraries into your work

0:14 the interop is beautifully done (and first class)

0:15 doomlord_: i like the idea of language choice with a common back end :)

0:22 ChongLi: yeah, it works surprisingly well

0:23 doomlord_: I'm not keen on java at all but clojure and scala are interesting

0:24 ChongLi: I haven't looked too much into scala (it seems way too complex for me)

0:25 but clojure is brilliant

0:25 doomlord_: coming from c++, scala looks nice.

0:25 ChongLi: rich hickey is a genius

0:26 scala looks to me like a "kitchen sink" design

0:26 whereas clojure is very small and deliberate

0:26 doomlord_: what interests me about a lisp is the prospect of macros for data-driven coding; I've been through the mess of #defines and templates to emulate things that are missing in c++. (x-macros)

0:26 ChongLi: yeah

0:27 there's something really profound in having a language written in its own data structures

0:27 doomlord_: exactly

0:31 I like haskell a lot (what i know of it so far) but find the record system problems grate a bit

0:32 ChongLi: yeah

0:32 I've used haskell somewhat as well

0:33 besides the record syntax, I find myself really annoyed that so many of the libraries in haskell were written before a lot of the current techniques were discovered

0:33 (such as bagwell's tries)

0:33 doomlord_: what i like most about it is the type-inference and partial application. i think F# could be perfect (those features plus straightforward OOP style record acess) but prefer something crossplatform

0:34 ChongLi: clojure has partial application, it's just a bit clunky to use

0:34 doomlord_: hence looking at clojure and scala. Been dabling with lisp for the past couple of weeks.

0:34 ChongLi: it's easier if you alias partial to something short like p

0:34 and comp to c

0:35 there are always tradeoffs though

0:35 doomlord_: been using 'pretty-mode' in emacs , interesting having a lambda symbol :)

0:35 i guess if you're going to compose AND partially apply, you might aswell use a lambda

0:35 ChongLi: I turned that off, my font did look so great

0:36 did *not* look so great

0:36 rather

0:36 when I came to clojure, the real eye-opener for me was how it based everything off of the sequence abstraction instead of some concrete data structure like lists

0:37 doomlord_: to reduce a bit of the bracketing in common lisp i made a macro (fnx ...) which is just (lambda(x) ... ) but i gather clojure has such a shorthand inbuilt

0:38 is [a b c] a sequence or a vector

0:38 is it designed to be optimized for random access

0:39 ChongLi: [a b c] is a vector

0:40 optimized for random indexing

0:40 and appending to the end

0:41 (a b c) is either a list or a sequence

0:42 AtKaaZ: ,(class '[a b c])

0:42 clojurebot: clojure.lang.PersistentVector

0:43 doomlord_: (def a '(1 2 3)) ... thats a sequence?

0:43 AtKaaZ: ,(class '(a b c))

0:43 clojurebot: clojure.lang.PersistentList

0:43 AtKaaZ: ,(class (seq '(a b c)))

0:43 clojurebot: clojure.lang.PersistentList

0:43 AtKaaZ: ,(seq? '(a b c))

0:43 clojurebot: true

0:43 AtKaaZ: ,(seq? '[a b c])

0:43 clojurebot: false

0:44 doomlord_: ah i thought a vector would be a subtype of sequence

0:44 mattmoss: ,(sequential? '[a b c])

0:44 clojurebot: true

0:45 michaelr525: ,(seq? [a b c]

0:45 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

0:45 ChongLi: basically everything can be turned into a sequence with seq

0:45 doomlord_: i like the ? ! conventions for boolean tests and mutation

0:45 michaelr525: ,(seq? [a b c])

0:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)>

0:45 michaelr525: ,(seq? [:a :b :c])

0:45 clojurebot: false

0:45 doomlord_: i also like the call notation for element access

0:45 ChongLi: ,(seq? '(seq [a b c]))

0:45 clojurebot: true

0:45 michaelr525: ah right

0:45 mattmoss: To quote amalloy: "All seqs are sequential, but not all sequential things are seqs."

0:46 doomlord_: so a seq means its *only* accessible sequentially

0:46 AtKaaZ: ,(sequential? "abc")

0:46 clojurebot: false

0:46 AtKaaZ: ,(sequential? (seq "abc"))

0:46 clojurebot: true

0:46 thmzlt: ,(def foo "bar")

0:46 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

0:46 ChongLi: a seq means it can be accessed with first and rest

0:47 and that first and rest operate uniformly

0:47 thmzlt: ,"hi"

0:47 clojurebot: "hi"

0:47 ChongLi: so that all seq-based functions take seqables and convert them to seqs while operating on them

0:47 AtKaaZ: ,'hi

0:47 clojurebot: hi

0:48 ChongLi: ,(map #(+ % 1) [1 2 3])

0:48 clojurebot: (2 3 4)

0:48 ChongLi: see how it takes a vector and returns a seq?

0:48 ,(seq? '(map #(+ % 1) [1 2 3]))

0:48 clojurebot: true

0:49 AtKaaZ: ,(map println [1 2 3])

0:49 clojurebot: (1

0:49 2

0:49 3

0:49 nil nil nil)

0:49 doomlord_: can you emulate CLOS's multiple dispatch with macros

0:50 ChongLi: you can turn the result back into a vector as well

0:50 ,(vec (map #(+ % 1) [1 2 3]))

0:50 clojurebot: [2 3 4]

0:50 AtKaaZ: yep, that's how I noticed the output isn't part of the return

0:50 ChongLi: I have no experience with common lisp

0:50 tomoj: &(mapv inc [1 2 3])

0:50 lazybot: ⇒ [2 3 4]

0:51 tomoj: doomlord_: no need, we have multimethods

0:51 ChongLi: yeah, multimethods are really cool

0:51 tomoj: arbitrary dispatch functions

0:51 I think that's more powerful than clos's dispatch, but I never used clos

0:52 doomlord_: what are multimethods

0:52 ChongLi: they allow you to dispatch on the type of multiple arguments

0:52 tomoj: just google "clojure multimethods"

0:53 doomlord_: is that the same as multiple-dispatch http://en.wikipedia.org/wiki/Multiple_dispatch

0:53 ChongLi: whereas most traditional OOP languages are single dispatch; they dispatch on the type of the receiver object

0:53 yes

0:53 tomoj: no

0:53 ChongLi: oh, no?

0:53 tomoj: it's more powerful than multiple dispatch

0:54 ChongLi: http://clojure.org/multimethods

0:54 tomoj: (defmulti collatz even?)

0:55 AtKaaZ: ,(let [-+1 -1] (Math/abs -+1))

0:55 clojurebot: 1

0:55 doomlord_: ah perhaps it gives more control over dispatch choice, from what it says on clojure.org

0:56 AtKaaZ: ,(let [+ -1] (Math/abs +))

0:56 clojurebot: 1

1:03 AtKaaZ: ,(let [% 1] (list %%%%%))

1:03 clojurebot: (1 1 1 1 1)

1:04 tomoj: heh

1:07 AtKaaZ: ,(#(doall (let [& 1 % 2] (str & %& % &%))) 3)

1:07 clojurebot: "1212"

1:08 tomoj: &'(str & %& % &%)

1:08 lazybot: ⇒ (str & %& % & %)

1:10 AtKaaZ: the %& was eaten

1:11 ,(#(let [& 1 % 2] %&) 3)

1:11 clojurebot: nil

1:11 AtKaaZ: ,(#(let [& 1 % 2] %&) 3 4 5 6 7)

1:11 clojurebot: (4 5 6 7)

1:11 AtKaaZ: makes sense

1:14 ,(#(let [& 1 % 2] (str %&, %1, %2, %3)) 3 4 5 6 7)

1:14 clojurebot: "(6 7)245"

1:15 tomoj: huh?

1:15 AtKaaZ: ,(#(let [& 1 % 2] %1) 3)

1:15 clojurebot: 2

1:15 AtKaaZ: no idea

1:16 tomoj: &'#(let [% 2] %1)

1:16 lazybot: ⇒ (fn* [p1__74259#] (let [p1__74259# 2] p1__74259#))

1:16 tomoj: guess it's because % and %1 get the same gensym

1:17 ah, yeah, makes sense

1:17 AtKaaZ: oh that does make sense

1:18 (inc tomoj)

1:18 lazybot: ⇒ 4

1:18 tomoj: similarly ##(#(let [%2 2] %2) 1 1)

1:18 lazybot: ⇒ 2

1:21 AtKaaZ: ,(#(let [%2 2] %&) 1 3 4)

1:21 clojurebot: (4)

1:21 AtKaaZ: since %2 is used, %& takes the rest from %3...

1:25 doomlord_: trying to use spit/slurp from the clojure repl its telling me unsable to resolve symbol; do i have to import something or use a namespace qualifier to get file IO functions?

1:26 AtKaaZ: ,slurp

1:26 clojurebot: #<core$slurp clojure.core$slurp@77c37078>

1:26 tomoj: just paste the error (somewhere else (e.g. gist.github.com) if it's more than a few lines)

1:26 doomlord_: java.lang.Exception: Unable to resolve symbol: spit in this context (NO_SOURCE_FILE:49)

1:26 tomoj: did you do (in-ns 'foo) or something?

1:26 doomlord_: not that i know of

1:26 AtKaaZ: ,(find-ns 'clojure.core)

1:26 clojurebot: #<Namespace clojure.core>

1:27 tomoj: doomlord_: try (ns-refers *ns*)

1:27 AtKaaZ: what does it say if you do that?

1:27 doomlord_: this is clojure installed on ubuntu linux with apt-get install clojure

1:27 tomoj: waat

1:27 didn't know they made a deb out of it

1:28 that's version 1.1

1:28 doomlord_: thst displays a whole load of symbols

1:28 tomoj: you almost definitely shouldn't use it

1:28 doomlord_: hahaha ok

1:28 tomoj: &(:added (meta #'spit))

1:28 lazybot: ⇒ "1.2"

1:28 AtKaaZ: nice one

1:28 tomoj: just get leiningen

1:29 AtKaaZ: ,*clojure-version*

1:29 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

1:29 doomlord_: will leiningen update my current install

1:29 tomoj: no, I would purge that shit

1:29 leiningen is just a binary you put on your PATH, and it only 'installs' things into your home directory

1:30 AtKaaZ: bash script?

1:31 tomoj: yeah, it downloads the clojure parts of leiningen and runs them

1:31 AtKaaZ: that reminded me of gloss, I've to get on it, been procrastinating

1:32 (I mean to use it)

1:32 tomoj: ztellman's gloss?

1:32 AtKaaZ: yes

1:32 the binary part reminded me:)

1:33 tomoj: oh, I see, yes, s/binary/bash script/

1:35 AtKaaZ: is aleph something like netty?

1:37 tomoj: aleph wraps netty

1:38 AtKaaZ: yes!! I are glad to hear zat

1:38 I was reading this: https://github.com/ztellman/aleph/wiki/TCP but it's clear when reading this: https://github.com/ztellman/aleph

1:39 tomoj: huh, I think I just observed that having (an old version of) aleph on the classpath makes clj-http always return nil

1:40 no, that wasn't it

1:41 AtKaaZ: now I'm curious what actualy happens

1:42 tomoj: hopefully it does not cause any trouble

1:43 I removed aleph and I'm still getting nil

1:43 AtKaaZ: track it down? :)

1:47 doomlord_: ok got 'spit' now

1:47 AtKaaZ: if I modify project.clj 's dependencies am I stuck with having to restart the repl to have effect?

1:48 tomoj: yes, but see https://github.com/cemerick/pomegranate

1:50 AtKaaZ: "12 bajillion dependencies" lol

1:53 tomoj: hmm, this is very odd. when I use :as :json, http/get returns nil

1:53 otherwise it works fine

1:54 lein-pedantic doesn't complain

1:54 but this was working fine an hour ago

1:56 ah shit

1:56 aleph and friends were AOT'd in one of my deps

2:00 AtKaaZ: but there were no errors about this? I take it it's fixed if you remove the AOTz?

2:01 "Leiningen Managed Dependencies issue: unknown problem (missing exception message)"

2:02 is there a function that checks for invalid chars?

2:03 tomoj: AtKaaZ: yeah, it's fixed. so apparently it was aleph's fault (but again, old version, so maybe it's fixed now)

2:03 what does "invalid" mean?

2:04 AtKaaZ: ok but it sounds like it would've been tough for me to track that down

2:05 I simply add ["gloss" "0.2.1"] to dependencies and I get that in problems (in eclipse), so I figured maybe I got invalid chars in my paste like it happened with this: https://github.com/quil/quil/commit/d0312f0f119db066a8d613dec8803571b92bea39

2:06 , ["gloss" "0.2.1"]

2:06 clojurebot: ["gloss" "0.2.1"]

2:09 AtKaaZ: running lein is better, i can see the exception heh

2:11 which is this: https://gist.github.com/3887551

2:12 ok looks like I fail

2:13 it's supposed to be this: [gloss "0.2.1"]

2:14 mindless copypasting = bad

2:16 does this work with lein1 though ? in dependencies: ["gloss" "0.2.1"] instead of [gloss "0.2.1"]

2:36 wei_: what are best practices for deploying clojurescript? is One still the best example to follow?

2:37 tomoj: what a weird error

2:37 "java.lang.String cannot be cast to clojure.lang.Named"

2:38 scottj: wei_: maybe checkout lein-cljsbuild

2:39 tomoj: interesting INamed isn't in cljs

2:39 wei_: checking out the lein-cljsbuild examples right now, thanks

3:03 technomancy: did infoq remove the ability to download the talk videos by doing view source? =(

3:05 oh, nope it's just a user-agent tweak necessary

3:05 ivan: youtube-dl used to be able to do it, until infoq broke it a few weeks ago

3:05 tomoj: do tell

3:05 ivan: in Firefox I can send an iOS UA and right click -> save video

3:06 tomoj: I see rtmpe :(

3:06 technomancy: yeah I just do M-x user-agent android, then view source and C-s for mp4

3:08 tomoj: I was hoping I'd find your .conkerorrc, thanks for publishing

3:08 technomancy: =)

3:35 tomoj: looks like you can get it without changing user agent by concating the cloudfront path for the flash player and the path from the rtmpe query arg

3:41 aperiodic: tomoj: i don't understand that error. then how does ##(name "Alice") work?

3:41 lazybot: ⇒ "Alice"

3:41 aperiodic: i suppose i can find that out myself

3:42 i see it has a special case for strings

3:42 i guess i just assumed strings were named only because name worked on them

3:43 tomoj: me too

3:43 and I assumed they were INamed in cljs

3:44 aperiodic: but INamed doesn't exist?

3:52 tomoj: nope

3:52 name and namespace use manual (predicate) type dispatching

3:53 (and keywords are just strings with an extra character on the front)

4:16 aperiodic: what's the easiest way to do a forcat?

4:17 Raynes: (reduce concat (for ..))

4:18 It's lazy, so the difference isn't that significant.

4:19 aperiodic: thanks

4:25 AimHere: Why (reduce concat ...) instead of (apply concat ...)

4:25 I'd have thought the latter is more likely to be optimized, in the cases where they're equivalent...

4:32 wei_: is there any way to check if my extern is getting loaded correctly on compilation? https://gist.github.com/3887952

4:33 I'm suspicious because I don't get any warnings even if I change the externs file name, but I'm seeing a JSC_MISSING_PROVIDE_ERROR either way

4:48 tomoj: wei_: looking at the cljs compiler, it seems like you should get an error if the extern you list doesn't exist

4:48 but I'm not sure

4:49 wei_: I'll run the compiler by itself to check. I've been running it through lein cljsbuild

4:49 tomoj: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L147

4:49 it looks like it calls slurp

4:49 which errors if the file doesn't exist

4:52 hmm

4:52 (if use-only-custom-externs all-sources (into all-sources (CommandLineRunner/getDefaultExterns)))

4:52 (cond-> all-sources use-only-custom-externs (into (CommandLineRunner/getDefaultExterns)))

4:52 is a singleton cond-> harder to read than an if?

5:25 amalloy: Raynes, AimHere: (reduce concat ...) is never a good idea. use apply

5:26 oh, and aperiodic: ^

5:27 tomoj: &(:added (meta #'clojure.repl/pst))

5:27 lazybot: ⇒ "1.3"

5:27 tomoj: :(

5:35 amalloy: tomoj: are you still on 1.2 or something? i thought i was the last one to upgrade

5:40 tgoossens: Hi. I'm going trough the sourcecode of "Ref.java"

5:40 I noticed that there are a lot of 'invoke()' methods

5:41 a lot of overloads with an increasing amount of arguments

5:41 and at a certain point

5:41 invoke( .... Object arg15, Object arg16, Object arg17, Object arg18, Object arg19, Object arg20, Object... args)

5:42 there is Object... 'args' , why not do that immediately?

5:47 Chousuke: tgoossens: for performance

5:50 svedubois: How I can translate these java lines to clojure?

5:50 float[] emboss = new float[] { -2,0,0, 0,1,0, 0,0,2 };

5:50 Kernel kernel = new Kernel(3, 3, emboss);

5:50 The first line I suppose is: (def emboss (float-array [-2 0 0 0 1 0 0 0 2]))

5:51 But I am not sure... And the second line I don't have idea

5:51 Sgeo: new in Java is representable with the new special form in Clojure

5:51 (new Kernel 3 3 emboss)

5:52 There's reader syntax for that, though:

5:52 (Kernel. 3 3 emboss)

5:52 lpvb: svedubois: you can use commas

5:52 (def emboss (float-array [-2 0 0, 0 1 0, 0 0 2]))

5:52 Sgeo: ,'(Kernel. 3 3 emboss)

5:52 clojurebot: (Kernel. 3 3 emboss)

5:52 lpvb: (def emboss (float-array [-2, 0, 0, 0, 1, 0, 0, 0, 2,,,,,,,,,,,,]))

5:52 Sgeo: ,(macroexpand-1 '(Kernel. 3 3 emboss))

5:52 clojurebot: (new Kernel 3 3 emboss)

5:53 Sgeo: How do I check to see if it's reader syntax or macroexpand, this doesn't make it obvious which it is

5:53 ,(macroexpand-1 #(foo))

5:53 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0)>

5:53 Sgeo: ,(macroexpand-1 '#(foo))

5:53 clojurebot: (fn* [] (foo))

5:53 Sgeo: Oh, huh, I guess it does. So what level of sugar is Blah. on?

5:55 ,'(.foobar)

5:55 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Malformed member expression, expecting (.member target ...)>

5:55 Raynes: amalloy: Why?

5:55 Sgeo: ,'(.foobar blah)

5:55 clojurebot: (.foobar blah)

5:55 Sgeo: .?

5:55 amalloy: &(first (reduce concat (range 1e5)))

5:55 lazybot: java.lang.StackOverflowError

5:56 amalloy: &(first (apply concat (range 1e5)))

5:56 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

5:56 amalloy: &(first (apply concat (repeat 1e5 '(1))))

5:56 lazybot: ⇒ 1

5:57 Raynes: I don't quite understand why the first thing happens.

5:57 Sgeo: svedubois, anyway, new Foobar(baz, blah) in Java is (Foobar. baz blah) in Clojure, or equivalently (new Foobar baz blah). The first is preferred

5:57 &(first (reduce concat (repeat 1e5 '(1))))

5:57 lazybot: java.lang.StackOverflowError

5:57 Sgeo: reduce needs to walk the entire sequence

5:58 It's like Haskell's foldl, doesn't work on infinite lists, and doesn't know how to stop.

5:58 Raynes: Oh, I was under the impression it was lazy.

5:58 I see why that doesn't make sense now though.

5:59 amalloy: Sgeo: there's nothing wrong with walking the entire sequence, though. that doesn't give you the stackoverflow

6:00 &(let [r (reduce concat (repeat 1e5 '(1)))] (+ 2 2))

6:00 lazybot: ⇒ 4

6:00 Raynes: Well, there is plenty wrong with it.

6:00 Sgeo: ohdeargod, please tell me that reduce uses loop/recur

6:01 amalloy: the stackoverflow comes from attempting to realize the first element, which has to traverse through all ten thousand thunks created by concat before it can find even a single element

6:02 Sgeo: ,(class (reduce concat (repeat 1e5 '(1))))

6:02 clojurebot: clojure.lang.LazySeq

6:02 Sgeo: hmm

6:02 ,(class (reduce + (repeat 1e5 '(1))))

6:02 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.Number>

6:03 Sgeo: ,(class (reduce + (repeat 1e5 1)))

6:03 clojurebot: java.lang.Long

6:03 Sgeo: concat returns lazy sequences?

6:07 goracio: hi there clojurescript question - how to handle "this" for example i have binding with bind to a click then i click on element and want to get value of attribute, so i need this in that case

6:10 andrewmcveigh: goracio: you need to use the "this-as" macro

6:10 goracio: example ?

6:11 andrewmcveigh: goracio: (this-as this … ($ this))

6:11 so, whatever the 1st param to this-as is, you can use in place of javascript's 'this'

6:12 goracio: ok will try

6:21 svedubois: Is it correct this java to clojure conversion?

6:21 Raster newRaster = op.filter(raster, null);

6:21 (def newRaster (.filter op (raster nil)))

6:22 andrewmcveigh: svedubois: nearly… (def newRaster (.filter op raster nil))

6:25 svedubois: although, normally in Clojure, vars/names don't use camelCase. So it would be "new-raster", to be more clojure-like.

6:26 raek: the line could also be translated as (let [new-raster (.filter op raster nil)] ...). 'def' is only for global variables

6:37 frawr: Hello Kind people of the clojure community

6:38 Can anyone give some pointers on building a ring app?

6:40 svedubois: Is this java to clojure conversion correct?

6:40 Raster raster = reader.readRaster(0, param);

6:40 (def raster (.readRaster image-reader 0 param))

6:40 In repl I obtain this error:

6:40 clojure.lang.Compiler$CompilerException: java.lang.UnsupportedOperationException: readRaster not supported!

6:41 (def raster (.readRaster reader 0 param))

6:44 Chousuke: it is correct.

6:44 goracio: (this-as mid ($ mid)) gets window object not an element

6:45 andrewmcveigh: (this-as mid ($ mid)) gets window object not an element

6:46 Chousuke: svedubois: that exception is not a clojure one. it's calling the method fine, but the method is throwing a UO exception.

6:47 svedubois: also, are you sure you want to def "raster" as a global? usually it's better to use local bindings (ie. use let)

6:51 andrewmcveigh: goracio: can you paste-bin the bit of code that you're trying to get to work?

6:55 tomoj: interesting, datomic's built in transactions happened on 1 Jan 1970

7:08 goracio: andrewmcveigh: solved :) passed macro via anon fun - ... :click (fn [] (this-as me ( handler me))

7:09 andrewmcveigh: goracio: cool :)

8:16 tgoossens: I love how rich puts in 42 in all of his talks and even the sourcecode of clojure :p

8:17 Cubic: Hi! I'm getting a reflection warning "Reflection warning, NO_SOURCE_PATH:1 - call to invokeStaticMethod can't be resolved. " at the end of my program (at execution, not at compilation). Is that a clojure thing, or is it caused by my program?

8:17 I'm running with lein run

8:53 svedubois: Is correct this java to clojure conversion?

8:53 DataBufferUShort buffer = (DataBufferUShort) newRaster.getDataBuffer();

8:53 (def buffer (doto (DataBufferUShort.) (.getDataBuffer new-raster)))

8:55 tomoj: that is like `buffer = (new DataBufferUShore()); buffer.getDataBuffer(newRaster); return buffer`

8:56 svedubois: And how it could be written?

8:56 tomoj: you want (def buffer (.getDataBuffer newRaster))

8:57 perhaps (def ^DataBufferUShort buffer (.getDataBuffer newRaster))

8:57 but you probably don't want def

9:31 dabd: why can't I use this map as function? ({:@id "Count", :$ "14751"} :@id)

9:32 I get a "Invalid token :" message

9:33 Bronsa: ,:@a

9:33 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :>

9:33 Bronsa: :@a is not a valid keyword

9:34 tomoj: are you trying to do {(keyword @id) :$ "..."} ?

9:34 AdmiralBumbleBee: @ is not valid in a keyword name

9:34 only * + ! - _ and anlphanumerics are

9:34 Bronsa: : is valid too

9:34 ,:a:b:c

9:34 clojurebot: :a:b:c

9:35 dabd: yeah i got it

9:35 AdmiralBumbleBee: oh, right Bronsa :)

9:35 dabd: this map was obtained from a parsed json string

9:35 AdmiralBumbleBee: the : is a bit important heh

9:35 tomoj: I feel like we should have nested prefix lists in ns

12:25 peppe21: ciao

12:25 !list

12:27 list

13:14 thmzlt: so I'm defining a macro that expands to a defn call around a binding call... is that ok or should I put the (binding ...) around the (defn ...)?

14:12 tantamountain: I’m trying ClojureScript (and ClojureScript One) for the first time. Cloned ClojureScript One into a folder, but running `lein repl` gets me: `FileNotFoundException Could not locate cljs/closure__init.class or cljs/closure.clj on classpath: clojure.lang.RT.load (RT.java:430)`.

14:12 The REPL then apparently runs normally afterwards.

14:22 Oh wait, never mind; forgot to run `lein bootstrap`.

14:56 augustl: are there any facilities to build "lazy maps"? I.e. maps that resolve their values when invoked, but then cache the value.

14:59 Sgeo: Why do regexes need a reader macro, what's wrong with just using strings?

15:01 AdmiralBumbleBee: Sgeo: I believe it makes a java.util.regex.Pattern

15:01 Iceland_jack: Sgeo: isn't it because it treats the strings as raw as well: (re-pattern "\\d+") == #"\d+"

15:06 Sgeo: You know what would be nice? A version of partial that did something like (partial-subj assoc :a 5) == #(assoc % :a 5)

15:07 ivan: augustl: I was curious too and just found https://bitbucket.org/kotarak/lazymap/src/5a2437e70a91/src/main/clojure/lazymap/core.clj?at=default

15:08 jakov: why are there no multiline comments for text in clojure?

15:08 ivan: stackoverflow tells me "If the keys are cheap to compute, but the values are expensive, you can return a full map with the correct keys, and values which are each delays; the caller can force only the values they need."

15:09 #_"Multi line comment"

15:10 technomancy: augustl: you could reify whatever interface makes keys work and just plop a memoized function on top o fthat

15:11 AdmiralBumbleBee: Sgeo: why would you want partial there?

15:12 Sgeo: Because it seems common to treat the first argument of a function as a "subject" of sorts, and being easily able to make anonymous functions based on that assumption may be useful

15:12 Similarly to how partial is useful

15:15 augustl: technomancy: ah

15:18 technomancy: augustl: it depends what you want, really. a memoized function alone is half of what you're asking for; it just doesn't work with keys

15:18 AdmiralBumbleBee: Sgeo: why not just use an anonymous function literal?

15:18 as in your example

15:18 I'm curious if there'd be some other benefit

15:18 Sgeo: Same reason that partial exists rather than people just using anonymous function literals

15:18 augustl: technomancy: the keys are pre-defined, it's just the values that would be nice to look up run-time

15:19 Sgeo: Also, imo, there should be a function (defn $ [fn arg] (fn arg))

15:19 It has some utility sometimes

15:19 At least in Haskell it does

15:20 Although in Clojure I guess it is as simple as #(%1 %2)

15:20 But still

15:20 gfredericks: Sgeo: my beginner impression is that the primary utility of $ in haskell is changing the precedence of things, which isn't an issue in clojure

15:20 Sgeo: ,(map #(%1 %2) [inc dec identity] [2 20 10])

15:20 clojurebot: (3 19 10)

15:21 Sgeo: In a 4clojure solution, I used #(%2 %1), which should just be flip $

15:21 (Actually, no, hmm. That wasn't the exact thing I used)

15:29 Why does every? have a question mark and some doesn't?

15:29 ,(doc some)

15:29 clojurebot: "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"

15:29 Sgeo: ,(doc every?)

15:29 clojurebot: "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."

15:29 gfredericks: some isn't a predicate

15:43 Frozenlo`: Oh yesss... I named an argument the same as a function and was wondering why I was getting an error. -_-

15:56 Sgeo: doc is a macro?

16:00 hyPiRion: ,(let [x every?] (doc x))

16:00 clojurebot: Gabh mo leithscéal?

16:00 hyPiRion: yup.

17:09 dnolen: core.logic 0.8.0 beta1 going out!

17:22 hyPiRion: I never remember: Is "Programming Clojure" or "Clojure Programming" the best introduction to Clojure?

17:23 Or is "Clojure in Action" a good book?

17:23 brehaut: clojurebook.com is good

17:24 jasonleaf: For me "clojure in Action" is the best of three, shows me how to do more practical things with Clojure

17:29 laughingcow: how does one set the class path so as to avoid class not found errors with respect to com.sun.jdi.virtualmachine when trying to run lein ritz?

17:29 I'm on windows 7 64bit

17:29 hyPiRion: Okay, thanks for the input.

17:29 brehaut: start by downloading virtualbox…

17:30 laughingcow: I already set the class path to c:\program files\java\jdk1.7.0\lib but I still get the exception

17:34 anyone?

17:34 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

18:22 AtKaaZ: what project should I use for sending a POST in an attempt to try download a pdf from infoq without being existing user :)

18:22 I might also need to set referrer(?)

18:24 seancorfield: clj-http ?

18:24 AtKaaZ: cool thanks, I'll look into it

18:25 seancorfield: hyPiRion: just saw your Q about books - Clojure in Action is based on Clojure 1.2 so all the library stuff is outdated

18:25 hyPiRion: i recommend the o'reilly book by cemerick et al "Clojure Programming"

18:27 cemerick: thanks seancorfield :-)

18:27 hyPiRion: http://www.clojurebook.com if you're looking for an easy link

18:32 Apage43: AtKaaZ: Also, clojure.java.io/copy is useful combined with passing clj-http's request methods :as :stream

18:35 (with-open [bodystream (:body (clj-http.client/get someurl {:as :stream}))] (clojure.java.io/copy bodystream (clojure.java.io/file "destinationfilename.pdf")))

18:35 AtKaaZ: oh thanks

18:36 Apage43: you'd swap out /get with /post, I suppose, and probably pass whatever data is also necessary

18:37 AtKaaZ: I wasn't sure what you meant until you gave the example

18:52 mklappstuhl: hey

18:52 (map :point3 (triangle1 triangle2))

18:52 I'm trying to get point 3 of each triangle

18:52 triangle is a hash-map

18:53 Apage43: if they each have a key :point3 that'd work

18:53 Sgeo: (triangle1 triangle2) assumes that triangle1 is a function or macro

18:54 Apage43: ah, yeah

18:54 Sgeo: [triangle1 triangle2] or (list triangle1 triangle2)

18:55 Apage43: i guess it doesn't explode outright since maps are fns. It tried to look up triangle2 in triangle1

18:55 mklappstuhl: ah right, got it!

18:55 Apage43: and if points are some seqable, the map would also have not blown up, and just returned nils for whatever elements it found

18:57 mklappstuhl: (map :class (list test-triangle1 test-triangle2))

18:57 => (nil nil)

18:58 Apage43: hm. you trying to get the Java class?

18:58 mklappstuhl: Apage43, this could also be point1

18:59 test-triangle1 returns a valid triangle

19:02 the (list triangle1 triangle2) thing returns a valid list of user/triangle functions

19:05 (def test-triangle2 (fn [] (Triangle (Point 2 3) (Point 1 1) (Point 8 1))))

19:05 this is the definition of my test triangle

19:07 lnostdal: swank-clojure doesn't seem to work at all anymore, and nrepl / nrepl.el still isn't very usable ... what do people use these days? ritz?

19:08 (swank-clojure just stopped working now with latest clojure from git .. AFAICT)

19:09 Apage43: ritz is probably the way to go if you want to use swank

19:09 lnostdal: " No matching ctor found for class clojure.lang.Compiler$CompilerException" swank-clojure says now .. *shrug*

19:10 i just want to hack clojure using emacs .. like, i thought, everyone else .. i don't care whether the backend is nrepl or swank

19:10 Apage43: I'm using nrepl.el

19:10 lnostdal: fwiw ritz doesn't work either .. https://github.com/pallet/ritz/issues/58

19:11 perhaps i instead should do what Paul Graham did in the 90's .. copy/pasting snippets of code to the terminal .... :)

19:12 nrepl.el is close to not usable .. it doesn't deal with threads correctly at all .. kind of makes all that nice support for dealing with concurrency in the language pointless x)

19:14 Apage43: well if everything sucks; https://github.com/clojure/tools.namespace

19:15 at least that makes it a bit easier to do the repl in a separate window thing

19:16 lnostdal: heh, yes ... perhaps :)

19:16 kind of a bummer really

19:25 mklappstuhl: Apage43, is ( map :key (list hashmap1 hashmap2)) _the_ way to extract a list of keys from a bunch of hashmaps?

19:26 Apage43: list of the values of the key :key, anyway

19:27 Sgeo: You could do (for [hashmap [hashmap1 hashmap2]] (:key hashmap)) but map is cleaner I think

19:36 tomoj: what if "#[1 2 %]" read to `(fn* [x#] [1 2 x#]) ?

19:36 unfortunately doesn't work for maps (nor sets..)

19:36 but vectors seem most common anyway

19:37 technomancy: tomoj: isn't that just conj?

19:37 tomoj: well that's a silly example

19:38 #[(str prefix %) value] was the real example that made me think of this

19:40 Apage43: #(do [(str prefix %) value])

19:40 brehaut: tomoj: surely you meant to use juxt there?

19:41 (juxt (partial str prefix) (constantly value))

19:42 technomancy: #(vector (str prefix %) value)

19:43 tomoj: brehaut: yeah, I thought of that, but I was formulating an example for someone who knows only js

19:43 and it seems verbose anyway

19:43 brehaut: but juxt!

19:43 technomancy: it's their lucky day; they get to learn about juxt =D

19:43 tomoj: :)

19:43 Apage43: hadn't thought of that

19:44 brehaut: and they can even use it in JS! http://swannodette.github.com/mori/#juxt

19:44 tomoj: surprised to not see constantly in mori

19:44 brehaut: although it looks like there is a bug in the docs there

19:44 Sgeo: mori?

19:45 Ah

19:45 brehaut: mori is parts of clojurescript compiled for use as a js lib like underscore

19:45 tomoj: hmm yes me too. i dont know why not either

19:45 tomoj: I have _.constantly in our underscore mixin anyway :)

19:45 brehaut: ha

19:50 tomoj: oh, constantly is in mori

19:50 it's just docless I guess

19:51 undoc'd rather

19:54 brehaut: right

19:55 tomoj: apparently thats my fault

19:59 AtKaaZ: can any existing users on infoq tell me the referrer used when trying to download slides from http://www.infoq.com/presentations/Datomic ? cause I seem to have the url right but won't work maybe without referrer(?) also how to specify referrer with clj-http?

20:01 Apage43: it's probably checking more than just the referrer

20:01 AtKaaZ: you're probably right

20:01 anyway the url would be this: www.infoq.com/pdfdownload.action?filename=presentations/GoToCopenhagen2012-RichHickey-WritingDatomicinClojure.pdf

20:02 Apage43: but to send a referrer, you add :headers {"referer" "referrer url"} to the options map

20:02 AtKaaZ: I did notice other blogs link to similar urls and not working

20:02 Apage43: notice "referer" with -one- R in the header name key

20:02 AtKaaZ: Apage43, great thanks ! oh i see

20:02 Apage43: HTTP spec misspelled it.

20:02 AtKaaZ: lol

20:05 hyPiRion: seancorfield: Ah, thanks for that info.

20:08 AtKaaZ: well I found it in a different place: http://gotocon.com/dl/goto-cph-2012/slides/clojure/datomic-in-clojure.pdf

20:12 this might be a silly question but why do clojure people use apple laptops ?

20:15 Apage43: because windows is Too Damn Weird, and buying a laptop and installing a different OS on it is not for everyone

20:34 seancorfield: AtKaaZ: i think it's a general trend in the FOSS community to use Apple or Linux, not Windows?

20:35 most (open source) langauges have a fairly poor experience on Windows because OSS devs tend to use Apple/Linux and that in turn causes more users of the OSS software to prefer Apple/Linux which just reinforces the poor experience on Windows

20:37 I've used every version of Windows since 3.1 but I don't like it as a software development platform (it's fine as an office work machine or a content consumption machine - although I don't even use it for that)...

20:37 ...I've always preferred a *nix platform for software development and Cygwin just doesn't cut it for me

20:37 So, no, it's not a silly question (and it deserves a sensible answer).

20:41 AtKaaZ: alright, that makes sense, but coupled with what Apage43 said however, I'm still wondering why not just install the linux/unix on non-apple laptops? initially I was thinking maybe apple provided better service or longer guarantee period?(didn't check)

20:42 Apage43: again, it's nice to be able to buy a laptop that's usable out of the box

20:43 For folks that develop software that is going to be run on a *nix mainly it makes a lot of sense. I imagine folks that develop windows desktop software, or games, or such have a lot more Windows machines floating about.

20:43 Especially if it's a company machine, part of the new hire process shouldn't have to be installing a new OS on the laptop we just got you

20:44 technomancy: I use debian because it's pretty clear apple and microsoft don't have developers' best interest in mind.

20:44 AtKaaZ: ok, I guess I was imaining only the subset of laptops that exist without any preinstalled OSes (like windows) and having the user install linux on them, but also imagined that apple are more priced in comparison(didn't check this)

20:44 seancorfield: lnostdal: I know technomancy is no longer supporting swank-clojure but have you mentioned the Clojure 1.5.0 master failure to him?

20:44 technomancy: swank-clojure fails on projects with Clojure 1.5.0 master with Exception in thread \"main\" java.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.Compiler$CompilerException, compiling:(swank/commands/basic.clj:182:24)

20:44

20:45 * Apage43 uses Arch Linux on machines that are mine

20:45 technomancy: seancorfield: hm; haven't used 1.5 yet

20:45 lnostdal: seancorfield: not yet .. or well, now he knows .. :) .. i figured i'd move on

20:45 technomancy: that's not an AOT problem is it?

20:45 Apage43: my work laptop is a macbook partially because they had me doing iOS deve at one point, though =P

20:45 technomancy: I actually know next to nothing about the internals of swank

20:45 seancorfield: technomancy: 1.5.0 is fine up until a very recent build that breaks swank-clojure

20:46 and it looks more like a bug in Clojure TBH

20:46 lnostdal: yes, confirming the same; it started happing in very recent versions (git) of clojure 1.5

20:46 oh

20:46 interesting

20:46 seancorfield: AtKaaZ: I have a netbook running Ubuntu as my secondary machine but I find Ubuntu a bit clunky for day to day work

20:47 and i really love my 27" quad core iMac :)

20:47 technomancy: weird, swank is throwing internal clojure compiler exceptions

20:47 AtKaaZ: :)

20:47 technomancy: that's wonky

20:47 i guess that's what happens when you don't have ex-info =\

20:48 seancorfield: I'd say it's swank using undocumented clojure internals that you should expect to break

20:48 seancorfield: clojure 1.5.0 alpha 4 works, alpha 5 breaks

20:48 so it was a commit between those versions that breaks swank-clojure

20:50 my guess would be this commit https://github.com/clojure/clojure/commit/1c8eb16a14ce5daefef1df68d2f6b1f143003140

20:50 but that's based on a quick glance

20:52 hyPiRion: Then it's pretty obvious swank is doing something weird with fn then.

20:52 AtKaaZ: is ex-info from blind?

20:52 technomancy: ex-info is from clojure.core in 1.4

20:53 lnostdal: https://github.com/clojure/clojure/commit/6bbfd943766e11e52a3fe21b177d55536892d132 line 6289 ?

20:54 the argument list has changed: public CompilerException(String source, int line, int column, Throwable cause)

20:54 it takes a column now it seems .. i dunno

20:55 https://github.com/clojure/clojure/blob/6bbfd943766e11e52a3fe21b177d55536892d132/src/jvm/clojure/lang/Compiler.java#L6328

20:55 the actual file after that patch

21:00 tomoj: ran into that problem yesterday too

21:03 lnostdal: i guess src/swank/commands/basic.clj line 208'ish needs patching

21:04 not sure how to extract a column number from a linenumberreader, though

21:04 tomoj: but needs to be a patch that detects whether clojure version is 1.5.0-alpha5 or greater?

21:04 lnostdal: i... suppose

21:21 doomlord: how does clojure react if you give it a map with repeated keys, or uneven key: value arrangement

21:22 brehaut: ,{:a 1 :b}

21:22 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Map literal must contain an even number of forms>

21:22 brehaut: ,(hash-map :a 1 :b)

21:22 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: :b>

21:23 AtKaaZ: ,{:a 1 :a 2}

21:23 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Duplicate key: :a>

21:23 doomlord: i'm dealing with a fileformat which isn't really maps, it has multiple instances of the same 'key' in the same collection (its more like arrays of polymorphic objects).. i'm ust wondering what the best way to represent that in clojures' syntax would be.

21:23 brehaut: {:a [1 1]}

21:23 is a way

21:23 but it might not be the best way depending on what you are doing

21:24 if each object in your file is a distinct object, it might just be a seq of maps is best

21:25 doomlord: although it looks a lot like maps.. maybe its better to make it vectors with keys strewn within.. and it wont react to vector acessors

21:25 sorry wont react to key acessors i mean

21:26 its the fbx file format

21:31 tomoj: I think {:a 1 :a 2} is {:a 2} in the latest 1.5?

21:34 seancorfield: lnostdal: good catch... yes, swank/commands/basic.clj is explicitly creating a compiler exception.

21:34 you could (try ... without column ... (catch Exception _ ... with column 1 ... )) i guess?

21:38 lnostdal: i haven't figured out how to get, well, stuff .. to use a local swank-clojure snapshot.. i think

21:39 AtKaaZ: can you make each statement(erm, function call?) be inside a try catch ? somehow easily

21:40 brehaut: lnostdal: any particular reason you want swank-clojure?

21:40 doomlord: is it possible to iterate/'map' over the keys and values of a map .. in the {:a 1 :a 2 :b 2} case getting (:a 1) (:a 2) (:b 2) passed in

21:41 lnostdal: brehaut: yes, nrepl.el / nrepl isn't there yet

21:41 brehaut: doomlord: yes; with map

21:41 doomlord: though you get vectors rather than lists

21:42 AtKaaZ: tomoj: still duplicate with 1.5.0-alpha6

21:43 Sgeo: What's wrong with nrepl?

21:44 doomlord: REPL says (def a {:a 1 :a 2 :b 2}) (map #(print %1) a) => ([:a 1][:a 2]nil [:b 2]nil nil) ... looks like what i want but what are the nills doing there

21:44 AtKaaZ: how does that work?

21:44 with the duplicate :a

21:45 you can prepend a (vec ...) to see, nil is the return from print

21:46 hiredman: win 15

21:46 brehaut: doomlord: you arent able to have duplicate map keys

21:47 AtKaaZ: but it looks like he was able to, I want to know how :)

21:47 lnostdal: ok, yes; always sending 0 for column works .. seancorfield / technomancy

21:48 doomlord: ok.. (map #(vector (% 0)(% 1)) { :a 1 :a 2 :b 2}) => ([:a 1][:a 2][:b 2]) ... i understand this breaks the traditional map acessor but this is doing whaat i want- and there are subsets whre some of the keys are unique: it tends to be just one key that is repeated

21:49 maybe its undefined behaviour..

21:49 brehaut: ,(map (fn [[k v]] (str k " => " v)) {:a 1 :b 2})

21:49 clojurebot: (":a => 1" ":b => 2")

21:50 doomlord: i keep forgetting it has that nifty destructuring of arguments

21:51 AtKaaZ: doomlord, you reified the map accessor?

21:52 doomlord: the way the source data works its most natural to shove it in that form

21:52 this must come up with xml too

21:54 AtKaaZ: ,(hash-map :a 1 :b 2 :a 3)

21:54 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>

21:54 AtKaaZ: ok that works on 1.5.0-alpha6

21:55 which is probably what tomoj said

21:55 tomoj: weird, I couldn't get it working here

21:55 AtKaaZ: this works: (hash-map :a 1 :a 2) but this doesn't: {:a 1 :a 2}

21:55 tomoj: seemed like repl problems

21:55 yeah, neither worked for me, hmm

21:55 AtKaaZ: ,(class {:a 1 :b 2})

21:55 clojurebot: clojure.lang.PersistentArrayMap

21:56 AtKaaZ: ,(class (hash-map :a 1 :a 2))

21:56 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>

21:56 AtKaaZ: ,(class (hash-map :a 1 :b 2))

21:56 clojurebot: clojure.lang.PersistentHashMap

21:56 doomlord: its letting it through for me... but this laptop has an old cloujre from the ubuntu repos i think

21:56 AtKaaZ: v 1.1 ?

21:56 brehaut: yikes. dont do that

21:56 AtKaaZ: ,*clojure-version*

21:56 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

21:56 brehaut: leiningen

21:56 doomlord: i have the right version on my desktop

21:57 Hodapp: blugh, Counterclockwise is being horrid

21:57 I suppose my one choice left if I want anything resembling an IDE is to use Emacs

21:57 doomlord: emacs is great!

21:58 windmove

21:58 mork: emacs is pretty good for clojure not perfect but very good.

21:58 AtKaaZ: doomlord, what version does your ubuntu clojure say it is? or doesn't it have the *clojure-version* ?

21:58 Hodapp: but this Eclipse tooling is just... shit-tastic

21:58 mork: well it is eclipse

21:59 doomlord: i think its 1.2... 3 metres away, there is 1.5 installed i think. however i've had very little sleep recently and can't be arsed moving 3 metres right now

22:00 Hodapp: I had the REPL working... right now, I am unable to get it to evaluate anything at all.

22:01 AtKaaZ: ,(defstruct s :b :c) (struct-map s :a 1 :a 2)

22:01 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

22:01 Hodapp: mork: what do you use?

22:02 mork: emacs

22:02 AtKaaZ: doomlord, I think taking some sleep sounds optimal at this stage

22:03 ,(struct-map (create-struct :b :c) :a 1 :a 2)

22:03 clojurebot: {:b nil, :c nil, :a 2}

22:04 Sgeo: ,(doc create-struct)

22:04 clojurebot: "([& keys]); Returns a structure basis object."

22:04 AtKaaZ: who knows how to create a PersistentTreeMap?

22:04 Sgeo: ,(create-struct :b :c)

22:04 clojurebot: #<Def clojure.lang.PersistentStructMap$Def@3bc4284a>

22:04 mork: monger has a macro called partial-query I want to construct a function that can take a vector of arbitrary length and merge everything together and apply the result to (with-collection)

22:05 how can I do this in clojure?

22:05 Gosh: I have my code organized like this "src/main/clojure" for code and "src/test/clojure" for tests. I would like to have the same namesapces in test folder as I have in main folder. Is there a way to achieve this without having namespaces overlapping. My current solution which I dont like is, I wrapped all namespaces in "src/test/clojure" folder with a test namespace. Any better solution?

22:05 brehaut: is with-collection a function or a macro?

22:05 AtKaaZ: ,(struct (create-struct :b :c) "one" "two")

22:05 clojurebot: {:b "one", :c "two"}

22:06 brehaut: AtKaaZ: struct‽ thats mighty old

22:06 AtKaaZ: brehaut: it is?

22:06 brehaut: yes

22:06 mork: brehaut: it is a macro

22:06 AtKaaZ: but it has extends, sorta

22:07 brehaut: AtKaaZ: im pretty sure it its the next best thing to deprecated if not actually deprecated

22:07 AtKaaZ: brehaut: what should be used instead?

22:07 brehaut: just a map

22:07 or, if you need polymorphic dispatch, records

22:07 (by polymorphic dispatch i of course mean implementing interfaces or protocols)

22:08 AtKaaZ: http://clojure.org/data_structures#Data%20Structures-StructMaps note the note

22:09 AtKaaZ: awesome thanks

22:09 mork: I'm thinking that I can just do something like (map (partial-query) conditions)

22:18 brehaut: any suggestions?

22:19 brehaut: nope

22:19 only that applying anything that looks like a macro is not so much fun

22:20 mork: aww

22:21 hmm guess I'll come back to the idea later when I get more comfortable with clojure

22:22 any answer I find will probably overcomplicate what I'm trying to do at the moment anyway.

Logging service provided by n01se.net