#clojure log - Jul 08 2010

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

1:51 scottj: ugh I hate it when you have to write two versions of the same thing, one in your backend language and one in javascript, if you want security and a decent UI. Really then your better option is just using the javascript version on front and backend and using javax.script.ScriptEngineManager, but it's pretty sad when writing javascript on the server is the best option.

2:21 pers: Hello all. I am trying to do some rough benchmarking of clojures lazy sequences against the CL SERIES lazy sequences. Is there a faster way (maybe with types) to express in clojure: (reduce + (take 10000000 (iterate inc 0)))

2:22 or better than: (reduce + (range 0 10000000))

2:46 semperos: trying to make a relatively simple macro

2:46 want to send an agent an arbitrary number of assoc's

2:47 the agent is a map with keywords mapped to vectors

2:47 so I'm conjing and then sending that to the agent via assoc, but I want to do that an arbitrary number of times for one send command

2:47 and I want to abstract away the conj syntax in a macro

2:48 if stats were my agent, then an example would look like this:

2:49 (send stats assoc :nicks (conj (:name @stats) "Johnny") :hobbies (conj (:hobbies @stats) "Piano"))

2:49 so from a macro standpoint

2:49 just not quite clicking with how I write out the arbitrary number of repeats for the args to that assoc

3:15 mmarczyk: better (send stats (fn [s] (assoc :nicks (conj (:name s) "Johnny") :hobbies (conj (:hobbies s) "Piano")))) (or sth similar) so that the :name & :hobbies values are taken from the Agent state assoc will be working with

3:15 as for the macro, you'd have to give an example of what you'd like an example invocation to look like

3:25 semperos: plus this definitely sounds like a job for a function rather than a macro...

3:25 semperos: also what I like to hear :)

3:26 reading your code from a few minutes back...

3:27 mmarczyk: that was in response to your snippet which obtained some of the arguments to (send stats ...) from @stats

3:27 semperos: right

3:28 mmarczyk: not a good idea -- who knows what might happen between the first @stats, the second @stats and the final send ;-)

3:28 semperos: absolutely true

3:29 to make sure I understand

3:29 how is your 's' above being dereferenced, so I can get at the actual value attached to each keyword?

3:30 mmarczyk: the 's' is the agent's state

3:30 * semperos needs to reread doc

3:30 semperos: more often, that is

3:30 I read it, didn't sink in; thanks, that makes complete sense

3:30 mmarczyk: that's how send works

3:30 :-)

3:30 in your (send stats assoc ...) version

3:31 assoc gets a "state" argument too -- as the first argument, in fact

3:31 semperos: yep, makes sense

3:31 thanks for answering complete newbie questions and guiding aright

3:32 mmarczyk: np :-)

3:32 semperos: I miss IRC

3:32 mmarczyk: now I'm not sure if I understand what you're trying to do, but I guess you want to conj multiple things

3:32 onto some of the vectors in your map

3:32 which is held by the agent

3:32 right?

3:32 semperos: yep

3:32 still in play-to-learn phase

3:33 parsing some server logs

3:33 mmarczyk: you might find update-in useful

3:33 e.g.

3:34 (send stats (fn [s] (-> s (update-in [:nicks] conj "Johnny" "Lil' John") (update-in [:hobbies] conj "Piano" "Harpsichord"))))

3:34 maybe use a 'let' around the '->' form if you need to compute some of those arguments to conj first

3:35 semperos: that's pretty

3:36 mmarczyk: you can wrap it in a function with whichever signature is convenient

3:38 semperos: that definitely reads in the code like what I'm trying to do more than the straight conj's

3:39 mmarczyk: maybe (defn update-stats [args] (let [m (apply hash-map args)] (fn [state] (reduce (fn [s [k vs]] (apply update-in s [k] conj vs)) state m))))

3:39 um, actually (defn update-stats [stats args] ...)

3:40 semperos: at first read-through, makes sense

3:40 mmarczyk: to be used as (send stats update-stats :nicks ["Johnny" "Lil' John"] :hobbies ["..." "..."])

3:40 also, it's (defn update-stats [stats & args] ...)

3:40 hopefully no more typos remain :-)

3:40 semperos: no worries

3:41 I really appreciate it

3:41 mmarczyk: it might not be enough if some of the values need to be computed from other stuff already in stats, but you can generalise from here

3:41 not at all

3:41 :-)

3:41 semperos: can indeed

3:41 and in this case, no further context needed; just insertion

3:42 that's what I get for disobeying the first rule of macros

3:42 mmarczyk: :-)

3:42 actually in this case a macro wouldn't work at all

3:42 because there's no getting around the need for the actual runtime values of the arguments

3:42 semperos: yep

3:43 macro expansion at compile time

3:43 mmarczyk: right

3:43 so in this case, a macro would likely end up expanding to ((fn ... :-)

3:43 semperos: right

3:45 cais2002: is there a way a site-map or anything where I can view all pages on clojure.org

3:45 semperos: there's this one :)

3:45 http://clojure.org/space/sitemap

3:46 mmarczyk: whoa, cool :-)

3:46 never knew about that!

3:46 semperos: just figured there'd be one for the search engines

3:46 by day, I'm a Drupal programmer, which is why I enjoy Clojure so much

3:46 feels mentally cleansing

3:47 cais2002: it does not include http://clojure.org/protocols

3:47 semperos: cais2002: I don't know if it includes everything, or if it's even the primary sitemap for search engines

3:47 mmarczyk: cais2002: it's best to go to assembla for the new features anyway

3:47 cais2002: http://assembla.com/spaces/clojure

3:48 cais2002: mmarczyk, right, but then it points back to clojure.org, saying that that's where the latest copy is

3:49 mmarczyk: cais2002: hm, indeed

3:49 guess this will be cleaned up 'round release time

3:49 cais2002: so assembla is supposed to be the starting point for latest info?

3:50 mmarczyk: it's the starting point for development info, in addition to the ggroups

3:52 ok, breakfast time... bbl

3:52 semperos: mmarczyk: thanks for everythign

3:54 mmarczyk: semperos: np :-)

4:20 esj: howdy, y'all

4:27 yangsx: hi, what does & mean in a function call like (standard-metadata &form docstring sym) in Stuart's lazytest?

4:28 mmarczyk: yangsx: &form is bound to the entire form being expanded in the body of a macrofunction; try e.g. (defmacro foo [& args] &form) (foo 1 2 3)

4:30 yangsx: or actually (defmacro foo [& args] `'~&form)

4:33 yangsx: mmarczyk: the expression I cited comes from describe.clj in lazytest. The problem for is it is not in a backquote form

4:34 mmarczyk: yangsx: it doesn't need to be, it's just a "magic argument" to macros

4:34 yangsx: every macro defined with defmacro receives two extra arguments, &form and &env

4:36 &env allows access to the lexical context of the site where the macroexpansion takes place

4:36 &form just holds the whole form being expanded

4:36 these are just regular symbols, the & has no special meaning

4:36 yangsx: how is &form different from the body of a defmacro

4:36 Licenser: Hmm case study: would it be useful to couple a combo box with a hash map? As in key is displayed, key and value given as selected?

4:37 mmarczyk: yangsx: when (foo 1 2 3) from above gets macroexpanded

4:37 the body of the macro function is `'~&form -- syntax-quote, quote, unquote, &form-the-symbol

4:37 whereas &form is bound to (foo 1 2 3) -- a list of the symbol foo and a bunch of numbers

4:38 Licenser: useful for what? ;-)

4:39 yangsx: mmarczyk: thanks. I never know this. (I don't think CL has this convention.)

4:44 mmarczyk: yangsx: I think you can use &whole to specify a symbol to be bound to the whole form being macroexpanded in CL's defmacro

4:44 as in, (defmacro foo (&whole form &rest args) `',form)

4:49 yangsx: mmarczyk: you're right

4:57 &whole is mentioned just once in "On Lisp" and &form is not mentioned at http://clojure.org/macros. That explains why I have to ask for help here :)

5:02 mmarczyk: :-)

5:02 yangsx: http://www.lispworks.com/documentation/HyperSpec/Body/m_defmac.htm#defmacro

5:03 all the magic incantations assembled :-)

5:04 then by following the links we can learn that apparently (setf (macro-function foo) (lambda (form env) ...)) is possible... crazy language :-)

5:05 yangsx: there are quite some arcane features in CL :)

5:06 mmarczyk: yup :-)

5:08 just searched On Lisp for any mentions of &whole... the only one -- well, except the other one pointing back to it from the index :-P -- says that some model of macro expansion wouldn't handle &whole properly :-)

5:09 technical merit aside, OL never comes short in the amusement department

5:18 LauJensen: Morning guys

5:18 Bahman: Morning LauJensen!

5:18 tcrayford: morning Lau

5:28 npoektop: hi! how to get public field of an object?

5:31 esj: npoektop: in repl-utils is show, which i think will help

5:33 npoektop: esj, i need smth else. I need to get a field of an object and used it

5:33 vibrant: any shortcut for (let [foo (someexpr)] (map #... foo) foo)?

5:33 esj: npoektop: sorry dunno ;)

5:33 vibrant: so to create an object, map it and return it

5:34 Chousuke: vibrant: that code is buggy

5:34 vibrant: map is lazy, so nothing will actually happen to foo

5:35 vibrant: oh ok so i should just do for

5:35 Chousuke: no, for is lazy too

5:35 you want doseq or something

5:35 if you need side-effects

5:35 vibrant: oh ok yea.

5:35 but regarding my initial question, any idea?

5:36 Chousuke: no such thing

5:36 it'd be easy to make though.

5:36 vibrant: yea, was just checking if i'm missing something. thanks.

5:40 npoektop: Chousuke, is it possible to get public field of an object to use it somewhere else? I solved my problem another way, so i'm just asking

5:40 for interest

5:43 mmarczyk: vibrant: (doto (someexpr) (->> (map #...) dorun))

5:44 not that it's shorter, but perhaps DRYer

5:44 vibrant: haha thanks

5:44 mmarczyk; where are you from?

5:44 mmarczyk: Poland

5:59 cais2002: what's the difference btw defrecord and deftype ?

6:07 Chousuke: cais2002: defrecord implements a standard map interface automatically

6:08 cais2002: deftype does nothing

6:08 cais2002: unless you know you need deftype, use defrecord :)

6:11 cais2002: Chousuke: map interface means I can do (fieldname record-instance) ?

6:11 Chousuke: cais2002: :fieldname, but yeah

6:11 cais2002: basically, it works just like a normal map

6:11 cais2002: there are some other interfaces implemented too

6:12 cais2002: but I don't know what they are

6:12 cais2002: Chousuke, under what situation will reify be useful?

6:12 Chousuke: when you need to implement a java interface or a protocol without actually creating a new named class.

6:12 eg. a swing listener or something.

6:13 cais2002: i c, that's what I guessed.. sort of anonymous class

6:13 Chousuke: yeah

6:13 cais2002: (foo

6:13 (let [x 42]

6:13 (reify P

6:13 (foo [this] 17)

6:13 (bar-me [this] x)

6:13 (bar-me [this y] x))))

6:14 Chousuke: reify also closes over locals so you can return reified objects from functions.

6:14 cais2002: it seems a waste to implement bar-me when u only need foo in this case

6:15 Chousuke: well, I dunno, usually you're supposed to implement the entire interface

6:15 Though won't reify generate stubs for methods that you leave out?

6:16 tomoj: isn't (foo (reify P (foo [t]))) useless anyway?

6:16 I mean, why bother reifying?

6:16 Chousuke: yeah, you wouldn't really use reify like that :p

6:16 usually you'd have a function that returns reified objects and then do (foo (get-object))

6:17 cais2002: right, the documentation is pretty confusing. I have to dig into the code in clojure.java.io to reach the ah-ha moment

6:17 i mean what i thought is the ah-ha moment for me

6:18 documentation is a bit abstract, should have more meaningful examples

6:20 tomoj: protocol function vars don't get :file and :line metadata, bug?

6:21 I mean, is there some reason they shouldn't?

7:05 LauJensen: tomoj: Are you on a recent snapshot, I seem to recall that issue being discussed a while ago

7:14 tomoj: I have clojure-1.2.0-master-20100623.220259-87.jar, looks like that's the latest

7:20 LauJensen: I cant say if its a bug or not. I think its tied to the fact that datatypes are reified as classes and not as values in vars.

7:30 Licenser: Good morning my lispy friends

7:31 LauJensen: Good morning

7:32 Raynes: Morning.

7:32 Licenser: How is the world of parentheses today.

7:32 .

7:33 ? Is what I mean

7:33 tomoj: looks like defprotocol uses intern directly

7:35 and the :line/:file stuff is done in the compiler

7:37 should macros have another implicit arg for this?

7:37 guess it would be rarely useful

7:38 LauJensen: tomoj: From a user-perspective, you shouldnt need it

7:40 Licenser: For a swing combo box would it be goood to allow key value pairs as data source?

7:40 tomoj: user-persective?

7:41 user of what?

7:50 esj: Hi Licenser

7:51 Licenser: hi esj

7:54 LauJensen: tomoj: user = developers. Im not seeing where you, Mr. tomoj, will be needing that info ?

8:05 zmila: ,({ :1300 [:1322 :1003] :0130 [:1003] } :0130)

8:05 clojurebot: [:1003]

8:42 vibrant: what use is ~'name in a macro?

8:42 isn't it equivalent to just name?

8:49 dabd: I am searching for the Clojure 1.2.0 roadmap to find more info about

8:49 support for annotations in gen-class. Does anyone know where this is

8:49 documented? Thanks.

8:50 Licenser: The one page has some info not github but where the trackers are

8:50 Ut I always forget the name

8:51 esj: assembla ?

8:52 Licenser: Exactly

8:52 They have some nice infos the in the wiki thingy I think

8:54 LauJensen: vibrant: name resolves to user/name, #'name resolves to the literal symbol (be it local or whatever) 'name'

8:55 ,`#'name

8:55 clojurebot: (var clojure.core/name)

8:56 vibrant: i guess i have to experiment with this :)

8:56 i just found it in clj-record

8:56 any other suggested ORM?

8:56 Licenser: vibrant: Stupid db :P

8:57 vibrant: made by Smart Joe? :)

8:57 oh shit it exists

8:57 Licenser: Nope smart smart licenser

8:57 vibrant: hehe

8:58 yea look neat hehe

8:59 Licenser: I think it is pretty cool if you don't need real db featured

8:59 LauJensen: vibrant: You can check out my blogpost on fluid dynamics and understand the definition of map!, that relies heavily on #' syntax

9:01 vibrant: thanks Lau

9:01 LauJensen: np

9:13 Licenser: Clj-cookie

9:19 Coojies

9:23 neotyk: guys anyone would be interested in taking a look at async http

9:23 *** client for clojure?

9:23 I'm interested to know if it's api is idiomatic clojure

9:24 Licenser: Sure

9:24 neotyk: http://github.com/neotyk/ahc-clj

9:24 Licenser: Expect me to whine about it not being simple enough ;)

9:25 neotyk: Licenser: that would be very much appreciated

9:25 I like simple

9:26 cemerick: neotyk: how does that differ from c.c.http.agent?

9:27 neotyk: is backed by NIO

9:27 doesn't block a thread to wait for response

9:28 and you can provide callback for events

9:28 Licenser: Hmm looks good actually, since you only seem to have two really external fns GET and POST

9:28 neotyk: like body part, ideal for streaming

9:28 Licenser: How about allowing params to be passed in a map?

9:28 Ao the k, v pairs

9:28 neotyk: Licenser: yes, all http verbs will have support fns

9:29 Licenser: So you might think about making the other functions private

9:29 Unless there is a Reason to publish em

9:29 neotyk: Licenser: http://github.com/neotyk/ahc-clj/blob/master/test/async/http/client/test.clj#L136

9:30 Licenser: Ah neat

9:30 neotyk: next thing I'm working on, whel writing a test for it is to be

9:30 *** able to provide a map as body

9:30 dnolen: neotyk: have you looked at clj-apache-http ?

9:30 Licenser: Also if the map is the last arg you can make it look like key worded args, at least in 1.2

9:30 neotyk: but it could be that it works already

9:31 dnolen: neotyk: one thing I recommend is support urls to be represented as maps. make it's a easier to manipulate urls when representing restful resources

9:31 neotyk: Licenser: how would that look like?

9:31 dnolen: uri as strings is fine, but maps should be supported

9:31 neotyk: dnolen: have had quick look at it

9:31 but find apache http client api not nice

9:32 Licenser: As last arg just put ... &{:as opts}]

9:32 With a space of cause

9:32 neotyk: dnolen: how would that map as url be used?

9:33 Licenser: It is part of the new destructing neotyk

9:34 neotyk: where can I read about new destructing?

9:34 Ktm: hi, i'm having a problem with leiningen (snapshot from github) : I called "lein compile" but it does not stop and seems to compile clojure.contrib in the classes directory

9:35 Licenser: Hmm good question I yhink the main new feature is map destructing

9:35 Ktm I thick it is not supposed to is it?

9:37 Ktm: Licenser: well i just want the class specified in :aot to be compiled :-)

9:39 neotyk: Licenser: so basically I could have in GET for example: [#^String

9:39 *** url & {:as options :or {}}] ?

9:40 Licenser: neotyk: I think so yes

9:41 Ktm: Wasn't it renamed to something else

9:41 Namespaces I think

9:44 Ktm: Licenser: do you have a doc on that?

9:57 dnolen: neotyk: you should look again clj-apache-http is very, very good.

10:09 Ktm: Licenser: i've got the same problem when replacing :aot by :namespaces

10:10 Licenser: Hmmm look at the gh page of lien, I k

10:11 Don't use oat myself

11:09 cemerick: import isn't cutting it anymore. Being able to apply aliases to packages would be nice.

11:10 (:import [java.awt.image :as img]), or something

11:11 Licenser: cemerick: Yes it would

11:12 cemerick: and the 1.3 list gets bigger :-)

11:16 chouser: cemerick: and outer classnames

11:17 Licenser: It should be 1.3 times as big as the 1.0 list

11:17 cemerick: chouser: that seems less useful to me. I suppose it depends on how gnarly the classnames in question are.

11:17 chouser: I have classnames 3 levels deep, each 20-30 chars long

11:17 Licenser: And wildcard imports

11:18 chouser: that's like a 60-char classname, and no shorter way to refer to it without resorting to macros.

11:18 cemerick: Licenser: I think package aliases are far saner than wildcard imports.

11:18 chouser: yeah, I don't actually like wildcard imports at all.

11:18 Licenser: cemerick: Yes but both could be possible

11:19 cemerick: well, *anything* is possible. There was a wildcard import fn kicking around years ago.

11:19 Licenser: Also if you defprotocol something in a namespaces using that ns should import the proto classes

11:19 Call it import

11:19 Erm wimport

11:20 cemerick: chouser: Aside from stuff in the JDK, I'm blissfully in control of all the package and classnames floating around here. :-)

11:22 chouser: extended by com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder

11:22 pain

11:22 cemerick: yikes

11:23 man, four-deep inner classes!

11:23 Licenser: Kiiiilll them

11:23 chouser: being able to import the class so you can leave of "com.google.protobuf" just seems entirely insufficient.

11:24 cemerick: are there similarly-absurd things in .NET-land?

11:24 Licenser: cemerick: Give people freedom and they will do absurd things

11:27 AWizzArd: rhickey: Hello, are you here?

11:29 vibrant: huh

11:29 did anyone else notice that json-str captures all printed information when passed a lazy seq?

11:30 is it a known bug?

11:37 polypus: ~ping

11:37 clojurebot: PONG!

12:18 AWizzArd: ~max people

12:18 clojurebot: max people is 283

13:24 fbru02: hey all i have a question , when is it necessary to do bdd or unit testing when programming in clojure ?? \

13:26 qbg: Define 'necessary'

13:27 mmarczyk: hurray! just defined a DefaultMap in Clojure :-)

13:27 http://gist.github.com/468332

13:28 now I can use merge-with even if some maps might miss some keys. :-)

13:29 dabd: what is the release date for Clojure 1.2.0? thanks

13:31 qbg: dabd: Soon for certain values of soon ;)

14:18 LauJensen: mmarczyk: is the __map a standard for naming that you just made up ?

14:38 Licenser: coookies

14:39 mmarczyk: awsome!

14:59 LauJensen: 2x Clojure on the frontpage of HN today :)

15:03 Man alpeh/netty is an impressive combo

15:11 lancepantz: LauJensen: HN?

15:11 LauJensen: http://news.ycombinator.com

15:12 @ lancepantz

15:12 lancepantz: ty

15:14 LauJensen: np

15:22 tomoj: LauJensen: for example, to implement defprotocol

15:23 (re: where one might use file and line metadata in macros)

15:38 pers: Hello folks. If I may... What is the correct way to get the function associated with a symbol. I can do it with (eval 'foo-function) but wonder if there is a bettery way, ala CL's SYMBOL-FUNCTION.

15:39 s/better/bettery/

15:39 sexpbot: Hello folks. If I may... What is the correct way to get the function associated with a symbol. I can do it with (eval 'foo-function) but wonder if there is a betteryy way, ala CL's SYMBOL-FUNCTION.

15:40 cemerick: pers: maybe you mean @#'var-name?

15:40 ,@#'+

15:40 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@1842c64>

15:40 cemerick: (which is sugar for (deref (var +)))

15:41 ,(deref (var +))

15:41 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@1842c64>

15:41 pers: camerick: thanks, i'll play with that...

15:41 cemerick: pers: but, functions aren't associated with symbols :-)

15:41 arohner: pers: resolve, ns-resolve

15:42 ,(resolve 'map)

15:42 clojurebot: #'clojure.core/map

15:42 arohner: that gives you the var associated with the symbol

15:42 ,@(resolve 'map)

15:42 clojurebot: #<core$map clojure.core$map@677786>

15:42 pers: arohner: thank also..

15:42 arohner: pers: that doesn't require reader syntax, so you can even do

15:42 ,(resolve (symbol "map"))

15:42 clojurebot: #'clojure.core/map

15:45 vibrant: if I dispatch multimethods with the class function

15:46 how do i defmethod which will work for a byte array?

15:47 btw when is 1.2 coming out?

15:48 Raynes: When It's Ready(TM)

15:48 AKA soon.

15:49 cemerick: vibrant: using (class (make-array Byte/Type 0)) as your dispatch value should work

15:49 er, Byte/TYPE

16:02 LauJensen: cemerick: Did you check out my last post? Im sure you'll find some inspiration :)

16:02 cemerick: LauJensen: sorry, link?

16:02 LauJensen: here via HN http://news.ycombinator.com/item?id=1498275

16:03 Consider it an early birthday present :)

16:03 (or late)

16:04 bobo_: LauJensen: the screencast was awesome, it would be even awesomer if keybindings you use are displayed as overlay in the video

16:05 ive seen it in some other videos, but cant rememver where atm.

16:05 LauJensen: bobo_: Yea thats where linux is failing me a little bit. Im recording using gtk-recordMyDesktop and grabbing the sound with a separate soundrecorder, then merging with mkvmerge - So in that process there is no tool for overlays :(

16:05 In this regard the OSX guys have it made

16:05 bobo_: ah

16:06 LauJensen: Although, now that I think of it, I actually think that theres a video editing more for Emacs - I'll check it out

16:06 bobo_: :-)

16:06 LauJensen: sure enough http://1010.co.uk/gneve.html

16:06 bobo_: haha, thats abit weird tbh =)

16:07 LauJensen: eh?

16:07 bobo_: seeing video in emacs

16:07 LauJensen: I dont follow?

16:07 Here's how its done http://www.youtube.com/watch?v=0vumR5Hcz7s

16:08 tomoj: http://julien.danjou.info/blog/2010.html

16:08 cemerick: LauJensen: screenflow FTW, FYI :-)

16:08 LauJensen: cemerick: I know I know :)

16:09 cemerick: LauJensen: so far, this screencast highlights everything about emacs that I find objectionable. Perhaps that was your intent. ;-)

16:09 LauJensen: no no - I was actually hoping that you would appreciate the power of integrating all of your daily-use tools

16:10 cemerick: heh

16:11 Licenser: night my lispy friends

16:11 LauJensen: I finish with some Clojure tips though - I think they might make you jealous :)

16:11 good night Licenser

16:11 vibrant: anyone did some digging with Vaadin and Clojure?

16:13 * Licenser 'll watch your video tomorrw :)

16:15 AWizzArd: LauJensen: did you see Zach Tellmans new lib? "Aleph"?

16:16 LauJensen: AWizzArd: Oh yes I did!

16:16 cemerick: LauJensen: I've never doubted the incremental power that emacs/slime/etc provides. It's the UI and discoverability (lack thereof) that keeps me away (C-x o for marking a task as done is *so* obvious! ;-).

16:16 AWizzArd: LauJensen: so, it sounds good doesn't it?

16:16 LauJensen: Its C-x t, t = toggle. It toggles the TODO states :)

16:16 AWizzArd: Very good - I'm definitely going to run some tests with it

16:16 cemerick: heh, whichever it was :-)

16:17 LauJensen: The great thing about Zach, is that everything he does it 100x faster than what everybody else is doing :)

16:17 cemerick: See, I just heard you say what it was in the screencast 1 min ago, and I've already forgotten.

16:17 LauJensen: cemerick: Could that be, because you dont _want_ to learn ?

16:17 I mean, a man with your intelligence should be able to sit down with a cheat-sheet and memorize 10 or so shortcuts ?

16:17 cemerick: Exactly. I've got other things to learn already. :-)

16:17 AFAICT, there's *hundreds*.

16:17 LauJensen: Ah, so you're too busy sawing to sharpen the saw? makes sense I guess... :)

16:18 I think I use 10 or 12 regularily, but I'll have to ask my fingers

16:21 slyrus: anyone have a pointer to a nice library that uses protocols (? -- defrecord is what I want, I think) that I can learn from?

16:23 LauJensen: sec

16:23 slyrus: http://blog.higher-order.net/2010/07/04/conj-labs-clojure-lessons-part-i/

16:23 slyrus: thanks LauJensen

16:23 ohpauleez: that's what I was going to point you to :)

16:24 LauJensen: ohpauleez: sure sure :)

16:24 ohpauleez: haha

16:24 LauJensen: slyrus: But if you really want to dig in, you should do what the author of that post did and visit conj-labs.eu :)

16:24 ohpauleez: labrepl has an example too

16:25 and there's a create talk/video about them http://vimeo.com/11236603

16:26 LauJensen: ohpauleez: give up already - I beat you to that first link, you cant take it back by flooding the channel :)

16:27 ohpauleez: haha

16:27 LauJensen: I also enjoyed the post today. I always forget that you also use Awesome

16:28 LauJensen: There was this fun comment on #archlinux, where one guy said "I run awesome", then the next guy goes "I run ok. I wouldnt say I run awesome" :D

16:28 Glad you enjoyed the post though!

16:28 (and I hope cemericks being so quiet because he's secretly installing Arch and Emacs)

16:28 ohpauleez: I was a slackware guy for a long time, and now I use Arch and OS X

16:29 LauJensen: Yea Slackware was my second distro as well. But I just grew weary of not having pacman

16:30 I remember a great post on the Arch forum where this guy suddenly injects in a discussion about version control in pacman "WHAT? Arch has a package manager?! Ive been hand-compiling for a year now!"

16:30 cemerick: I can't imagine I'll ever run linux on a non-server box.

16:31 technomancy: LauJensen: have you considered relabeling the comment submission button on your blog? right now it says "Submit Query", which is a little strange

16:32 cemerick: actually, that's not true -- I do some limited testing in ubuntu in virtualbox

16:32 LauJensen: technomancy: Thanks - I forgot all about that, I'll get to it

16:32 smiley-: how can I use the # character in a string?

16:33 if I use "#w" it will say "No dispatch macro for: w"

16:33 cemerick: oh?

16:33 ,"#w"

16:33 clojurebot: "#w"

16:33 smiley-: hmm

16:35 technomancy: hmm... looks like I need to generate a TAGS file for Clojure's Java source =)

16:35 smiley-: I used the string in a doto did put the string into a def instead now

16:35 seems to work better

16:35 * technomancy is finishing up LauJensen's screencast from yesterday

16:36 cemerick: smiley-: can you paste the usage that wasn't working?

16:36 ,(doto "#w" println)

16:36 clojurebot: "#w"

16:36 #w

16:36 slyrus: so, I want to represent atoms (you know, the basic unit of matter in the physical world, not the data structure for managing stateful data). any suggestions on a type name?

16:36 cemerick: ,(println "#w")

16:36 clojurebot: #w

16:37 LauJensen: slyrus: sure, basic unit of matter => bum

16:37 slyrus: bah

16:37 LauJensen: :)

16:37 hiredman: whats wrong with atom?

16:37 slyrus: (defrecord atom ...)?

16:37 hiredman: (defrecord Atom ...)

16:37 technomancy: slyrus: atomos is where our English "atom" comes from

16:38 could always go greek

16:38 or better yet: ἄτομος

16:38 that last one was for hiredman =)

16:38 AWizzArd: Btw, is Zach Tellman sometimes in here?

16:38 smiley-: bah.. I had unbalanced " thats why it failed

16:38 slyrus: yeah, I thought about Atom. I feel like it's likely to confuse folks (me included) at some point.

16:38 hiredman: in whatever.physics that defrecord will result in whatever.physics.Atom so you can call it a physics atom

16:41 LauJensen: technomancy: I answered your question on the post - **; is your friend

16:41 AWizzArd: Less than rarely

16:42 technomancy: LauJensen: but I have to use the mouse to read your reply since I don't know the answer yet. (oh noes!)

16:42 LauJensen: thanks. =)

16:42 LauJensen: I was actually considering removing the 'show comments' button and just have all comments rendered

16:43 technomancy: LauJensen: would be nice not to have a nested scrolling div at least

16:43 LauJensen: sure :)

16:43 btw - Been a while since I saw an Emacs post in the top 6 on HN

16:44 "this screencast is the first thing that's made me seriously consider switching to Emacs from vi"

16:44 technomancy: go go gadget M-x upvote

16:44 LauJensen: :)

16:44 I'll bet you've got a red button strapped to your arm that does that

16:44 slyrus: hiredman: is (defrecord foo.bar.DataType ...) the convention, rather than foo.bar.data-type?

16:45 AWizzArd: Is there a good reason why the binding forms of 'binding' are evaled in parallel and not in sequence, as it happens in 'let'? (do (def x 0) (def y 0) (binding [x 10, y (dec x)] [x y])) ==> [10 -1] (vs. [10 9])

16:50 LauJensen: AWizzArd: Shouldnt that blow-up and not give you -1?

16:50 neotyk: LauJensen: haven't seen your new screencast yet, have you showed power of paredit?

16:50 LauJensen: neotyk: The power of paredit is that you can disable it

16:51 neotyk: plain wrong

16:51 LauJensen: neotyk: paredit is crutched for the lame and handicapped

16:51 neotyk: paredit is like training wheels. The sooner you get them off the faster you go

16:51 Better to master Emacs

16:51 Than to be a slave of pardit

16:52 ysph: LauJensen: in what sense?

16:52 technomancy: we are still waiting for Lau to see the light on that one.

16:52 neotyk: technomancy: m'key

16:53 shoover: LauJensen: do you use kill-sexp, transpose-sexps, etc?

16:53 AWizzArd: LauJensen: I expected it to behave like let in the way it binds the vars, i.e. sequentially. But binding seems to behave like CLs LET, whereas CLs LET* is like Clojures let. Throwing an exception would be strange I would say, because binding should be able to take multiple bindings.

16:53 cemerick: AWizzArd: I wouldn't expect that to ever change if I were you.

16:54 LauJensen: shoover: no

16:54 ,(binding [x 10 y (dec x)] [x y])

16:54 clojurebot: java.lang.Exception: Unable to resolve var: x in this context

16:54 AWizzArd: cemerick: what changes? The behaviour of 'binding'?

16:54 cemerick: yeah

16:54 AWizzArd: LauJensen: yes, because (def x 0) needs to be done first.

16:55 LauJensen: Anyway - I have to hit the sack - Good night to all- Feel free to drop comments on the blog if you can make a strong case for paredit :)

16:55 AWizzArd: cemerick: I don't want to vote for binding to change, but I am interested if there is a technical reason why it was made to behave the way it does.

16:55 It is easy to add a binding* macro that works sequentially. This however may indeed be a nice addition.

16:56 cemerick: ah, I thought you were revving up to lobby for a change to binding :-) My bad.

16:56 AWizzArd: Well, this is one of the valid interpretations. I was not clearly specifying against such a breaking change.

16:57 Though, I would vote for the addition of binding* or something similar. Anyway, I will have to ask rhickey next time he shows up.

16:59 cemerick: It seems like a rarely-needed item. I can only remember requiring it once or twice.

16:59 technomancy: AWizzArd: IIRC it's not possible to implement with good performance in binding like it is in let

17:06 AWizzArd: technomancy: ok, efficiency would make sense

17:12 slyrus: let me put that another way... why do folks use CamelCase instead of sanely-cased-identifiers for defprotocol?

17:16 hoeck: slyrus: maybe to denote that ThisIsAProtocol?

17:16 neotyk: slyrus: they compile down to java interfaces, that can be used by Java folk

17:16 slyrus: ah, ok. I thought it might be something like that.

17:39 anonymouse89: I'm trying to do something like (ns myprog (:require [clojure.contrib.math :as math]))

17:39 but now how do I add another :require?

17:39 I understand I could do (:require (a b c))

17:39 chouser: (:require [a :as b] [c :as d])

17:39 anonymouse89: but how can :as be used in that case?

17:41 chouser: thanks, I was being silly: the require wasn't on classpath

17:45 chouser: ok

18:08 arohner: I don't suppose anyone is working on map-of, similar to vector-of?

18:41 ohpauleez: does anyone know what the latest/fastest/most used interface to cassandra is?

18:41 client*

18:49 arohner: do defrecords use less memory than the equivalent PersistentMap?

18:53 dsop: stuarth: before I post it to clojure-dev, does it make sense to add a digest wrapper in contrib. something that wrapps MessageDigest?

18:54 and if yes, does it make sense to star ta contrib.crypto.digest namespace or just add contrib.digest

19:18 itistoday: #_(defn reduce

19:18 what's the #_ there?

19:18 cemerick: arohner: yes, slots in records are fields, whereas slots in PMs are entries in a tree.

19:18 qbg: Ignore the next form

19:20 arohner: cemerick: thanks. I'm dealing with massive memory usage in my app, 1.5GB

19:20 itistoday: qbg: oh right, thanks

19:20 arohner: cemerick: and that's only 1/4 the data loaded so far

19:21 itistoday: does that mean the entire definition is commented out? why ... do that?

19:21 qbg: itistoday: IIRC, the protocol based reduced caused some issues

19:21 cemerick: itistoday: because that version of reduce will come back eventually

19:22 itistoday: oh, ok, thanks!

19:23 cemerick: arohner: records will help, but of course, do some profiling before embarking on any major efforts.

19:23 arohner: cemerick: yep. I

19:24 I'm looking at the visualvm heap dump

19:24 TeXnomancy: arohner: 8GB instances on EC2 aren't that pricey, depending on how long you need it for. =)

19:24 arohner: TeXnomancy: 24/7, if we're successful

19:25 TeXnomancy: and we're not being paid yet, so I'd rather not spend the money :-)

19:25 TeXnomancy: and I suspect that excessive memory usage is causing performance problems paging across the datastructure

19:26 dsop: rhickey: would it make sense to add a wrapper around MessageDigest as contrib.digest or contrib.crypto.digest?

19:27 TeXnomancy: sure

19:39 slyrus: ok, now for a good example of using zip-filter.xml?

19:44 itistoday: is there a good document somewhere on chunked seqs?

19:56 rberger: Anyone know of an Opscode chef cookbook for installing leiningen and its dependencies?

20:00 TeXnomancy: rberger: I'm not sure leiningen belongs on chef-handled servers?

20:04 itistoday: i think i just received my first customized lisp-related spam email...

20:05 rberger: TeXnomancy Why do you wonder that? I would think it would be ideal way to make sure the right things are installed?

20:05 TeXnomancy: rberger: we use lein to build a tarball to deploy

20:06 that way as long as a build succeeds on the CI server, it'll always be deployable

20:06 you don't want issues with mirrors going down, etc. to affect being able to deploy a known-good build

20:06 http://github.com/technomancy/lein-release

20:07 rberger: TeXnomancy I see... I guess we're still at the stage where we are deploying more from source right now..... But what you are suggesting does make sense.

20:32 itistoday: ah ok, found this: http://www.infoq.com/news/2009/12/clojure-11-rc1-transients

20:34 what about creating chunked-seqs? how do you do that?

20:37 slyrus: is there a better way to get the attributes from each of these nodes than: (map :attrs (zf/xml-> elements :element zip/node))

20:40 in particular, I was hoping something like this would work: (zf/xml-> elements :element zip/node :attrs)

20:41 (maybe without the zip/node in there, but neither way works)

20:48 hiredman: ,(doc repeatedly)

20:48 clojurebot: "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"

20:54 hiredman: ,(doc interpose)

20:54 clojurebot: "([sep coll]); Returns a lazy seq of the elements of coll separated by sep"

20:54 hiredman: ,(doc interleave)

20:54 clojurebot: "([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."

20:59 TeXnomancy: ,(zero? nil)

20:59 clojurebot: java.lang.NullPointerException

20:59 hiredman: ,(zero? nil)

20:59 clojurebot: java.lang.NullPointerException

20:59 * hiredman whistles

20:59 * TeXnomancy glances around nervously

21:00 * itistoday encountered a grue

21:03 qbg: Cause is .getClass() being called on nil in clojure.lang.Numbers/ops

21:03 itistoday: should it return true?

21:04 TeXnomancy: I'd prefer false, to an exception, but whatever.

21:06 itistoday: oh, yeah that would make sense

21:07 ,(and nil (zero? nil))

21:07 clojurebot: nil

21:07 itistoday: tada!

21:07 :-p

21:09 ,(System/exit 0)

21:09 clojurebot: java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)

21:10 itistoday: ,(Thread.)

21:10 clojurebot: #<Thread Thread[Thread-278,5,main]>

21:11 itistoday: ,(.start (Thread. #(println "foo")))

21:11 clojurebot: nil

21:11 itistoday: ,(dotimes [_ 1e9] (.start (Thread. #(println "foo"))))

21:12 clojurebot: java.lang.OutOfMemoryError: unable to create new native thread

21:12 dsop: :)

21:12 itistoday: grrr

21:16 ,(#((println "foo")(println "bar")))

21:16 clojurebot: java.lang.NullPointerException

21:16 itistoday: why?

21:16 clojurebot: why not?

21:16 qbg: You are trying to call the function nil

21:16 itistoday: ,(#((println "foo")(println "bar") (fn [_] "blah") ))

21:16 clojurebot: java.lang.NullPointerException

21:16 itistoday: nope

21:16 see

21:17 at least i think there shouldn't be a nil anywhere there

21:17 qbg: println returns nil

21:17 itistoday: qbg: the last thing that's returned is a function

21:18 (fn [_] "blah") no?

21:18 qbg: No

21:18 itistoday: then why is nil returned?

21:18 qbg: You are trying to call the function (println "foo"), which is nil

21:18 itistoday: oh

21:18 i see

21:18 thanks :-p

21:25 ,(letfn [(f [] (.start (Thread. #(do (Thread/sleep 10) (f)))))] (f))

21:25 clojurebot: nil

21:25 itistoday: ,(letfn [(f [] (.start (Thread. #(do (Thread/sleep 1) (f)))))] (f))

21:25 clojurebot: nil

21:26 itistoday: ,(letfn [(f [] (.start (Thread. #(do (f)))))] (f))

21:26 clojurebot: nil

21:26 itistoday: clojurebot: you should be dead

21:26 clojurebot: I don't understand.

21:28 itistoday: must be the compiler

21:30 ,(letfn [(f [] (.start (Thread. #(dotimes [_ 100] (Thread/sleep 100) (println "foo") (f)))))] (f))

21:30 clojurebot: nil

21:30 itistoday: ,(letfn [(f [] (.start (Thread. #(dotimes [_ 10000] (Thread/sleep 10) (println "foo") (f)))))] (f))

21:30 clojurebot: nil

21:30 qbg: Why try to kill clojurebot?

21:31 itistoday: fun?

21:31 clojurebot: http://jackcoughonsoftware.blogspot.com/2009/05/teaching-functional-programming-to-kids.html

21:31 itistoday: i mean, big props to hiredman, this guy is tough

21:31 qbg: At least try a fork bomb with threads

21:31 itistoday: i don't remember how to fork in java....

21:32 that's essentially what i'm doing though

21:32 with threads

21:32 is it not?

21:32 ,(letfn [(f [] (.start (Thread. #(dotimes [_ 1e9] (println "foo") (f)))))] (f))

21:32 clojurebot: nil

21:32 itistoday: that should kill him

21:34 cais2002: itistoday, I guess the bot starts a new thread or process to run ur command or run it in some way that does not break the main process

21:34 qbg: ,(delay (println "Foo"))

21:34 clojurebot: Foo #<Delay@163a5f9: nil>

21:34 itistoday: yeah this would be easier if i looked at its source :-p

21:35 qbg: ,(delay (dotimes [_ 100] (print "-")))

21:35 clojurebot: ----------------------------------------------------------------------------------------------------#<Delay@1d7c125: nil>

21:35 qbg: ,*out*

21:35 clojurebot: #<StringWriter >

21:36 itistoday: why does that print a bunch of -'s?

21:37 i thought it doesn't execute the body unless forced

21:37 qbg: Because printing it forces it

21:37 itistoday: i don't understand, the print is inside the delay

21:37 why is it evaluated?

21:38 qbg: (by it I refer to the return value)

21:38 itistoday: oh, you mean because it's a repl?

21:38 yeah i think that's it

21:38 (def x (delay (dotimes [_ 100] (print "-"))))

21:38 doesn't print anything

21:38 qbg: Forcing delays to print them is a bit dubious

21:39 itistoday: That is because def doesn't return the delay

21:39 So the repl won't be printing it

21:39 itistoday: right, def returns a var, correct?

21:39 qbg: Correct

21:40 itistoday: k, cool

21:40 qbg: Debugging your lazy functional languages that uses delays as thunks is a bit tedious

21:40 *language

21:41 cemerick: delays aren't thunks

21:41 qbg: They do what I want, though

21:43 cemerick: well, ok, but they're not thunks. You could easily write an IDeref implementation that works like a delay but doesn't print its value.

21:43 qbg: True

21:44 itistoday: cemerick: my vocab is shaky here, what's the difference between a thunk and a delay?

21:47 clojurebot is gone :-D

21:47 ,(+ 1 1)

21:47 did someone take him down or did I succeed in killing him?

21:48 hiredman: ?

21:49 cemerick: itistoday: hrm, looks like it's not so clear, at least as far as wikipedia is concerned. I've always understood thunks to be invokable, whereas delays require a special force operation.

21:50 itistoday: cemerick: i'd say that makes delays invokable via force? eh?

21:51 sexpbot: help

21:51 sexpbot: itistoday: I can't help you, I'm afraid. You can only help yourself.

21:51 cemerick: By invokable, I mean usable in function position, e.g. (some-delay)

21:51 (which they used to be capable of, before 1.1)

21:52 itistoday: yeah i think the concept of thunks (from what i read on wikipedia) applies to the idea of delays though (if you ignore the lack of needing a function)

21:52 that was actually a question

21:52 stated for some reason a statement

21:52 !(+ 1 1)

21:53 what's the syntax for sexpbot's eval?

21:53 qbg: $(+ 1 1)

21:53 sexpbot: => 2

21:53 itistoday: ah, k

21:53 we still have one bot that works

21:53 although i'm tempted to bring this one down too... i'll restrain myself though

21:53 if clojurebot comes back online though, sexpbot ... watch out

21:53 cheluis: (+ 1 1)

21:54 qbg: $(not= 'clojurebot 'kenny)

21:54 sexpbot: => true

21:54 itistoday: lol

21:55 fbru02: hey guys , I'm doing a presentation in front of a group of rubysts , and I have a question, when is a good idean in clojure to unit test your code?

21:57 itistoday: fbru02: idean? you mean idea?

21:57 fbru02: itistoday: yes

21:57 itistoday: isn't that more of a general question? not really clojure related?

21:58 qbg: I guess it depends on how you feel about unit testing

21:58 fbru02: i como from a haskell background and we did more of quickcheck

21:59 come

21:59 itistoday: fbru02: 'quickcheck'?

22:02 fbru02: itistoday: http://kotka.de/blog/2010/06/ClojureCheck_is_back.html

22:04 itistoday: fbru02: ah, cool, gotcha

22:05 cheluis: hey, I was wonder if anybody here can help me... I an learning clojure, and so far, I like it very much, but I dont have any lisp background. Which is the best way to iterate over the chars of a string?

22:05 qbg: Iterate how?

22:06 itistoday: cheluis: i'd do performance testing you .charAt() vs. sequences

22:06 s/you/with

22:06 s/you/with/

22:06 sexpbot: s/with/with

22:06 qbg: ,(reduce #(+ %1 (int %2)) 0 "Hello, world!")

22:06 * qbg mumbles things about itistoday

22:06 itistoday: qbg: i kill him, remember?

22:06 $(reduce #(+ %1 (int %2)) 0 "Hello, world!")

22:06 sexpbot: => 1161

22:06 qbg: $(reduce #(+ %1 (int %2)) 0 "Hello, world!")

22:06 sexpbot: => 1161

22:07 itistoday: hehe

22:07 cheluis: ie... given a string "hello" return "hlo"

22:07 itistoday: ... substring?

22:08 cheluis: uh?

22:08 itistoday: that's a very weird thing to want to do

22:08 what exactly are you trying to do?

22:09 is your goal to eliminate 'el'?

22:09 or the 2nd and 3rd characters?

22:09 qbg: $(apply str (take-nth 2 "hello"))

22:09 sexpbot: => "hlo"

22:09 cheluis: that!

22:09 itistoday: :-)

22:09 cheluis: thanks

22:09 I'm practicing with codingbat.com exercises... Implementing those exercise but in clojure

22:10 it's a very very newb way of learning but well...

22:10 at least its one

22:10 lemme try that

22:15 itistoday: $(java.net.InetAddress/getLocalHost)

22:15 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: ()

22:18 cheluis: hey thanks... =)

22:21 itistoday: $(-> "http://www.apple.com" java.net.URL. .openStream java.io.InputStreamReader. java.io.BufferedReader. .readLine)

22:21 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: ()

22:21 itistoday: sexpbot: :-\

22:21 sexpbot: Command not found. No entiendo lo que estás diciendo.

22:22 gstamp: $(keep identity [1 2 nil 3])

22:22 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/keep)

22:22 gstamp: hrrm

22:22 itistoday: $(+ 1 1)

22:22 sexpbot: => 2

22:25 rberger: Opscode cookbook for leiningen at http://cookbooks.opscode.com/cookbooks/leiningenfor what its worth. Just does the basic install via Opscode Chef

22:26 qbg: OT question: How do you unit test complex functions?

22:26 rberger: http://cookbooks.opscode.com/cookbooks/leiningen

22:36 arohner: qbg: by making them simple functions

22:36 qbg: sorry to be snarky, but that's my preferred way

22:36 (making simple functions, not being snarky)

22:36 qbg: arohner: By complex I mean that it takes or produces complex input/output

22:37 arohner: qbg: side effects, or complex datastructures as input/output?

22:37 qbg: data structures

22:37 itistoday: $(.start (Thread. #(println "foo")))

22:37 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: ()

22:38 itistoday: oh... great. sexpbot is impenetrable.

22:38 qbg: or just complex data

22:38 arohner: qbg: I've been looking for a library to do complex validations. I haven't seen anything thats better than the standard clojure functions

22:38 (map #(assert foo) vals)

22:38 it makes me wonder wether such a thing is possible

22:39 qbg: Relevant: http://blog.objectmentor.com/articles/2010/06/03/tdd-in-clojure

22:41 That article leaves me unsatisfied

22:41 arohner: qbg: yeah, and I don't find that final test particularly useful

22:43 qbg: Half of the reason why I test almost nothing is because I can't see how to test it

22:43 Unit test, that is

22:52 itistoday: $(send-off (agent {:x *out*}) (fn [x] (println "foo!!")))

22:52 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/send-off #'clojure.core/agent)

22:53 * qbg thinks sexpbot has a whitelist

22:53 itistoday: yeah

22:57 $@(future (+ 1 1))

22:57 sexpbot: Command not found. No entiendo lo que estás diciendo.

22:57 itistoday: $(deref (future (+ 1 1)))

22:57 sexpbot: java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/future-call)

23:35 cais2002: what's the difference btw (defn ^String foo [] 'foo) and (defn #^String foo [] 'foo)

23:42 ysph: cais2002: i believe the meta macro has been shortened to ^ in 1.2, but i'm not positive

23:43 "The ^ reader macro has been deprecated as a shortcut for meta in the hopes that it can eventually replace the #^ reader macro."

23:43

23:43 cais2002: is ^type-name the way to do type hint for clojure defined types?

23:44 ysph: that should work for 1.2, yes

23:45 cais2002: ysph: r u saying that it's deprecated but still supported in 1.2?

23:46 ysph: no, it is deprecated as a shortcut for meta, so that it may become the reader macro instead

23:46 the way that is worded is confusing

23:53 cais2002: ah, i c. so we are encouraged to use (meta xxx) for meta and keep ^ for the old #^ ?

23:53 itistoday: cais2002: yes

Logging service provided by n01se.net