#clojure logs

2011-02-25

00:44Sgeo@(macroexpand '(comment Lah de dah))
00:44Sgeo&(macroexpand '(comment Lah de dah))
00:44sexpbot⟹ nil
00:47Null-AGen-class isn't working for me https://gist.github.com/843408
00:47Null-AWhen I execute the let statement, i get class not found.
00:57SgeoIt simply won't run :(
00:59SgeoHere we go
02:08no_mindusing compojure, I want to defien a route which has an optional param. How do I this ?
02:42Deranderno_mind: my routing api knowledge is low because it's late right now, but I would define the route twice once w/ param, once w/o
03:16bartjIf I reference a string as:
03:16bartjblah/x
03:16bartjI am not able to dynamically construct it:
03:17bartjie. given "blah" and "x" are strings
03:17Deranderno_mind: oh, I was also thinking rails instead of compojure. whoooooooooooooooooops
03:27TobiasRaedermorning
03:28bartjanyone ?
03:34Chousukebartj: I don't understand your question
03:34Chousukebartj: do you mean creating a symbol like blah/x? Just (symbol "blah" "x")
03:35bartjyes and evaluate it
03:35Chousukesounds suspicious
03:36Chousukeyou can evaluate things with eval, of course, but make sure it's what you really need to do.
03:36Chousukemost clojure code will never need to use eval directly.
03:37Chousukeand if user input is involved, it becomes somewhat of a security issue.
03:37mrohhey
03:41AdamantChousuke: not somewhat, it does. one of the classic security issues for the Lisps and derived languages with an eval function
03:50bartjChousuke, when I do a : (eval (symbol "blah" "x"))
03:50bartjI get a: No namespace blah
03:50bartjbut, things work just fine when I do a: blah/x
03:51Chousukehuh
03:53Chousukeso what is it that you're trying to do anyway?
03:54ChousukeIt's hard to tell what's broken when there's no real code to look at
03:54Chousukeand I'm interested in what you are trying to accomplish by using eval anyway.
04:01bartjsorry for the delay
04:01bartjlet me explain
04:02bartjI dynamically want to pick up strings from a files
04:02bartjlet us call them A and B
04:02bartjthese files have the same variables defined: x
04:03bartjno, I would like to pick up B/x if B is the file I would like to get it from
04:03bartj*now
04:04bartjso, what I do is:
04:04bartj(:require [path.A :as A] [path.B :as B])
04:05bartjand (eval (symbol "B" "x"))
04:09fliebelmorning
04:12raekbartj: I don't know if this approach is the best way to do it (what you presented is a solution, but we still don't know the underlying problem you are trying to solve), but I don't see where the error is: http://pastebin.com/DH1P5Bfb
04:14raekif you are making your own file format, it's probably safer to make a function that interprets it rather than converting it to clojure code and evaling it.
04:15raek(interpret-in-context {:x "hello"} (slurp "filename.txt")), rather than (eval (slurp "filename.txt"))
04:34fliebelDoes anyone here have experience with protobuf?
04:38fliebelI was thinking it could be used to parse binary files, but it seems to generate and parse a fixed type of file?
04:41bartjraek, sorry, I was away for lunch
04:41bartjstrangely, it does work from the REPL
06:15hoecklypanov: why? are you afraid of the climate change and a flooded country?
06:15lypanovhoeck: various reasons - no startup culture, annoying health care (bad personal experiences)
06:16lypanovas for climate change... no response.
06:16lypanov:)
06:16hoeckjust joking :P
06:16lypanovphew :P
06:17lypanovdutch people sometimes even have that view... kinda scares me. probably the safest (from water level issues) country on the planet other than maybe tibet.
06:17lypanovamerica / india / etc, now they are fucked ;) they hire dutch people...
06:18hoecklypanov: where do you live currently, and what do you expect from moving to germany?
06:20lypanovhoeck: the hague. previously amsterdam. as i said - start up culture, actual programmers in large companies. etc.
06:21ogrimDoes anyone know how I may store '(101010 001100) as integers instead of (101010 576) as it evaluates to?
06:21babilenlypanov: and where do you plan to move? (just curious)
06:21lypanovprobably berlin
06:21hoeckpersonally, I was astonished that there are even some "startups" in the city I'm living in (dresden), thought at first that such things only exist in the big urban areas
06:21lypanovmaybe frankfurt
06:22tomoj,010
06:22clojurebot8
06:22babilenlypanov: don't move to frankfurt. berlin is a good choice, but you might want to look around. hamburg is nice as well. anyway, one goes where the job is :)
06:22hoecklypanov: if I would have to move, I'd either move to Hamborg or Berlin
06:23hoeckthere are even some companies there listing clojure on their job ads :)
06:24ejacksonogrim: (Integer/parseInt "10101" 2) if they are strings initially
06:25ogrimtomoj: I see that converts 001100 to 576, but I just want to store 001100 in a list. ejackson: they should be integers initially. I do (def init-pop '(001100)) and want it to stay 001100
06:26ogrimThe only workaround I found was parsing it with java calls, but that seemed uncessesarily complex
06:27Chousukeogrim: there's no way to do that.
06:27ejacksonthe convention is that if it starts with 0 its octal
06:27Chousukesince 001100 *is* 576
06:27ejacksonyou could make it a list of integers, or a bit array i guess
06:27clgvogrim: you understand that integers are always stored as binary? just the repl prints them as decimals bei default? ;)
06:28Chousuke(dunno if it actually is, just going by what you said :P)
06:28Chousukethe point being, numbers are numbers, no matter which base they're in.
06:28clgvChousuke: lol it isnt. 001100 = 12 ;)
06:28Chousukeclgv: that's what I thought. :P
06:29Chousukehm
06:29ogrimoh ok. I'll see what I'll figure out then. I'm pretty new to Clojure as I come straight from Java and CLisp
06:29ejacksonoctal
06:29ChousukeI guess 001100 gets parsed as octal
06:29Chousukeyeah
06:29clgvah leading zero, ok ;)
06:29Chousukewhat was the binary syntac?
06:30Chousukesyntax
06:30ogrimthanks for the help everyone :)
06:30clgvogrim: in java it's the same ;)
06:32ejacksonChousuke: I cant find one !
06:37Chousuke,2r1010
06:37clojurebot10
06:37Chousukethat works at least
06:37Chousukebut there was another one too
06:38ejacksonnice
06:38Chousuke,0b1010
06:38clojurebotInvalid number: 0b1010
06:38Chousukehm
06:38clgv,1010d
06:38clojurebotInvalid number: 1010d
06:38Chousuke,b1010
06:38clojurebotjava.lang.Exception: Unable to resolve symbol: b1010 in this context
06:39Chousukegah, oh well
06:40ChousukeI should know, I've written a clojure reader before ;/
06:41clgvchousuke: http://faustus.webatu.com/clj-quick-ref.html seems there isnt
07:03tscheiblhi there
07:04tscheibl(if a a b) ... is there a function which does the same without the redundant 'a' ?
07:04ejacksonor
07:05tscheiblahhhh
07:05Dranikhi all!
07:05tscheibl,(let [a 42 b 43] (or a b)
07:05clojurebotEOF while reading
07:05tscheibl,(let [a 42 b 43] (or a b) )
07:06clojurebot42
07:06Dranikagain, what's the difference between #^ and ^ except that #^ is old?
07:06tscheibl,(let [a nil b 43] (or a b) )
07:06clojurebot43
07:06tscheiblI'm such a noob :(
07:07ejacksonwe're all noobs.
07:07ejacksonif we're not, we're working below potential.
07:10tscheiblfor the last 5 days I manage to reduce the lines of code of my project for about 75% while retaining all the functionality
07:10ejacksonthat is the joy of clojure :)
07:10ejacksonwel... one of them.
07:10tscheiblI mean I mange to reduce it to 75% EVERY day
07:11clgvtscheibl: calling it a success depends on whether it's still readable and easily understandable ;)
07:11ejacksonit also has lots or lurvely, curvely parentheses. That cuonts for something
07:11tscheiblI just ask 1 question at irc every where the answer enlightens me so much to make this possible
07:12tscheiblclgv: it gets more readable every day, indeed
07:12clgvok thats good then ;)
07:13tscheibland the indentation depth also has been reduced by at least 50% since the start
07:13tscheiblluv that language and the really helpful irc community
07:14raekDranik: in 1.1, #^ was used for attaching metadata to source code and ^foo was sugar for (meta foo). since 1.2, ^ is for attaching metadata to source code and #^ should be unused (but behaves as 1.2's ^ for backward compability, I think)
07:15Dranikraek, so the main conclusion: just use ^ and forger about #^ completely, yep?
07:15Dranik*forget
07:15raekunless you have to deal with 1.1 code, yes
07:15Dranikok, thanks
07:15tscheibl(forget "#^")
07:16tscheibl;)
07:16clgvI noticed that sometimes ^:keyword doesnt work and causes a compiler error in a defn or defn-
07:17raekI think that shortcut (^:foo instead of ^{:foo true}) was added in 1.3
07:17clgvbut I couldnt tell the difference between the few calls where it didnt and the plenty ones where it did
07:17raekclgv: was this within the same clojure version?
07:17clgvraek: it was all in clojure 1.2
07:19raekhrm. I think I got something wrong. ^:foo does compile in 1.2 for me, but it becomes ^{:tag :foo}
07:19raek...just like typehints behave
07:21clgvah ok. didnt realize that.
07:21clgvI tried it with ^:static
07:22clgvthough I am still curious what ^{:static true} does
07:22raekit is/was a 1.3 feature
07:23raekI don't know if :dynamic has replaced it
07:23raekclgv: http://clj-me.cgrand.net/2010/06/10/primitive-types-support-for-fns-coming-to-a-clojure-branch-near-you/
07:24clgvraek: oh thanks. reads to be enlightened ;)
07:26raekI think the idea is that if a function is static, then every call to it will be hard coded to that version of the function (so if you redefine the function, you have to reevaluate all the dependent defns too)
07:26raekthis allows for better performance and primitive support, or something like that
07:27clgvsounds reasonable
07:27clgvwow. my program is twice as fast on my home computer compared to the one at university :D
07:27clgvI like the core-i7 cpus ;)
07:29raekclgv: I would also check out the new :dynamic thing. It is a more recent approach that might solve the same problem as :static.
07:29clgvthe other one is a core2 for comparison
07:30clgvraek: I didn't necessarily need :static but found it when trying to optimize the runtime of the arithmetic part of my program
07:34clgvraek: the static thing has structural similarities with the :inline one
07:37tscheiblhah.. reduced by 5%, again
07:39tscheiblmy boss will ask me what I did all the time when he counts the lines of code... maybe I should switch back to C++ again :D
07:40clgvwhat is the most efficient way to calculate all partial sums of a sequence of doubles?
07:40clgvI'd guess: loop-recur
07:40ejacksonreductions ?
07:41ejackson,(reductions + 0 [1 2 3 4 5 6])
07:41clojurebot(0 1 3 6 10 15 21)
07:42ejackson,(reductions + [1 2 3 4 5 6])
07:42clojurebot(1 3 6 10 15 21)
07:42ejacksonis better, if I understand what you mean by 'partial sums'
07:42clgvoh interesting. I didnt know that one
07:42ejacksonits a cutey
07:42clgv&(doc reductions)
07:42sexpbot⟹ "([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init."
07:43clgv$source reductions
07:43sexpbotreductions is http://is.gd/cZqevO
07:45clgvthx :)
08:05BleadofShould (identical? "foo" "foo") be false?
08:06BleadofI was just looking at Clojure data structures video where it returned false for that, but I tested and it returns true... It was a bit spooky.
08:33jcromartieBleadof: I think it's reasonable for two string literals to be the same object.
08:33jcromartiestrings, keywords, numbers
08:34jcromartieempty lists
08:34jcromartieempty vectors
08:34jcromartieheh
08:34jcromartieinteresting
08:34jcromartieNOT symbols though
08:34jcromartieevery symbol parsed is a new object?
08:36Dranikis clojure 1.2 available for .NET ?
08:48tscheiblDranik: https://github.com/richhickey/clojure-clr
08:48Draniktscheibl, the question is whether it is stable or not?
08:49tscheiblhttps://github.com/richhickey/clojure-clr/zipball/1.2.0
08:49Dranikthanks!
08:49tscheibldunno... there is a zipball at least
08:50tscheiblu can also find a 1.3.0 alpha there
08:50Dranikhmmm... intriguing...
09:00phenom_anyone tried out 1.3.0 with the developer jdk7 release ?
09:06Dranikphenom_, really interesting...
09:07phenom_Dranik: did you see any improvements outside primitive math?
09:07Dranikin java7?
09:09Dranikwell, for me java7 contains just some enhancements of the existing functional
09:09DranikNIO.2, new file system api and so on -- nothing special
09:09Dranikthe only interesting thing there is InvokeDynamic
09:10Dranikbut who knows how much time will pass before every java scripting language will use it
09:14phenom_and the invoke dynamic is there to support tco ?
09:16Dranikwhats tco?
09:17stuartsierrainvokedynamic is basically an easier way to do what Clojure already does –– dynamic method calls without reflection
09:29Bleadofjcromartie, I think that's because symbol is always itself so they must not be identical. :)
09:41ejacksonIf I have a namespace hierarchy like: ns1 :uses ns2 :uses ns3. What do I do in ns2 to make vars from ns3 visible in ns1 ?
09:42stuartsierraejackson: you can't
09:42ejacksonthat's a bummer.
09:42ejacksonthanks.
09:43stuartsierraIt's a feature: each namespace declaration shows exactly where every symbol in that namespace comes from.
09:43ejacksonthat makes sense.
09:44stuartsierraIt's a huge help for debugging and refactoring.
09:44ejacksoni'll :require ns3 in ns2, and make defs.
09:44stuartsierraOr just ;use ns3 in ns1.
09:44ejacksoni have a sprawling namespace (accounting.*) and want an interface nampsace acconting. cose.
09:44ejacksons/acconting. cose/accounting.core
09:44sexpbot<ejackson> i have a sprawling namespace (accounting.*) and want an interface nampsace accounting.core.
09:45ejacksonbut I'll refactor to clean up. Thanks stuartsierra.
09:45stuartsierra'welcome
09:47raekjcromartie: symbols with the same names are the same instances
09:48raek,(identical? 'foo 'foo)
09:48clojurebotfalse
09:48raekhm?
09:48stuartsierraraek: Clojure symbols are not interned like in Common lisp.
09:48stuartsierraKeywords are.
09:48ejackson,(identical :foo :foo)
09:48clojurebotjava.lang.Exception: Unable to resolve symbol: identical in this context
09:48stuartsierra,(identical? :foo :foo)
09:48clojurebottrue
09:48ejacksonha
09:48raekhrm. I assumed they were...
09:49raekI imagined symbols and keywords to work exactly the same way, modulo eval semantics
09:50stuartsierraNope, symbols are just labels, almost like Strings.
09:50raekwhose literals are interned..?
09:50raek,(identical? "foo" "foo")
09:50clojurebottrue
09:51raekI recall that changed at some point
09:51stuartsierraYeah, that's a little odd. Symbols probably could be interned, ...
09:51stuartsierraYes, very early on, as a perf optimization.
09:51stuartsierraBut since you rarely do equality tests on symbols, there's less benefit.
09:51_fogusstuartsierra: How would metadata on interned symbols work?
09:51dnolenfliebel: exist has an implicit all. exist is like let. all is like do.
09:51stuartsierra_fogus: An excellent point!
09:52stuartsierraThat's probably why.
09:52raekah!
09:52raekthen it makes much more sense
09:53raek_fogus: *bows*
09:56dnolenfliebel: (a c b d) is a possible odering, but it's important to make no assumptions about ordering. No assumptions also means that the notion of concurrency is sort of baked in.
09:56_fogusstaurtsierra: BTW, you can do some nasty side-effecty stuff using create-ns and intern
09:57ogrim/quiy
09:57ogrim
09:57stuartsierra_fogus: Oh yes, I've had evil fun with that.
09:57_fogusYeah really (eville == fun)
10:01fliebeldnolen: Ah, thanks for explaining that.
10:01_fogusI once had an idea for a namespace library with a thin prototypal skin over it. But I'm fairly sure that would get my Clojure card revoked.
10:02fliebelIs Logos concurrent/parallel?
10:02dnolenfliebel: no yet, but that's a goal, and it's built on a good conceptual foundation to allow it.
10:03_fogusdnolen: Do you mind elaborating? What foundation do you mean?
10:05dnolen_fogus: no assumptions about the ordering of results from disjunction.
10:07_fogusIs that a property of kanren or your impl?
10:07dnolen_fogus: property of kanren, and miniKanren.
10:08_fogusAre there interesting variants of parallel-kanren?
10:08_fogus(I'm using "kanren" to stand in for both mini- and not)
10:10dnolen_fogus: miniKanren researchers did a parallel version, but just forking processes on every disjunction is of course not going to work.
10:10dnolenCiao-Prolog does task granularity analysis. So perhaps that's a direction of investigation for miniKanreners
10:12dnolenhttp://clip.dia.fi.upm.es/papers/granularity.pdf
10:15pjstadig_fogus: you have a clojure card?!
10:16_foguspjstadig: Yeah, my kid colored one for me.
10:16pjstadignice
10:21_fogus"just be- cause something can be done in parallel does not nec- essarily mean, in practice, that it should be done in parallel."
10:21_fogusWhat!?! But I just got done seding all of my maps to pmap!
10:21jcromartie:P
10:21jcromartiepmap
10:22jcromartieI was having some fun with that yesterday... http://imgur.com/HUXsI
10:22jcromartie&(dorun (pmap #(dorun (pmap println %)) '((I put a thread in your thread) (so you can compute while you compute))))
10:22sexpbot⟹ nil
10:22jcromartieoh wait
10:22jcromartie,(dorun (pmap #(dorun (pmap println %)) '((I put a thread in your thread) (so you can compute while you compute))))
10:22clojurebotnil
10:23jcromartieprinting from other threads doesn't work in these bots eg?
10:23jcromartieeh?
10:24pjstadighaha it took me a second to get that one
10:24pjstadigi was like, "this doesn't make any sense its all mixed togeth--oooooohhh"
10:26ejackson_fogus: thank god I'm use Firefox and it doesn't load.... lucky break.
10:29rseniorit's not clear to me how to do an internal forward using compojure, i.e. a form was submitted, I take some action and want another page to render the results, am I missing something?
10:30jcromartiersenior: you would just pass the request off to the appropriate handler no?
10:31ejacksonyes, I imagine there is only one function on the compojure end the accepts the POST, processes and renders the results ?
10:34rseniorjcromartie: do you mean call the name I bind the defoutes to? I'm using defroutes, not the handlers directly
10:34rseniorejackson: I have one now, but can break it up
10:34jcromartieI have to admit I'm a bit confused by some changes to compojure lately, myself.
10:35jcromartieCan you paste your routes code?
10:37Dranik!seen rhicker
10:37Dranik!seen rhickey
10:38rseniornot much to see, but it's here https://gist.github.com/843940
10:39rseniorthe template stuff is enlive
10:39jcromartiethree cheers for protocols, BTW... check out https://github.com/weavejester/compojure/blob/master/src/compojure/response.clj
10:39rseniorjcromartie: just saw that not long ago, I had always been using maps
10:41Raynes$seen rhickey
10:41sexpbotrhickey was last seen quitting 6 days and 16 hours ago.
10:41jcromartiersenior: you could redirect by passing a new request to admin-app from within a handler
10:41tscheiblcan I somehow get a reference to the currently executing function object? .. I'm not sure that I used the correct terminology here but I don't know better...
10:41RaynesDraggor: ^
10:41jcromartiejust make sure it's not a loop
10:41RaynesDranik, even.
10:41DranikRaynes, thanks
10:42tscheiblI mean from within that function?
10:42Dranik$where_is rhickey
10:42Dranikdoesn't work any more :-(
10:42tscheiblDranik: I hope busy finishing 1.3 :)
10:42Dranik:-)
10:42mduerksenDranik: he does work, and that's why he isn't on chatrooms all the time ;)
10:43Dranikthat's good! I can't wait for 1.3!
10:43Dranik:-)
10:44rseniorjcromartie: so that admin app accepts a uri snippet and params?
10:44jcromartiersenior: check out https://gist.github.com/843950
10:44jcromartieanybody else, please comment
10:44tscheibl,(let [f (println f)] ())
10:44clojurebotjava.lang.Exception: Unable to resolve symbol: f in this context
10:45tscheiblexctly
10:45tscheiblexactly
10:45tscheiblbut I'd need a reference to this function
10:45tscheiblinside it
10:46rseniorjcromartie: ahh, takes a map that has the url
10:46raektscheibl: an anonymous function? you can have a "named anonymous" function: (fn f [] (... f ...))
10:46tscheiblahh
10:46raekthis is also done if you use letfn
10:46raek,(letfn [(f [] (str f))] (f))
10:46clojurebot"sandbox$eval2185$f__2186@359a33"
10:47jcromartiersenior: what do you mean
10:47jcromartieit just takes the original request, a new uri, and the handler to apply
10:47jcromartiebut it's not complete
10:47jcromartieit's not really a redirect
10:48jcromartieyou should be doing a HTTP redirect
10:48jcromartiewhat I wrote is really a handler transfer
10:48jcromartiealthough actually, I'm not sure what you want... but if you're trying to implement the POST/redirect/GET pattern
10:48rseniorI mean this part of your code (handler (assoc req :uri uri :redirected-to uri))
10:49jcromartiewell handlers (and routes, which are handlers) only ever take a request map
10:49jcromartiehttp://en.wikipedia.org/wiki/Post/Redirect/Get
10:49rseniorright
10:49jcromartieso you want a HTTP 303
10:50jcromartieif that's what you're trying to do
10:50tscheiblraek: thx for the enlightenment :) but I checked back and saw that is was a proxy (let [timer-task (proxy [TimerTask] []... so I could use 'this' within the implemented members
10:50raekrsenior: you don't need to (apply str ...) the output from enlive. ring adapters accept seqs-of-strings
10:53rseniorjcromartie: I think that is what I'm trying to do, it's been a while since I've done web development at that low of a level
10:53jcromartieyeah welcome to the trenches :P
10:53rseniorraek: good idea, I'll switch it
12:00TimMcjcromartie: There's a *name* for that?
12:15DespiteItAllHmm, the clojure.xml api page is missing the emit function. Now I'm wondering what else isn't on the api pages
12:22cinchraek: regarding "ring adapters accept seqs-of-strings", wrap-lint throws an exception if you feed it a seq of strings, but i think it's a bug in wrap-lint because the ring spec says seqs are allowed but wrap-lint doesn't check for seqs. i should submit a bug report
12:34sritchie_hey all -- I'm having trouble figuring out how to use clojure.contrib.probabilities.random-numbers/rand-stream
12:34sritchie_I see it's using defstream,
12:35sritchie_and I want to be able to take values off of it -- I'm just not sure how to bind a new stream to anything
12:36sritchie_(for now, I'm using (defn rands [x] (take x (repeatedly rand)))
12:36sritchie_)
12:47kencauseysritchie_: https://github.com/clojure/clojure-contrib/blob/master/modules/stream-utils/src/main/clojure/clojure/contrib/stream_utils.clj (includes doc at top)
12:50sritchie_kencausey: great, thanks for that, time to do some reading
14:57Max-69ciao
15:03SgeoHmm
15:03SgeoIs it my imagination, or is it too easy to do concurrency wrongly, even with Clojure's primitives, thanks to ability to read without being in a transaction?
15:03SgeoI should write an example
15:04pdkyou don't need to worry about catching only half an update
15:05SgeoBut I do have to worry about making decisions in the wrong place
15:24SgeoCan I make ending parentheses not automatically be placed in La Clojure?
15:27Sgeohttp://ideone.com/NpTeh
15:29TimMcSgeo: You don't want Paredit mode?
15:30SgeoTimMc, if that's the name for it, how do I disable it?
15:31TimMcDunno. I haven't used La Clojure, but it sounds like Paredit mode. (Paredit is an Emacs minor mode that has analogs in many s-expression editing programs.)
15:31TimMcYou probably want it, even if you don't know it yet. :-P
15:32TimMc(That said, La Clojure might do it poorly, for all I know.)
15:32SgeoI want to know why Clojure doesn't provide security against what I posted >.>
15:33TimMcAre you proposing a language that only allows reading inside transactions? Because that could still be misused very easily.
15:33TimMcI don't think there's a way to protect against that.
15:34SgeoJust curious, how could it be misused?
15:34TimMcSimple, by wrapping each read in a separate transaction. :-P
15:35hiredmanif you do that you are using agents incorrectly
15:35TimMcAnyway, I think your example is flawed. Aren't agents supposed to be updated with functions that run entirely inside the agent's update transaction?
15:35hiredmanif you need coordination and the stm you want refs
15:36hiredmanclojure provides a number of different concurrency primitives with different options for you to choose from
15:37SgeoI think it may be too easy for people to choose the wrong concurrency primitives
15:37TimMcDon't worry about other people.
15:39hiredmanSgeo: and?
15:39TimMcThere will always be a large supply of programmers who will mess up concurrency no matter how easy it is in some language. YOu have to let that go.
15:40Null-AI'm trying to use gen-class with slime, I C-c k the filed, but I still can't import or reference it
15:40Null-Athe file*
15:47DespiteItAllSeeing all the cool stuff in IDE's makes me wish I'd never gotten attached to vim
15:48TimMcDespiteItAll: Like what?
15:49DespiteItAllsomebody mentioned la clojure earlier, so i googled it and came up with this http://plugins.intellij.net/preview/popup/?sid=2625&amp;pid=4050 I don't know what's going on there but it looks cool.
15:49TimMcAutocompletion and javadocs are the only thing I really use in Eclipse, for instance.
15:50raekNull-A: gen-class requires compilation. http://clojure.org/compilation
15:50Null-Araek: So how do I use it with slime?
15:50raekNull-A: you usually use some thing like "lein/cake compile" to start the compilation
15:50Null-Araek: run lein compile, add aot to project.clj
15:51TimMcI assume Emacs can do autocomplete, etc., but I don't know how to do it yet. :-P
15:51Null-Araek: restart swank server?
15:51raekNull-A: yes, you have to restart the clojure instance if you need to update a class that you have already loaded
15:51Null-Ak
15:52raekthe first time, you should be able to compile the namespace with the 'compile' clojure function and then just use the class
15:52Null-Acool, thanks raek
15:53DespiteItAllyeah, emacs has a bunch of cool features that I wish I had in vim.
15:53jcromartieTimMc: M-/ for a simple text lookup and M-Tab for the Swank autocomplete
15:53DespiteItAllI could probably duplicate them, but the effort is always too much
15:53jcromartieM-Tab does autocomplete on things like Java packages and Clojure namespaces such
15:54amalloyjcromartie: i can't give up M-Tab as my window-manager window-switching key :P
15:54jcromartiehm
15:54jcromartiewell on Mac I use the Mac option key as Emacs meta
15:55jcromartiebut on Windows yeah that's tricky
15:55jcromartieor Linux
15:55jcromartieI think just plain Tab works in the repl though
15:55amalloyjcromartie: i could use the windows key as Super (which i do), but i don't want to rebind everything to S-Tab
15:56amalloyand the autocomplete plugin does a pretty good job for me without having to manually activate it
15:56amalloyso i'm not inclined to add a binding
15:56jcromartieWhat plugin?
15:56amalloyjcromartie: http://www.emacswiki.org/emacs/AutoComplete
15:56jcromartieoh my
15:56amalloyalso Sgeo your example is wrong in more ways than you intended :P
15:58amalloy(send agent #(%2) {:balance result}) is not the same as (send agent (constantly {:balance result}))
15:59amalloy&(let [a (agent {:balance 1000})] (send a #(%2) {:balance 500}) (Thread/sleep 1000) @a)
15:59sexpbot⟹ {:balance 1000}
16:00amalloy&(let [a (agent {:balance 1000})] (send a (constantly {:balance 500})) (Thread/sleep 1000) @a)
16:00sexpbot⟹ {:balance 500}
16:03jcromartiethat's the wrong way to model an account anyway
16:03jcromartiehow about a better example?
16:05Sgeoamalloy_, ok.. why?
16:06jcromartieamalloy_: THANK YOU <3 for auto-complete-mode
16:06jcromartieawesome
16:07SgeoWhy does it work like that?
16:07jcromartie#(%2) is a function that calls its second argument
16:08jcromartie&(#(%2) nil {:foo :bar})
16:08sexpbotjava.lang.IllegalArgumentException: Wrong number of args (0) passed to: PersistentArrayMap
16:08SgeoHow would I make it just return the second argument?
16:08jcromartie&((constantly {:foo :bar}))
16:08sexpbot⟹ {:foo :bar}
16:08jcromartie&(#(identity %2) nil :foo)
16:08sexpbot⟹ :foo
16:09jcromartiebut if you already have what you want, you don't need to muck with args... just use constantly
16:09SgeoMaybe I should stick with fn?
16:09jcromartie!doc constantly
16:09jcromartieis that how you do it?
16:09Sgeo&((fn [a b] b) 5)
16:09sexpbotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: sandbox6385$eval9330$fn
16:09Sgeo&(fn [a b] b) 5
16:09sexpbot⟹ #<sandbox6385$eval9339$fn__9340 sandbox6385$eval9339$fn__9340@19b38d7>
16:10jcromartieSgeo: we're trying to solve the wrong problem here
16:10Sgeo&((fn [a b] b) 0 5)
16:10sexpbot⟹ 5
16:10jcromartie&(#(do %2) :foo :bar)
16:10sexpbot⟹ :bar
16:10jcromartiebut anyway
16:11SgeoThat's... unintuitive to me
16:11SgeoHm wait
16:11SgeoI think I get it
16:11jcromartieit's exactly the same as (fn [_ b] b)
16:11Sgeo#(stuff) seems to be (fn [] (stuff))
16:11jcromartieyes
16:12SgeoOk
16:12jcromartiebut you never do #(stuff) because you could just use stuff
16:12jcromartie&(map inc [1 2 3])
16:12sexpbot⟹ (2 3 4)
16:13jcromartiewell, that's a bad example
16:13jcromartie#(stuff) is pretty useless
16:13jcromartieunless it's purely for side-effects
16:14jcromartie&(let [counter (atom 0) count #(send counter inc)] (map #(count) [1 2 3]) @counter)
16:14sexpbot⟹ 0
16:14jcromartie&(let [counter (atom 0) count #(send counter inc)] (doall (map #(count) [1 2 3])) @counter)
16:14sexpbotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: sandbox6385$eval9386$fn
16:14jcromartieheh
16:14jcromartieanyway
16:14Sgeojcromartie, I didn't mean literally stuff
16:14jcromartieI know
16:14jcromartiebut #(foo)
16:16jcromartiebut anyway, don't store an account balance :)
16:27SgeoAre refs readable outside of transactions?
16:27stuartsierrayes
16:28Sgeo:/
16:28danbellis there a core way to map a set of arguments across a sequence of functions?
16:28stuartsierraSgeo: deref on a Ref will always return the most-recently-committed value, never the value inside a transaction.
16:29hiredman,((apply juxt [inc dec]) 1)
16:29clojurebot[2 0]
16:29danbell,(doc juxt)
16:29clojurebot"([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, a...
16:29danbellcool, thanks
16:30DespiteItAllwhy would you not store an account balance?
16:32SgeoThere is something about Clojure that .. hmm
16:36amalloyjcromartie: ouch, you think thunks (that is, no-arg functions) aren't useful?
16:37jcromartieamalloy: they can be useful but it's almost always for side-effects and it's hard to think of an example off the top of my head
16:37SgeoI was recently fascinated by Slate. They have something called Prototypes with Multiple Dispatch. They talk about methods being defined in terms of all their objects. I know Clojure uses immutable stuff, so it's not exactly the same, but I think multimethods serve a similar purpose.
16:37SgeoAnd may be more flexible
16:37amalloyjcromartie: try implementing lazy-seqs without thunks
16:37SgeoI should translate their example to Clojure
16:38amalloyeg, (range 10) is a pair of (data, thunk-for-next-data) elements
16:38stuartsierraSgeo: Clojure doesn't implement Prototype inheritance directly, but it's easy to implement yourself.
16:40SgeoThe PMD paper on Multiple Dispatch alone: "
16:40SgeoHowever, there remain problems with the example, as expressed. It is still
16:40Sgeoawkward to express stateful behavior; this is still represented by the control
16:40Sgeoflow branches inside encounter methods. Furthermore, the code describing that
16:40Sgeounhealthy sharks swim away from all other animals is duplicated in two different
16:40Sgeoencounter method"
16:40SgeoSorry
16:40SgeoThe first criticism does not apply to Clojure's multimethods, I think
16:40SgeoAs it's not strictly "class" based
16:41dnolenstuartsierra: prototypal inheritance is simple via ad-hoc hierarchies. rhickey based his work on the Self paper if I recall correctly.
16:41amalloyjcromartie: that is, they're useful not just for side effects, but for delaying/modifying computation/evaluation. eg in sexpbot, most user code is wrapped up in a thunk to be computed on another thread while the core engine goes back to listening for requests
16:41stuartsierradnolen: cool, I'll have to look that up.
16:42dnolenhttp://dosync.posterous.com/beyond-javascript-prototype-chains
16:42dnolenI compared JS prototypal inheritance to Clojure's more general facilities a while back ^
16:42jcromartieamalloy: true, I guess I was just scratching the surface
16:42stuartsierradnolen: thanks, I'll take a look
16:43jcromartiehooray for thunks!
16:43jcromartie:)
16:43amalloylol
16:43amalloythere we go, that's the kinda of enthusiasm i like to see!
16:44Sgeotype?
16:44clojurebothttp://www.assembla.com/wiki/show/clojure/Datatypes
16:45SgeoOh, I was skipping ahead?
16:45SgeoBad bot
16:45SgeoAnd that wasn't a question. I was skipping ahead
16:46SgeoOh, wait
16:46Sgeo,(doc type)
16:46clojurebot"([x]); Returns the :type metadata of x, or its Class if none"
16:48Null-Araek: So each NS `foo` as a foo_init.class generated for it. Will this coperate with java namespaces of the same name?
16:49Null-Acooperate*
16:49Null-AI think normally in java you can't have a package 'foo' and a class 'foo', name conflict
16:52Null-Ahmh, maybe you can after all
16:52Null-Awith the jvm
17:09amalloyjcromartie: oh, and you're welcome re autocomplete
17:12SgeoHow difficult could it be to make a very very basic DrClojure?
17:13amalloyit took me a while to realize, but M-n and M-p are the intended way to move through the suggested completions
17:14SgeoMaybe I should try emacs
17:14SgeoI certainly like emacs on the command-line
17:14SgeoBut in Windows, as a Windows program?
17:14lucianSgeo: it's fine, if you like emacs, use it everywhere
17:15SgeoI like it just fine when my choices are pretty much emacs, vim, nano, is what I meant
17:16lucianah, so you don't actually like emacs all that much
17:17lucianme, i like vim everywhere (in particular it's input scheme)
17:18lucians/it's/its/
17:18sexpbot<lucian> me, i like vim everywhere (in particular its input scheme)
17:18luciansexpbot: you're not being very useful with that
17:21jcromartieSgeo: Emacs for Windows is pretty solid.
17:23lucianjcromartie: except he doesn't actually like emacs
17:28amalloylucian: i can make him stop sedding your messages if you want
17:29amalloypeople seem to have a love/hate relationship with the feature so it's not gonna go away, but if it bugs you...
17:29stuartsierraw00t! No red dots on http://build.clojure.org for the first time!
17:29lucianamalloy: meh
17:30lucianamalloy: it's not really that annoying, but it doesn't seem very useful either
17:35hugod_just ran into http://dev.clojure.org/jira/browse/CLJ-444 in clojure 1.2 - if I read file:///Users/duncan/lisp/docs/java/docs/api/java/lang/ref/ReferenceQueue.html#poll%28%29 correcty though there is still an issue with enqueued references being dropped by the call to rq.poll and not being cleared from the table
17:36amalloyhugod_: puzzlingly enough that file: link is no good for the rest of us :P
17:36hugod_oops
17:38hugod_this one works a little better http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ref/ReferenceQueue.html#poll()
17:38raekNull-A: when AOT compiling the namespace foo.bar.baz, the class foo.bar.baz_init will be generated (baz_init class in foo.bar package). you would get a conflict if you have "package foo.bar; public class baz_init { ... }" in any java sources...
17:41raekthere shouldn't be any problem with calling the class the same as the last component of the package
17:50Null-Araek: k, when you use :gen-class on ns, interestingly it creates directory baz, and class file baz.class as siblings in the directory
17:51Null-A(direcotry foo/bar/)
18:48raekNull-A: the baz_init class has a static initializer that will evaluate the code of the namespace, and the baz class is the one that will have the methods declared in :gen-class. you can set that name to something else by adding the option :name OtherName to the :gen-class part
18:50Null-Aawesome thanks
18:51raek(methods of generated classes will always have an implementation that calls a clojure fn in a ns)
18:51Null-Ayah that's really convinient
18:52Null-Aconvenient*
18:53raekso by reevaluating the corresponding defn form, you update the behaviour of all existing instances of the generated class
18:53Null-Aexactly :)
19:01ossarehhola
19:09TimMcSgeo: I think most Emacs users on GNU/Linux systems use the graphical version anyway.
19:12sritchie_hey all -- one quick question on storing records of data
19:12sritchie_I want to encode some of the information on these MODIS products as a clojure datastructure --
19:12sritchie_https://lpdaac.usgs.gov/lpdaac/products/modis_products_table
19:13sritchie_I'll be using the product name as a key, but I want to be able to store multiple values
19:13sritchie_is this a job for defrecord?
19:19TimMcI've enever actually been clear on the use-cases of defreord over, say, maps.
19:20TimMcI suppose defrecord with (.field-name obj) gets you some type hinting.
19:22sritchie_here's one about maps... say I want to check a substring against a few possible options
19:22sritchie_is it more efficient to look the substring up in a map? Or to use cond?
19:24sritchie_https://gist.github.com/1455e310c21417ad13b5
19:24sritchie_as an example
19:27amalloysritchie_: well your cond example is broken
19:27sritchie_because it has no :else?
19:27amalloyno, because you're using cond as if it were case
19:28sritchie_amalloy: oh, whoops
19:28sritchie_condp = s, then
19:28amalloyto answer your actual question: case is going to be way faster, though at the scales we're talking about, even if it were a million times faster it wouldn't matter
19:28amalloyso like case < map < cond
19:29sritchie_amalloy: got it
19:29sritchie_so the issue at this scale is reusability of the cases, I guess
19:30amalloyactually for small maps i'm not sure whether cond or map is faster b/c small maps are implemented as arrays
19:30sritchie_so a map makes sense if I need access from multiple functions, case or cond for a single function
19:30amalloysritchie_: not so! you can reuse them with case. the issue is that you have to know it all at compile time
19:30SgeoHmm
19:31SgeoMaybe Clojure multimethods aren't more powerful than Factor's system
19:31SgeoI'd need to think about what Factor does to be sure
19:31sritchie_amalloy: hmm, interesting
19:31sritchie_amalloy: how would I reuse cases?
19:32Sgeo" there's a multi-methods vocabulary. the core generics implementation is single-dispatch though"
19:32amalloyeg (let [tests [1 2 4] ] (defmacro switch-with-values [elt & rets] `(case ~elt ~@(for [[test val] (map vector tests rets)] test val))))
19:33amalloysritchie_: haven't typed it into a repl, but something like that would work, and allows you to use the same test values (1 2 4) with different return values
19:33amalloyit's simpler if you always want to use the exact same map
19:34sritchie_got it. I'm still not used to thinking about how macros can sub in anything at compile time, and produce the same code
19:34sritchie_sorry, I mean, condense that idea of reusing a block of cases down, so nothing gets repeated
19:35amalloy(defmacro mapped-case [elt] (cons 'case (cons elt (for [[test val] {1 1000 2 500 4 250}] test val)))) ; a different style to keep you on your toes
19:36sritchie_time to go study these
19:36amalloyalso that one doesn't compile. that's what i get
19:36amalloyfor trying to be clever
19:37sritchie_amalloy: once I can recognize the fact that it won't compile at a glance, I'll have studied enough
19:37sritchie_amalloy: on this example, anyways
19:37amalloysritchie_: hah. i didn't recognize it either. i got up a real repl
19:40amalloyaha
19:40amalloythis version works and is much tidier: (defmacro mapped-case [elt] `(case ~elt ~@(apply concat {1 1000 2 500 4 250})))
19:40sritchie_amalloy: I didn't realize that destructuring a map split it into keys and values
19:41amalloysritchie_: destructuring a map *entry* splits it
19:41sritchie_ah, and in your example, for walked across a map, which produced entries
19:42amalloy&(let [m {1 2 3 4}] [(seq m) (first m) (let [[k v] (first m)] [k v]))
19:42sexpbotjava.lang.Exception: Unmatched delimiter: )
19:42sritchie_&(take 2 {1 1000 2 500})
19:42sexpbot⟹ ([1 1000] [2 500])
19:42sritchie_got it
19:42amalloy&(let [m {1 2 3 4}] [(seq m) (first m) (let [[k v] (first m)] [k v])])
19:42sexpbot⟹ [([1 2] [3 4]) [1 2] [1 2]]
19:46amalloyANYWAY. moral of the story: you can use case or a map, and there are differences, and it's up to you to pick
19:47sritchie_amalloy: haha, that is a good takeaway
19:47sritchie_thanks for the help
19:55Null-Aany idea on how to declare array of bytes return value in gen-class :methods?
19:55Null-Aits not `bytes`
19:56amalloyNull-A: i seem to recall seeing this on the mailing list in the last couple weeks
19:56Null-Ai'll take a look
19:56amalloy^"[B" probably works
19:57amalloybut (in 1.3, at least - not sure about 1.2) i think ^bytes is supposed to be the hint for a byte[], which won't work for clojure fns but ought to for gen-class methods
19:57amalloyNull-A: ^
19:58Null-Aah, well i'm on 1.2
19:58Null-Aamalloy: you think :methods [[foo [] "[B"]] will work?
19:59Null-Athere's never a caret
19:59amalloythat would be my best try
20:02amalloylooks like no, though
20:03amalloyactually maybe i just don't know how to use gen-class :P. anyway try it out and let me know, Null-A
20:03Null-Aamalloy: didn't work
20:03Null-Aamalloy: i think I can get by with ByteArrayOutputStream as return type
20:03Null-Aamalloy: thanks for the help ;)
20:05hiredmanb
20:10amalloyhiredman: for returning a byte[]?
20:21hiredmanamalloy: focus on the wrong window, that b was meant for emacs
20:22amalloythat was my second guess (modulo specificity about where you meant to send it)
21:00sattvikNull-A: For gen-class, you can have a return type of "[B" for an array of bytes
21:01sattvikFor example: (ns MyClass (:gen-class :methods [[myMethod [] "[B"]]))
21:02Null-Asattvik: I did try that
21:03Null-Asattvik: are you sure it works? it didn't work when I tried it
21:03Null-Aclassnotfound "[B"
21:05sattvikHmmm... I just tried it out, but let me be sure.
21:11sattvikNull-A: This code seems to be working for me: https://gist.github.com/844849
21:12Null-Asattvik: on 1.2 clojure?
21:12sattvikyes
21:12Null-Ak, i'll retry
21:12TimMcThe "[Foo" notation offends my balancing sensibilities. :-(
21:12sattvikIt is rather ugly.
21:12TimMc(Interestingly, emoticons do not.)
21:13TimMcI suppose my brain sees "face" before "code".
21:16SgeoI think Clojure might have gotten me interested in Haskell again >.>
21:17Lulu58e2Haskell keeps defeating me and I keep coming back for more
21:23SgeoMaybe I'll find Leksah to be a nice usable IDE
21:23SgeoWhich is more than I can say for all the Clojure stuff I've found
21:24SgeoThen again, I probably should try to get familiar with a Lisp at some point
21:27SgeoAlthough my Android phone does have a nice Clojure REPL, which is more than I can say for Hasell
21:27SgeoHaskell
21:27Null-Asattvik: ah it did work
21:27Null-Athanks
21:27sattvikNo problem. I'm glad it helped.
21:29Null-Asattvik: doesn't seem to work with gen-interface though, just gen-class
21:30Null-Athat's why I originally thought it didn't work
21:31sattvikNull-A: Yes, that's right. The patch to get it to work in gen-interface and definterface just got committed today. For those, you can use ^bytes.
21:32Lulu58e2Huzzah! Finally got Clojure running through Slime
21:35gfrlogso let's say I want to load several versions of a namespace at the same time...
21:35sattvikActually, with the new patch, you will be able to use bytes instead "[B" for gen-class, too.
21:36dnolenSgeo: or you could stop wasting your time looking for an 'perfect' environment and start writing code. From what I hear Simon Peyton Jones writes GHC in Emacs :)
21:36dnolenand debugs w/ print statements.
21:37SgeoDecent environments I have seen: Newspeak's IDE, and DrRacket. Although I seem to be satisfied with things like Notepad++ when it comes to Python
21:38SgeoThen again, I have little experience with Newspeak's IDE or with DrRacket
21:43groovy2shoesDrRacket has some nice features for Lisps. One of my favorites is the way it highlights nested lists with different shades depending on how deep they are.
21:57amalloycombining -> and doto yields some pretty powerful stuff. it's really nice how these two play nice together automatically - props to whoever thought them up
22:09spewngroovy2shoes: Not exactly the same, but emacs and vim can be set up to have rainbow parens.
22:17groovy2shoesspewn: Yeah. The shading makes it even more visually distinct :)
22:42Lulu58e2Is there a new f macro that expands to fn?
22:46amalloyLulu58e2: uh, i don't think so but maybe you'd better clarify
22:54Null-AI have :aot all, but when I run lein compile, it can't find my gen-class
22:54Null-Aits not even generating any class files inside classes/ dir
22:55tomojyou have literally ":aot all" ?
22:55Null-Atomoj: yah
22:55Null-Ain my project clj
22:55joshua__$find-fn 1 2 3
22:56tomojwhat made you think that would work?
22:56joshua__&find-fn 1 2 3
22:56sexpbotjava.lang.Exception: Unable to resolve symbol: find-fn in this context
22:56joshua__&findfn 1 2 3
22:56sexpbotjava.lang.Exception: Unable to resolve symbol: findfn in this context
22:56Null-Atomoj: my boss wrote it
22:56tomojah :)
22:56Null-Awhat works?
22:56tomojI'd guess lein would say "well, I don't see any namespace called 'all'.."
22:56tomojsample.project.clj says you can supply a regex
22:56Null-Aohm
22:57tomojbut doesn't provide an example.. wonder if it means :aot #".*" or :aot ".*"
22:57Null-Atomoj: actually its ":aot :all"
22:58Null-Awhich I think is valid
22:58tomojyeah, that looks more likely to work
22:58tomoj:aot [#""] appears to work
22:58joshua__find-fn 1 2 3
22:59Null-Atomoj: i'll try it..
22:59Null-AI tried the namespace too
22:59Null-Anone of it worked
22:59tomojI do see checks for :all
22:59tomojshould work
22:59tomojthen :all is not the problem, I guess
22:59Null-Atomoj: wierd how classes/ dir is empty
23:02joshua__$find-fn 2 2 4
23:02joshua__$findfn 2 2 4
23:02sexpbot[clojure.core/unchecked-multiply clojure.core/+ clojure.core/* clojure.core/unchecked-add]
23:03tomojNull-A: does `lein compile` say it's compiling things, or nothing?
23:04Null-Atomoj: i took out the references to my clojure genenerated class, and now it compiles
23:04Null-Atomoj: but none of the clojure classes are present in classes/ dir
23:05Null-Aoh I see some stuff, actually
23:05Null-Ajust not my gen-class, hmh
23:10Null-Auhg, bbl
23:16Lulu58e2amalloy: I'm running Clojure in Emacs via swank; I tried (filter (fn [x] (< 2 x) [1 2 3 4 5 6]) and it complains that it can't find "fnn"
23:16Lulu58e2amalloy: So I try it (filter (f [x] (< 2 x) [1 2 3 4 5 6]) and it works
23:17DespiteItAllclearly you have an invisible 'n'
23:17DespiteItAlloh, actually, i know what it is
23:17Lulu58e2I did C-c C-m over "f" and it shows "fn" in whatever the slime buffer is called
23:17DespiteItAllit's turning fn into the greek letter
23:17DespiteItAllit's an annoying thing that clojure mode does sometimes
23:18amalloyLulu58e2: is that the parens you're actually using? cause there should be an ) after (< x 2)
23:18Lulu58e2So, that's why I asked about the "f" macro; seems "f" is macro-expanding to "fn"
23:18Lulu58e2amalloy: lol, no, I had a 2nd ) after the anon fn
23:19DespiteItAllLulu58e2: look at the 'f' closely. it's not really an 'f'
23:19amalloyLulu58e2: i'm inclined to agree with DespiteItAll: there's an invisible n in there somewhere
23:19Lulu58e2Okay, it does look like a fancy f with a bit of a tail
23:20Lulu58e2lol, okay, interesting.
23:20DespiteItAllyeah, you need to turn off 'pretty-fns' I'm not sure how to
23:20Lulu58e2Yup, did backspace and it goes back to regular old "f"
23:20Lulu58e2Thanks!
23:21amalloyheh. when no logical solution is possible, search for ghosts
23:21Lulu58e2:)
23:22Lulu58e2I'm making the switch from Clojure in IDEA on Windows to Clojure in Emacs on Ubuntu.
23:22Lulu58e2Garsh, what a mind-job.
23:23Lulu58e2(and I'm quite new at Clojure at that)
23:24amalloynice. i made the switch, more or less, from java in eclipse on windows to clojure in emacs on ubuntu at about the same time
23:25amalloyevery choice well worth it
23:25Lulu58e2Same, switching from Java after reading Seven Languages in Seven Weeks
23:26Lulu58e2I'm not sold on emacs yet, but it gets good press. Worth a shot.
23:26Lulu58e2I did the tutorial and watched "Meet Emacs" from PeepCode
23:26amalloyhttp://norvig.com/21-days.html
23:26Lulu58e2lol "in Ten Years"
23:27amalloytrue words
23:27Lulu58e2Oh I'm sure truer words were never spoken
23:28amalloyi think the url is almost as funny as the rest of the article
23:29Lulu58e2I like the Alan Perlis "... change the way you think ..." quote
23:29Lulu58e2Haskell had me thinking like a crazy person. :D
23:30amalloysure it didn't just make you crazy?
23:30Lulu58e2<snicker>
23:31Lulu58e2I'm convinced there's something there. After I get a little more comfortable with Clojure I'm going to hit that last chapter in 7Lin7W
23:31amalloyLulu58e2: something "there" where?
23:32amalloycuz in isolation "i'm convinced there's something there" sounds like a crazy person :)
23:32Lulu58e2rofl
23:33Lulu58e2Come on, with words like monad and things like "function lifting" I'm sure it must have 110% of awesome baked right into it.
23:33Lulu58e2Plus, the "Learn you a Haskell for Great Good" sells it all by itself.
23:33amalloyoh in haskell
23:34amalloyyeah haskell is a language that i am convinced will be fabulous for me if i can ever muster the strength to really learn it like i did clojure
23:35Lulu58e2I can still read it fairly well, which surprised me, but I think Clojure will help me learn more of the FP I need to tackle Haskell
23:35Lulu58e2I need Clojure to change the way I think (i.e. functionally) and then Haskell to take it to the "pure" level.
23:41Lulu58e2Okay, why does clojure-mode insist on doubling up my parens? Is it Paredit or Fill doing it?
23:41amalloyparedit
23:42amalloyi hated it for a while but it's actually super-handy
23:42Lulu58e2Hmm, okay, thx
23:42Lulu58e2What's the idiomatic way to look up Paredit info? Google?
23:42amalloynot so much because it doubles your parens, but because it knows your code is well-balanced it can perform handy list-editing functions on it for you
23:43amalloyLulu58e2: or #emacs. i'm not a pro myself
23:43amalloythe ones i use most are C-<RIGHT>, M-(, M-<UP>, and M-r
23:44Lulu58e2Please excuse my ignorance, but what's with the different colours? (I'm using XChat)
23:44amalloyuhm, what colors?
23:44Lulu58e2(I tried Googling it but I'm not sure if it's XChat, Freenode, or what)
23:44Lulu58e2Sometimes your nick and text is red, sometimes blue
23:44Lulu58e2Mine is light grey
23:44amalloymine? it's something your client is doing, but i don't know what
23:45amalloyLulu58e2: maybe it has to do with whether ive mentioned you in the message
23:45Lulu58e2I suppose I should find a #xchat or #irc-retards channel
23:45Lulu58e2Hmm, yes, that does seem to be a pattern
23:45amalloyLulu58e2: lol, i would join that channel. i actually just use pidgin as a holdover from my windows days
23:45amalloyit's a pretty awful irc client, but i'm comfortable with it
23:45seancorfieldLulu58e2: how many IRC clients have you tried on Ubuntu? i tried a bunch and settled on Konversation
23:46Lulu58e2Um, let me count ... 1
23:46seancorfieldoh... heh... ok...
23:46Lulu58e2I suppose I should try more but Clojure-Emacs-Swine-Swank takes precedence
23:47amalloyslime, or is swine an actual thing?
23:47Lulu58e2D'oh
23:47Lulu58e2nvmd, is slime
23:48Lulu58e2(had to quickly double-check my web page :)
23:48Lulu58e2Okay, C-<RIGHT> is cool
23:49Lulu58e2Ack! M-<UP>
23:49amalloylol
23:49amalloyC-/ to undo
23:53Lulu58e2seancorfield: are you using KDE?
23:56Lulu58e2lol "slurp" and "barf" commands (paredit)
23:58amalloyoh, and paredit's C-k is imo a lot more useful than the built-in
23:59Lulu58e2amalloy: yeah, I can see now the value of paredit
23:59Lulu58e2amalloy: I didn't even realize there were commands associated with it.
23:59Lulu58e2That's another point for Emacs
23:59Lulu58e2(and obviously for paredit itself)