#clojure log - Sep 20 2009

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

0:36 danlei`: what would be a quick fix (if possible without getting down to the java level) for JComboBoxes double entry bug?

0:36 * danlei` is not a java guy

3:02 mortonJohnson: (defn hello [] "Hello Everybody")

3:30 CalJohn_: In clojure, is it true that STM types can be read without a transaction?

3:30 unlike haskell's STM

3:39 Chousuke: CalJohn_: yes.

3:40 CalJohn_: can you atomically read while applying a non-atomic transformation?

3:42 Chousuke: the reference is conceptually something like a "pointer" to an immutable value

3:42 so "reading" it is just a dereferencing operation

3:42 and once you have the value, nothing can change it

3:42 CalJohn_: right, right

3:42 ok

5:07 rafsoaken: How do I catch a say ArrayIndexOutOfBoundsException?

5:08 never mind, found it..

5:30 jamesswift: hi folks, i was asking today about 'trie's and if anyone here could provide an example of how you would transform the inTree to the outTree http://paste.lisp.org/display/87340

5:30 the #haskell foks gave me a nice example in that language but i would like to have ine for clojure

6:28 ben_m: Hey there :) When I edit a file in vim, can I somehow run an interactive clj in another terminal with the file I'm editing and then just reload that when I change something?

6:29 Nevermind, (load-file "foo.clj") works :)

7:38 cow-orker: will there be a non-private assert-args anytime soon?

7:39 Chousuke: you could use the pre- and postcondition support

7:39 I wonder if it's documented anywhere :P

7:40 cow-orker: hmm.... I haven't seen it, but that doesn't mean it's not documented somewhere :-)

7:42 Chousuke: the only mention I've seen of it is in the commit logs :)

7:42 cow-orker: I'll have a look there .... thanks!

7:43 Chousuke: search for ":pre" in the logs

7:43 that'll find it

7:43 cow-orker: thanks a lot!

7:58 :pre and :post cleaned up the code quite a bit! :-)

10:34 ankou: hi, the documentation says that the parameter of memoize should be refererentially transparent but is this a requirement?(I want to use it for loading a file which is not a pure function but a candidate for remembering the output)

10:42 durka42: ankou: as long as you don't care that the function's output won't change if a file's content changes behind its back

11:13 alinp: hi

11:13 is there a way to force evaluation for a function ?

11:14 I mean ... for map for instance

11:14 is it possible ?

11:14 ,(doc map)

11:14 clojurebot: "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."

11:14 alinp: I don't want to return a lazy seq ...

11:14 I want to return a seq ... evaluated

11:16 the reason why I want that is ...

11:16 when calling time function for a map, it will not return the actual time took for the map to be executed

11:17 same for pmap

11:17 xdp: hello,drawString slow down my application, howto fix it?

11:17 danlei: alinp: why not wrap it in a doall?

11:18 alinp: danlei: thanks :)

11:18 this is what I tried to find out

11:18 danlei: ok. there's also dorun, if it's all about side effects ...

11:18 xdp: any alternative to drawString in java?

11:19 hmm

11:21 any swing wrapper in clojure by now?

11:25 or swt?

12:21 thesnowdog: At the risk of being jumped on, is there a list of "Clojure success stories"? As cheesy as it may be, management types love this stuff. I couldn't find it but my google foo is weak.

12:29 ben_m: I gather you've found vim-clojure?

12:29 clojurebot: Gesundheit!

13:29 manic12: is there any swing example code in clojure?

13:29 LauJensen: Is the JVM Video up somewhere yet ?

14:25 ben_m: thesnowdog: Why do you ask? :)

16:46 ordnungswidrig: How must a multimethod dispatch function be written? What are the params passed to it? The actual params that the multifunction is invoked with?

16:47 I keep getting "Wrong number of args passed to: user$fn"

16:49 Chousuke: yes

16:49 ordnungswidrig: I used (defmulti foo first)

16:50 Chousuke: then you would call (foo [1 2 3 4]) or something

16:50 and the dispatch value would be "1"

16:50 ordnungswidrig: ok

16:50 without the explicit seq would (defmulti foo (fn [&rest] (first rest))) do?

16:51 Chousuke: yes.

16:51 though I think you need a space after the & :)

16:52 ordnungswidrig: And with an explicit dispatch keyword: (defmulti foo [ type & rest] type) ?

16:52 Chousuke: yeah

16:52 ordnungswidrig: where type is a namespace keyword and I have a hierachy built using derive?

16:52 Chousuke: though both type and rest shadow core functions :P

16:53 ordnungswidrig: it can be anything

16:53 ordnungswidrig: ah the shadows.

16:54 http://gist.github.com/189297

16:54 manic12: are there any good examples of using gen-class ?

16:55 Chousuke: ordnungswidrig: the defmethods need to take the shape parameter too

16:56 so (defmethod draw ::shape [_ x y] "shape") -> now you can call (draw ::shape x y)

16:58 ordnungswidrig: Now I see the light!

16:58 :-) That makes sens as the method can now acces the dispatch value it was called for.

16:58 Chousuke: or you could do something like (defmulti draw type) and then (defmethod draw ::rect [rectangle] "rectangle") and ensure that rectangles have ::rect as their :tag metadata

16:59 ordnungswidrig: :tag metadata?

16:59 Chousuke: (doc type)

16:59 clojurebot: "([x]); Returns the :type metadata of x, or its Class if none"

16:59 Chousuke: oh wait, it was :type :P

17:01 anyway, (draw (with-meta something-representing-a-rectangle {:type ::rect}))

17:01 ordnungswidrig: ah, I see.

17:01 Chousuke: (or you can have a make-rect that attaches the metadata for you

17:01 ) :P

17:02 ordnungswidrig: something like that, yes. I'll try. Designing a non-oo api is nothing I've done in the last 5 years.

17:03 Chousuke: well, defmethods used like this are quite a lot like OO in a sense.

17:03 but all your objects are immutable values, not something that can change so I guess the program ends up quite different :)

17:04 ordnungswidrig: Yes, actually I'm desiging a litte rest framework remotely resembling erlangs webmachine. Every resource is represented by a collection of functions (calculate etag, does-resource-exist etc.)

17:05 What I'm doing is to provide reasonable default implementations and a single resource can take the defaults and decorate / replace them with the actual implementation for it

17:06 Chousuke: hmm

17:06 ordnungswidrig: I thought of making each decision point function a multimethod and dispatching on a namespace keyword representing the resource

17:07 Chousuke: that might work

17:07 though what will you do if you want to use functions from different namespaces?

17:07 ordnungswidrig: I though namespace keywords would do the trick?

17:08 Chousuke: I mean, if you want to dispatch to one namespace for one of the functions and to another for some other.

17:08 I guess that might just not happen :/

17:12 ordnungswidrig: Hmm, basically there will be a default dispatch value for the default implementation and I assume that all methods defined for a single disptach value are in the same namespace.

17:13 Chousuke: right. though actually WHERE they are defined does not matter. :) just as long as there is a definition for a certain dispatch value

17:13 ordnungswidrig: ...or a dispatch value that matches with isa?

17:13 Chousuke: yeah.

17:14 you can manually define a dispatch value "outside" your namespace if you just write it out in full. ie. (defmethod foo :some.external.namespace/dispatch-key [] ...)

17:15 ordnungswidrig: But (derive :orders :some.namespace/ressource) and (defmulti :orders) will do and pickup the defaults for .../ressource as well?

17:16 Chousuke: well, derivation doesn't "inherit" anything

17:17 it just provides the default in case there's no more specific implementation

17:17 ordnungswidrig: Yes, I meant the default implementaion

17:18 Chousuke: so in that case if you didn't do (defmethod :orders [] ...), it would use the fuction for :some.namespace/resource

17:18 duck11231: Is it possible to re-def a defmulti without losing the associated defmethods?

17:19 Chousuke: I don't think so :/

17:19 duck11231: I have some of my defmethods in other files, and when I re-eval the base file, I lose some of my handlers

17:21 Chousuke: duck11231: I suppose the solution to that would be to define the multimethod in some other file that doesn't need to be re-evaluated :P

17:22 ordnungswidrig: Chousuke: hehe, "header files"

17:22 Chousuke: I suppose you could do some hackery to get the methods currently defined for the multi and then set them up again manually after the multimethod has been redefined...

17:22 the MultiFn class has .getMethodTable and .getPreferTable and .addMethod and .preferMethod... :)

17:23 duck11231: I think I need to write an emacs keybinding to send a complete reload of my base namespace. I don't like using C-M-x because I lose linenumbers, so I usually C-c C-l

17:26 ordnungswidrig: ist there something like "underive" in the repl?

17:27 *slapmyhead* underive

17:27 Chousuke: :)

17:28 pixelman: Trouble starting swank. Shouldn't I be able to do (start-swank) when i (use 'swank.swank) ?

17:33 doh! it was called (start-server ...

17:37 ordnungswidrig: hmm, emacs shows the matching opening parent only when I'm on the character _after_ the closing parent. is this the default?

17:45 ben_m: What's the difference between an atom and a ref?

17:45 (I'm reading 'Programming Clojure' and it wasn't explained yet)

17:47 hiredman: clojurebot: atom vs. ref?

17:47 clojurebot: I don't understand.

17:47 hiredman: clojurebot: atom vs. ref is <reply>http://groups.google.com/group/clojure/msg/fd0371eb7238e933

17:47 clojurebot: Ack. Ack.

17:47 Chousuke: ben_m: changes to refs are coordinated, changes to atoms are not

17:48 though that might be an oversimplification

17:48 ben_m: So atoms are not exactly threadsafe?

17:48 Chousuke: well, they are atomic

17:49 ben_m: Doesn't ring a bell, but I will look it up :)

17:49 Chousuke: it means that you won't see a "half-value"

17:51 but the point is that if you have two atoms, there's no way to get a consistent snapshot of them both "at the same time", so to speak

17:51 ben_m: I see

17:51 Chousuke: whereas with refs you can do the reads in a transaction and if anything changes the refs in the middle, the read gets retried until you get a consistent result

17:52 hiredman: if you have two queues, and those two queues are in atoms, if you take an item from one, and put it in the other, it is possible for other operations to be interleaved between the take and the push, so there is a time when the thing you are swapping is in neither queue

17:52 rafsoaken: How can i construct a hash-map from (1 \a 2 \b) ?

17:52 Chousuke: rafsoaken: apply hash-map :)

17:52 rafsoaken: obvious when you think about it :) thx

17:53 hiredman: if you do the same thing with queues in refs, the whole unit of work happens at once

17:53 ben_m: Chousuke: hiredman: Thanks, I think I understand :)

17:53 rafsoaken: ,(apply hash-map (1 \a 2 \b))

17:53 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn

17:53 manic12: where is an example of the use of the :constructors keyword in gen-class?

17:53 rafsoaken: ,(apply hash-map (list 1 \a 2 \b))

17:53 clojurebot: {1 \a, 2 \b}

17:53 hiredman: rafsoaken: whole 'nother problem

17:54 rafsoaken: yeah, sorry wanted to try clojurebot desperately

17:54 Chousuke: ,(into {} (partition 2 '[a 1 b 2 c 3]))

17:54 clojurebot: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry

17:54 Chousuke: wait, what.

17:54 ben_m: (into {} works just like a cast, right?

17:54 hiredman: using numbers as keys in a map has issues

17:55 ben_m: In other languages.

17:55 Chousuke: ben_m: cast? no.

17:55 hiredman: eh?

17:55 Chousuke: ben_m: into actually builds the map

17:55 hiredman: ~def into

17:55 Chousuke: ,(into {} (partition 2 [1 2 3 4]))

17:55 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Map$Entry

17:55 Chousuke: why doesn't that work? :/

17:56 hiredman: ,(partition 2 [1 2 3 4])

17:56 clojurebot: ((1 2) (3 4))

17:56 Chousuke: ,(into {} [[1 2] [3 4]])

17:56 clojurebot: {3 4, 1 2}

17:56 hiredman: ,(int {} (map vec (partition 2 [1 2 3 4])))

17:56 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: core$fn

17:56 hiredman: ,(into {} (map vec (partition 2 [1 2 3 4])))

17:56 clojurebot: {3 4, 1 2}

17:57 Chousuke: anyway, using into might be better if you're building a big map from a large seq

17:57 since IIRC apply holds on to the head of the sequence, while into does not.

17:59 manic12: where are some examples hiding of the use of gen-class, specifically the :constructor and :init keywords ?

17:59 rafsoaken: thanks Chousuke & hiredman~

17:59 s/~/!

18:00 manic12: anyone?

18:04 should I just write my class in java and then use the java interop capabilities?

18:05 ben_m: How would the defmulti call look like if I want to use a meta tag as dispatch function? (My terminology might be wrong here)

18:06 For example (doesn't work obviously): (defmulti sound ^{:animal-type}) (defmethod sound ^{:animal-type :dog} [] (println "Bark"))

18:08 Chousuke: ben_m: (defmulti sound (fn [thing] (:animal-type (meta thing))))

18:08 ben_m: Ooh :)

18:08 Chousuke: or (defmulti sound (comp :animal-type meta)) :)

18:09 and then (defmethod sound ::dog [thing] "bark")

18:09 ben_m: Now that confuses me :)

18:10 What's the ::dog doing?

18:10 Chousuke: it's the type tag

18:10 similar to :dog, but ::dog is automatically namespace-qualified

18:10 ben_m: I should probably keep reading the book before I ask question :D

18:10 Chousuke: ,'::foo

18:10 clojurebot: :sandbox/foo

18:10 ben_m: ,':foo

18:10 clojurebot: :foo

18:13 ben_m: Thanks for your help :)

18:13 Good night.

18:18 manic12: i want to override a constructor, how do i do that?

18:27 Chouser: manic12: you don't. just provide a function that will act as a factory

18:29 hm, I guess gen-class can provide ctors

18:31 manic12: and provide a :factory keyword?

18:32 Chouser: manic12: you're using gen-class?

18:33 manic12: either gen-class or :gen-class of ns, I don't care

18:35 Chouser: ok, then you can use :constructors to create ctors with whatever signatures you need.

18:35 manic12: how do I provide the body of the ctor, and how do I call super?

18:37 Chouser: you use :init to provide a function that will be called before the object is created, and :post-init to provide a function that will be called after the object is created (and the super called).

18:38 manic12: ahh! i glossed over that post-init stuff

18:38 thank you

18:38 emacsen: what's the cannonoical clojure way to provide validation on an object (eg make sure the values conform to what they should be on a struct)?

18:39 Chouser: hm... there are validators for reference types, but not for structs as far as I know.

18:39 probably best to provide a function that should be used for creating the struct, and do any checks there.

18:40 emacsen: k. I was doing that but then thought there might be a more clojureish way

18:40 I'm doing something simple like stoing lat/longs and want to be sure that the numbers fall within the proper range always

18:44 the other confusing thing is that for atoms, there's :validator

18:45 Chouser: emacsen: yeah, reference types have validators

18:45 atoms, refs, agents, etc.

18:46 more critical there, because any function could be used to change it.

18:46 emacsen: okay... similar dumb question... If I have a struct, is there a function to ask the struct its "structure basis object" name?

18:46 Chouser: not dumb -- comes up all the time.

18:47 but a struct basis is not a class. a struct is just a simple optimization of a map.

18:47 emacsen: so what do I really want?

18:48 Chouser: if you want to attach a "type" to an object, it's common to use metadata

18:48 emacsen: oh that's a good idea

18:48 Chouser: ,(type #^{:type ::Foo} {:a 1})

18:48 clojurebot: :sandbox/Foo

18:49 emacsen: heh

18:54 thanks for the advice

18:57 Chouser: yet another reason to have a function to create the things

18:57 emacsen: right- makes sense

19:55 sfuentes: i'm a little confused here and i was hoping somebody could help me out here. It seems that some ppl in the clojure community see OOP as not really being a good way of modeling programs. Is this true?

19:55 emacsen: sfuentes: that's a very big simplification, but it's sort of true

19:56 dnolen: sfuentes: and pretty much impossible in Clojure anyway. Clojure doesn't support OO style programming very well. You'll have to explore other approaches.

19:56 emacsen: more accurately we'd say that the benefits of OO can be achieved other ways, and the OO model itself causes problems

19:56 technomancy: sfuentes: have you read http://clojure.org/state ?

19:56 emacsen: dnolen: Well, you can do it.. you can call java OOs, etc

19:56 erm java objects

19:57 technomancy: Clojure people don't endorse conflating state and identity, which is something most mainstream OOP implementations do

19:57 emacsen: sfuentes: also, it's a big leap for some people who'd never used CLOS (the Common Lisp object system). if you have, it's a leap, but a smaller one

19:57 rlb: Also, some of the very common systems (Java, C++, etc.) are *very* narrow programming models..

19:58 (even as far as OOP goes)

19:58 emacsen: and now sfuentes, I'm afraid we're going to have to pelt stones at you...

19:59 sfuentes: my usual thinking is that prog languages are tools and obviously tools are designed for certain tasks. so the challenge for me here is to try to understand where a tool like clojure is better suited.

19:59 emacsen: sfuentes: it's better for data oriented problems

20:00 (though it can do far, far more)

20:00 dnolen: sfuentes: I think the programming language == tool analogy to be very fragile. programming language == factory that generates tools to be a better one.

20:00 emacsen: sfuentes: have you ever used a lisp before?

20:02 dnolen: sfuentes: when you program in something like Java changing the factory is an expensive and sometimes impossible task. Clojure is a just in time factory where many parts are easily reconfigurable.

20:02 sfuentes: the only lisp (clisp) i know is from my programming languages cs class

20:02 emacsen: they never teach lisp right in school

20:02 sfuentes: but i wouldn't say i know the language

20:02 rlb: FWIW, quite a while back I found the Keene CLOS book to be a good way to see a broader perspective wrt OOP in fairly few pages. Although it may not be as easy if you're not yet familiar with lisp in general.

20:02 emacsen: or... I shouldn't say never... but they usually teach it poorly and too quickly

20:04 sfuentes: it's hard to discuss the benefits of Clojure without someone understanding the benefits of Lisp in general. Lisp isn't easily compatable to other languages because it's a very different style of programming

20:04 different than say Python or Ruby, or C

20:04 ( I should say "Lisps aren't" rather than "Lisp isn't")

20:05 technomancy: sfuentes: there are real unavoidable problems with concurrency when you mix state and identity like how most OOP does

20:06 you should read the "State and Identity" essay I linked to

20:07 dnolen: emacsen: Lisps really are not so different then Python Ruby IMHO. Those are Lispy languages. Clojure's emphasis on FP and concurrency are the more distinguishing traits.

20:07 emacsen: dnolen: we'll have to agree to disagree :)

20:07 dnolen: emacsen: haha, sure.

20:08 sfuentes: my dilemma is in trying to decide on what "tools" to invest my time in

20:08 dnolen: sfuentes: what "tools" are you using now?

20:09 sfuentes: mostly php :/

20:09 dnolen: well Clojure will be serious upgrade for you then ;)

20:09 sfuentes: not really by choice, as that knowledge is widely requested

20:10 emacsen: it's widely requested that you know Clojure?

20:11 sfuentes: emacsen: no. clojure *appears* to me as being a *newer* skill/tool that has potential ... so obviously it would suit me to get a head start

20:12 emacsen: sfuentes: it's a big jump from PHP. I might suggest trying something like going through technomancy's peepcode video

20:12 and watching the Rich Hickey videos

20:12 and then deciding

20:12 sfuentes: i did watch one of hickey's videos.

20:13 emacsen: The problem is right now there aren't many gentle introductions

20:13 sfuentes: i even purchased the peepcode video last night.

20:15 dnolen: sfuentes: in order to ease your introduction I would use NetBeans + Enclojure. Though I'm Emacs person myself- I wouldn't recommend it as your introduction to Clojure. If you're doing web dev, you should definitely check out Compojure and/or Ring.

20:17 sfuentes: i remember fiddling with clisp in college and wondered why it wasn't more widely used in industry. the problem *seemed* to be centered on standard libraries. Clojure seems to have alleviated this by targeting the jvm, so it seems like there's a strong case for a lisp dialect now. That's how I feel now, and that's why i'm thinking about learning clojure.

20:19 dnolen: Netbeans+Enclojure is what I'm working with right now. Haven't really developed anything meaningful, but that's my dev env

20:19 dnolen: sfuentes: well then you're all set. Learn some Clojure! :)

20:20 sfuentes: i got one more question

20:23 before i heard of clojure, scala appeared to be the lang to learn from the rest. so now i'm wondering if scala and clojure are alternatives or whether they complement each other in larger systems. I think if I knew more about lisp I would know this, but I don't.

20:25 dnolen: sfuentes: not too many scala people here I don't think. however the my reductive generalization would be: Clojure is a simpler language than Scala but probably just as powerful for writing applications.

20:27 sfuentes: alot of what i'm hearing seems to be centered around FP vs OOP, and if that's the case, can you say that other functional languages are simple and perhaps even more powerful than OOP languages?

20:28 dnolen: sfuentes: that would be too reductive of a generalization :) not all FP languages are "simple". nor are all OO languages "powerful", PHP case in point.

20:30 sfuentes: i see. so haskell would not be considered simple, right?

20:31 but i'm not sure i would say php is naturally oop

20:31 by the way, i appreciate you guys taking time to answer my silly questions

20:36 Chouser: I think the combination of syntax and type system would be enough to consider Haskell more complex than Clojure.

20:37 Though I don't think Clojure's STM could be called simple.

20:38 rlb: sfuentes: also, in my experience, clojure tries to avoid being too pedantic. If you need mutation, fine. If you want to work in a more java/c++-esque object oriented fashion, you can (to some extent), that's just a very limited application of clojure's multimethods.

20:39 (There I'm speaking mostly about dispatch...)

20:40 Makoryu: Haskell is certainly simple compared to its peers in the imperative world. It has fewer rules with fewer exceptions... Of course, that allows libraries to implement a certain amount of syntax as ordinary functions

20:43 sfuentes: again. thank you all for your time and insights.

20:55 dthomas: If I do something like (doseq [x (new-huge-lazy-seq)] (stuff-with x)) will the whole sequence end up materialized in memory when iteration terminates? Or are the head elements eligible for the GC after they are operated upon and then forgotten?

20:56 I suspect there is an easy way to test this involving top and (repeatedly).

20:59 hiredman:

20:59 dthomas: Yeah, I think this is a stupid question.

21:00 Lazy sequences still confuse me.

21:20 emacsen: dthomas: lazy sequences still confuse you why

21:20 that is, what about them confuses you

21:20 Makoryu: dthomas: If you generate a lazy data structure and then explore the structure without letting the reference to the root go out of scope, the whole thing will remain in memory.

21:21 dthomas: Half the point of lazy sequences is that you can recreate them at will if you need them for different purposes, and it won't matter how big the entire thing would be.

21:34 dthomas: Makoryu: Presumably built-ins like (map) and (for) are not written in such a way that they keep the root around?

21:34 (doseq [x (iterate inc 1)]) doesn't start accumulating memory in my box as it presumably would if something was holding on to the root of the lazy seq made by iterate.

21:36 That's what was confusing me today.

21:42 Chouser: doseq itself won't hold onto the head, so the JVM garbage collection will clean it up as it goes.

21:43 if you did (let [xs (iterate inc 1)] (doseq [x xs])) it would consume memory.

21:58 sfuentes: i'm embarrased to ask, but can somebody explain this snippet to me: http://pastie.org/624107

21:58 i'm hung up on the last line

21:59 dnolen: sfuentes: functions (fns) can have multiple arities.

21:59 durka42: the indentation is done confusingly, but it's a function with multiple arities

22:00 so you can call it with no arguments or with one

22:00 and if you call it with none, it calls itself with one, namely the String "world"

22:00 sfuentes: awww i see

22:01 is there a reason to use hyphex prefix to the function name though?

22:01 err hyphen

22:01 durka42: for gen-classing i believe

22:03 sfuentes: what is that if you don't mind me asking

22:03 nm. i'll look it up

22:03 durka42: making a java class from a clojure namespace

22:04 hiredman: ~compile

22:04 clojurebot: the unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation

22:05 sfuentes: got it. thank you.

22:58 interferon: can i convert a struct-map to a vanilla map?

22:59 Chouser: (into {} my-struct-map)

23:03 interferon: thanks!

23:05 prospero_: if I use map over a hash-map, what's the simplest way for that to generate a new hash-map?

23:07 it seems like there should be a simpler way than (apply hash-map (apply concat (map (fn ...) {...})))

23:08 dnolen: prospero: (into {} ...)

23:08 ,(into {} [[:foo 'x] [:bar 'y]])

23:08 clojurebot: {:bar y, :foo x}

23:09 prospero_: I knew there was something I was forgetting

23:09 thanks

Logging service provided by n01se.net