#clojure logs

2010-06-04

00:08Blackfootis there a faster way for developing GUI apps that doesn't involve lein uberjar every change?
00:45konrWhen I need to add methods to a class, there is no other way than using gen-class, right?
00:46cemerickBlackfoot: get a decent repl server library, and have your app open a repl port at startup. Then you can start it once, connect with a REPL, and code, load, and repeat iteration after iteration.
00:47cemerickI use enclojure and its repl server lib at the moment, FWIW.
00:47cemerickkeeping a close eye on ccw, though
00:48Blackfootcemerick: hrm ok, i will give those a try thanks
00:48cemerickkonr: or use gen-interface/defprotocol, and include the method definition in your deftype/defrecord
02:11bhenryare there security issues i'm not seeing in using the password hash from a django project's postgres db and passing it to a clojure app as a private token stored in a user collection in a mongo db so users would only be required to login (and more importantly be created) one time?
02:13bhenrynote: intranet site with mostly trustworthy employees (trustworthy in that they aren't very tech savvy to mess with security)
03:24vIkSiThmm, if I have do a def like : (def a "abc") - is there a way I can get a value with two indices swapped?
03:24vIkSiTbasically, get "acb" for instance
03:34raek(defn swap [coll index-a index-b] (assoc coll index-a (get coll index-b) index-b (get coll index-a)))
03:34tomojcan't assoc strings, though
03:34raekhrm, right
03:34tomojbut I guess you could go through seqs
03:34tomojer, vectors
03:35raekyes, do (vec) on coll
03:35tomojis it always gonna be a string?
03:38raek(defn str-swap [s index-a index-b] (let [v (vec s)] (apply str (assoc v index-a (get v index-b) index-b (get v index-a)))))
03:38raek(str-swap "foo" 0 3) => "oof"
03:39raekI haven't looked in the javadoc, though
04:01vIkSiToooh thats a good one.. raek, thanks for the pointer
04:01vIkSiTtomoj, hmm, could be any seq really
04:02tomojthat's unfortunate
04:02tomojwell, maybe not, hmm
04:05tomojoh, yeah, it is, I think
04:06tomojif it's any seq, you don't have constant time access to the nth element
04:06tomojso swapping will be difficult
04:06vIkSiTah good point
04:06tomojI think you could return a new lazy seq with the elements swapped, but it would have to process all the elements between i and j before returning its ith element
04:08tomoj(and store them all in memory at once)
04:36LauJensenMorning all
04:40esjMorning el'Lau !
06:57rhickeycgrand: nice blog, although it falls short of what I would consider primitive support for fns - the ability to use them with map/reduce/filter et al
06:57rhickeyone thing I would suggest is to not overload invoke like that
07:10cgrandrhickey, I know it's a short-sighted solution and not what you are aiming for. Thanks for confirming my second thougts about having named the method invoke.
07:11rhickeycgrand: the other big problem in general is the semantic difference between operations on boxed and unboxed ints
07:12rhickeyI'm surprised actually that the non-hinted fib isn't much slower
07:13cgrandI guess it's -XX:+DoEscapeAnalysis at work
07:13rhickeycgrand: not turned on here, plus going through different math ops
07:15cgrandby difference in semantics you mean the promotion of ints to long etc. ?
07:15rhickeycgrand: the whole boxed number tower stuff, possible promotion to BigIntegers etc
07:16rhickeycgrand: did you compare hfib to fib in Java on same machine?
07:17cgrandno but I can, wait
07:17rhickeyI'm wondering if all the math in hfib is primitive
07:17rhickeyand the cost of the (int 1) (int 2)
07:21rhickeycgrand: heh, yeah, you are not getting what you think you are getting here, yet
07:21rhickeyi.e. this wins here for me:
07:21rhickey(defn fibn [n] (let [n (int n)](if (>= (int 1) n) 1 (+ (fibn (dec n)) (fibn (- n (int 2)))))))
07:25cgrandrhickey: java for fib(38) : around 360ms
07:25wiressorry, i'm just dropping in halfway, but you can work with primitives in closure? I thought everything is boxed?
07:26rhickeycgrand: see ^^, I don't think you are getting prim args through the recursive calls
07:27LauJensenwires: sure
07:28LauJensenwires: http://bestinclass.dk/index.clj/2010/03/functional-fluid-dynamics-in-clojure.html
07:28wiresLauJensen: using java interop?
07:28rhickeycgrand: in fact, I'm wondering if the inline is in play while compiling the body
07:28wiresLauJensen: thanks, let me check that post
07:29lpetitwire: s/closure/clojure/g
07:29cgrandrhickey: at some point I traced it to check which method was invoked, and the specialized invoke was called
07:29rhickeycgrand: going to breakfast here, I'm sure you'll figure it out - bbl
07:32wireslpetit: sorry :) i know that :)
07:32lpetitwires: sorry, couldn't resist ;-)
07:32wireslpetit: hehe
07:33wireslpetit: it's always good to have a few spelling nazi's in the room ;)
08:24rhickeycgrand: your perf problem is having to go through the var to get 'this' for the inlined call
08:25cgrandrhickey: thanks, I checked that a pure reify solution was around 800ms
08:26rhickeycgrand: definterface + deftype 400 ms here
08:27cgrandrhickey: something along these lines http://gist.github.com/425352 ?
08:28rhickeycgrand: http://gist.github.com/425352#comments
08:28lpetitrhickey: what about having some *warn-on-protocol-impl-redef* (tentative name) to help users of libraries detect that some libraries one depends upon haven't respected the "protocol rule" ?
08:29lpetitrhickey: ideally, the message could indicate what the current namespace was for the last redef of the protocol impl for a certain type
08:30lpetitrhickey: I really fear the FUD coming in a few months if subtle problems arise. I would not like this problem to become Clojure's "oh no, don't use monkey patch *at all* of Ruby".
08:30rhickeylpetit: I don't want to solve theoretical problems, let's see if we actually have this problem in practice first
08:31lpetitrhickey: always the same scheme. lpetit envisions an hypothetical future problem, rhickey's pragmatism wins ;-)
08:32rhickeylpetit: the biggest difference is people monkey patch in Ruby because they *have to*, no one has to have duplicate protocol defs and social pressure might be enough to keep it that way
08:33lpetitrhickey: yes, maybe. I feel this way because me, as a library user, can be impacted by 2 libs I depend on in a very insidious way.
08:35LauJensenI opensourced bestinclass.dk: http://bestinclass.dk/index.clj/2010/06/best-in-class--now-open-sourced.html
08:35rhickeylpetit: then it becomes a quality of implementation thing for the libs, and a coordination effort for the community, but not something forced by a technicality
08:35lpetitrhickey: it's not just me breaking my own rules. Nothing will break, maybe for months, because nobody will notice that data are created slightly differently by another "almost semantically correct" implementation. I don't like this feeling. I can live with less compile time errors, because there will be (almost always) immediate runtime crashes. Not so easy with protocols redefs.
08:36rhickeylpetit: I'll be ready to listen when you first encounter this problem
08:37rhickeylpetit: libs can have 'almost semantically correct' versions of their own ordinary functions right now, causing runtime crashes. Again, just a quality of implementation issue
08:38rhickeythe crash isn't due to a second def, but a wrong def
08:44lpetitrhickey: ok. It's just that in case of a wrong def, on can't know in advance something's will be wrong. With protocol redef, it could be done.
08:44lpetits/on/one/
08:44sexpbotrhickey: ok. It's just that in case of a wroneg def, one can't know in advance something's will be wroneg. With protocol redef, it could be donee.
08:44lpetits/wroneg/wrong def/
08:44sexpbots/on/one/
08:44LauJensenI favor the warning - or something at least - if anything can go wrong, eventually it will go wrong
08:50TimMcLauJensen: I see the github repo of bestinclass -- cool.
08:53LauJensen:)
08:53TimMcThis will be good for me to paw through. I learn best from example.
08:56cgrandrhickey: thanks, I added a disclaimer to my post and linked to this discussion
09:26LauJensenBest In Class #10 on Hacker News, hooray :)
09:27carkhhello all, i'm giving another try to records and could not find a way to instanciate a record from another namespace easily, i need to do it this way : (cara.foo.MyRecord. "test")
09:28carkhis there a way to avoid fully qualifying it ?
09:28chousercarkh: it's "just" a class. import it.
09:28carkhahh ok
09:28carkhlet me try this =P
09:29carkhindeed this works, thanks !
09:37lpetitcarkh: I guess there's also some work in progress in master fo automatically creating factory fns for records
09:38carkhthat would definetly help
09:38eevar2LauJensen: how is business? clojure an easy sell?
09:39lpetitcarkh: I cannot retrieve it in the commits. Maybe I was just dreaming :-(
09:39carkhheh well no big deal anyways, just a convenience thing
09:57Licensersmart people around, is there a reason (I mean not an implementation reason but a thought out one) that update-in does not work with [] the same way get-in does?
09:58Licenserdefn update-in
09:58Licenser~defn update-in
09:58clojurebotGabh mo leithscéal?
09:58Licenserthank you clojurebot
10:01chouserit does seem unlikely that was intentional, doesn't it.
10:02LauJenseneevar2: Business is tough, selling Clojure is never an issue though
10:03eevar2yea, recon it's finding decent clients which is the major issue
10:04mefestodoes `iterate` use a constant amount of memory?
10:04chouseriterate returns a lazy seq
10:05chouserwalking a lazy seq without holding the head uses a constant amount of memory, though it currently churns through (probably ephemeral) garbage
10:05mefestochouser: hmmm ok am i doing this wrong? http://clojure.pastebin.com/SjaFmmCy
10:06mefestochouser: i get an OutOfMemoryError before i hit 6mil
10:06chouseryou're holding the head
10:06chouserxs is holding the entire seq, which is cached as you walk it.
10:06mefestoonly using default jvm settings
10:06LicenserI hold my head when I have headache or bumped it, did you bump your variable?
10:06mefestochouser: ahhh thanks
10:07chousermefesto: if you get rid of the def and do (take 1e7 (iterate inc 1)) instead, it should work fine.
10:08chouserexcept you also need to use 'next' instead of 'rest' or you loop will never end
10:09mefestochouser: thanks for the help, i was baffled :)
10:10axihrm, gen-class doesn't work from the repl?
10:10chousernope, must be AOT-compiled
10:10axiokay
10:10axiI guess I should just stop using classes
10:11Leafwaxi: there goes a lifetime change :)
10:11axilol
10:12Licenseraxi: I managed to entirely stay away from classes save for the clj-swing lib which needs classes to interface with the java side, it is a great live when you get rid of classes
10:12Licenserhell many cultures made the same experience
10:12chousergen-class is annoying, but you can work with classes via proxy, reify, definterface, defprotocol, defrecord, deftype -- all of which are much less annoying.
10:13Licenseryes defprotocol and deftype really are nice, just since its not stable yet the documentation is kind of sparse
10:14trptcolindo others get this same problem? http://gist.github.com/418759
10:15trptcolinticket #372 in Assembla, but it seems stuartsierra isn't seeing it on his machine
10:15trptcolini was thinking maybe hash-ordering difference or something..?
10:16Licensertrptcolin: yes
10:16mefestotrptcolin: i get the same exception
10:16Licensersame for me
10:16trptcolingood, thought i was going crazy for a moment :)
10:16Licenserno stuart is, :P
10:16Licenserbut in a good way I think
10:19trptcolincan anyone w/ assembla permissions update the ticket to reflect the fact that others are seeing it as well? i had permission to create the ticket but not add/edit
10:19Licensertrptcolin: It seems you have found the reason alredy, it seems that the test macro works with substitutions and also substituted the function argument
10:19mefestohas anyone here integrated clojure in a spring project?
10:23mefestoi was playing around with it but quickly felt like it was totally pointless. now im wondering if it would be better to build the "service layer" using clojure only and expose a restful interface
10:33Licenserchouser: nice code!
10:39bytecoderhello, i'm looking for something to the following, given two lists [{:a 1 :b 2} {:a 2 :b 1 :c 5}] and [{:a 1 :b 3}] and the key :a the result should be [{:a 1, :b 3} {:a 2, :b 1, :c 5} ]
10:39bytecoderbasically, the elements of old data have to updated with new values.
10:41chouserLicenser: :-) thanks.
10:41bytecoderi have a farily simple implemention with me; little worried about its performance and don't want to redo if it's already there.
10:41LicenserI wonder if we can convince people to change update-in :P it would help me a great deal right now ^^
10:42bytecoderLicenser: got it
10:43Licenserbytecoder: hm?
10:44bytecoderoops.
10:44bytecodergot the context wrong. "update-in" kind of sounded like what i want.
10:44Licenser*g*
10:45Licenserbytecoder: so remove the key from the second hashmap with dissoc then map over the first and merge
10:47lpetitccw users around the corner ?
10:48bytecoderwill it work in this case [{:a 1 :b 2} {:a 2 :b 1 :c 5} {:a 4 :b 6}] and [{:a 1 :b 3} {:a 4 :b 100}] too?
10:50Licenserlpetit: I used it a bit but am back to emacs
10:51Licenserbytecoder: epends on what you want the outcome to be
10:51lpetitwanted to know if some people had tried yesterday's release ...
10:52bytecoderok. thanks for info. let me try that.
10:54Licenserbytecoder: user> (merge-but [{:a 1 :b 2} {:a 2 :b 1 :c 5}] [{:a 1 :b 3}] :a) ;=> ({:a 1, :b 3} {:a 2, :b 1, :c 5})
10:54Licenser(defn merge-but [[ & ms] [& sub-ms] exclude]
10:54Licenser (map #(merge %1 (dissoc %2 exclude)) ms (concat sub-ms (repeat {})))) is the code
11:00bytecoder(merge-but [{:a 1 :b 2} {:a 2 :b 1 :c 5} {:a 4 :b 6}] [{:a 1 :b 3} {:a 4 :b 100}] :a) ;=> ({:a 1, :b 3} {:a 2, :b 100, :c 5} {:a 4, :b 6})
11:01Licenserbytecoder: is that what you expect?
11:02bytecodernope. i'm expecting ({:a 1, :b 3} {:a 2, :b 1, :c 5} {:a 4, :b 100})
11:02Licenserah I see
11:03bytecoderlet me post my code which uses list comprehension.
11:03bytecoder(defn merge-data [old-data new-data key]
11:03bytecoder (for [i old-data]
11:03bytecoder (let [d (first (select #(= (key i) (key %)) new-data))]
11:03bytecoder (if d d i))))
11:03bytecoderplease don't mind the var names :)
11:04Licenserbut why would you expect in the second map b to stay_
11:04Licenserd
11:04bytecoderi don't see this to be functional at all. i'm sure it can be done better.
11:04Licensero you want ONLY :a updated or anything but a?
11:04bytecoderi have two list of maps. wherever the key matches the right side data should just take over.
11:04LicenserI don't see why in map 2 :b should be 1 and not 100
11:04Licenserahh then I entirely missunderstood your problem
11:05bytecodersorry. should have explained my question a little more.
11:05Licenserso if :a in the left map and :a in the right map have the same value you want the right map otherwise the left map?
11:06bytecoderyes right.
11:06Licenserand what happens if thre is no right side?
11:06Licenseror the right/left side does not have the key?
11:07Licenserthen you keep the left one right?
11:07bytecoderyes, right.
11:08Licenserhttp://gist.github.com/425518
11:09Licenserso the name is horrible for this function now :P
11:11cemerickchouser: anything short of clojure data structure semantics doesn't seem worthwhile. Or, at the very least, you'd be building something other than a clojure, it seems.
11:12bytecoderLicenser: ({:a 1, :b 3} {:a 2, :b 1, :c 5} {:a 4, :b 6}) still not ({:a 1, :b 3} {:a 2, :b 1, :c 5} {:a 4, :b 100})
11:12chousercemerick: yes, but I think some people want that sometimes. see scriptjure
11:12bytecoderLicenser: anyway, i think i can tweak it a bit to get it working. let me try.
11:12cemerickOh, sure. And scriptjure is cool, bu tit's already there. :-)
11:12bytecoderLicenser: thanks again.
11:12Licenserah I think I still got wrong what you want :)
11:12Licenseryou're welcome
11:13chousercemerick: yes. I should have mentioned it by name -- wasn't sure he knew of it.
11:14TimMcI'm curious about some of the design decisions in Clojure -- for instance, why have true, false and nil by reserved names, instead of #t, #f, and (I guess) #nil?
11:14TimMcDo any of the books cover that stuff?
11:15mefestoTimMc: i think i saw something on that in a video here http://clojure.blip.tv/
11:15mefestoTimMc: one of the vids "clojure for lisp programmers"
11:15chouserTimMc: I've never heard that particular question. My guess, and that's all it is, is that the latter would have been considered uglier than necessary.
11:15mefestoTimMc: iirc, false is only in there for java interop
11:16TimMcmefesto: In at least one Scheme, false evaluates to #f. You can shadow the binding, though. :-P
11:17TimMcchouser: I like #t and #f because then you don't have to worry about self-evaluating symbols or whatever. '(foo bar true) is a list of symbols in Scheme, but two symbols and a boolean in Clojure.
11:17chouser,(map type '(foo bar true))
11:17clojurebot(clojure.lang.Symbol clojure.lang.Symbol java.lang.Boolean)
11:18chouserinteresting point
11:18TimMcmefesto: Thanks for the link.
11:18TimMcchouser: It's one of my main annoyances with lisp.
11:19chouserTimMc: symbols aren't used much for data in clojure.
11:19chousernot that that really answers your question, but perhaps is why it doesn't come up much.
11:20TimMcchouser: True. You could easily argue that if you are trying to use 'true, you're doing something wrong -- but it does mildly violate the principle of least astonishment.
11:22KirinDaveI've never liked the Principle of Least Astonishment.
11:22KirinDaveNearly every feature of every language that I really liked, I was astonished by.
11:22chouserheh
11:22TimMc:-D
11:23KirinDaveMacros are a great example. I think most people are sort of astonished by what they represent.
11:23KirinDaveIn ruby, Eigenhacking probably as a similar woah-factor.
11:24chouserActually, I think a lot of people don't understand the value of macros.
11:24KirinDaveHell, even lexical scope somewhat astonishing when you come from a land of dynamic scoping.
11:24KirinDavechouser: I meant most of the (subset of people who write them)
11:24chouserIf they did, they'd quit inventing languages with it them.
11:24chouserah
11:24chousers/with/without/
11:25sexpbotah
11:25chousersexpbot: not helpful.
11:25chouseractually, s/with it/without/
11:26TimMcI interpreted the original statement as "stop making DSLs with macros!"... which seemed odd.
11:27chouseryeah, sorry. not my point. :-)
11:27chousersomeday I'll spend some time in template haskell and see if that takes me anywhere interesting.
11:28KirinDaveThere was this article recently that the hackernewscrowd was nodding their head with about how we need to stop having tool wars and start working together.
11:28KirinDaveI sort of think the two are not mutually exclusive.
11:28KirinDaveSo much of compsci history since 1980 has been trying to get the software industry to stop fucking around and getting software engineers to take their craft more seriously.
11:29KirinDaveI'm not complaining about my salary, but part of the problem with these sorts of jobs is that they attract as many cash seekers as craft seekers. :(
11:31chouserKirinDave: I recommend making up for it by being underpaid to write a book.
11:31cemerickKirinDave: I don't think programming, as we understand it today, can ever be crammed into an "engineering" box that would lead to / require the kind of culture shift you're talking about.
11:32KirinDavecemerick: I don't know. I mean, how different is what we do from architecture?
11:32cemerickHugely. The physics and patterns of architecture are well known, and irrefutable.
11:32cemerickBest way to build a webapp? No so much. :-)
11:32KirinDavechouser: Haha, after my powerset sales stuff vests I am fine with a bit of time off. I was thinking of spending 6 months as a barista for blue bottle.
11:33KirinDavechouser: I can make a decent latte, but I want to really get it down to a science. ;)
11:33chouserheh
11:33KirinDavecemerick: But that's more a matter of time.
11:33cemerickI disagree.
11:33KirinDavecemerick: And it's not like building techniques are locked in stone.
11:33cemerickProgramming and software dev is far more akin to cooking than it is to engineering. If we can pull ourselves out of this primordial ooze of twiddling bits and describing how to do things relevant to the domains we're working in, then I think there's a chance.
11:34cemerickThere's really only one way to build an arch. :-)
11:34cemerick(speaking of stone)
11:34canderaIt's even more like building machines that will come to your house and cook for you, actually.
11:34KirinDavei think the major difference between architecture and programming is that for an architect, the blueprint is the most succinct, correct representation of a potential building. For software engineers, the program they are planning to write is the succinct representation.
11:34KirinDaveSo we have this problem of being unable to build adequate specs.
11:34KirinDaveWe have to project down from high level specs to specifics.
11:34cemerickThe program is a manifestation, not a formal representation.
11:35KirinDaveOh?
11:35TimMcI think it's easier to see bad architecture in buildings than in libraries.
11:35KirinDaveWhat's the difference for thought? :)
11:35cemerickblueprint:building :: ????:code
11:35KirinDavecemerick: There is no real comparison.
11:35KirinDavethat's the problem.
11:35KirinDaveWe can't fully spec out a piece of code without writing code.
11:35cemerickExactly. :-)
11:35TimMcMy pet peeve is that we don't have good visualization tools for large codebases.
11:35mefestoisn't code the blueprint and it's running state the building?
11:36chousermefesto: I think that's closer.
11:36mefestotdd fit into this conversation any?
11:36KirinDavemefesto: No, because the blueprint (if correct and complete) has all the data to specify the building. A spec for code does not.
11:36cemerickIf we can find a way to describe things in formalities, then we can lift ourselves into a better place.
11:36KirinDaveAnd I dunno if they exist for our work.
11:36lpetitany chance to see one day optional static type checking in clojure ? (as e.g. is provided optionally in Chi )
11:37chouserand engineering+construction is like service maintenance
11:37canderaI think if you asked guys who actually hammer nails, they might have a different opinion about the blueprint having all the data to specify the building. It specifies some projection of the building into idea space.
11:37cemericklpetit: you mean Qi?
11:37chousercemerick: but if that formality is sufficiently precise, isn't that just code in a new language?
11:37KirinDavechouser: Right. For compsci it's code all the way down.
11:37lpetitcemerick: oh yes Qi
11:38cemerickchouser: It might be "code in a new language", but it would be of a sort that is unambiguously the best way to represent what will eventually be built.
11:38cemerickMuch like blueprints.
11:38chouserlpetit: I doubt it will look like it does in Qi, but yes I think so. Some day.
11:38KirinDavecandera: Well the blueprint isn't providing a how-to-build-the-building list. It's providing a representation of the finished building.
11:38KirinDavelpetit: If SBCL can do it, why can't we? ;)
11:39cemerick...and given that formalism, no one will give a shite what the thing is built in, just like most people don't care about building materials.
11:39chouserlpetit: perhaps datalog rules making assertions about code at compile time that encompass not just types of expressions but potentially a lot more
11:40KirinDaveSBCL sort of shocks me with how amazing that compile ris.
11:40mefestoi like comparing software dev to gardening... continually growing software
11:40canderaKirinDave: agreed. But what use is just the representation in the absence of finishing the building? I'm not actually arguing against your point. But the architecture analogy has caused (IMO) endless trouble in our profession.
11:40KirinDaveI suppose it is the prime example of, “If You Spec It, They Will Build It.Æ
11:40lpetitchouser, cemerick: I'm asking because not so rarely, I can see on articles, etc., the fact that there is no static type checking as "one of the advantages of working in a 'dynamic' langage". But I really think it was first a design decision because, he, in a two-years man work, one cannot put everything !, and not having static type checking (optional one, of course) was certainly a way to...
11:40KirinDavecandera: What does it matter if it's useful?
11:40lpetit...save work (and thorough thougt about the nature of types, etc.).
11:40mefestodoesn't the blueprint view lead one towards big-upfront-design issues?
11:41mefestowhere as "growing" lets you build on top of small working parts and incrementally proceed to new features
11:41cemerickKirinDave: It simply *cannot* be code all the way down, or we screwed. Look at some of those fairly elaborate (and successful in their niche) application builders that are entirely graphical. They get jobs done, and no one using them knows jack about code, or cares. That's the way it should be.
11:41chouserlpetit: I'm not sure that's quite right. There has been much effort put into keeping Clojure as dynamic as possible without sacrificing too much performance.
11:41canderaKirinDave: I suppose whether or not it matters it's useful is a matter of perspective. :)
11:41lpetitchouser, cemerick: and I've always seen this as a poor argument, even a counter-productive argument, when told in the ears of Enterprise people.
11:41cemerickIn other words, we need to put 90% of programmers out of work. :-D
11:41KirinDavelpetit: Ultimately dynamic type checking provides more room for optimization and analysis. The more detail you put in your code at compile time, the less latitude a runtime environment has to profile and fix it.
11:42lpetitchouser: maybe I didn't make my point as clear as I intended.
11:42KirinDavelpetit: As trace tree optimizations become cheaper and more well-understood, we're going to see shit like magical auto-unboxing of arithmetic, etc just as a side effect of even bigger optimizations.
11:43KirinDavelpetit: Already what LLVM can accomplish given a codepath and some modules is _astonishing_.
11:43KirinDaveAnd garbage collectors are so good now that for a lot of use patterns they are faster than manual malloc.
11:43lpetitchouser: I'm not complaining. I'm just thinking that we should not place so much emphasis (some times) as not having static type checking as an advantage.
11:43cemericklpetit: Having worked in scala for a year (not exactly a long time, but perhaps long enough?), I'm very skeptical of rich statically-typed langs. The boxes you can paint yourself into are exquisite and very, very painful.
11:43Licenserwhat is SBCL?
11:43TimMcKirinDave:
11:44chouserlpetit: perhaps not. But not *requiring* static type declarations is indeed an advantage.
11:44TimMcKirinDave: (Sorry.) What is "Eigenhacking"?
11:44arohnerLicenser: a Common Lisp implementation
11:44TimMcIt is apparently ungoogleable.
11:44lpetitcemerick: that's why making it optional is IMHO the line to draw
11:44PloujLicenser: Steel Bank Common Lisp
11:45lpetitchouser: not in all environments.
11:45chouserlpetit: if the language required it, it would be required in all environments
11:46KirinDaveTimMc: Eigenhacking is opening up the eigenclass of ruby objects and classes.
11:46cemericklpetit: Perhaps. I'm not sure what that would look like, in a day-to-day sort of way.
11:46KirinDaveTimMc: It's my word. I'm a big enough deal to be able to do that sort of thing.
11:46cemerickI suppose type hinting as we have now, but then the compiler errors out if you're attempting to access an undefined key on a defrecord instance?
11:46lpetitchouser: in Qi, as far as I understand it, it's optional. I sometimes like to change a type in my IDE, and see instantly all the red crosses spotting all the places I need to go. :)
11:46TimMcKirinDave: Thanks, "eigenclass" is actually getting me some results. (I don't know any Ruby.)
11:47lpetitchouser: OK, I've just done this all day long, so I'm biaised today :-D
11:47lpetitchouser: in java of course
11:48KirinDaveMan, if ARM would write some instructions and hardware to directly support garbage collection in phones...
11:48lpetitKirinDave: I don't totally follow you. I'm not thinking about optimization, but about having, optionnally, the most errors reported as quick as possible. that's all.
11:48KirinDaveA new era
11:48KirinDavelpetit: Well the only type of static type checking really useful for errors is haskell's style.
11:48KirinDavelpetit: The java style is ultimately a red herring in error correctness.
11:49KirinDaveerr. error vs. correctness
11:49lpetitcemerick: haskell did that well, no ?
11:49cemericklpetit: I wouldn't know -- never spent enough time there.
11:51lpetitcemerick: by following the Qi tutorial once, I thought it would be as easy as : emit some (start-static) form to the compiler, and from now on it does its best to fail if the information it has on types for new functions/macro clashes. Later on, emit (stop-static) and you're back in the good old "fail at runtime" environment.
11:52cemerickThat seems a little baroque. I'd rather have a compiler flag I can set! to true, but whatever. :-)
11:52cemerickI'd be perfectly happy if type-hinted host interop were statically enforced. That's a reasonable first compromise, I think.
11:53lpetitcemerick: no because you would not break other's code at compile time. Still let it a chance to fail at runtime :-p
11:53lpetitmust leave, thanks for the chat
11:57The-Kenny(doc reify)
11:57clojurebot"([& opts+specs]); reify is a macro with the following structure: (reify options* specs*) Currently there are no options. Each spec consists of the protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Methods should be supplied for all methods of the desired protocol(s) and interface(s). You can also define overrides for methods of Object. Note that a
11:58The-KennyAre the examples in the doc for reify outdated?
11:58The-Kenny(str (let [f "foo"] (reify Object (toString [] f))))
11:58The-Kenny,(str (let [f "foo"] (reify Object (toString [] f))))
11:58clojurebotjava.lang.IllegalArgumentException: Must supply at least one argument for 'this' in: toString
12:10carkh,(str (let [f "foo"] (reify Object (toString [this] f))))
12:10clojurebot"foo"
12:11The-Kennycarkh: Yeah, I know. But the doc uses [] as the arglist. Looks outdated
12:11carkhoh ok
12:12Licensercoooookies!
12:43_fogus_KirinDave: Finally got around to reading it. Nice.
13:39islonI have a vector and I want to process the items 5 by 5, which is a good function?
13:42bhenrycan i have a map of structs?
13:44dnolenislon: (map #(partition 5 %) (partition 25 v)) ?
13:44dnolenbhenry: sure
13:47islondnolen: yes, thanks
13:54djpowellany clojure.java.shell people online?
14:12bhenryi need help with the error i get with this. https://gist.github.com/e4ac084bfb54a723c147
14:13bartj, (doc signal)
14:13clojurebotI don't understand.
14:15bartjbhenry: what are signal and other functions towards the end of your script?
14:15canderabhenry: Might be a swank/slime problem. You tried it from a bare REPL?
14:17replacadjpowell: what's up?
14:17raekbhenry: you'll have to use (:refer-clojure :exclude [type]) in your namespace declaration to avoid collision with clojure.core/type
14:18raekor simply rename type to something else, e.g. remark-type
14:38bartjis it possible to see the source code of the into function?
14:39bhenryraek: i had a feeling that was going to be used already
14:39bhenrybartj: those are part of the error in the comment. i don't know what they are, but they aren't in my function.
14:40raekbartj: (use 'clojure.contrib.repl-utils) (source into)
14:42bartjraek: thanks!
14:43djpowellreplaca: oh, i just have a few suggested fixes to it
14:44djpowellreplaca: bufferring the io via clojure.java.io; allowing specification of input encoding; reading streams in parallel threads to prevent stderr from filling the buffer and blocking; and probably using platform default encoding rather than utf-8 as the default
14:45djpowelli'll get a patch together, but wanted to discuss whether they are all a good idea first
14:45raekpersonally, I don't think "platform default encoding" makes any sense
14:49raekif the default is UTF-8, at least one can rely on a fixed behaviour for reading non-ascii characters
14:51raekthe encoding should be considered a part of the data format, not an implementation detail
14:52michaeltomerI'm a complete Java and Clojure noob, so forgive the ignorance of this question: Can you include a JAR file from within a Clojure script? Kind of like how Ruby does " require 'MyAwesomeFile' "
14:53raekas a swede, one gets tired of ones "åäö" turning into "åäö" or "???" at random all the time... :)
14:53raek</rant>
14:53chousermichaeltomer: not usually. generally the .jar must be on the classpath when you start the JVM.
14:53TimMcraek: hear, hear
14:54michaeltomerWill that complicate things for distributing the files to endusers who probably don't have the JDK, and certainly don't have clojure-contrib in their classpath?
14:54michaeltomerSorry, I'm a Ruby programmer by trade, so I've got some biases to overcome :)
14:55raekyou can always ship the jar files with your program (if its license allowes it, of course)
14:55raekjust start clojure with the correct classpath
14:55raekand you can use what's inside the jar
14:55michaeltomerThat sounds easy enough. Thanks!
14:55chousermichaeltomer: I'll try to defend the JVM here, though my heart's not really in it...
14:56raekmichaeltomer: I recommend looking into leiningen
14:56raekit's a build system that, among other things, handles dependencies
14:56michaeltomerchouser: That's okay. I could try to defend the speed of MRI, but my heart isn't in it either :)
14:56chousermichaeltomer: it's not uncommon to provide a single .jar with everything you need, sometimes called an uberjar. leiningen and maven both provde ways to build these based on a list of dependencies you provide.
14:57Crowbar7MRI?
14:57raekhowever, when you program, you don't mention the jar file, only the things in it
14:57michaeltomerThe canonical implementation of Ruby. Matz's Ruby Interpreter.
14:58chousermichaeltomer: another option is to provide a .jar with its dependencies available inside in a format that leiningen and maven can use. end-users with either can then ask for your .jar plus all its depenencies.
14:58michaeltomerMy clumsy way of saying that Java may be rigid, but Ruby is slow.
14:58chouserits dependency list, that is.
14:58michaeltomerSounds like I should start learning about Maven as well.
14:58michaeltomerI'm really looking for something simple. I'd rather not have to mess with build tools.
14:59raekif namespace my.random.project is in mrp.jar, you start clojure with -cp mrp.jar and write (:use my.random.project) in your namespace declaration in the file that uses the lib
14:59raekleiningen uses maven under the hood
14:59michaeltomerI like running scripts from my text editor, but it looks like I'm going to have to start running things from the command line.
14:59raekbut only for dependency management, I think
14:59michaeltomerA bit of a bummer.
15:00Licensermichaeltomer: when you use leiningen lein-search might be nice for you since it is somewhat a frontend for the clojars webside that remotely reminds of ruby gems
15:00raekyou don't have to run from the command line
15:00michaeltomerLicenser: Ah, that's what that is. That could be really handy.
15:01michaeltomerraek: Wouldn't I need to in order to specify the jar files to include?
15:01michaeltomerUnless using something like leiningen?
15:01raekwell, you have to decide what dependencies you need to use before starting the clojure instance, true
15:02michaeltomerIn this case, I'm doing the Mire tutorial which requires clojure-contrib
15:02chousermichaeltomer: for my own use, I have a directory full of jars (actually symlinks to jars) and a clojure startup script that puts them all on the classpath.
15:02raekbut you can still configure, say emacs, to launch the repl with your jar in the classpath
15:02raekit
15:02raekit's just a matter of configuring the IDE
15:03michaeltomerraek: Fair enough, though it seems like overkill to configure my text editor just for one script.
15:03raekevery project can have its own versions of its dependecies
15:03chouserand also all the jars that ubuntu has installed for me. So I can manually "install" a .jar by symlinking to it, or use apt.
15:03dnolenmichaeltomer: if you want something like the convenience of gem, I'd go with lein.
15:04michaeltomerLike I said, these things seem easier in Ruby, but that trade comes with a massive drop in speed.
15:04michaeltomerThat's a big part of going with Clojure. That and I've always wanted to learn a lisp.
15:05michaeltomerI'll check out leiningen. Thanks!
15:05chousermichaeltomer: I have felt exactly the same way about .jar management.
15:05raekI think that ruby have been designed with scripting in mind much more than clojure
15:06chouserBuilding Clojure on top the JVM is one of its biggest strengths, and also one of its biggest weaknesses.
15:06raektrue.
15:06michaeltomerraek: That's a good point.
15:06trptcolinfwiw, i don't think the jar-loading thing is really a JVM limitation. for instance, JRuby allows you to dynamically load jars if you know the path, even if they're not on the classpath when you launch.
15:07headiusmichaeltomer: what sort of things cause a massive drop in speed on ruby?
15:07trptcolini guess it's probably a difference in the way the classloader works?
15:07chouser(doc add-classpath)
15:07clojurebot"([url]); DEPRECATED Adds the url (String or URL object) to the classpath per URLClassLoader.addURL"
15:07trptcolinah, interesting
15:07Raynestrptcolin: Clojure allowed that before, but the add-classpath function/macro was deprecated.
15:07RaynesOh, too late.
15:08headiustrptcolin: all java libs loaded from ruby code in JRuby are loaded via our own URLClassLoader
15:08chouserapparently it caused problems in various deployment situations. A pity.
15:08michaeltomerI'm thinking about using Clojure for offloading some data processing onto customer's computers. I need something that'll work on Windows, Linux, and OS X, and I would prefer it not be a nightmare to set up. Does Clojure fit that bill?
15:08headiuspfft
15:08michaeltomerHey, Charlie! A familiar face!
15:08headiusURLClassLoader works fine when you need it...and when it causes problems...don't use it
15:08headiusmichaeltomer: hello!
15:09michaeltomerI'm a Rubyist treading into Java land. Slap some sense into me before I get hurt!
15:09bartjer, what gives?
15:09bartj, (doseq [entry ({:a 1} {:b 2})] (println entry))
15:09clojurebotnil
15:10trptcolin,({:a 1} {:b 2})
15:10clojurebotnil
15:10canderabartj: did you mean that to be a vector?
15:10michaeltomerheadius: I just mean the speed in general. Ruby isn't a terribly performant language, no offense to your awesome work on JRuby.
15:10chouser,({:a 1} :a)
15:10clojurebot1
15:10bartjcorrected...should have been - (doseq [entry '({:a 1} {:b 2})] (println entry))
15:11headiusdoseq always makes me thing of The Most Interesting Man In The World
15:11headiusthink
15:11chouserbartj: a vector is more idiomatic unless you have a specific reason to quote that collection.
15:11headiusmichaeltomer: ok...that's fair to say, though it's mostly due to the main implementation being fairly naive
15:11michaeltomerheadius: Absolutely.
15:11headiusmichaeltomer: I'm pretty sure I can get jruby to thwomp any other JVM dynlang very soon
15:12headiusat least for straight-line execution perf
15:12michaeltomerheadius: Including Clojure? If so, then you've got my attention.
15:12bartjchouser: er, no reason
15:12headiusincluding clojure
15:12headiusI've just started to play with dynamic optimizations in jruby that can turn dynamic calls into static, lift boxed math to primitives, and so on
15:13headiusby end of summer some of that should be landing in jruby 1.6
15:13headiusbut this is #jruby talk, so I'll shut up now
15:13michaeltomerheadius: Sounds awesome. I'd be very interested in using JRuby, as my code is already in Ruby. I'd prefer not to rewrite if I can help it.
15:13bartjcandera: yes vector would be better...
15:13michaeltomerheadius: Sorry :)
15:13headiusmichaeltomer: feel free to talk in jruby, we can at least see if jruby handles your case faster right now
15:14bartjer, is it possible to group all values of a given key
15:14bartjsomething like this: ({:A 1} {:A 2} {:A 3} {:C 1} {:C 2})
15:14bartjto this: ({:A [1 2 3]} {:C [1 2]})
15:15bartjI tried:
15:15bartj, (into {} ({:A 1} {:A 2} {:A 3} {:C 1} {:C 2}))
15:15clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
15:16bartjI mean:
15:17bartj, (into {} '({:A 1} {:A 2} {:A 3} {:C 1} {:C 2}))
15:17clojurebot{:A 3, :C 2}
15:18chouser,(reduce (partial merge-with vector) [{:A 1} {:A 2} {:A 3} {:C 1} {:C 2}])
15:18clojurebot{:C [1 2], :A [[1 2] 3]}
15:18chouserhm, not quite...
15:19pedroteixeira,(doc group-by)
15:19clojurebot"([f coll]); Returns a map of the elements of coll keyed by the result of f on each element. The value at each key will be a vector of the corresponding elements, in the order they appeared in coll."
15:21chouserbut he only wants the values, not the maps
15:22pedroteixeiraremember there was a reduce-by function in groups, might help?
15:22bhenrycandera: i just had to quote each struct form
15:22chouser,(reduce (fn [m p] (let [[k v] (first p)] (assoc m k (conj (m k []) v)))) {} [{:A 1} {:A 2} {:A 3} {:C 1} {:C 2}])
15:22clojurebot{:C [1 2], :A [1 2 3]}
15:23chouserthe use of single-entry maps is a bit odd
15:23canderabhenry: Glad you found it. One day I'll actually answer a question successfully here.
15:24canderaBefore anyone else. Even chouser. :)
15:24canderaMaybe when he's asleep.
15:24chouserMmmm, sleep...
15:25bartjchouser: perhaps, I can run this?
15:25bartj(zipmap (keys {:C [1 2], :A [[1 2] 3]}) (map #(into [] (flatten %)) (vals {:C [1 2], :A [[1 2] 3]})))
15:26bartj, (zipmap (keys {:C [1 2], :A [[1 2] 3]}) (map #(into [] (flatten %)) (vals {:C [1 2], :A [[1 2] 3]})))
15:26clojurebot{:A [1 2 3], :C [1 2]}
15:26chouseryeah, or just use the reduce expr I gave.
15:26bartjchouser: yes, I did not look at that...
15:27codemonstai
15:27codemonstai'm having trouble reading lisp / clojure code
15:27codemonstamy eyes don't know where to start at
15:27codemonstain C++, I look from left to right
15:27codemonstathat doesn't seem to work here
15:27chousercodemonsta: right. often it helps to read from the inside out.
15:28dnolencodemonsta: -> and ->> help with that
15:28dnolen,(+ 4 (/ 5 (* 6 3)))
15:28clojurebot77/18
15:28dnolen,(-> 6 (* 3) (/ 5) (+ 4))
15:28clojurebot38/5
15:29chouserI tend to skim along from the outside in (left to right) picking up important words like 'defn', 'for', 'doseq', 'let' ... things that change the context in some way, but only keep them vaguely in mind.
15:29dnolenheh
15:29canderaHere's an alternate solution. Looks cleaner, so I'm assuming that I'm missing something :)
15:29candera(reduce
15:29candera #(merge-with
15:29candera (partial conj [])
15:29candera %1 %2)
15:29candera [{:A 1} {:A 2} {:B 3} {:B 4}])
15:29chouser...then read from the inside out to get the real details, what each form returns and passes to the next.
15:29canderaWhoops. Should have reformatted. Sorry.
15:30dnolen,(+ (/ (* 6 3) 5) 4)
15:30clojurebot38/5
15:30candera,(reduce #(merge-with (partial conj []) %1 %2) [{:A 1} {:A 2} {:B 3} {:B 4}])
15:30clojurebot{:B [3 4], :A [1 2]}
15:30bartjcodemonsta: I found this wonderful wonderful article on Stack Overflow when I was starting out - http://stackoverflow.com/questions/1894209/how-to-read-mentally-lisp-clojure-code
15:30codemonstais using -> and ->> idiomatic?
15:30codemonstait seems like one would want to avoid them
15:30dnolencodemonsta: yup
15:31chousercandera: that is nice. not sure what's wanted if a key shows up only once though.
15:31chouser,(reduce #(merge-with (partial conj []) %1 %2) [{:A 1} {:B 3} {:B 4}]){:B [3 4], :A 1}
15:31bartjcandera: thanks!
15:31clojurebot{:B [3 4], :A 1}
15:32canderachouser: Ah, good point.
15:33codemonstareading clojure code make me cry because I can read 100 of lines of C++ code in a moments
15:33codemonstareading 100 lines of clojure code, however...
15:33chousercodemonsta: ah, but 100 lines of clojure is actually like at least 200 of C++. And possibly more like 500
15:34bartjcodemonsta: after you learn to read clojure code, you will still cry...
15:34Raynescodemonsta: The 100 lines of Clojure you'd be reading would probably do about 10 times what the C++ code does.
15:34chouserit's more idea-dense, so don't be surprised if it takes longer to read.
15:34bartjcodemonsta: But, those would be tears of joy and disbelief :)
15:34trptcolinand your mouse's scroll wheel will last much longer
15:34codemonstaso i shouldn't feel like a tard if I can't read clojure at the same rate I can read C++?
15:35dnolencodemonsta: certainly not
15:35codemonstai feel like a first grader trying to read 'run spot run' over here
15:36dnolenthat's 'map spot reduce' ;)
15:36codemonstaand all the other kids are laughing at me :)
15:37codemonstais it possible / easy to implement a metacircular evaluator in clojure?
15:37codemonstait would be nice to augment the language that way, if one were so inclined
15:39dnolencodemonsta: there's plenty to augment with the language as it is. macros go a looooooooooong way. you can autogenerate code from files on your disc at runtime if you want.
15:39codemonstai can't hack eval then?
15:40dnolencodemonsta: you can, but eval is really slow, since it's not interpreted, eval just kicks in the compiler and puts that code right into the running program.
15:40chouserClojure has eval. What would metacircular improve? (I'm not asking rhetorically)
15:42codemonstasomeone was making an effort to 'port' SICP to clojure
15:42wirescodemonsta: i'm not sure what you mean; isn't clojure itself metacircular? ie. it depends on JVM + clojure.jar to implement core functions? clojure is not an (self-) interpreter, right?
15:43codemonstathe concepts are not clear in my head
15:44bartjcodemonsta: did you have a look at the SO link I pinged above?
15:44codemonstaI'd just like to be able to extend the language itself the same way its is done in SICP
15:44codemonstayes
15:45trptcolincodemonsta: jakemcc has gotten the furthest i know about
15:45trptcolinsee http://github.com/jakemcc/sicp-study
15:46bartjdid anyone of you here do this: http://sicpinclojure.com/
15:48codemonstahttp://blog.n01se.net/?p=41
15:50codemonstai suppose i'd really want to hack the compiler instead of the evaluator
15:51codemonstamy goal is to work in a language that I can personally extend
15:51chousermacros are hooks directly into the compiler
15:51wirescodemonsta: just start writing. macro will get you very far
15:52codemonstamacros transform expressions
15:52codemonstabut that's not the end-all
15:52wirescodemonsta: if that's not enough, you can drop to java?
15:53chousernah. macros will get you really really far
15:53wiresindeed
15:53codemonstabut they're not as powerful as hacking the language
15:53dnolencodemonsta: there are certain things in sicp that you can't do (like implementing lazy evaluation). but if that's what you really want to explore why not hack on PLT Scheme?
15:53wirescodemonsta: uhm. what specifically are you thinking about
15:54codemonstaI don't need to hack the language
15:55codemonstaI want to work in a language that's hackable if it come to needing it
15:55nDuffcodemonsta, you might be surprised at how much of "the language" is actually defined through macros already
15:55chouserlike... lazy-seq
15:56wirescodemonsta: but what do you mean, hackable: you can write code that transforms your code, you can replace/reimplement the core implementations (which are just java), or you can add new 'elementary' functions using java interop
15:56codemonstai mean I shouldn't have to drop to java to add special forms
15:56codemonstabut, it's acceptable if I have to
15:57codemonstait's probably easier to hack the java than to hack, say, LLVM
15:57chouserif you really want to, you can write macros that generate java bytecode and load that right up. clojure-native actually does this, without a single line of Java.
15:57codemonstastill, that would only apply the JVM version
15:57codemonstawhat if I want to deploy to .NET?
15:57chouserI'm sorry, what are you actually asking for?
15:57codemonstaI get to maintain a hack on each platform?
15:58wirescodemonsta: start coding, then come back with concrete problem you can't do with macros
15:58codemonstajust asking for what lisps usually provide
15:58chouseris there a specific feature you'd like to add that you think cannot be done via macros?
15:58wirescodemonsta: I was skeptical at first, but really just try it ;-)
15:59codemonstaI'm not skeptical, just trying to find the downsides of clojure
15:59wireshaha
15:59chouserclasspath
16:00wirescodemonsta: dude, If you ask me... there are very little downsides... compared to haskell, c++, java, python etc..
16:00wirescodemonsta: this stuff is so elegant, it's mindblowing
16:00codemonstaperhaps, but one still needs to know the ugly spots
16:00zakwilsonJVM startup time
16:00zakwilsonJVM memory overhead
16:00codemonstaif it were up to me, my next project would be in Clojure
16:00wiresagreed
16:01dnolencodemonsta: not as fast C++, classpath, young ecosystem, JVM startup times are downsides.
16:01zakwilsonand the fact that I can't get a parallel map to run efficiently on the Mac Pro I'm using for the heavier number crunching
16:02codemonstaI wonder how far along the clr implementation is
16:02codemonsta.net rocks much harder than the java library
16:02codemonstatho I bet there's mad issues with .net libs on the clr port as well
16:03zakwilsonHow does .NET's performance compare to the JVM?
16:03codemonstabut you're right, I just need to start writing clojure
16:03codemonstaIf only I had a project I could use it for...
16:03zakwilsonCreate one
16:04shoovercodemonsta: ICFP is in 2 weeks
16:04codemonstai don't have time for hobby projects, sadly
16:05codemonstaall I have time to do is scan over new languages and annoy said language users on IRC
16:05shooverwell played
16:05wirescodemonsta: idea: find some crappy implementation of a java interface and re-implement that using clojure
16:06codemonstahmmm
16:06wirescodemonsta: we did that in our product and are now slowly learning and rewrite more and more
16:06wireswell, we = me
16:06wireshaha
16:06KirinDaveIs Michael Harrison here?
16:07zakwilsonThat sounds like an awful way to learn Clojure... a good way to learn the Java interop part, but I find that part of the language a neccessary evil, not one of the interesting parts
16:09chouserMight be a good way to learn why it is you should learn Clojure, though.
16:10wireszakwilson: I started with toy programs, fib, graph algorithms etc. to get the idea
16:10KirinDavechouser: Maybe my blog post had a major error by neglecting to mention extending primitive types
16:10KirinDavechouser: Or maybe the average rubyist is just not getting what I was saying...
16:10KirinDavechouser: But I am seeing a lot of http://www.michaelharrison.ws/weblog/?p=303#more-303
16:10KirinDaveAnd I cannot parse it.
16:11wireszakwilson: We have a product and for us it made a lot of sense to rewrite some core parts in clojure, java interop hence unavoidable.
16:11KirinDaveI thought I was very careful to mention divorcing inheritance from the issue. I think I said it at least twice.
16:12dnolenKirinDave: well it is a subtle thing. But yeah that post thoroughly misses the point.
16:13KirinDavednolen: Look at the last example
16:15dnolenyou can only respond to that with: huh?
16:16codemonstaclojure is strongly typed, right?
16:16dnolenon the other hand, there is a "hostiness" to protocols and types that you can only understand from "inside" Clojure. So perhaps the reponse isn't as off base as I'd like to believe.
16:19codemonstaso anyways, I write simulators for a living
16:19bartjchouser: thanks a lot!
16:19codemonstaand writing simulators generally involves modeling real world objects with structures
16:20codemonstalike struct Entity { String Identity; Vector3 Position; Matrix Orientation; };
16:21_fogus_KirinDave: I am perpetually perplexed by monkey-patching especially given that I know very little Ruby.
16:21codemonstaso that's usually my starting point
16:21KirinDave_fogus_: It's just class reopening.
16:21joshua-choidnolen: Protocols and types are being used though to make Clojure more independent of the host, interestingly enough.
16:21_fogus_KirinDave: But your post seemed pretty comprehensible
16:21joshua-choiin contrast
16:21KirinDaveBut people seem to think Mixins and inheritance solve the problem.
16:21KirinDaveAnd they do not, but perhaps that is the subtlety.
16:21codemonstathen I usually use inheritance to extend structures like struct Person : Entity
16:21KirinDavein general is-a relationships have fallen out of fashion
16:22KirinDaveThey're the most difficult kind of relationship, requiring basically full knowledge of the underlying class.
16:22KirinDavehas-a is far more reasonable for most uses.
16:22codemonstaKirin, let's not get into that just yet
16:22_fogus_Monkey patching seems like the bastard child of Scala's implicits
16:22codemonstaIs this a reasonable approach in closure?
16:22cemerickFYI, last call on dropping your 2¢ in the "State of Clojure" survey. It's going to get closed down around midnight tonight EDT: http://bit.ly/dCmlZL
16:22KirinDave_fogus_: I think it predates scala, but...
16:22KirinDave_fogus_: Want to really get weirded out? Check out eigenclasses
16:23cemerickby quite a ways, yeah
16:23cemerickI think the term is actually from the python side, no?
16:23KirinDaveeigen?
16:23KirinDaveOr monkeypatch
16:23cemerickmonkeypatching
16:23codemonstacan / should one do simulation modeling in Clojure creating and extending structures?
16:23codemonsta'by creating'
16:23KirinDavemp comes from python as a pejorative. Rubyists adopted the term as a prideful thing.
16:23cemerickyeah, that's what I thought
16:24cemerickit's a big smell in the py world
16:24_fogus_KirinDave: I've looked into eigenclasses.
16:24dnolencodemonsta: yes. deftype, defrecord will do that. Though Clojure takes the "inheritance sucks" stance. Which is making more sense to me everyday.
16:25codemonstaI agree that inheritance suck, but in many languages, the extra indirection of has-a gets in the way
16:25bartjchouser: the only thing I am not sure is why you used (first p)
16:25codemonstaAll major C-derived languages, for example
16:27codemonstain C++, you'd have karen->GetPerson()->GetEntity()->GetPosition();
16:27codemonstaand that's really terrible
16:28codemonstayou could write forwarding methods at each level for each facet, but that's also terrible
16:28codemonstanot sure if clojure has the same issues
16:29codemonstathe alternative is automatic forwarding to implement is-a via has-a, and I don't recall what languages have that
16:31KirinDaveclever fellow, that one
16:31bartjdnolen: any nice articles explaining that stance?
16:32codemonstamy summary is that is-a can always be implemented as has-a very succinctly with just a bit of sugar
16:33codemonstaand the problem with is-a is that it permanently bind the relationship of the two objects
16:33MenTaLguYis it bad that I actually don't remember what I wrote about eigenclasses?
16:33codemonstawhereas has-a allows the relationship to change
16:33dnolenbartj: most of Clojure's source and literature on clojure.org :)
16:33KirinDaveMy problem is that I am just so sick and tired of the ruby community at large
16:34KirinDaveThere is a nasty problem with the ruby community of affecting DHH and crew.
16:34codemonstathere's also the old and true mantra of 'prefer containment to inheritance'
16:34KirinDaveNow those guys know what they're doing, but many rubyists are web devs who don't have nearly the skills those people have either through effort or talent
16:34codemonsta!ggl
16:34KirinDaveBut they take a chip on their shoulders like, "Didn't you think of inheritance?"
16:34dnolenbartj: multimethods do support dispatching on hierarchy.
16:34KirinDaveOr anything :)
16:35KirinDaveDispatching on string length ;)
16:35raekalef and go-lang has and interesting approach to has-a/is-a
16:35_fogus_MenTalguY: most of my exposure was your frequent responses on _why's old redhanded blog
16:35MenTaLguYahhh
16:35MenTaLguYI'm pretty angry at _why for nuking redhanded
16:35MenTaLguYit was a big part of our collective memory
16:35codemonstathe advantage of is-a is establishing semantic type relationships
16:36codemonstahas-a generally does not impose a type semantic
16:36codemonstathough I suppose that's less important in a dynamic languages
16:37KirinDaveMenTaLguY: Can we be angry at him for a lot of things?
16:37MenTaLguYI wonder if the wayback machine has redhanded archived actually...
16:37codemonstathe difference between is-a and has-a really is semantics, so you can't discount either
16:37KirinDaveMenTaLguY: I don't know or care what his deal was. He took a thing he only had partial ownership in
16:37MenTaLguYindeed
16:38KirinDaveAlso, yaml's code sucked. ;)
16:38MenTaLguYI'm not quite sure what the deal was with syck
16:38codemonstawhat happened?
16:38codemonstasomeone wiped a community code base?
16:39KirinDaveMenTaLguY: I suspect it was designed as an elaborate prank.
16:39KirinDaveMenTaLguY: Also I am sorta grumpy that everyone said to learn ruby through why's book. Why's book was the worst way to learn ruby for 90% of everyone who asked
16:39KirinDaveBut people loved comics so they're like YEAH!
16:39MenTaLguYcodemonsta: roughly speaking, yes
16:40codemonstaand noone has a back up?
16:40KirinDavecodemonsta: it was his blog
16:40MenTaLguYcodemonsta: one of the major rubyists who ran a lot of key infrastructure and projects committed virtual suicide and took all of it with him
16:40bartjI thought there were copies on github
16:40KirinDaveno
16:40MenTaLguYwe managed to rescue a lot of it
16:40KirinDavenot for redhanded
16:40MenTaLguYbut, not of everything
16:40codemonstaah
16:40MenTaLguYso it does seem that the wayback machine has redhanded archives
16:41codemonstawell, I was a bout to excoriate all of you for not having a back up of the repository, but a blog is a different matter
16:41MenTaLguYthough unfortunately the wayback machine is pretty unreliable these days
16:41MenTaLguYI can't actually seem to *get* to the paages
16:42codemonstaseems to me though that clojure has best solved the general concurrency problem
16:43onkarahi guys I am using the CCW for eclipse and trying to create a clojure file in an existing java project and I keep getting this error "Cannot create Clojure file outside a java source folder"
16:43codemonstawhat other language comes close to this?
16:43onkarathough if I do that in a brand new project everything works fine
16:44MenTaLguYerlang, probably
16:44MenTaLguYnot sure it's such a great language otherwise, but it does manage concurrency pretty well
16:45codemonstaah, ya, actors
16:45codemonstai prefer clojure's agents tho
16:45codemonstadoesn't scala have some concurrency semantics?
16:46onkarascala has erlang style actors
16:46codemonstaah, ok
16:46onkaranot sure if it has STM
16:46codemonstaSTM FTW
16:47codemonstawell, cheap STM, anyways
16:49bartjI almost always use reduce where apply would suffice - I think
16:49bartj, (reduce str [\a \b \c \d \e])
16:49clojurebot"abcde"
16:49MenTaLguYSTM isn't actually a good solution in most cases
16:49bartj, (apply str [\a \b \c \d \e])
16:49clojurebot"abcde"
16:49bartjis this frowned upon?
16:49MenTaLguYin that specific instance apply makes more sense
16:50MenTaLguYand is most likely more efficient
16:50MenTaLguYsince you're (theoretically) not creating a bunch of intermediate string objects
16:50bartjis there some mental distinction I can make in this regard?
16:50MenTaLguYsure
16:50MenTaLguYin the case of apply, you're just calling str with five arguments
16:50MenTaLguYin the case of reduce, you're calling str four times
16:51MenTaLguY(str (str (str (str \a \b) \c) \d) \e)
16:51bartjMenTalguY: ok...got it
16:51MenTaLguYversus (str \a \b \c \d \e) for apply
16:51Borkdude,(dotrace [str] (reduce str [\a \b \c \d \e]))
16:51clojurebotjava.lang.Exception: Unable to resolve symbol: dotrace in this context
16:51bartjyeah, when you put it that way - it looks pretty bad
16:51Borkdude$(dotrace [str] (reduce str [\a \b \c \d \e]))
16:51sexpbotjava.lang.Exception: Unable to resolve symbol: dotrace in this context
16:53onkaraMenTaLguY: in what cases does STM makes most sense ?
16:53MenTaLguYwhen transactions are small and local
16:54onkaraso how does one handle distributed transactions
16:54Borkdude,(clojure.contrib.trace/dotrace [str] (reduce str [\a \b \c \d \e]))
16:54clojurebotjava.lang.ClassNotFoundException: clojure.contrib.trace
16:54onkarathrough Agents ?
16:54Borkdude$(clojure.contrib.trace/dotrace [str] (reduce str [\a \b \c \d \e]))
16:54sexpbotjava.lang.ClassNotFoundException: clojure.contrib.trace
16:54Borkdudehmm...
16:54MenTaLguYtransactions and distribution are kind of inimical
16:54Borkdudeactually in my REPL, this causes a StackOverflow.. wondering why
16:54MenTaLguYthere are such things as distributed transaction managers, but they tend to be bottlenecks
16:56onkarayup agreed but then how does clojure handle distributed trasactions
16:56MenTaLguYit doesn't, nor do the clojure standard libraries
16:56MenTaLguYyou're better off with message-passing for distributed stuff
16:57onkaraMenTaLguY: thats the agent or reactor pattern ... right ?
16:57MenTaLguYwell, I was thinking really distributed
16:57MenTaLguYzeromq or something
16:57MenTaLguY(I forget if that has clojure bindings)
16:58MenTaLguYactor/reactor pattern I guess
16:58MenTaLguYagents are more about mobile data in a way
16:58MenTaLguYwith agents, you take the code to the data
16:58MenTaLguYwith actors etc. you take the data to the code
16:58MenTaLguYer
16:58KirinDavehum
16:58MenTaLguYagents are more about mobile code in a way, sorry
16:59KirinDaveAgents is a heavily loaded term in this space.
16:59MenTaLguYthis is true
16:59KirinDaveFor example, when you say agents to me I think of systems like "aglets"
16:59MenTaLguYI'm thinking of agents in terms of what Clojure agents are specifically
16:59KirinDaveWhich were the very soul of code going to data.
16:59MenTaLguYyeah
16:59MenTaLguYthat kind of thing also
17:00MenTaLguYI guess also things like the big implementations of MapReduce
17:00MenTaLguYin those cases you're basically farming out your map/reduce functions to where the data lives
17:01MenTaLguYthe essential thing, though, is that if you want concurrency/parallelism, you have to farm things out to multiple physical places
17:01MenTaLguYwhether multiple cores or nodes on a network or whatever
17:02MenTaLguYyou can try to maintain the illusion of shared *local* storage (which is what STM tries to accomplish), but it breaks down after a while and you have to explicitly acknowledge the physical distance in practice
17:03MenTaLguYI think I'd go so far to say that STM simply doesn't scale unless you can find clever ways to partition the system (whether explicitly or implicitly)
17:04MenTaLguYwhich becomes harder the larger/less local your transactions are
17:08onkaraMenTaLguY: I think you should blog about these limitations of STM ... and may be things will be improved upon ... FYI for the biggest selling point apart from functional and dynamic language that clj is was STM ...
17:09onkarai mean limitation of clj's implementation of STM
17:09MenTaLguYit's not a question of improving STM, it's kind of a physical laws of the universe thing
17:09MenTaLguYClojure has one of the best STM implementations I've ever seen
17:10MenTaLguYbut STM just isn't a suitable programming model for distributed computing
17:10onkarawell i am just starting with clojure .... so I only understand things theoretically
17:11MenTaLguYthere are places where STM is useful, for the record
17:11KirinDaveRight, it's usefull as an underlying mechanism.
17:11KirinDaveBut as an actual solution, it's really not applicable.
17:11MenTaLguYpretty much
17:12MenTaLguYI still tend not to like it because it's hard to predict the performance characteristics under load, though Clojure again does a much better job than most any other mainstream STM implementation I've seen
17:13MenTaLguYI probably really should blog about this
17:20onkarahi guys since I am new to clojure (getting started) with CCW/Eclipse ... after trying the hello world example I want to try clojure.contrib.logging ... what jar do I need to (down)load to make that work
17:21dnolenonkara: the contrib jar
17:21dnolenif you have it just make sure it's on your classpath
17:22onkaradnolen: its in my classpath and this is what I am trying http://gist.github.com/425960
17:22onkarabut I get error java.io.FileNotFoundException: Could not locate clojure/contrib/logging__init.class or clojure/contrib/logging.clj on classpath:
17:23dnolenonkara:how are you starting clojure?
17:23onkaradnolen: what do you mean ?
17:23onkarayou meant running the code ?
17:24dnolenoh yeah, sorry you're using CCW, then contrib hasn't been properly added to the classpath, or perhaps you need to restart the CCW repl (I don't use CCW so I can't say)
17:25onkarathe clojure-contrib.jar that CCW has doesn't have logging.clj
17:26dnolenjust get a more recent one and add the jar to your project, I would think.
17:26onkaradnolen: thanx will try that
17:27TimMcI'm having trouble getting CCW and leiningen to play well together.
17:27TimMcSpecifically, regarding libs.
17:29TimMc`lein deps` puts all manner of jar files into ./lib... how do I get CCW or Eclipse to put those on the classpath?
17:31TimMcUrgh, never mind... this is just CCW getting itself into a bad state.
17:31TimMcProject -> Clean fixed it.
17:31TimMc(CCW was failing to see the jars, even though ./lib was on the build path as a class folder)
17:38digashdoes anybody knows why Numbers.java have no primitive implementations for short?
17:39digashand byte too?
17:40TimMcAnyone here use Eclipse + CCW?
17:40TimMcI'm having trouble figuring out how to invoke Clojure properly.
17:41korreinvoke?
17:41clojurebot() invokes the form inside, but there is an implied str call. The semantics are different inside the interpolated string, necessarily so.
17:41TimMcI guess there are a couple of different use-cases.
17:42TimMc1) I want to run my core.clj file, which launches a ring server.
17:42TimMc2) I'd like a REPL that loads all the definitions from an open .clj file so that I can do some interactive programming.
17:43onkarahi guys I am trying a very simple logging excercise http://gist.github.com/425960 first of all I am getting this error "java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword"
17:43korreit excecutes the file every time you save i think
17:43onkaraand second how can I ensure that I am using log4j and not java.logging
17:43TimMcCurrently I'm getting weird errors, so I'm not sure if it's a classpath issue or a code issue. :-/
17:44korreonkara: you whant an iseq from the name of the keyword?
17:44korreas in (seq (name some-key-word))
17:45onkarakorre: please bear with me I am very new to the whole clojure thing ... could you gist me an example so that I can better understand you ?
17:46korreso if you hawe the keyword :something and you whant a seq of the characters like (\s \o \m \e .......)
17:46korreis it a seq of the name you are after?
17:47onkaranot really I am not after Seq of the name parameter
17:47korreo wait sorry Don't know how to create ISeq from: clojure.lang.Keyword" is from the exception :D
17:48onkarathis is a very simple code I am just trying to test the integration of logging (may be log4j) in clojure
17:48korreso you are passing the keyword to something expecting a seq
17:49onkarakorre: never mind that ... i am now getting a different error http://gist.github.com/425960 on line 9
17:50onkaraan exception is being thrown
17:50onkarain the function
17:52onkaraseems that code is failing on the string concatenation
17:52korre(log/warn "params = " name)
17:52onkarayeah ... can't make out whats wrong with that ?
17:52korreyou are intending to write (log/warn (str "params = " name)) i gess
17:53onkaraah
17:53korrename will be the second parameter to logg otherwize and it expects a throwable
17:53onkarainteresting though that (println "something" "here") works fine
17:53onkaraperhaps its doing (str "something" "here") internally
17:54korreprintln also adds spaces
17:54korre,(println "hej" "world")
17:54clojurebothej world
17:55onkarayes it does
17:56onkarahow do I configure contrib-logging to use log4j
17:56onkaraor rather how do I find which logging system it is using ?
17:57korreim nott a java land guru :p
17:57korreyou can check the source code on github
17:57onkarayou from the lisp world ?
17:57korre.net
17:57onkaraah
17:57onkaraclose
17:58onkaraBTW how does clojure perform on .net
17:58onkara?
18:05korreseams it uses the first login system it can find
18:06korreorg.apache.commons.logging first then org.apache.log4j and last java.util.logging witch is the implementation i seam to get in my repl
18:09riddochcBest feature of clojure: Bringing Lisp to Java. Worst feature: Java. ;)
18:09korreallot of thinking is being put to fight with java api's :p
18:16mmarczykriddochc: lol :-)
18:27riddochcI've been reading through SICP again. It seems very math-centric rather than programming-centric. I definitely understand why HTDP was written to substitute for it...
18:32Borkduderiddochc: same problem with Project Euler maybe
18:34Borkdudegtg
18:35mmarczykriddochc: I don't agree at all
18:37mmarczyknot that SICP doesn't have it's cool math examples, but they always enter the stage so that a programming-related concept may be illustrated in an interesting setting
18:37riddochcmmarczyk: No? I'm not having difficulty with the math, but I think it makes it harder to focus on the programming problems.
18:37mmarczykI actually find it easier to focus when there's something remotely interesting going on
18:38mmarczykHtDP seems "reasonable" to me, considered in abstracto, but but when I actually tried reading it -- after SICP -- I just couldn't maintain my interest
18:38mmarczykmostly because there was really no challenge
18:39riddochcWell, SICP is definitely more challenging.
18:39mmarczyk"take exactly these ingredients and put them together in precisely the following way" -- the challenge is not to yawn
18:40mmarczykI don't know what happens in the later chapters, though, since I never managed to get to them... I suppose I could skip around, but by the time I was considering doing so, I'd decided to move on to another book
18:40mmarczykthat's about HtDP, of course
18:41mmarczykall that despite my great admiration for the work of the PLT group
18:44riddochcYeah, I'm pretty impressed with PLT.
18:57arrummzenIs Clojure a language people typically develop with an IDE (Like Java) or one people typically develop with an editor (Like Python)?
18:59lancepantza majority use emacs
18:59tomojthat's surprising
19:01arrummzenhehe, I specifically formed my question to avoid the emacs vs. vim/eclipse vs. netbeans issue.
19:01dnolenarrummzen: both
19:10TimMchttp://clojars.org/search?q=clojureql <-- how am I supposed to know which one I want?
19:11TimMcThere's a [clojureql 0.9.7] pushed by laujensen... but also some 1.0.0 entries.
19:20technomancyTimMc: the one without the "org.*" qualifier is the canonical one
21:39defnarrummzen: it's really all about what you want to do, how you like to work
21:40defnarrummzen: lots of people are using plugins for IDEs like netbeans, lots of people like emacs + slime + paredit, some people prefer vimclojure and nailgun, etc etc
21:40defnarrummzen: i use emacs, but emacs is certainly not the "best" option -- it's just the one I happen to prefer
21:45Raynesarrummzen: I did a poll a while back. It showed that a large majority of people use Emacs and SLIME. Coming in second was Vim and VimClojure, followed by the various IDEs. Just some statistics. I use Emacs.
21:46RaynesThere is no reason you shouldn't necessarily use an IDE if that's what you're comfortable with.
21:47defnIDE development is slow in general I think -- There might be a time in the future where I reconsider and choose a full IDE, but for the moment Emacs + paredit + slime has been good to me
21:48tomojwho do you think is more likely to answer a poll about editors, an emacs or vim user, or an IDE user? :)
21:49Raynesdefn: I doubt that. Once you go Emacs, you never go back.
21:49defntomoj: heh, touche
21:49Raynestomoj: Don't hate on my statistics.
21:49defnRaynes: nah, I think that's a naive answer
21:49Raynes:p
21:49defnif we had a really incredibly refactoring code browser/IDE tailored for clojure, I bet people would switch
21:49defnincredible*
21:50mabeslol... tomoj has a point, any editor poll will be a biased sampling when left to people to volunteer
21:50defnthere's always something better 'round the corner
21:50arrummzenI actually used emacs for coding for a long time.
21:50Raynesdefn: I seriously, seriously doubt that. You're welcome to fantasize though. <3
21:50arrummzenBut I switched to Eclipse for Java development because it did so much refactoring/code fixing for me.
21:50mabesI know my team would easily pay a could hundred dollars a seat for a really, really nice IDE for clojure..
21:51mabeser.. a couple
21:51Raynesdefn: However, the "Once you go Emacs, you never go back." remark was just a joke.
21:52RaynesI use Emacs for everything. A new editor geared toward Clojure, however incredible, wouldn't get my attention. I know at least a few Emacsers who would probably agree.
21:53defnRaynes: either way I think it is smart to not be so sure about this particular issue (IDEs) -- I can see a plethora of reasons why one might switch
21:53defnRaynes: I'm an Emacser, but I might do my clojure development in a different IDE if it was better than Emacs -- I'd be a fool not to
21:53defnIt's not inconceivable that something better could come along
21:54RaynesIf you're familiar and comfortable with Emacs, there aren't too many reasons one would switch. You have a powerful editor that can do virtually anything you want it to.
21:55RaynesYou're talking about an editor for Clojure. If a new fangled editor came along that was as awesome as Emacs (that includes being extensible and useful for other languages), of course I'd like inclined to switch to it.
21:55RaynesBut I'm not going to leave my comfort zone for a new Clojure specific IDE just because. I'm productive enough in Emacs to not want to go that route.
21:55RaynesBut that's just me.
21:55RaynesLet's not turn this into an argument. :p
21:55Raynes<3
21:57Raynes:D
21:59lancepantzwhat is that editing the definition of?
21:59lancepantz(emacs newbie here)
21:59tomojM-. will even reach inside jars
21:59Rayneslancepantz: Yes. It jerks you to the definition of something.
21:59RaynesI couldn't find a function a minute ago.
22:00RaynesSo SLIME found it for me.
22:00Raynes:D
22:00tomoje.g. M-. on defn brings you to core.clj
22:00lancepantzoh, wow
22:00lancepantzthat' is awesome
22:01lancepantzwhat is the chord that shows you a function's signature in the minibuffer?
22:05tomojspace :(
22:06lancepantzheh, correct sir
22:09tomojit looks like slime-echo-arglist will just show it without inserting a space
22:09tomojbut it's not interactive and not bound
22:09lancepantzi see
22:10lancepantzit seems to just work for core functions?
22:10tomojno, it should work for any functions that are available in the namespace you're in
22:11lancepantzdoes not for me
22:12codemonstawhat's the best clojure ide for a visual studio user?
22:12tomojyou mean, if you do (defn foo [bar & baz]) at the repl, and then type '(foo ', you don't see '([bar & baz])' ?
22:14tomojI'm using clojure-mode 1.6
22:14lancepantzi do at the repl, but if i have a buffer open that uses clojure.test, if i type '(deftest ' i don't see [name & body]
22:15tomojis your repl in the same namespace as the buffer?
22:16tomojI imagine it is based on where the repl is, not the buffer
22:16lancepantzi meant when i type in the buffer
22:16lancepantzit does work in the repl if i use the ns
22:17tomojI know
22:17tomojI'm asking if, while you're typing in the buffer, the repl is in the buffer's ns
22:17lancepantzno
22:18tomojhmm, actually, that doesn't seem to matter, at least in 1.6
22:18tomojhave you compiled the functions you're testing with?
22:18tomojoh, deftest. well, have you compiled the buffer?
22:19lancepantzah, bingo
22:19tomojit talks to clojure to figure these things out instead of doing some deep analysis of the source code
22:19lancepantzi see
22:21tomojI want a function that automatically cleans up my ns declaration
22:21lancepantzyeah, that would be awesome
22:22lancepantzi'd like to be able to move the files in the dir structure and have the ns declarations fixed
22:22tomojit's a pain to remove things, because they will still be around
22:23tomojand you won't find out you removed something you shouldn't have till your next session :(
22:24defn@ Raynes, lancepantz : M-, returns you to your previous position after M-.ing on something
22:25defnfwiw
22:25RaynesCool.
22:25lancepantzyeah
22:26tomojdidn't know that, thanks
22:26tomojand it's a stack, nice
22:26tomojchase something down the rabbit hole and come right back out with a few keystrokes :)
22:27lancepantzthat will save me so much time
22:27lancepantzusually i keep a browser open to the api docs
22:27tomojwhat other nifty tricks are there? C-c C-m is one
22:28tomojI feel like there must be some I haven't discovered yet
22:28defnwhat is C-c C-m
22:29tomojmacroexpand the form at point in a separate buffer which goes away with 'q'
22:29tomojstrangely the macroexpansions I see there are uglier now than they used to me
22:29tomojbe
22:30defncool
22:30defnim not sure how ill use that
22:31defni still couldnt write a macro to save my life :\
22:31lancepantzwhile we're at it, if i enable clojure-mode in my repl, it insert's \n instead of \r when i press enter
22:31defnoh man -- using paredit and proper clojure-mode in slime is a weird problem IIRC
22:31tomojin my experience it's bad to mess with the repl mode
22:32defnparedit alone is a pain
22:32lancepantzyeah, paredit acts differently too
22:32defnyou need to explicitly define certain bindings and tell the repl what a { is, etc.
22:33defnC-c M-p is kind of a handy one FWIW
22:33defndo it in a file where you have eval'd the ns declaration
22:33tomojalso available as ,i when at the repl
22:33defn(ns foo.core)| C-x C-e, C-c M-p
22:33defnwhoa..cool
22:34defnwhat else can you do with ,*
22:34tomojdefn: ,h for example :)
22:37tomojnever tried +p and -p before, cool
22:40codemonstaI'm going to invent the next mainstream programming language
22:40codemonstait will use MOP
22:40codemonsta'Mort-Oriented Programming'
22:40codemonstait will make stupid things easy and smart things impossible
22:41lancepantzoh, like lein
22:41lancepantzsorry, sorry
22:41codemonstahehe
22:41defncool
22:41defnGod I need a new project to be excited about
22:42codemonstamake an opengl game in clojure
22:42defni dont like games
22:42lancepantzi like walton
22:42defnno desire to learn opengl
22:42lancepantzstay excited about it :)
22:43defnlancepantz: yeah i want to be, but it's all a mess and I want to redo it, but I keep getting stuck
22:43lancepantzknow how ya feel
22:44defnthe other thing is im sort of upset with the lack of options for doing web applications in clojure -- so ive been looking at integrating jruby + rails with ring and clojure
22:44defni want to decouple the client-side part of walton from the server-side stuff
22:45defnand ive never built anything like that before and am kind of clueless as to where to start
22:45defni want people to be able to query my server and get example data
22:45defnfrom the client-side
22:45defnpeople mentioned JSON, but again, just don't know where to start with building that functionality
22:45tomojI guess the C-c C-d family is worth mentioning as well
22:45lancepantzyeah, i use compojure just to serve an http api
22:45lancepantzour front end is rails
22:46defnyeah you mentioned some code a week ago
22:46defnanything go online yet?
22:46defn<-cheater
22:46lancepantztuesday is the big release
22:46defnI am scared of compojure due to lack of docs and would love to see how you do things
22:46tomojmoustache+ring+some json lib
22:46defnin fact, I'd like to give a talk about it at our local ruby group if you'd be okay with it
22:47lancepantzyeah ofcourse
22:47defnalthough i need to be careful
22:47defni think the ruby guys are a little annoyed by my FP nazi tendencies
22:48lancepantzhahah
22:49tomojmy coworkers get annoyed too. luckily my boss is on my side :)
22:49lancepantzwe're split
22:49lancepantzwhich is great, because i don't want to mess with the ruby stuff, and they don't want to mess with the clojure stuff
22:53tomojwhy don't I ever use C-c C-d C-d ? :(
22:56tomojI wonder how slime-who-calls and friends are implemented for CL
23:12defnsome of them are very interested in doing FP in Ruby -- as much as they can anyway
23:12defni feel that others find that it's just too arcane for them or something
23:12defni sympathize with them because it took me a good 4 months to even understand how to think functionally
23:13defni looked for definitions of FP and of course found all sorts of crazy ideas on what FP is truly
23:13defni think the whole "no side effects" thing is totally misunderstood at first by a lot of OOP programmers
23:14defnone gets the sense that a lot of programmers dont even realize how many things they're mutating
23:17ihodesabsolutely agree. i didn't get what FP was until I started doing it, and realizing how awesome it was. eventually found out that people call what I was doing "FP"...