#clojure logs

2011-03-01

02:21kilo__(re-matches #"[a-zA-Z]* " "test")
03:46bartjif I have a list of vectors of size 2, eg: [1 2] [3 4]
03:47bartjto convert it into a hash-map I do: (zipmap (map first above_list) (map second above_list))
03:47bartjis there a better way ?
03:47bartjI think the map entries are vectors themselves, so I think there should be a function for this, to get back the original map?
03:49bartjgrr, (into {} above_list)
04:07TobiasRaedermorning
04:07TobiasRaederis there a way to have methods with the same name and varying number of args or varargs in protocols?
04:08pyrhi
04:08TobiasRaederhi :)
04:10ChousukeTobiasRaeder: I don't think protocols support varargs but you can do (defprotocol Foo (method [arg] [arg arg2])) for example.
04:12TobiasRaeder@Chousuke alright, sadly i kinda need something like (method-a [arg1]) and (method-a [arg1 arg2]) for convinience guess ill just have to name the 2. method-a method-b
04:15pyrok, probably stupid question
04:15pyrbut I can't get to go from a symbol to evaluating a function that has the same name
04:15pyri.e, given :foo, calling (foo)
04:17pyri meant keyword
04:17pyrnot symbol, obviously
04:18ChousukeTobiasRaeder: convenience? what do you mean?
04:18TobiasRaederI am kinda unhappy with the current wrappers around java.io.File (ie. i haven't found a function that wraps the File(String, String) constructor
04:18ChousukeTobiasRaeder: that syntax is only used when you define the protocol, when you implement it you write a (method [...] ...) block for each arg count
04:19TobiasRaedermy goal was something along the lines of (as-file "web") and (as-file "web" "WEB-INF") for example
04:19TobiasRaederoh, maybe i missunderstood you initially
04:19TobiasRaederthink i did :)
04:19Chousukeprobably
04:21Chousukeso what you want is (defprotocol FileOps (as-file [this] [this whatever]) and then implement those two for String
04:21Chousuke+)
04:22Chousukea multimethod might be more flexible though. Protocols are faster but only polymorphic on the first argument.
04:22Chousukeprotocol methods*
04:22TobiasRaederyeah which is enough for me
04:22TobiasRaederbut thanks that was exactly what i was looking for
04:27TobiasRaeder@Chousuke mind looking at https://gist.github.com/848878 ? the first one doesnt work (throws Wrong number of args (1) passed to: user$eval2530$fn) for (as-file "filename")
04:27TobiasRaeder@Chousuk the one i just wrote down (Foo and FooRecord work flawlessly)
04:33ChousukeTobiasRaeder: your extend-type syntax is wrong.
04:33Chousukeat least according to my docs :P
04:33TobiasRaederhttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/extend-type
04:34TobiasRaederextend uses a map but extend-type seems fine
04:34TobiasRaederand it works for (as-file "web" "WEB-INF")
04:34TobiasRaederbut the one param one throws the exception
04:34Chousukehuh
04:34Chousukebut it says there (baz ([x] ...) ([x y & zs] ...))
04:35TobiasRaederoh wow missed that
04:35TobiasRaederobviously - its the important part in this case
04:35Chousukewhat probably happened is your latter two-argument definition overrode the one-argument definition
04:36Chousukethey're both valid fn tails for a single arity so there would be no error I suppose.
04:36TobiasRaederwhats weird is that the foo example worked but now it's working
04:37TobiasRaederthanks for pointing that out :)
04:37ChousukeTobiasRaeder: defrecord uses a different syntax for some reason :/
04:37TobiasRaeder@Chousuke yeah mixing two different thing and not thining about them enough ... thanks :D
04:38Chousukeyou've got extra apostrophes in your doc strings btw :P
04:39TobiasRaederthx :p
05:02khaliGis there a nicer/easier way to persist some settings than slurping to file?
05:04Fossijava properties maybe
05:04khaliGhm, but doesn't still require reading writing files yourself?
05:05Fossithere's some to file or such
05:06khaliGi just want to avoid file io if i want to say some user setting
05:06khaliGbut i guess there isn't any convenience feature like that :(
05:07khaliG*save
05:12AWizzArd_khaliG: you can store the user settings in a map and simply spit it on disk
05:12AWizzArd_When you want that data back then slurp it and read-string it.
05:13khaliGAWizzArd_, yup doing that for other stuff atm, that's cool at least its a clojure form and all. i just want to avoid dealing with files directly, if possible
05:17FossikhaliG: the good thing about the property stuff is that it will go to $HOME$/.java-properties or such so you don't need any pathhandling
05:17Fossibad thing is it's not a nice format
05:18khaliGfair enough. I think i'm just going to sit down and write a Registry thing and use that throughout
05:29Cozeyhow to access resources in classpath from clojure?
05:33khaliGCozey, same way as java
05:33Cozeyso i need to just go through RT/baseLoader?
05:35khaliGCozey, yep
05:36clgvseems thread local binding via "binding" is extremely expensive. is that true in general? is there anyway elegant way around it?
05:37clgvexample: ##(time
05:37clgv (binding [*value* 1]
05:37clgv (doall
05:37clgv (map #(+ % *value*) (range N)))))
05:37clgv&(time
05:37clgv (binding [*value* 1]
05:37clgv (doall
05:37clgv (map #(+ % *value*) (range N)))))
05:40khaliGCozey, hm check out clojure.lang.RT/baseLoader
05:41CozeykhaliG: there's no contrib package to support (. baseLoader getResources)? it returns some CompoundEnumeration, which is not easy to access (not sure how except completely using java interop)
05:43Cozeyhmm. is there a standard way to iterate over something with hasMoreElements/nextElement?
05:45ChousukeCozey: you can use let to bind the value to a local if you want to close over it.
05:46Cozeymhm
05:46ChousukeCozey: is that a java interface?
05:46Cozeynone :-( http://download.oracle.com/javase/1.5.0/docs/api/javax/naming/CompoundName.html
05:46Cozeywhat if i wanted to list directory in classpath?
05:47Chousukefile-seq?
05:47Cozeydo i have to go through baseLoader/getResources, and forget about all clojure.contrib.io goodness ?
05:47Chousukecore has a couple iterator/enumerator/whatever seq constructors
05:48Cozeyok, got it! (file-seq (file (baseLoader/getResource ... ))
06:01khaliGif you overwrite some function in clojure.core is there a way to undo that?
06:02raekkhaliG: overwrite as in (def conj ...) in your namespace, or (alter-var-root #'clojure.core/conj ...)?
06:03khaliGraek, i used defprotocol with methods called set and get
06:03Chousukethat shouldn't overwrite anything :/
06:04khaliGit did :/
06:04raekok. then clojure.core/get is still intact, but your namespace contains a get -> your-ns/get mapping, instead of get -> clojure.core/get
06:04khaliGraek, correct
06:04Chousukeshouldn't Clojure throw an error in a case like that?
06:04khaliGit gave warnings
06:04raekkhaliG: you can remove the var with (ns-unmap 'your-ns 'the-var) and then (refer-clojure) to put back the old one
06:05Chousukehmm
06:05raekI think it gives a warning nowadays instead of an error to not break old programs
06:05ChousukeI dunno if you should unmap the thing from your namespace
06:06Chousukewouldn't that render it inaccessible?
06:06raekChousuke: for protocol functions or in general?
06:06Chousukethe functions
06:06Chousukeor hm, I guess in general
06:06khaliGraek, that did the trick, thank you
06:07raekah, my interpretation of the question was that he wanted to call it something else but undo the mistake
06:07khaliGyep, i'll change the name to something else now
06:07xkbis it possible to stop one specific agent?
06:07xkbbesides adding a control bool
06:08raekxkb: no
06:08xkbok
06:08xkbI created a small tank simulation, where each moving element is an agent, including bullets
06:08xkband that creates quite alot of threads sometimes :P
06:08raekif you use a thread pool manually (very similar to sending to an agent) you can call future-cancel on the future
06:09Chousukexkb: so you didn't go the all-bullets-in-one-structure route? :)
06:09xkbChousuke: tried that at first, eventually decided to try this anyway.
06:09raekbut thread interruption only works directly for certain blocking calls. in general, you have to poll the current thread's interrupted status in your code
06:10xkbChousuke: maybe I will convert it back.. as this solution slows the system downquite often
06:10Chousukeshouldn't the number of agent threads be limited anyway? :/
06:10raekwhich is in the end very similar to check a bool value
06:10xkbI now cary the state of :hit or :shot in each tank and bullet
06:10xkband those flags act as control bools
06:11xkbit's not really elegant
06:11khaliGhow does the all-bullets-in-one structure work? :s
06:11raekkhaliG: note that it is possible to have a var called 'get' in your ns and still access the clojure one
06:11ChousukekhaliG: easily. just update the state of all bullets in one go.
06:11khaliGoh, i see
06:11xkbkeep one ref with all bullets
06:11khaliGraek, understood
06:11xkbor at least that's what I did
06:12Chousukeyou could even have all tanks AND bullets in one structure, really.
06:12xkband I fixed the number of bullets
06:12khaliGso you update everything in ticks?
06:12xkbyes, actually 2 ticks
06:12Chousukeit should be easier to keep synchronised too
06:12xkbsomething I have to work on
06:12Chousukeif you have a bunch of agents it'll be hell to figure out what is going on at any single moment
06:13xkbI now have 2 freq. one for bullets, and one for tanks
06:13Chousukeso how are you going to draw the UI? :D
06:13xkbChousuke: in a separate agent
06:13xkbacting on the grid of the world
06:13xkband the world cells contain stuff
06:13Chousukexkb: so do the other agents send it drawing commands?
06:13xkblike the ants demo
06:13xkbChousuke: nope, the other agents now update "the world"
06:14Chousukeah.
06:14xkbexactly like the ants demo
06:14xkbwith the food etc.
06:14xkbit's kind of a strange mental model though
06:15xkbas the state of a tank is partially in the agent (position) and in "the world" (grid content)
06:15ChousukeI've been thinking that if you need efficient drawing in a functional program you'd probably have to construct a sequence of "drawing commands" from whatever happens when the world is updated.
06:15Chousukebecause if you update the world data structure and then draw it, you'll have to redraw everything :/
06:16xkbhmm kinde lik FRP
06:16xkblike*
06:16xkbFunctional Reactive Programming
06:17ChousukeI suppose. You could even construct a seq of update commands and then just send it to two receivers, the one that updates the world data structure, and the renderer. :)
06:17xkbHmm might be fun to try
06:17xkbthis needs to be finished before comming weekend :P
06:17Chousukeyeah, so maybe not :P
06:17Chousukebut it would let you keep the rendering logic neatly separate from the game logic
06:18xkbI'm going to do a presentation on Clojure parallelism/concurrency and use this as a case
06:18Chousukedesigning "clean" functional programs seems to get tricky whenever UIs are involved :P
06:19xkbI must say, It was quite hard to escape from a more OOish design
06:19ChousukeI mean, haskell folks go arrows arrows and everyone else is just "er, hm, just write some imperative code"
06:19Chousuke:P
06:19xkbhehe indeed
06:19xkbor they put it in a Monad anyway
06:20Chousukearrows are a generalisation of monads I think
06:20xkbeven though I very much like Haskell :)
06:20xkbye
06:20Chousukeor a related concept anyway
06:20AWizzArd_Chousuke: I did not follow the discussion. Was it explained above what you mean by "arrows arrows"? If not, could you please tell more about it?
06:21xkbAWizzArd_: it's a haskell concept: http://www.haskell.org/arrows/
06:21ChousukeAWizzArd_: I didn't mean much about it; all I know that haskell people have taken some pretty interesting approaches to UI programming and they use arrows :P
06:21xkbor actually it's more of an abstraction over computation
06:21Chousukethere was a really neat demonstration in some paper
06:22Chousukethey wrote a pong UI and then a mirror UI transformer
06:22xkbcool :)
06:22Chousukethen they combined the pong UI with the mirror UI thingy and got a mirrored pong UI
06:22xkbStill I always feel I have to dig up my cat. math. book to really understand it
06:22Chousukeand it was synchronised with the non-mirrored UI
06:22Chousukeboth getting the same inputs
06:22Chousukejust rendering differently
06:22Chousukereally cool stuff
06:23xkbhmm think I'll google for the paper
06:23xkbsounds interesting indeed
06:24ChousukeI unfortunately don't remember the name of the library they used /:
06:25Chousukethe arrows page probably links to it
06:30xkbah found it
06:30xkbhttp://conal.net/papers/genuinely-functional-guis.pdf
06:31Chousukehmm, looks like my memory is not very reliable.
06:31Chousukeoh well, still cool stuff.
06:34AWizzArd_I see, thanks.
07:10shafirehi
07:11G0SUBshafire
07:11shafirewhy do I write the keys like :key value and not key: value? which reason behind this?
07:12shafireand why def?
07:14companion_cubebecause :key is a special kind of datatype
07:14companion_cube,:hello
07:14clojurebot:hello
07:15kilo_,'(does the comma invoke the bot ?)
07:15clojurebot(does the comma invoke the bot ?)
07:15kilo_yep it does !
07:15xkb,(class :key)
07:15clojurebotclojure.lang.Keyword
07:16xkb,(class something)
07:16clojurebotjava.lang.Exception: Unable to resolve symbol: something in this context
07:16companion_cube,(= :hello :hello)
07:16kilo_,( + 1 2)
07:16clojurebottrue
07:16clojurebot3
07:16Chousukeshafire: Clojure has pretty minimal syntax. Map syntax for example is nothing but {} and key value pairs
07:16thorwilwhere a value can be a key
07:17Chousukeshafire: so the following are valid maps: {:key 'val} {'key :val} {1 2} {"key" {:another 'map}} and even {{:a :map} 'val}
07:17shafireso, why not key: value - looks better?
07:18Chousukeshafire: what would key: be?
07:18companion_cubefor the sake of uniformity
07:18xkbas far as I know a key can be anything implementing hascode/equals right?
07:18Chousukeshafire: and IMO it doesn't really look any better. :P
07:18Chousukethe : is just superfluous. why should it be there?
07:19thorwilshachaf: because the : has nothing to do with the following item, but only marks a key symbol as such
07:19shafireokay, and why def and not function or so?
07:20Chousukedef is for defining bindings to anything, not just functions
07:20Chousukeand since "fn" is the clojure term for a function, the define-function macro is called defn :P
07:21shafire:-)
07:21shafiretoday, it's my first day with clojure
07:21Chousukedefn is just a shortcut for (def foo (fn foo ...)) plus some other stuff :)
07:24xkbshafire: so do you like it? :)
07:24Chousukeif Clojure syntax seems weird to you, keep in mind that most of it is not actually defined in terms of text, but in terms of data structures
07:24shafireyeah, i like it, but it's complicated
07:25shafirebut i have the feeling, the code is shorter
07:25Chousukethe data structures have a literal textual representation, but the syntax of things like defn or defmacro or defprotocol is defined by the data structures, not the text.
07:25xkb:)
07:26shafire(* 99999999999999999999999999999999999999 99999999999999999999999999999)
07:26clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "99999999999999999999999999999999999999">
07:27xkb:P
07:27clgvperformance question: does an algorithm written with iterate have significant duration overhead compared to a loop-recur one?
07:27shafire(* 99999999999999999999999 999999999999999999999999)
07:27clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "99999999999999999999999">
07:27shafiremhm
07:27shafirehow long?
07:27Chousukefor example, in (defn foo [params] body) there's no "paren, defn, string, bracket..." but "list:defn-symbol, name-symbol, vector of symbols, body"
07:29Chousukethough I guess this is not so important in the beginning. I just think it's good to keep in mind if you think clojure has weird syntax.
07:29shafiredo you use intellij? good enough?
07:30shafirei like weird syntax :D
07:30xkbI use vim, but that's an exception in clojure-land
07:30xkbmost use emacs I think
07:30clgvI use eclipse which seem to be rare too ;)
07:30Chousukeemacs with paredit and slime is just too good with lisp :)
07:31xkbvim has something similar nowadays
07:31Chousukethough I suppose some of the IDEs have comparable features already.
07:31xkbthough the emacs version is far superior
07:31xkbhowever, my mind is wired in vim
07:31Chousukevim is not very suited to working with external programs :/
07:31clgv<joke>I already had an operating system installed - so why should I install emacs too? </joke> ;)
07:32Chousukeit's got a nice editing model IMO but the implementation is bad.
07:33Chousukeit's great as a simple editor but when you need to extend and integrate it with other tools it shows its weakness :/
07:34kilo_hi, newbie here, how do i invoke the clojurebot
07:34companion_cube,(+ 1 1)
07:34xkbuse , as prefix
07:34clojurebot2
07:34kilo_,(* 99999999999999999999999 999999999999999999999999)
07:34clojurebotjava.lang.ExceptionInInitializerError
07:34Chousukenumbers too large :P
07:34kilo_interesting. this works on my clojure box
07:34Fossikilo_: if you just want a quick repl you can also message it in private
07:34xkbwhat's up with the bignums
07:35Chousuke,(* 99999999999999999999M 99999999999999999999999M)
07:35clojurebot9999999999999999999899900000000000000000001M
07:35kilo_M !!
07:35Chousuke,*clojure-version*
07:35clojurebot{:major 1, :minor 2, :incremental 0, :qualifier ""}
07:35khaliGugh protocols are confusing, shall i persevere or just use interfaces for now :/
07:35clgvwhats up with sexpbot today?
07:35xkbpersevere I'd say
07:35kilo_Fossi, tx, already have clojure version, was showing off to a (C++) friend
07:36kilo_i meant clojurebox
07:36Fossikilo_: well, i meant people tend to use it in here after asking that question and we all get spammed to death ;)
07:36shafirewhy do you like clojure?
07:36kilo_I understand.
07:36Fossishafire: why wouldn't you?
07:36xkbelegant, terse syntax. no bloat
07:37khaliGxkb, ok i shall!
07:37Fossilisp + jvm + nice datastructures = win
07:37xkbkhaliG: good luck :)
07:37xkbhehe nice one
07:37clgv&(+ 1 2)
07:42shafireFossi: win win:)
07:43shafirejust one i don't like
07:43shafirenobody is commeting his code....
07:43shafirenobody has commented his code
07:43shafirehttps://github.com/richhickey/clojure-contrib/blob/master/clojurescript/src/clojure/contrib/clojurescript.clj
07:45clgvshafire: you are right. I hate the lack of commets, too. it makes a lot of things hard to understand
07:46xkbquite often in functional programming, functions are very short and therefore easy to understand without comments
07:47xkbbut I agree, in contrib it's very hard to understand sometimes
07:47clgvthen have a look in clojure core xkb - I pick a random definition and you explain it adhoc ;)
07:47xkbhehe hence the second sentence :)
07:48xkbcore and contrib are very hard to read sometimes indeed
07:48xkbesp. with nested let bindings and stuff
07:49clgvit took me a while to get the details of the "defn" definition in there ;)
07:50kilo_hey, what does .....
07:50kilo_,(doc defn)
07:50clojurebot"([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any do...
07:50kilo_not too readable.... hmm
07:51clgvkilo_: I didn't mean the doc. I meant the implementation of "defn" ;)
07:52xkbfor documentation you can also check http://clojuredocs.org/clojure_core/clojure.core/defn-
07:52shafirewhy are all clojure def so short? that is really amazing...
07:53khaliGshafire, compared to?
07:53kilo_clgv, true
07:53kilo_that was easier to understand
07:54shafirekhaliG: java
07:54Dranikjava is designed to be understendable for brain-damaged people
07:55kilo_sorry clgv, i misunderstand . when you said 'in there' .....
07:55clgvkilo_: np
07:55shafireDranik: you are so funny :D
07:56shafireand the clojure community is more active than the scala community
07:56khaliGshafire, i'm not sure.. i've got an almost complete program in about 500 lines of clojure and when i mocked it up in netbeans/matisse the generated code itself was about 1000 lines just for an older version
07:57shafiremh
07:57Fossiactually i like the code of core quite a bit
07:57Fossisometimes it's easier to just read the code than the random doc
07:57Fossiesp for things like defn
07:59clgvI think e.g. the defn code would be easier to understand if there were some comments explaining the sub steps ;)
08:07shafirecommenting clojure is a major step worth
08:10shafiresee you later
08:10shafirebye
08:14_fogusamalloy_: Ping
08:24semperos_fogus: pretty sure he's a west coaster
08:24_fogusIt was worth a shot.
08:24semperos:)
08:27cemerick_fogus: BTW, Ruby? :-O
08:27cemerick;-)
08:28_fogusOOP is the wave of the future!
08:29cemerickSo I've heard.
08:29cemerickBizarrely, I've been tinkering with perl lately.
08:29_fogusOrgiastic mutation FTW
08:29cemerickI guess that's more deserving of a :-O
08:29clgv_fogus: whats that supposed to mean?
08:30_fogusPerl6?
08:30_fogusclgv: What is what supposed to mean?
08:30clgv(14:19:54) _fogus: OOP is the wave of the future!
08:30cemerickHonestly, I'm not over the WTF stage enough to make any reasonable distinction between perl 5 or 6 yet.
08:32_fogusclgv: Haven't you heard the news? Object-oriented programming is the "way that the world works"
08:32cemerickclgv: I think writing a Clojure book makes one dread functional programming.
08:33clgvah ok. :P
08:33clgvis that book finished now?
08:33_fogusclgv: I'm just playing... but I'm also not hardlined against OOP
08:34cemerickclgv: the above has a huge ;-) of course
08:34clgvcemerick: yeah read it like that ;)
08:35fliebelcemerick: http://rubini.us/2011/02/25/why-use-rubinius/#wur-academic
08:35fliebel"Despite vast odds, somehow programs are written that actually run."
08:36_fogusfliebel: Nice quote
08:36cemerickEverything is always despite vast odds.
08:36cemericks/somehow.*/somehow we moved out of the caves
08:36cemericketc
08:37_fogusGetting out of bed this morning was pretty tough too
08:38cemerick"Oh shit, I need to screw with dates today. GD ISO 8601"
08:39_foguscemerick: I liked your tweet about the Scala levels.
08:39fliebel_fogus: Link?
08:39_fogusfliebel: To the original?
08:40fliebel_fogus: Noh, just curious what cemerick said.
08:40cemerick_fogus: It's bat-nuts crazy IMO. I have cynical theories as to why such a concept was surfaced.
08:40cemerickThankfully, I do keep my trap shut sometimes.
08:41_fogushttp://twitter.com/#!/cemerick/status/40416922378051584
08:41clgvif I have a transient vector can I still change position "i" or is the "only" effect that conj!-ing is much faster?
08:42_foguscemerick: That post is a perfect microcosm of the Scala community in general.
08:42cemerickclgv: nah, there's assoc! and dissoc! too
08:42clgvcemerick: thanks. thats what I wanted to hear ;)
08:42cemerickand pop! and disj!
08:43cemerickdisj! only for sets, of course
08:43fliebelAnd some more with some copy-pasting fom clojure.core :)
08:43fliebele.g. update-in!
08:44cemerick_fogus: I figured. Doesn't seem out of line with the crazy I was seeing before I left.
08:44cemerickEh, that's ungenerous of me.
08:45cemerickI suppose it works for some. Just not my cup of tea.
08:45_fogusScala's type system is so powerful that it also types the programmers themselves.
08:46fliebel_fogus: Nice one :)
08:46_fogusobject Fogus extends A3 with L1
08:46cemerickhah
08:47cemerickThe haskell and F# folk don't seem to have such artifice though. Perhaps it's the "java.next" sword that hangs over the scala community's head that prompts such things.
08:47_fogusScala's levels are too coarse... I can't properly mix them into myself!
08:48fliebelcemerick: Han, in Haskell, you'd just say Pepijn -> Pepijn and be done with it.
08:56_fogusdnolen: Can the same be said about any language?
08:57clgvif clojure had levels, the good thing would be that we could level up ;)
09:00lucianclgv: imagine: "you're typing away, you just wrote a highly-concurrent web-server using the STM and your text editor goes: "DING! LEVEL 4!""
09:01jkdufairI think I need a guide like that for life itself. i.e. A1: respiration, defecation, A2... Z999: zen master
09:01cemericklucian: now we just need unlockable achievements…
09:02cemerick…and that's when I become a carpenter.
09:02clgvlucian: hilarious thought :D
09:02fliebeldnolen: I gave up the number stuff for a while. I tried to reason about it for a while, change a few things, but no luck.
09:02octehehe, speaking of achievements and programming
09:02octehttp://blog.whiletrue.com/2011/01/what-if-visual-studio-had-achievements/
09:03jkdufairM-x swank-level-up
09:03fliebelocte, lik the new ms word, I read?
09:03octeocte, huh?
09:03lucianocte: that list's somewhat funny
09:03octefliebel, huh?*
09:04jkdufairocte: literally LOL
09:04_fogus"You must go to El Dorado and talk with Chouser before you can reach the next level"
09:04fliebelocte: I read ms is planning to add achievements to word as a sort of 'game' to learn Word.
09:04octeoh
09:04octehaha
09:04octethat'd be funny
09:06jkdufairI tried to use PLT Scheme for a project. Amongst other things, the levels made me a bit nuts.
09:07lucianfliebel: reading that rubinius thing, it confirms my suspicion that Ruby programmers don't really know other languages
09:08fliebellucian: How so?
09:08lucianthe article treats bad and good languages just as badly, likely just because they're not ruby
09:08lucianfliebel: there's a dig at python, even comparing it to PHP to some extent. that's just nasty
09:09lucianalso an "eww" directed at Groovy, which isn't really that bad
09:09cemerickNo one can ever claim that Groovy is elegant, but it sure can get a job done.
09:09cemerickreading that rubinius thing talking about "making ruby fast" reminds me of those hordes of really smart people working on making javascript fast, all due to one unfortunate historical accident
09:11_foguscemerick: Which event? It's release?
09:11luciancemerick: meh, ruby isn't nowhere near as crappy as js
09:11luciani see ruby as almost as nice as python
09:11hoeckcemerick: which event, the inclusion in every browser?
09:11fliebelcemerick: As they put it in this book I have here, Ruby is made for fast writing, not fast execution.
09:13cemerickThe accident being: the original 10-day spike, followed by its updake, distribution, and then shoehorning into a standard. Everything is predicated on that one break.
09:14TimMclucian: My first encounter with Groovy was Grails, where I stared at the scaffolding code for about 20 minutes before I understood that they were trying to make a DSL using catchall methods. Then I burned my computer and ran away screaming.
09:14cemericklucian: It's the "let's work on making language X fast" objective that made me think of the js connection, not anything related to the languages themselves.
09:15_fogusfliebel: I think that is perfectly valid in the abstract. I can't say that I find Ruby particularly speedy at composing, but that's probably just me
09:15cemerickIt seems like once you're contemplating writing yet another VM, something's gone haywire.
09:15luciancemerick: i see. well, i see it as a nice goal. languages shouldn't be designed first and foremost to be easy to write a fast implementation for
09:16octeThe Joy Of Clojure is interesting enough that i'd actually want a dead tree variant
09:16cemericklucian: oh, it's a fine goal. See, this is what happens when I expose my stream-of-consciousness. :-P
09:16octei've never actually wanted to read a programming book before
09:16luciancemerick: well, which vm to use? for many purposes the jvm isn unacceptable
09:17lucianand parrot isn't yet mature enough
09:17fliebellucian: Rubinus, PyPy, Parrot, etc...
09:17dnolen_fogus: Clojure has far more levels than JavaScript, IMO
09:17sachoI don't see why javascript is "horrible" and makes programs written in it "slow"
09:17cemericklucian: LLVM, parrot, mono
09:17luciancemerick: well, they're using llvm
09:17companion_cubewhat do you call "levels" ?
09:18TimMcsacho: JS is great, IMO.
09:18lucianmono has dubious licensing issues
09:18dnolenfliebel: where you unable to implement the number stuff from TRS at all?
09:18locksrubinius
09:18lucianfliebel: and PyPy is awesome, but it's still writing a new VM
09:18sachoTimMc: sure, minus a few backward-compatibility inherited bumps.
09:18lucianfliebel: and you're forgetting that Ruby people hate Python (even though Python people rather like Ruby)
09:18cemericklucian: all I know about it, I read on wikipedia :-P
09:18lockslucian: psh, those pesky whitespaces ;P
09:18sachoare people who use both python and ruby rythonists or pybyists?
09:19fliebeldnolen: I got the addition exactly as in the book and the minikanren source, but it has duplicated results.
09:19luciansacho: that's a dreadful name
09:19locksis there a red snake?
09:19sachowhy not. Rython, Python that compiles to ruby code!
09:19_fogusdnolen: I would agree with that. But there's more to js than meets the eye. I'm not sure many people understand that
09:19luciancemerick: i see. they don't use llvm that much because llvm sucks for anything but compiling static code
09:19dnolenfliebel: hmm, is your all your work pushed to your fork?
09:19luciansacho: there's unholy, which does the reverse
09:20cemerickpypy and parrot get a pass, since they were through the gate first. Seriously, if someone said they were starting a new VM project, they should get a lot of strange looks.
09:20fliebelsacho: There is a Python implementaion for Rubynus.
09:20locksI'm reading 'js the good parts' and falling in love with it :P
09:20luciancemerick: i mostly agree, but i think that in this case it's partly justified
09:21lucianlocks: try CoffeeScript and you'll love it even more :)
09:21fliebeldnolen: Yes, except that I flattened one all into the parent exist, which should not matter.
09:21lockslucian: it's because of CS that I wanted to learn JS properly ;)
09:21locksthe C-syntax really tricks you into thinking of js wrong
09:21luciancemerick: for the record, i'm a pypy user and i plan to implement python on parrot
09:21_fogusdnolen: Although I might say that Clojure's required knowledge is less transferrable from other languages. In order to get experience in the types of things that Clojure advocates you need to have exposed yourself to many different languages.
09:21dnolenfliebel: I'll check it out later today.
09:21_foguslucian: Until you need to debug i5t
09:22cemericklucian: yeah, the perceived value is directly corollated with one's interest in ruby :-)
09:22fliebeldnolen: Only thing I did not do yet is computing the result by hand.
09:22companion_cubejust, what do you call "levels" in the context of a language ?
09:22lucian_fogus: ?
09:23dnolencompanion_cube: reference to this, http://www.scala-lang.org/node/8610
09:23luciancemerick: they considered PyPy to be too python-y (stupid) and parrot immature (mostly correct)
09:23companion_cubeuh, ok
09:23companion_cubeand clojure has more levels?
09:24pyrclojure just made my day
09:24pyrhttps://gist.github.com/849172
09:24cemericklucian: I have irrational faith in the parrot folks.
09:24dnolencompanion_cube: ehhh, no, just that Clojure has many levels as well. Even more so for those unfamiliar with FP or Lisp.
09:24luciancemerick: they do have awesome goals, don't they? join i.p.o#parrot
09:24cemerickcompanion_cube: I don't think anyone is going to be so daft as to attempt to codify "levels" for Clojure.
09:25companion_cubeoh, yeah, i suppose it takes time to begin playing with some features like meta
09:25lucianthe levels thing is stupid
09:25octehas anyone noticed that require'ing swank.swank increases compilation time a lot?
09:25_fogusI think Tony Morris's response to the Scala levels was apt. Vintage Morris.
09:25lockslol @ levels
09:26locksmakes me think of maturity levels *shivers*
09:26cemericklocks: I don't think the vernacular was accidental.
09:26locks_fogus: link?
09:26Adamantcomplexity is hard, let's go shopping
09:26lockscomplex is better than complicated
09:27_foguslocks: http://blog.tmorris.net/critique-of-oderskys-scala-levels/
09:27locksthanks
09:27fliebelHm, dos Clojure have a PEP 20?
09:28cemerickfliebel: style guide, you mean?
09:28fliebelcemerick: 8 is style guide, 20 is zen.
09:28luciancemerick: that's PEP 8
09:28fliebel(locks quoted it)
09:29luciancemerick: try python -m "this"
09:30lockswhat's the rpoblem with it?
09:30_fogusWe had a "style guide" in JoC up until the final editing phase, but threw it out
09:31lockshaha
09:31fliebel_fogus: Why?
09:31_fogusfliebel: page count mostly, but also because it's really something that should be a living document rather than in a book
09:31lucianlocks: it boasts a lot of features that rubinius doesn't actually have (yet, anyway)
09:31_foguswe will probably put it up on the site one day
09:32fliebel_fogus: (is it done nearly? I've only got 1.7 programming books left)
09:32lockslucian: it's blogpost-driven development :)
09:33Fossiyeah, that's quite a great comment to the level thing
09:33fliebelMan, #clojure is full of good quotes today :)
09:33lucianlocks: not only that, but CRuby (or is it called MRI?) has those exact features
09:33_fogusfliebel: The delay of JoC is a very sore point for me... but yes, it's 1-2 days away from being sent to the printer.
09:34fliebelyay!
09:34TimMc_fogus: Congratulations!
09:35eckroth`_fogus: what delayed JoC? I too have been waiting a while but it didn't seem to me like it has been "delayed"
09:35_fogusIf I ever consider writing another book again someone PLEASE shoot me
09:35TimMcaw
09:35zoldar_fogus, will this release have some substantial differences in comparison to the "final" MEAP release?
09:35luciandnolen: heh
09:35Fossii guess you have to be an author to get why every author says that
09:36_foguszoldar: The final MEAP has yet to be released. But it will be mostly the same structure as the last MEAP update with less grammar errors and misspellings. :-O
09:36eckroth`Fossi: probably; maybe the authors always have personal deadlines that are not met; it's best we (not the authors of JoC) can just pleasently bide our time :)
09:37pjstadigJoC is stalled?
09:37pjstadig:-p
09:37lockslucian: I think it's MRI now, who cares as long as we understand each other :P
09:37_foguseckroth`: I'll tell you over a drink one day... not in a public forum. Sorry
09:38octeinteresting
09:38eckroth`_fogus: oh ok; thought it was just a silly thing like buggy copyediting software or whatever; no problem; glad it's soon on its way!
09:38octethe long compile times when requiring swank seems related to leiningen
09:38octetakes 1m6s to compile a hello world which requires swank with leiningen
09:38octeand 16s with cake, with no jvm running
09:39fliebelOkay, anyone in for spewing Clojure commandments?
09:39fliebel"Namespaces are one honking great idea -- Clojure does more of those" ;)
09:39_foguspjstadig: zing!
09:40pjstadigsorry...
09:40pjstadigi was totally joking
09:40fliebel"When faced with repetition, refuse the temptation to write a macro"
09:40Fossiyeah, c&p instead
09:40fliebel-.-
09:41Dranikfliebel, where did you read that?
09:41fliebelDranik: I'm making it up right now.
09:42fliebel"Functions are better than macroes" "Although macroes are better than mutability"
09:43fliebel"fliebel may not be obvious at first unless you're Dutch."
09:43Dranikfliebel, that one about macro was really confusing
09:43tscheibl,(let [x [:test]] (contains? x :test)
09:43clojurebotEOF while reading
09:43tscheibl,(let [x [:test]] (contains? x :test))
09:43clojurebotfalse
09:43tscheiblshoud that worry me?
09:43tscheibll
09:43clgv,(doc contains?)
09:43clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric k...
09:44fliebelDranik: It was. you have better suggestions?
09:44tscheibl,(let [x '(:test)] (contains? x :test))
09:44clojurebotfalse
09:44tscheiblsame
09:45Fossiit's fun to read
09:45TimMcIs there ever a case in Clojure where (identical? l (next (cons :foo l))) is false?
09:45_fogustscheibl: contains? looks for keys only. It's not a function to look up values in a sequence
09:45tscheibl_fogus: ahh ok..
09:45fliebeltscheibl: I think some does that.
09:45TimMcThat is, do the persistent data structures ever get swapped out for size-based optimization?
09:46clgv,(let [x [:test]] (contains? 0 :test))
09:46clojurebotfalse
09:46_fogus,(some #{:test} '(foo bar :test))
09:46clojurebot:test
09:46clgvups lol mixed it
09:46_fogus,(let [x [:test]] (contains? 0 x))
09:46clojurebotfalse
09:46clgv,(let [x [:test]] (contains? x 0))
09:46clojurebottrue
09:46_fogus(let [x [:test]] (contains? x 0))
09:47_fogusI'm too slow!
09:47clgvand doing the same mistakes ;)
09:47_fogus:-(
09:52clgvhmm I have a bad feeling with this: I have an algorithm that is creating vectors with double and then calculating partial sums. Now I got the idea that the it could be a significant overhead to create all these vectors all the time in comparison to simply create one double array at the begin of the algorithm and reuse it every time. is that worth a shot or simply a bad idea?
09:53raek,(let [x #{:test}] (contains? x :test))
09:53clojurebottrue
09:53clgvthese vectors with doubles are really one main part of the algorithm - approx. half of the time is spent there
09:54dnolenclgv: yeah doesn't sound like you should be using vectors here.
09:55clgvdnolen: so the reused double-array would be the way to go?
09:55raekclgv: do you need to pour the data into vectors, or could you manage with using lazy sequences directly?
09:55dnolenclgv: if performance is the most important thing yes.
09:57clgvraek: I need could exchange the vectors with a sequence but I guess the question woul remain the same
09:57raekfor example, in (reductions f (vec (map g some-coll))), the vec is superflous
09:57raek...but this might not be the issue here
09:57clgvraek: it's a probability distribution that is calculated and then I draw a single element from it
09:58dnoleneven so w/ vector or sequences you face the overhead of boxing, unboxing numbers.
09:58raekso you need to do look-up with an index?
10:01clgvraek: its concept is: (1) calculate probability for each element (2) calculate commulative distribution function (partial sums) (3) draw random value (4) get element related to random value
10:06TimMcAh, so you don't know which element you'll be using ahead of time.
10:07TimMcUnless... could you pick the random value ahead of time and only do the calculations necessary for that value?
10:07TobiasRaederanyone knows an easy way to launch something (ie shellscript) and then pipe all output to stdout?
10:07clgvTimMc: yes, I don't know which element it'll be. I want to pick it at random with a certain probability distribution
10:08TimMcclgv: Is "draw random value" a random index into the vector or a random value *from* the vector?
10:09octeany opinions on berkeley db? (for java)
10:09TimMc_fogus: Like iterate?
10:09clgvTimMc: when I calculate the partial-sums the last one is total-sum. then I do (rand total-sum)
10:10_fogusTimMc: kinda yes
10:10TimMcWith take?
10:11TimMcclgv: I'm not sure I understnd the partial-sums stuff, unfortunately.
10:12_fogusTimMc: But I need the last n results to calculate the next value
10:12TimMc_fogus: Oh! Interesting.
10:13_fogusI'm sure someone has written it before.
10:14TimMcWhat's the use case?
10:14clgvTimMc: concept: (let [probs (map calc-probability element-list), partial-sums (reductions + 0.0 probs), rnd (rand (last partial-sums))] (select-element-index partial-sums rnd)
10:14clgvthats the idea
10:15_fogusTimMc: Curve fitting
10:15TimMc_fogus: hmmok
10:16_fogus,(doc hmmok)
10:16clojurebotGabh mo leithscéal?
10:16_fogus:p
10:18TimMcclgv: select-element-index grabs an element from the partial sums of the probabilities based on rnd?
10:18TimMcOr does it give you the index?
10:18TimMcIt reminds of wrand.
10:19clgvonly an index
10:19clgvwhats wrand?
10:19clgv,(doc wrand)
10:19clojurebotExcuse me?
10:19TimMcwhere did I see this...
10:20TimMcpffft, never mind
10:20TimMcIt's something defined in ants.clj.
10:20clgvyeah thats what google said too ;)
10:21TimMcIs that basically what you are doing with the probs, though?
10:22clgvseems so at first glance. it looks similar to my first approach
10:23clgvI am trying the double array approach now.
10:26clgvit's just getting pretty ugly in comparison to the first elegant version
10:27TimMcclgv: Benchmark the two. Is the ugliness worth the gains?
10:27clgvI'll do
10:28clgvI am encapsulating it in a deftype
10:28clgvso it's hidden from the main algorithm
10:30dnolenclgv: are you using amap/areduce?
10:32clgvdnolen: no. loop-recur right now
10:40clgvwith the new handling of java primitives in 1.3 will a transient vector of doubles be almost equivalent to a double array in terms of performance?
10:45dnolenclgv: no
10:45dnolenclgv: from what I understand transient gvecs are going to happen until after Pods.
10:46dnolens/are/aren't
10:46jcromartiedoes it make sense to have a "lazy set"
10:46jcromartie?
10:46jcromartieI guess not
10:47clgvdnolen: what is "Pods"? sexpbot seems to be on holidays...
10:48dnolenclgv: rhickey's new reference type for dealing POJOs as well as unsafe mutable code w/o having to manually deal with locks.
10:49jcromartiePods ~ Beans?
10:49dnolenclgv: ultimately, map + gvec of prims should be as fast amap/areduce. transients will become implementation detail.
10:49clgvdnolen: ok. I hope there is going to be a lot of docu on new features when 1.3 is released
10:51clgvah gvec = generic vector
10:51dnolenclgv: none of what I described is slated for 1.3 as far I know.
10:52clgvdnolen: oh ok. so it's "planned" for later?
10:53dnolenclgv: something like that.
10:55ttmrichterWhat's the current best package for "install and have a REPL" to introduce a new Clojure user to the technology?
10:56TimMcttmrichter: leiningen is a build tool, but I think it's a pretty fast way to get a REPL
10:57ttmrichterI'm targetting a Windows user here: someone who's going to want an installer and a clicky-icon.
10:57TimMcheh
10:58TimMcAre you sure you want someone writing programs who can't handle running a self-install script? :-P
11:00zoldarttmrichter, http://www.try-clojure.org/ could be of some use to some extent
11:00zoldarfor the basics at least
11:02ttmrichterIs "Clojure Box" any good?
11:02ttmrichterIt seems to fit the bill here.
11:03ttmrichterHmmm... The Emacs thing might be a tough sell.
11:10clgvttmrichter: you might try eclipse counterclockwise
11:11ttmrichterI was just about to ask about Counterclockwise and Enclojure.
11:11clgvttmrichter: if you have eclipse setup you just need to add the update site and install CCW and then create a clojure project
11:11ttmrichterI'm not sure if my target uses Eclipse or Netbeans (probably Eclipse).
11:12ttmrichterAre these plugins any good?
11:12ttmrichterAs in do they provide a REPL, build suites, etc.?
11:13jkdufairI have to say, Clojure Box is very very nice
11:13jkdufairworks out of the... well, box
11:13clgvCCW has a repl. but the one in the stable version feels a bit odd when using ;)
11:13jkdufairEmacs is not hard to learn
11:14jkdufairAnd Emacs can be pretty clicky and guified these days if that's what they prefer
11:14ttmrichterjkdufair: Given that I can't stand emacs myself, I rather doubt I'm in a position to tell someone else to use it.
11:15jkdufairAlas
11:17jkdufairThat's exactly how I work in Emacs
11:17ttmrichterWhen I say "window" I mean "a window with a shell".
11:17ttmrichterNot a window plied to the gills with bucky-bits and wrist-torture. ;)
11:18jkdufairM-x shell
11:18jkdufairthere's a window with a shell :-)
11:18ttmrichterAnd the window with the ABE editor?
11:18ttmrichter(ABE stands for "Anything But EMACS".:)
11:18jkdufairOh. I don't have that.
11:19ttmrichterI do. It's called xterm (or something equivalent like gnome_terminal or the like). :D
11:19jkdufairparedit mode is the real juice. it lets the developer THINK in s-expressions and not in text
11:21jkdufairmy brain is too small to think at a character level
11:22ChousukeI don't think I think in either characters or s-exprs, but since you're manipulating s-expressions anyway there's no reason not to use something like paredit
11:23jkdufairYeah, I don't suppose I think in s-exprs, per se, but I think about manipulating them
11:35TimMcttmrichter: I finally went over to the dark side and learned Emacs: http://www.brainonfire.net/blog/emacs-n00b-start/
11:35zoldarI'm a vim user who recently switched to emacs - with viper-mode it's really fine experience
11:36zoldarthe only pain I have recently, is working with mixed html/js content - this one really sucks :(
11:37zoldarthere's nxhtml for emacs but it doesn't play too well with newer versions
11:38TimMczoldar: I try to avoid embedding CSS and JS in HTML beyond trivialities; remembering to escape < and > as SGML hurts my brain.
11:39zoldarTimMc, I also try to reduce it to the minimum, but even then, it's a bit of a bumpy ride
11:40ttmrichterTimMc: I've learnt emacs. I just don't like it. :)
11:40TimMcheh
11:40TimMcIt took me three tries over the course of 2 years.
11:41TimMcParedit mode is fantastic, and that's the only reason I use the thing.
11:41TimMcNothing else compares in that regard.
11:42clgvso well I have the changed version running now and it's actually a bit slower... :(
11:42clgvno reflection-warnings though
11:42TimMcclgv: >_<
11:43clgvyeah well, the question is only: can I improve it or do I just delete that branch and go on somewhere else ;)
11:46clgvthe strange thing is that most of the time is spent in calculating the single probabilities which was done almost the same before.
11:53hv,(let [c Integer] (class c "10"))
11:53clojurebotjava.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$class
11:53hvoops
11:53hv,(let [c Integer] (new c "10"))
11:53clojurebotjava.lang.IllegalArgumentException: Unable to resolve classname: c
11:55TimMcYeah, classes aren't exactly first-class. :-/
11:55zoldar,(let [c Integer] (clojure.lang.Reflector/invokeConstructor c (object-array [4])))
11:55clojurebot4
11:56raekthere are class objects (as c above), but new is a special form and does not evaluate its first argument
11:56TimMcWhy would it not?
11:57raekthe compiler wants to decide which constructor to use at compile time
11:58raekthe byte code for instantiating a class is just an instruction or two
11:59hvraek: in my situation I need to decide at runtime, so is there another fn or macro that helps here?
12:00zoldarhv: you can use reflection, but bear in mind that it can be a significant performance hit
12:00raekhv: if you need it at run time, reflection is a good option (and the Reflector class presents a fairly simple API to do it)
12:01raekhv: in some cases, you can solve the problem with macros
12:02raek(assuming that you can make the decision at macro expand time)
12:03hvzoldar, raek: thanks, I guess I go with invokeConstructor.
12:04TimMc,(new Integer (identity "15"))
12:04clojurebot15
12:05TimMcraek: In the above example, I'm sure the compiler did not know what constructor to use statically.
12:06raekIIRC, the compiler emits code that uses reflection when the class is known, but the exact constructor is not
12:06hvPerhaps there is a reflective-new somewhere? like: (defn reflective-new [c & args] (clojure.lang.Reflector/invokeConstructor c (object-array args)))
12:07TimMcAh, OK.
12:07raekhv: where from do you get the class?
12:07zoldarhv: there's none (in 1.2 at least) - I have this very function in my personal toolbox
12:08hvzoldar: hmm, what do you call it?
12:08zoldarmake-instance
12:10zoldarhv: however, if you gave more context about what you want to do, folks here could suggest some better solution
12:11raekhv: sometimes you can get away with something like (defmacro instantiate-class-by-name [name & args] (let [c (name->class c)] `(new ~c ~@args)))
12:11raekin case you know the class, but have the name in some other form
12:12zoldarreak, are you sure that this macro will work?
12:12zoldarraek, argh, sorry
12:12hvraek: what is name->class
12:12hv,name->class
12:12clojurebotjava.lang.Exception: Unable to resolve symbol: name->class in this context
12:13raeklets assume that you have the class name in string form, then name->class would be the clojure function 'symbol'
12:13amalloyi find myself using (juxt identity more-functions) a lot. i want to write myself a little function wrapping that up, but i can't decide if it should be like (def annotate (partial juxt identity)) or (defn decorate [obj & fns] ((apply juxt identity fns) obj))
12:14amalloyie, both names make sense, and it could plausibly either return a function or immediately apply itself to a value
12:14raekhv: the point is, as long as you can make some clojure code that can construct the class name as a symbol, and then invoke that code in the macro, you can do all this at compile time
12:15hvraek: thanks, I have to think about it. Right now I am not sure if I can know the class name at compile time.
12:16raekthe exreme case of runtime would be if the class name is something that the user enters into a dialog box in the middle of program execution
12:17raekin that case you would need reflection
12:17raekin a case where you want to read the class name from a file at application start up, you can use macros
12:18raekso maybe "startup time" and "in-the-middle-of-execution-time" would be better terms :-)
12:18hvraek: I see, thanks.
12:19amalloyraek: it sounds pretty hard to read at startup time if the user is using an aot jar file though, right?
12:20raekhrm. good point.
12:21amalloybut if they have an actual clojure compiler, then yes, it can be pretty cool to have the compile cycle involve reading config from disk :)
12:26TimMcamalloy: That's almost as good as popping up a modal dialog from the macro to ask the user!
12:26TimMcSomeday I will hold a Macro Abuse Competition.
12:28amalloyTimMc: you will have to work pretty hard to beat even the iocc, and they barely have macros available
12:29TimMcI'm not restricting the concept to obfuscation.
12:34Adamantput fear in the hearts of the unbelievers
12:35Adamant(I joke, of course)
12:38BennylHi I am trying to debug some code that I am writing I use swank with debug enabled and I can di breakpoint but cannot step into/ out etc, can it be done?
12:41@rhickeythe latest push makes it so that fns only get code to support metadata if they have metadata when defined
12:41@rhickeymetadata support was a significant part of the code for small fns, and rarely used
12:43fliebelrhickey: Does this mean one cannot attach metadata to a fn later?
12:43amalloyfliebel: you already can't, because fns are immutable, right?
12:44@rhickeyfliebel: right, not unless it has metadata when defined
12:44@rhickeyamalloy: I presume he meant with-meta semantics
12:44fliebelright
12:44TimMcIs it a memory consideration?
12:45amalloyhm. so (with-meta (fn [] 10) {::whatever "value"}) won't be legal either?
12:46TimMcOr (defn annotate [f] (with-meta f {...}))
12:46fliebelIMO, unless there is a huge gain, I don't think it outweighs the inconsistency and possible troubles in existing code.
12:47@rhickeyLISP programmers know the value of everything and the cost of nothing. - Alan Perlis
12:48amalloyactually the only time i've put meta on functions i did it with (with-meta (memoize (fn [x] ...)) {:key value})
12:48amalloyand it sounds like i won't be able to do this anymore?
12:49@rhickeyTimMc: memory, time spent in validation
12:49TimMcah
12:50@rhickeybut one could easily make a fn wrapper that had metadata and forwarded to a wrapped fn
12:51fliebelrhickey: Is there any way to get etadata on an existing function now, except for wraping it in another function? ah, you're faster.
12:51amalloyrhickey: oh, like (defn {} meta-able [f] (fn [& args] (apply f args)))?
12:51@rhickeyuser=> (meta ^{::whatever "value"} (fn [] 10))
12:51@rhickey{:user/whatever "value"}
12:52@rhickeyjust put the metadata on the fn form
12:52amalloyi see
12:52amalloyi confess i'm not very comfortable with the ^ reader macro
12:53amalloyas in, unfamiliar, not "it disturbs me"
12:54TimMcWhat's this double-colon nonsense?
12:54drewr,[:foo ::foo]
12:54clojurebot[:foo :sandbox/foo]
12:54drewrTimMc: ^^ 'sandbox is *ns*
12:55TimMcNamespaced keywords? Or just a way to get keywords that start with *ns*/ ?
12:55fliebelrhickey: Maybe a bad idea, don't know, but would it work to make with-meta wrap the function itself? (defn with-meta [bla bla] (fn? bla (fn [] (apply ^meta bla bla)))
12:57TobiasRaederanyone here tried using lancet to integrate external ant tasks into leiningen?
12:57@rhickeyfliebel: that might be possible
12:58@rhickeyat some cost in perf vs direct support
12:58@rhickeydirect support is still provided if you have metadata at definition
12:59technomancyTobiasRaeder: yeah, the lein-tar plugin does that
13:02TobiasRaeder@technomanct alright, thanks a ton i will look into it :)
13:04TimMcholy crap I *just* got the joke behind Leiningen's name
13:04TimMcI am an idiot.
13:09_fogusTimMc: The later. ::foo ---> :my-cool-ns/foo, but nothing prevents you from just doing :my-cool-ns/foo at any time
13:09TimMcInteresting.
13:12@rhickeyfliebel: ok - https://github.com/clojure/clojure/commit/2b16fee78a0517bc83dd5735ab01d3d5813b1f72
13:14@rhickeyso, now the change is just an efficiency difference, not (much) of a capability difference
13:15TimMc"Keywords are like symbols, except [... t]hey cannot contain '.' or name classes."
13:15amalloy$source vary-meta
13:15sexpbotvary-meta is http://is.gd/50kMdS
13:15@rhickeyactually no capability difference, the wrapper can't do arity chewcking but the wrappee will
13:15TimMcHow does ##:Integer not name a class?
13:16TimMc,:Integer ; rather
13:16clojurebot:Integer
13:16amalloyTimMc: the same way that "Integer" doesn't name a class: only ##(Class/forName "Integer") does
13:16sexpbotjava.lang.ClassNotFoundException: Integer
13:17amalloyrhickey: so (meta (fn [])) will return {}, right?
13:18@rhickeyamalloy: nil
13:18amalloyrhickey: then vary-meta needs updating
13:18amalloydoesn't it?
13:18TimMcamalloy: That seems vacuously true; keywords aren't classes therefore they can't name them. Or do I not understand the word "name" here?
13:19amalloyTimMc: i tend to agree; perhaps what is meant is that keywords can't be interned in your namespace to resolve to classnames
13:19@rhickeyamalloy: no
13:20TimMcamalloy: In short, keywords only evaluate to themselves?
13:20dnmDoes dmiller hang out here?
13:21@rhickeyamalloy:
13:21@rhickeyuser=> (meta (vary-meta (fn []) assoc :a 1))
13:21@rhickey{:a 1}
13:21ahihiis there a strict variant of map that doesn't collect results? (for side effects)
13:21amalloyrhickey: ##(vary-meta (fn[]) conj [:a 1])
13:21sexpbotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IPersistentMap
13:21amalloyhrm
13:22amalloyahihi: check out dorun and/or doseq
13:22@rhickeyamalloy: expecting conj to work on something that might not have metadata is broken
13:22amalloyokay
13:22LauJensen_Morning :)
13:23ahihiwell, I guess I'm just looking for a predefined name for (comp dorun map) :)
13:23amalloyi assumed it was working before and broken after, but if it's broken before i don't mind - it is a bad idea, as you say
13:23ahihidoseq's for-style syntax seems a bit verbose since you have to introduce a variable
13:23amalloyahihi: depends what you're using it for
13:24amalloyif you don't *really* have to use map in the first place, then dorun/map is more verbose than doseq
13:24ahihibasically just (dorun (map f xs))
13:24amalloyahihi: sure, if f already exists
13:24ahihiit does
13:25amalloybut compare (dorun (map #(do stuff to %) args)) to (doseq [a args] (do stuff to a))
13:25ahihisorry, the verbosity remark was only about this case, not in general
13:25amalloyanyway whatever, use whichever makes more sense
13:25amalloyyeah, i'm sorta defending doseq for no particular reason
13:26ahihi:)
13:26ahihiwell, thanks for the pointers
13:27amalloyahihi: no problem. here's another: 0x4ba330f8
13:28chouserrhickey: I'm curious what prompted the fn metadata change.
13:29@rhickeychouser: I built just the Java bits of Clojure the other day, by hand, with javac - 5 secs, 500k, made me sad
13:29@rhickey:)
13:30drewrcinc is nigh?
13:30@rhickeychouser: but given the latest changes the ony change is less waste compiling, loading, verifying code for metadata support that no one will use
13:30@rhickeychouser: i.e. with wrapper gen, no loss of metadata for fns
13:30@rhickeyjust no per-fn code to support it
13:33@rhickeychouser: in general I was looking for ways to slim donw CLojure and improve startup time, as more people look to use it as a library, on Android etc
13:34@rhickeywe need a way to strip out all the interactive stuff when delivering as a runtime library
13:36fliebelrhickey: Great, so you implemented my auto-wrapper idea?
13:36@rhickeyyup, done
13:36cemerickrhickey: which is more common than not outside of "real" development -- updating a production webapp and such via a REPL is cute, but impractical most of the time.
13:37@rhickeycemerick: well, not so much losing the repl as losing, e.g. doc and arglist metadata, but yeah, could strip compiler and ASM too
13:38@rhickeyI implemented lazy fn loading, helps with startup time somewhat
13:38@rhickeybut no big wins anywhere - we suffer from class-per-fn and verification of same
13:39fliebelrhickey: Wait, aren't functions defined with meta already? user=> (meta (defn a [] 3))
13:39fliebel{:ns #<Namespace user>, :name a, :file "NO_SOURCE_PATH", :line 3, :arglists ([])}
13:39amalloyfliebel: ##(meta (fn[]))
13:39sexpbot⟹ nil
13:40@rhickeyfliebel: that's the metadata of the var
13:40fliebelAh, of course....
13:42ataggartRegarding android space/time trade-off, the switch bytecode emitted from case can currently have up to 8k entries since it always uses table instead of lookup. Might not be significant.
13:45@rhickeyataggart: thanks for that patch! I hope to get some time to look at it soon
13:46ataggartrhickey: the code is much longer than I anticipated when first embarking on it.
13:46__name__is the clojure book from pragmatic programmers still valuable for 1.2?
13:49ataggartrhickey: have you had a chance to look at the compiler/reflector patch on CLJ-445?
13:50technomancy__name__: sure
13:51__name__Is it any good? The example chapters were a bit short to judge, but I liked what I saw
13:52khaliG is putting a form at the top level of a clj file a good way to ensure it's evaluated, and only once?
13:52technomancy__name__: I liked it a lot. it's short, but to the point.
13:54khaliGor shall i use an init atom?
13:55amalloykhaliG: that ensures it's evaluated exactly once, but you may want to be careful if you ever AOT-compile
13:55amalloybecause it will be evaluated at compile time as well as runtime
13:55khaliGooh, i see. ok thanks.
13:56amalloy(disclaimer: the above is probably an unintentional oversimplification but it's been correct enough for me in the past)
13:57khaliGwell tell me if there is a better way to do this.. but hte first time i call get-registry, it should open up a file and read some data into a map. Subsequent calls to get-registry ought to return that map.
13:58amalloykhaliG: memoize
13:58khaliGamalloy, sounds good!
13:58amalloy(def get-registry (memoize (fn [] (do expensive stuff))))
14:15konrIs there a doseq-like function that collects the results of every interaction?
14:16TimMckonr: You can force a for.
14:17TimMc(dorun (map ...)) or (dorun (for ...))
14:17konroh, I got it! Thanks, TimMc
14:17TimMckonr: Wait!
14:17amalloyTimMc: that doesn't collect the results
14:17TimMcyeah
14:17amalloydoall
14:17TimMcThat's the one.
14:18TimMckonr: http://clojuredocs.org/clojure_core/clojure.core/doall <-- good site for finding related functions
14:18amalloy$findfn [1 2 3 4] [1 2 3 4]
14:18sexpbot[clojure.set/union clojure.set/intersection clojure.set/difference clojure.core/list* clojure.core/time clojure.core/dosync clojure.core/distinct clojure.core/lazy-cat clojure.core/sequence clojure.core/with-loading-context clojure.core/vec clojure.core/concat clojur... http://gist.github.com/849677
14:18amalloyhm. not as useful as i'd hoped
14:18amalloybut doall is in there!
14:25redingerClojure Conj 2011 information has been posted: http://clojure-conj.org
14:27swartso I've more or less got my clojure/emacs env set up (modulo firewall issues), but now I'm a bit confused about the dev process itself
14:28swartI have a repl, I have a buffer with a file in it, and I have various packages I can manage with lein. but how do I load packages into the repl and interactively update my code based on changes I make there?
14:29amalloyswart: do you have a swank server running?
14:29swartyes
14:29amalloyC-c C-k will feed the contents of the current buffer to the repl
14:29swartah ok
14:30swartI saw C-c C-k and I confused it with C-c C-j to compile the buffer
14:30amalloysee also the many handy things under the SLIME toolbar like C-c C-d C-d to see docstring for var at point
14:31swartok. I'm running emacs -nw due to the firewall problems but I think I'll have a look
14:31swart clearly I need to read more docs :)
14:32amalloyswart: ah. there's a way to get at the toolbar in -nw, and while overall i approve of -nw i don't use it that often in practice
14:33swartM-` does the trick
14:33amalloysweet
14:33lpetitrhickey: hello. can you explain more what is behind "lazy fn loading" ? Does it mean that not all fn code will be JIT compiled and/or loaded in memory until it is first evaluated (in a callable or argument position) ?
14:33amalloylpetit: he left
14:33lpetitamalloy: oh ok, thx
14:33lpetitamalloy: do you understand what's behind "lazy fn loading" ?
14:34amalloyyour guess is about the same as my guess was
14:34hiredmanlpetit: my guess is a change to how the code for namespaces is generated
14:34lpetitCurrently if there's an area where we pay for what we don't necessarily use, it's the fact that by means of transitive deps, all code of all fns constituting one's application is loaded on startup time.
14:35lpetithiredman: hmm, is your guess even more precise than that ?
14:36hiredmandefns maybe hold a reference to a instance of FnThunkLoader instead of the instance of the function
14:36lpetite.g. : unless the Android underlying framework uses lazy loading heavily itself and an Android app benefits from it out of the box (presumably via wrapper java classes), then if the android app has 20 screens, and the user only uses one, chances are the code for the 20 screens is loaded on startup, everytime
14:37hiredmanFnThunkLoader loads the fn it puts to via something like Class/forName and caches it
14:37hiredmanpoints
14:37amalloyhiredman: both devious and useful
14:37hiredmanlpetit: *shrug* until android gets a real gc, I doubt it is viable anyway
14:38hiredmanthat is a guess, I just scanned the diff
14:38lpetithiredman: of course, I know you can generalize from my example. Same problem for ccw with OSGi, for example.
14:39lpetithiredman: the latest version of Android still not ok wrt to this problem?
14:39hiredmanlpetit: don't follow it too closely, but I don't imagine it is a priority for google
14:41lpetithiredman: granted
14:41hiredmanoh, and then fnthunkloader sets the value of the var root to the instance of the class
14:44lpetitso, somehow, requiring a namespace would now just create vars full of "lazy thunks" of fn ready to load (compile?) bytecode (from disk) ?
14:47_fogus-awayWhoa! http://clojure-conj.org
14:48konrWhat's the clojuresque way of dealing with queues, dequeuing and multiple threads? (dosync (let [new @foo] (alter foo rest) (first new)))?
14:50brehautkonr: if you want a queue then clojure.lang.PersistentQueue might be what you are after
14:54hiredmanpq doesn't block
14:55ataggartcemerick: http://dev.clojure.org/jira/browse/CLJ-426
14:58brehauthiredman: would the java.util.concurrent.BlockingQueue be a better choice then?
14:59hiredmandepends if you want to block (I almost always do)
14:59brehauthiredman: i have no idea on his usecase
14:59ataggarthow about seque?
15:00Dranikis anyone from Belarus here?
15:04OlegYchme
15:06cemerickataggart: looks like a sizable job :-)
15:07ataggartit was, but the performance gains were worth it.
15:07ataggartplus being able to use enums will be nice
15:08ataggartI found your blog post when I was embarking on it. your and cgrand's comments pointed me in the right direction.
15:09cemerickataggart: looks like you're evaluating e.g. static fields and such?
15:10cemericker, maybe not
15:10ataggartevaling the symbol ns to see if it's an enum class
15:10ataggartthen evaling the whole thing to see if it's also the same enum class
15:10ataggartI wanted to avoid inadvertently screwing something up, hence the ns eval first
15:11cemericksure
15:11cemerickataggart: did you take a shot at static final fields, or is that out of scope?
15:12ataggartah, no I had forgotten. It should be perfectly doable so long as the values are themselves consistently hashed.
15:12ataggartI'll get on it now.
15:13cemerickataggart: I suppose requiring the fields to be final is a little too persnickety.
15:13ataggartI can reflectively find out
15:13ataggartthough it would be eaiser if the clojure.reflect ns was available
15:13ataggartinstead, I can probably just make calls to clojure.lang.Reflector
15:13ataggart(the new one)
15:14cemerickTrue, but that restriction will cause frustration; a lot of Java constants are declared static, but not final.
15:14ataggartnot much of a constant then
15:14ataggartexamples?
15:14clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
15:16cemerickataggart: perhaps "a lot" was an exaggeration ;-)
15:17ataggartcemerick: there is the concern that someone will want to switch on the actual symbols.
15:19ataggarta usecase that might occur when writing macros conditionally calling java fields/methods
15:20cemerickataggart: Sneaky. I'd say 'Absurd/Coincidence would be reasonable in such cases.
15:20cdddr$findfn [1 nil 2 3 nil] [1 2 3]
15:20sexpbot[]
15:21amalloy&(keep identity [1 nil 2 3 nil])
15:21sexpbot⟹ (1 2 3)
15:22cdddrI was thinking (remove nil? [list]) :)
15:22cdddrMore explicit.
15:23amalloycdddr: meh. are you producing this seq from a (map)?
15:24cdddrYes. I keep thinking there was probably a better way.
15:24amalloy&(keep :initials [{:name "amalloy" :initials "akm"} {:name "cdddr" :interests "caaadr"}])
15:24sexpbot⟹ ("akm")
15:25ataggartcemerick: The current doc for case notes that nothing need be quoted, so there's a backwards compatability issue with requiring symbols-as-symbols to be quoted. Of course that's also the case with the new enum functionality. Hmm...
15:25amalloyie, keep folds together the map and the remove
15:25cdddrAaaah.
15:26cdddrYeah, this is definitely better.
15:26__name__$source keep
15:26sexpbotkeep is http://is.gd/2Dlrr4
15:27cemerickataggart: Once things get resolved, symbols become second-class. I think that's a reasonable tradeoff, given the prevalence of enums, static fields, etc.
15:27__name__this code is scary :(
15:27cemerickataggart: If "constant" vars are in play as well, then that's doubly true IMO.
15:28ataggartcemerick: fair point.
15:29amalloy__name__: clojure.core is optimized for speed rather than legibility
15:29amalloyif you were writing keep yourself, you would do like (defn keep [f coll] (remove nil? (map f coll))) and that would be it
15:30__name__$source remove
15:30sexpbotremove is http://is.gd/ttw47S
15:30amalloyor if brehaut had his way, (def keep (comp (partial remove nil?) map))
15:30ataggartcemerick: so strings, numbers, quoted symbols, evaluated constants, enums, and clojure collections of the foregoing.
15:30__name__:)
15:30brehautamalloy: when did i become the champion of point free :P
15:31amalloybrehaut: i just like to blame my crazy ideas on the haskell community
15:31brehauthaha
15:31__name__amalloy: the standard functions just keep scaring me
15:31amalloynobody ever wants to stand up for them
15:31brehautamalloy i think the haskell community would be offended if they thought i was a spokesperson for them here :P
15:31amalloyheh
15:32cemerickataggart: seems entirely reasonable to me. "Constant" is a fungible term, of course. "Values as evaluated at compilation time" perhaps.
15:33amalloy__name__: try implementing them yourself from reading the docstrings. it will probably be more enlightening than trying to follow the source
15:33ataggartcemerick: agreed, though it should probably go in as a separate enhancement. There's enough shoved into that ticket already.
15:35ataggartcemerick: In any case, I'll get started on a separate patch with those changes, and see what Rich, et al. have to say.
15:35cemerickataggart: Sounds good, let me know if you need help (FWIW). Thanks for taking that on. :-)
15:36ataggartcemerick: heh, np. Gave me a chance to delve into jvm bytecode.
15:40DespiteWhat is the definition of "point" in "pointfree"?
15:41amalloyDespite: i think the rough answer is "named bindings"
15:41Despitegreat, thanks
15:41brehautDespite, amalloy: short hand for http://en.wikipedia.org/wiki/Least_fixed_point i think
15:42kencauseyhttp://www.haskell.org/haskellwiki/Pointfree See point 1
15:45brehautkencausey: hah jeremy gibbons (mentioned in 2) is completely insane with the point free :)
15:46Despitei like that style
15:46DespiteI wonder how far you can take it
15:46brehautDespite: you can write entire programs without mentioning the arguments to anything with the right operators
15:47TimMcJust like you can write entire programs with only lambdas.
15:48shachafDespite: http://en.wikipedia.org/wiki/SKI_combinator_calculus
15:50amalloyyeah, you can take it arbitrarily far
15:50brehautits better as a sometimes thing though
15:51_fogushttps://github.com/fogus/skiing
15:51brehautin particular, if naming the variables would add clarity, then you should. if the function is general enough that the name is completely laking information then point free can be a win
15:53DespiteHrmm, guess i need to read a book. I get lost when combinators come up.
15:55brehautDespite: start experimenting in a repl
15:56shachafDespite: When combinators come up? But those are the simplest types of functions! :-)
15:57shachafA Factor programmer I know has said that pseudo-"point-free style" can be carried much farther in Factor without losing clarity.
15:59brehautshachaf: father than in what?
15:59shachafbrehaut: Haskell in that context.
15:59brehautthats quite an astounding statement
15:59shachafbrehaut: Why?
16:00brehautbecause haskell is extremely good at point free
16:00shachafThe normal way of expressing things in a concatenative language is in terms of stack manipulation, with no names unless you explicitly want them.
16:06_fogusbrehaut: This series of posts was an outstanding look into that approach http://www.codecommit.com/blog/cat/the-joy-of-concatenative-languages-part-2
16:06brehaut_fogus: cheers
16:08TobiasRaeder@technomancy i checked out lein-tar but i guess i didn't make myself too awefully clear :/
16:08TobiasRaeder@technomany what i was really for was integrating some "ant-macro" (not sure about the term)
16:09TobiasRaeder@technomancy it's supposed to be imported via import task but i wasn't straight away to get the import task to work with lancet
16:10dnolenhow do stack-oriented PLs deal w/ concurrency?
16:13shachafdnolen: What does that mean?
16:14shachafdnolen: How does any language deal with concurrency?
16:17dnolenshachaf: thread, green threads, locks, data structures, STM, thread pools, co-routines, explicit/implicit data parallelism, etc. does the stack oriented paradigm make these more tedious? I see these kinds of things addressed in FP literature, but I haven't seen anything like that for stack-oriented PLs. Just curious.
16:19shachafdnolen: I don't think it's really a property of the fact that a language is a stack language.
16:21dnolenshachaf: not saying that, just curious about the lack of literature, or existence of features in the stack PLs I've (admittedly in a surface way) perused.
16:27bartjRegarding namespace variables
16:27bartjone can access them using: imported-namespace/variable
16:27bartjbut, when one does it via an (eval (symbol namespace variable)) it fails!
16:28bartjcan anyone please have a look at the code in this paste:
16:28bartjhttp://pastie.org/1622241
16:28bartjwhich shows the above problem of accessing namespace variables
16:28bartjusing (eval (symbol ....))
16:34bartjanyone ?
16:35hiredmanbartj: you are missing the difference between vars and symbols
16:35amalloyyes, and also (symbol us "president") doesn't work. us isn't defined; it has nothing to do with eval
16:36bartjsorry that was a typo
16:37bartjamalloy, I have corrected the paste: http://pastie.org/1622241
16:39bartjhiredman, can you please tell me what I am missing ?
16:40hiredmanthere is no local binding for us and no var
16:40raekbartj: without using eval: (-> (symbol country f) resolve deref)
16:40amalloyi don't think the issue is symbols vs vars, it's more about eval being in a null lexical context, isn't it?
16:41raekbartj: but the most important question is: why do you use namespaces and vars, instead of, say, a map?
16:41bartjyou mean something like: {def president {:us "obama" :uk "cameron"}) ?
16:41raekyes
16:41bartjbecause there are more than 20 different variables
16:42bartjin each country
16:42hiredmanamalloy: no, he assumes that when he sees the symbol 'us' there must be a var backing it
16:42hiredmanso he can refer to in an expression like (symbol us ...)
16:42amalloyhiredman: that was my objection to; he updated the gist to be using "us"
16:43amalloyand claims to still be having trouble
16:43bartjstrangely, it works on the REPL !
16:43hiredmanno it doesn't
16:44raekI think amalloy's observation explains it pretty well. the form sent to eval is not evaluated in the lexical context where the eval call is
16:44bartjraek, may I ask, why not?
16:45raek(let [x 1] (eval 'x)) ; <-- x is not available in the scope where the form is evaled
16:46bartjoh no! I thought it should be, because it is defined right before in the let
16:46amalloybartj: there are a lot of reasons eval is not the right tool to use for many jobs
16:46amalloythis is one of them
16:48dnolennice, lisp 50 years ago, http://funcall.blogspot.com/2011/03/fifty-years-ago.html
16:49raekI think this is a result of how closures are implemented
16:50raekwhen the compiler sees (eval ...), it cannot know which variables it closes over
16:50jkruegeri stumbled over this as well a while back. i tried to write a backend for couchdb and wanted to evaluate functions from the db dynamically in a certain context. what would be the proper way to do this then ?
16:52HK_I am a long time C# developer (since 2002 when it came out) who has discovered Clojure (and Lisp for that matter). I absolutely love the (almost non-existent) syntax, it's so elegant and it's unbelievable how many "frameworks" are all of the sudden unnecessary to achieve something.
16:53HK_I think Rich has done a very good job designing and implementing Clojure, but one think I don't understand is why the keywords have to be so cryptic. Why "defn", "fn" and all the other ugly keywoards? Why not just use "function" and if that is too long just "F". F would stand out and be very short.
16:53swartfn works for me
16:54ohpauleezHK_: defn is a macro for making a function (using fn) and def'ing it using (def)
16:54swartbesides you can change the syntax to suit yourself
16:54ohpauleezmore or less
16:54ssiderisHK_: but the nice thing is that the language is flexible enough to replace the keywords!
16:54swartangle brackets ftw!
16:54HK_would replacing the keywords make the code slower?
16:55ssiderisHK_: no, you can make it happen at compile time with macros
16:55ohpauleezHK_: nope, not necessarily
16:55lucianHK_: i find fn very nice
16:55bartjjkrueger, I am extremely clueless as well
16:55lucianmuch better than function
16:55HK_ok, good to know, thanks. so i guess the cryptic keywords are just legacy from other lisps?
16:55lucianHK_: partly
16:56technomancy"function" is such a long word that I have to use Emacs render-time magit to make JS bearable.
16:56technomancy*magic
16:56technomancydang
16:56swartat least it uses first and rest instead of car and cdr
16:56ohpauleezAs stated, macros expand at compile time, and any code you really need to perform better than clojure enables (which I think you'd be hard pressed to find), you can write in java and then wrap in clojure as you need
16:56jkruegerbartj: one thing about ruby i liked was the ability to completely control the environment in which a block of code gets executed
16:56swartmostly I think the postfix notation is confusing to new developers
16:56luciantechnomancy: i really like CoffeeScript's ->
16:57jkruegerit allowed from some pretty nifty stunts
16:58HK_@swart: this is what i meant. he used first and rest instead of car and cdr, but i wished he had done the same for the other keywords
16:58technomancylucian: my JS use predates coffeescript, but I'm totally going for that next time I need to do web work.
16:58ohpauleezjkrueger: You can use binding forms to achieve the same thing in clojure, no?
16:58technomancyquite sane
16:58jkruegerswart: who could forget good old cddadr :)
16:59lucianHK_: others than fn?
16:59swartyeah car and cdr have their appeal
16:59jkruegerohpauleez: apparantly not when you are using eval
17:00HK_i am still a total newbie, i don't know most clojure keywords. partly because they are hard to remember because they are so cryptic
17:00lucianswart: noooooooooo
17:00swart:)
17:00lucianHK_: could you give examples? i'm not much of a lisper either
17:00swartI like the symmetry is all
17:01ohpauleezjkrueger: ahh sorry, I was missing the context. I ran into a similar issue when I started working on net-ns (which I had since dropped) and realized it seemed more of a characteristic of bad design than of a real need for the project
17:01swartthey told me in uni that they stood for "contents of address register" and "contents of data register" but I think that's incorrect. at least according to something I read online somewhere
17:02jkruegerHK_: I agree with you that some things are short and that may seem strange. Functions like split-at or drop-while have full names. But you tend to use "fn" so much, that it just deserves a shorthand. The same goes for a few other functions/special forms.
17:02swartyou can always use a lambda character. unicode is ubiquitous now
17:02jkruegerHK_: independent of lisp folklore
17:03HK_i guess, it's just personal taste
17:03swartnot entirely. language idioms are important for sharing code
17:03HK_i come from the imperative OO world where everything is very descriptive
17:03swartthat's why I can't handle C#. too many ways to doe the same thing
17:03lucianHK_: so do i. what exactly bothers you in clojure's keywords?
17:03lucianswart: meh, that's now why i dislike it
17:03bartjraek, (-> (symbol country f) resolve) gives a NullPointerException ?
17:04luciani do like it more than i like java
17:04jkruegerswart: i hope you never had to write a c++ program
17:04HK_what i said earlier. i find the naming not consistent, so being a beginner i find it harder to remember
17:04lucianjkrueger: that's got to be the world's worst langauge
17:04swartI learned c++ a couple of years ago, but I've been a smalltalker for 20 odd years
17:04lucianHK_: i know, i was curious what names in particular
17:04technomancylucian: except for the ones that are bad on purpose
17:04luciantechnomancy: i'm not even convinced of that
17:05lucianbrainfuck has an elegant uniformity
17:05swartc++ turned out to be less horrible than I thought, but apparently it gets worse the better you understand it :)
17:05no_mindis there a framework in clojure that will let routes registered programatically ? Lets say a module registers the routes it want to handle...
17:05technomancylucian: perhaps if you measure "most harmful" rather than "worst"
17:05hiredmanHK_: consistent with what?
17:05lucianswart: try metaprogramming with templates
17:05luciantechnomancy: i guess
17:05jkruegerswart: i can confirm that
17:05lucianswart: it's plain evil
17:05HK_they should have been either just initials for keywords, e.g. F for funktion, M for macro, MM for multimethod, D for define, which could then be combined to D-F for define function
17:05HK_or they could be just abbreviations like func, sync, mac
17:06hiredmanHK_: how is that more consistent?
17:06raekbartj: resolve returns nil if the symbol does not corresond to any var
17:06raek,(resolve 'conj)
17:06clojurebot#'clojure.core/conj
17:06raek,(resolve 'foo)
17:06lucianHK_: F, M, MM and D seem worse to me than fn, macro , etc
17:06clojurebotnil
17:06raek,(resolve (symbol "clojure.core" "conj"))
17:06clojurebot#'clojure.core/conj
17:06HK_@lucian, i can see that
17:07amalloytend to agree. uppercase is evil anyway
17:07lucianamalloy: yeah! CL is stupid that way
17:07HK_they stand out htough
17:07swartand - nicer than _
17:07lucianHK_: so do keywords in a decent editor
17:07swartcamelcase cramps my fingers
17:07amalloyHK_: so does caadr
17:07bartjcan anyone please point to some material re: difference b/w vars and symbols ?
17:07amalloybut that doesn't make it a good idea
17:07lucianswart: meh, i find _ ok
17:08bartjvars = variables
17:08hiredmanHK_: you still have not explained your use of the word consistent
17:08technomancybartj: vars are storage locations; symbols are just names
17:08bartjsymbols are attached to vars ?
17:08HK_ok, guys, you're right, it was just the first thing i noticed when i started looking at clojure, now looking at some code, i noticed there aren't that many keywords anyway so it's not that bad
17:08swartno a symbol is a literal
17:08bartjand they are attached to a var ?
17:08swartnot necessarily
17:08HK_@hiredman: right, sorry, i will now
17:09swartthey are a value
17:09technomancy,(class (name #'reduce))
17:09clojurebotjava.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Named
17:09technomancy...
17:09technomancyspeaking of consistency...
17:09bartjwhat use are symbols if they are just names ?
17:09swartlike a string, but unique
17:09bartjblahblah is a name but doesn't reference anything :)
17:10swartbeats using numbers for everything
17:10swartcan be used for looking things up in maps for example
17:10HK_it's inconsistent because "fn" stands for function, where it used the first (f) and last letter (n) of the word, but in the case of "def" for define, it uses the first 3 letters. "defn" for define function uses the first three letters of the first word and the initial of the second word
17:10hiredmanor look up vars in namespaces
17:10raekbartj: you don't use them very often as data in programs. they are used for representing names in source code though.
17:10lucianHK_: so you'd prefer func and defunc?
17:11HK_i'd prefer func and def-func
17:11bartjraek, could you provide a tiny example, please ?
17:11hiredmanHK_: how do you come to the conclusion that the 'f' in fn is the first letter of the word 'function' and the 'n' is the last?
17:11spewn_HK_: I would argue that "fn" comes from FuNction, not FunctioN.
17:12raekthe code of the expression (inc 1) is represented as a clojure list of the symbol inc followed by the integer 1
17:12jkruegeri always liked "fun"
17:12jkruegerit's just fun to write a fun
17:12raek"clojure programmers have more fn"
17:13dnolenHK_: don't bring too many OO naming convention assumptions w/ you. Clojure is simply built on a different legacy - Scheme, CL, Standard ML, Haskell. Clojure naming conventions draw a lot from those languages.
17:13HK_because the 3 most common ways to abbreviate something are: 1) use initals of two words, like "ns" for namespace 2) use first and last letter 3) use first X letters
17:13lucianHK_: 4) use random Y letters
17:14HK_i was just interested, thanks for the discussion, i like the vibe you guys have
17:14amalloyHK_: i'm dubious. things ending in "ion" are special cases; mathematicians often use defn (superscript n) for definition
17:16amalloyand you see fn used for function all over: "The domain of the function fn"..."Let Fn be the Fibonacci sequence"...
17:16HK_so it's just convention then
17:16amalloyoh, i think that last one is supposed to be F<sub>n, but it's not clear
17:17amalloy*shrug* i think it's an arbitrary compromise between brevity and legibility
17:17ohpauleezamalloy: Yes, F sub n
17:18amalloyohpauleez: in the context i found it, it looked like Fn, and since they didn't say "the nth element" it didn't click for me right away
17:18ohpauleezahh cool
17:18HK_i don't mind "fn" that much anyway, it makes sense to me because i just thought they took the first and last letter of 'function"
17:18HK_something like : would have been cool for define
17:18HK_or := what is used in math
17:18amalloyHK_: we need our : for other stuff :P
17:19amalloyHK_: i'm curious where you see so many first-last abbreviations. i can't think of anything off the top of my head
17:19HK_GMail for Google Mail
17:19amalloythat's not first and last at all
17:19lucianit's not GL
17:19HK_oh sorry
17:20amalloythat's first and first
17:20HK_ i misread it
17:23HK_the word Doctor is an example
17:23HK_usually writen as dr
17:29signalseekercake users: how do you set the classpath for cake repl?
17:30signalseekerIt doesn't seem to honor my $CLASSPATH
17:30HK_say thanks to rich from me, he is a genious, bye bye
17:36amalloysignalseeker: if you're in a cake project the repl there will include the project's dependencies
17:36signalseekeramalloy: I am not in a cake project
17:37signalseekerI am using the global project I guess
17:37amalloythen you can futz with the settings in ~/.cake/project.clj, but you're better off not trying to manage classpath entries yourself
17:37amalloywhat do you need a custom classpath outside of a project for?
17:38signalseekerI don't need a custom classpath, I just want my default $CLASSPATH to be available
17:38signalseekerFor whatever reason, I can't import my jars in cake repl although I can access them directly through java
17:39bartjIf I have (ns blah1.blah2.blah3 :as us)
17:39bartj(ns-resolve 'blah1.blah2.blah3 (symbol x)) resolves properly
17:39bartjbut, (ns-resolve (symbol us x) doesn't
17:41ieureWhat the fuck. http://stackoverflow.com/questions/5161164/python-in-memory-object-database-which-supports-indexing
17:41amalloysignalseeker: the point i'm getting at that if there are jars you want to import, the "proper" way to do it is specify them as dependencies wherever your code is, so that the tools can manage the fiddly low-level classpath details
17:41amalloybartj: ns-resolve wants two args
17:43amalloy,(resolve 'clojure.core/first)
17:43signalseekeramalloy: Agree, thats a better soln. But I just want to explore some java APIs using clojure, I don't have a need of a full-fledged project yet. It seems like too much trouble to have to create a project for this purpose
17:43clojurebot#'clojure.core/first
17:43bartjamalloy, oops, I mean (resolve (symbol us x))
17:43amalloyHK_: aha! like soln above :)
17:44amalloysignalseeker: you could ask in #cake.clj
17:44signalseekerI did, there is no one there right now it seems :)
17:44amalloythat's often the case :P
17:45signalseekermaybe its not a cake thing, I am new to clojure. So I could be using the wrong syntax
17:45amalloylein and cake both honor some kind of java env vars, i'm just not sure what they are
17:45amalloy$google leiningen sample project.clj
17:45sexpbotFirst out of 451 results is: sample.project.clj at master from technomancy's leiningen - GitHub
17:45sexpbothttps://github.com/technomancy/leiningen/blob/master/sample.project.clj
17:46HK_how do i direct someone in this chat?
17:46signalseeker(import 'foo.c) ;; I have boo.jar with the package foo in my $CLASSPATH
17:48HK_amalloy: i don't know what soln is
17:48shafirehi
17:49amalloysolution
17:49amalloyHK_: /msg amalloy dude you are so wrong
17:50amalloymy point was that he said "agree that's a better soln", meaning solution. evidence for my fn claim has arrived already! :)
17:50HK_see, that's why i didn't get it
17:51HK_soln isn't a great abbreviation
17:51amalloy$google soln set
17:51sexpbotFirst out of 30900 results is: 1.5 Solution Sets Ax = 0 and Ax = b Definition. The rank of a ...
17:51sexpbothttp://www.math.northwestern.edu/~clark/285/handouts/soln-set.pdf
18:16konrThe java library I'm using keeps spilling NoClassDefFoundErrors and asking for classes not available on its jar file. Is this behavior expected, or something else is going on?
18:17ohpauleezkonr, what classes?
18:17ohpauleezis it because you're not including Clojure or other project dep jars on your classpath?
18:19konrohpauleez: org.cyberneko.html/HTMLConfiguration, for example. All my jars are in the lib/ directory, used by lein, but note that this class is not available on any jar
18:19konrohpauleez: I wonder if the .jar wasn't built properly
18:20ohpauleezkonr: That could be it, i'd check the manifest
18:20ohpauleezseems very weird to me
18:20konrs/\//./s
18:20ohpauleezespecially if you're managing the deps with lein/mvn-dep
19:11cdddrIs there a clojure builtin that swaps argument order?
19:13ohpauleezcdddr: can you give an example?
19:13amalloycdddr: sadly i don't know of one
19:13amalloy-> and ->> are kinda-sorta related
19:14amalloyohpauleez: i think he's looking for (fn [f] (fn [a b] (f b a)))
19:14cdddramalloy: Yup.
19:14ohpauleezahh ok
19:14amalloyi've wanted that a number of times, but it's a little hard to envision how it works for non-binary functions
19:16cdddrGranted, but it would be useful enough for binary ones. Or it could just be "reverse-args", though that's probably not very useful for non-binary stuff.
19:16amalloymaybe (fn reorder [f order] (fn [& args] (apply f (map order args)))), called like (reorder fnil {0 1, 1 0})
19:16amalloyer except that's totally absurd as an implementation
19:16amalloyas a description it kinda explains what i was getting at, i think :P
19:16cdddrYeah, it does. :>
19:20amalloycdddr: i'll sketch something out later this afternoon if you're interested in a more general solution
19:23cdddrSure, if I'll still be around.
19:40cdddr$findfn 1 inc dec [2 0]
19:40sexpbot[]
19:42__name__good night
19:42__name__$source findfn
19:42sexpbotSource not found.
19:42brehautfindfn is a sexpbot command
19:42__name__eh, i should just go to sleep :)
19:43__name__brehaut: yes i figured
19:43__name__$findfn 2 1
19:43sexpbot[clojure.core/unchecked-dec clojure.core/dec]
19:43__name__neat
19:43Despiteheh, reddit is hilarious. somebody posts a year old blog about building a game in clojure from an admited newbie, and the comments are full of arguments about how immutability is inefficient
19:44Despiteand FP'ers "live under a rock"
19:44cdddrArrgh, what was that function that worked like (fn [f1 f2] (fn [x] [(f1 x) (f2 x)])) ?
19:44brehautjuxt
19:44cdddrOh, thanks.
19:46Adamantreddit is crud.
19:46Adamantat this point.
19:47cdddrArguably, reddit has been crud for ong time now.
19:47brehauti am hoping that alex payne's bloomfilter is successful
19:47Despiteyeah, i read /r/programming only, but threads like that chase me away
19:47Adamantcdddr: I'd agree with that argument
19:47DespiteBut I don't have much other programming stuff to read, so I start jonesing.
19:47Adamanti'm not huge on Hacker News, but it's way better overall
19:48brehautreal programmers read lambda the ultimate. sadly im not smart enough to be a real programmer
19:48Adamantquality-wise, no argument, as long as you don't mind a deluge of startup stuff
19:49AdamantI read LtU for a while. it's good to do so, but it's very academic style. everyone needs some of that, not everyone needs it forever.
19:58cdddrAdamant: True that.
19:59cdddrAnd to be fair, HN is actually the one tech site that doesn't make me irritated within a few minutes of visiting. ;)
20:00TimMc/r/programming is long overdue for fragmentation.
20:00TimMcI mod /r/scheme and /r/PLT (Prog Lang Theory), which are super low traffic. :-(
20:01TimMcThe larger subreddits are basically useless.
20:01Adamantcdddr: I don't agree with the the views of many Ars residents, but Ars Technica is pretty good overall
20:03cdddrIt's been a while since I visited Ars last, and I don't remember being royally pissed, so I guess I'll give it a shot. :>
20:04cdddrAhh, the joy of replacing 40 lines of code with 8.
20:29loquaciouslyi think i found a spelling error in the source; do i need to do the contributors agreement, or can i just tell someone?
20:47TimMcMaybe we'll never know.
21:10tomojno self-joins in clojureql 1.0.1, it seems?
21:12pdktell me wise sages
21:12pdkfor folks who've read the preview of joy of clojure
21:12pdkwould it still be worth it next to a copy of practical clojure
21:12pdktempting since with this gift card i could preorder for $1
21:15technomancypdk: yes, definitely
21:16TimMcWhat is the target audience?
21:16TimMc_fogus: Will there be updated PDFs over time if I buy JoC?
21:17TimMcI'm rather fond of that approach.
21:25amalloycdddr: still around?
21:25cdddramalloy: Yup.
21:25amalloyhttps://gist.github.com/70f5bf52417ccdef5938
21:27amalloyforces args into a vector, so won't work if you want to (apply (reorder f {0 1 1 0}) (range))
21:28amalloycdddr: is what you were looking for, yeah?
21:29amalloypdk: yes, JoC is sweet
21:29cdddrYeah, it is. Thank!
21:29amalloyi haven't read practical clojure but assert anyway with 100% confidence that JoC is better :)
21:29amalloycdddr: cool. had it almost done two hours ago then a coworker showed up to pair-program :)
21:30amalloyit's a neat idea i played with a while ago but didn't write until someone else made me. maybe i'll start using it
21:30cdddrAlways an annoyance at work. ;)
21:30amalloyugh, what is wrong with me. so many smilies today
21:30amalloygonna go home. ta-ta
21:30cdddrtoodle-oo!
22:33amalloycdddr: i was thinking about the needless repetition of {0 1, 1 0} in reorder. i could redefine it as "swaps", but not sure how i would handle something that my current scheme would express as {0 1, 1 2, 2 0}. any thoughts?
22:34TimMcamalloy: You're looking for a better way to express a permutation?
22:34amalloyTimMc: yes, i suppose i am
22:34amalloyyou caught my gist to cdddr earlier, right?
22:34TimMcYes, but I didn't know the context.
22:35TimMcArbitrary permutation?
22:35amalloyhe was looking for a HOF that wraps some other function by reording the args it takes
22:36TimMcHOF?
22:36amalloymy example allowed ((reorder map {0 1, 1 0}) [1 2] inc) => [2 3]
22:36amalloyhigher order function
22:36TimMck
22:37TimMcIt does seem verbose.
22:38amalloyright. and i could make it accept just {0 1}, but then what if the user wants to reorder args in a more interesting way
22:38TimMcI suppose yours allows some arguments to be left alone, too.
22:38amalloyright
22:39amalloyand conceivably you could write {0 1, 1 1} to mean "pass original arg 1 as new arg0 and arg1"
22:39TimMcI imagine the functionality could be extended such that given a vector it would use the values as a cycle.
22:40amalloyhm
22:40amalloywhat do you mean?
22:40TimMc(reorder map [1 2 3 0]) would be (reorder map {0 1, 1 2, 2 3, 3 0})
22:41TimMc(Unless I have key:value backwards.)
22:44amalloyrotations like that would be better expressed as integers anyway
22:45amalloy(reorder map 1) or (reorder map -1), depending on whether i have key:value backwards myself
22:45TimMcTrue.
22:46TimMcOh! And that would allow for rotations of arbitrary arity.
22:46amalloybut not infinite
22:47TimMcI can't see using something like [1 0 3 2] anyway.
22:47TimMcTrue...
22:47amalloywell infinite is already impossible
22:47TimMcI wasn't aware you could apply...
22:47TimMcYeah.
22:47amalloyhard to see making it ever possible, or even useful
22:49amalloyprobly best to only allow swaps (maps) and rotations (ints)
22:49TimMcI'm imagining allowing seqs for &args.
22:49TimMcapply would have to know about the arity of the target function, etc.
22:49amalloyso? as long &args is finite, it's already handled
22:49amalloyyou just (count args) before you rotate
22:50amalloywhich you have to do anyway
22:50TimMcOh, I was still thinking of the infinite case for functions.
22:50TimMcIt's silly, though -- jut take a seq as an arg.
22:51TimMcNext up: Functions with uncountably infinite arity!
22:52TimMc:-D
22:53TimMcI should go to sleep before I try to come up with anything more absurd.
22:53TimMcnight all
22:55Thamster_i'm sorry for the following noob question
22:56Thamster_ Could not locate clojure/contrib/monads__init.class or clojure/contrib/monads.clj on classpath: (NO_SOURCE_FILE:0)
22:56Thamster_so i add the jar's location to the .closure file in my home directory?
22:59amalloyThamster_: the answer is likely to depend on how you are running clojure. leiningen, cake, cljr, or something else?
23:00Thamster_clj in osx terminal after installing via macports
23:00Thamster_?!
23:01amalloymmm. not a mac user here; i know the macports version of leiningen is hopelessly out of date, but i've no idea what the state of clj is
23:02Thamster_so its that complicated in general to add a jar to the classpath in clojure?
23:03amalloyno, not at all
23:03amalloycause nobody uses clj :P
23:03Thamster_i see
23:03Thamster_is there another interactive shell i could try?
23:03amalloyif you use leiningen or cake (as most do), you just add a line to project.clj, and it goes and downloads the jar from maven then puts it on the classpath
23:03Thamster_thanks for the tips btw
23:03amalloy$google raynes get started with clojure
23:03sexpbotFirst out of 254 results is: An indirect guide to getting started with Clojure » I Don't Blog
23:03sexpbothttp://blog.raynes.me/%3Fp%3D48
23:04amalloywtf sexpbot, that link sucks
23:04Thamster_haha
23:04amalloyhttp://blog.raynes.me/?p=48
23:06Thamster_he skips right by cljr
23:08amalloythat's not an accident. cake and lein give you all the cljr features and loads more, and are barely any more complicated to install, if at all
23:08Thamster_they are command line too?
23:08Thamster_interactive shells?
23:08amalloythey include shells
23:08Thamster_ok cool
23:09amalloy$ cake repl
23:09amalloyuser=> (inc 1)
23:09amalloy2
23:09Thamster_While Leiningen does have a command for starting an REPL outside of a project (a la cake, cljr), it does not currently have a way for you to manage dependencies for that “outside-of-a-project REPL” like cljr and cake does. If yo
23:09Thamster_… is that right?
23:09Thamster_i just want to do a quick tutorial on monads
23:10Thamster_i don't want an ide or anything
23:10amalloyit probably is no longer right, but technomancy is the one to ask
23:10amalloycake and lein really genuinely are command-line only tools. you don't have to worry about accidentally installing eclipse
23:10amalloythey both integrate with several IDEs, including eclipse, emacs, vim, and textmate
23:13Thamster_sudo gem install cake; cake repl
23:13Thamster_that wasn't too painful
23:13amalloyhurrah!
23:13Thamster_drew!
23:14amalloynow you can just add [clojure-contrib "1.2.0"] to the :dependencies in ~/.cake/project.clj (if it's not there already), and you'll have that jar on the classpath when you launch a repl
23:14Thamster_hey thanks amalloy , that seems to have worked and managed the dependencies automagically
23:15amalloythat's the idea!
23:15Thamster_hmm
23:16Thamster_java.lang.IllegalStateException: m-bind already refers to: #'clojure.contrib.monads/m-bind in namespace: user (NO_SOURCE_FILE:2)
23:16Thamster_maybe i should delete my .clojure file
23:20tomojI swear I remember finding the "outside-a-project" stuff in leiningen and being surprised
23:21tomojbut now I don't see it
23:31Thamster_this is pretty nice
23:32amalloycdddr: (reorder (partial reduce foo) {0 1}) vs (partial (reorder reduce {0 1}) [1 2 3]) is a funny distinction. swap the argument order for reduce, and decide which argument to partialize
23:33amalloyi think i'll play around with ways to make reorder more convenient then push something to clojars if you're interested
23:40technomancytomoj: you can install leiningen plugins that work outside a project
23:40technomancyand you can set up a bare swank repl that's standalone
23:40technomancyI haven't heard a coherent use case for actual dependencies outside a project, so I've left that to cljr for the time being.
23:41technomancyIMO incanter should ship with shell-wrappers like swank does for standalone incanter hackery
23:45ohpauleezRaynes: fixed a bug in clj-github, pushed to master already. Can you up the version, push, and release to clojars?
23:47amalloyohpauleez: probly best to tell him in #sexpbot; i think he's afk and might miss the scrollback in a noisy room like #clojure
23:47cemericktechnomancy: My next push on ccw will probably include a way to start a REPL unassociated with any project, and allow one to add dependencies to that session dynamically. I've found myself wanting a REPL with deps X, Y, and Z of late, without the bother of setting up a project.
23:47ohpauleezamalloy: Thanks man, good thinking. Also I don't know if I told you, but I really loved your post the other day
23:47amalloyoh i'm glad
23:47cemerickNothing special, but it seems useful enough (handy for beginners, too).
23:48amalloyi feel like the title was at once too pretentious and too hard to search for, so i tried to make up for it with content :P
23:48ohpauleezamalloy: haha. Well I sent it around the office, we all enjoyed it.
23:48amalloygreat
23:49ohpauleezI'm working on a longer post right now (re-starting up the blog)
23:49amalloyohpauleez: yeah, my blog had been silent for a month or so
23:49amalloynot counting a post about emacs/vim vs notepad that nobody really noticed
23:50ohpauleezI've been polling clojars and github (soon bitbucket), to grab clojure projects, scan their project.clj if they have one, and make a heat map of dependencies per version of artifact
23:50ohpauleezto help answer the question, "Which package should I be using?"
23:50amalloyohpauleez: which version, or which package?
23:51ohpauleezversion of artifact (you could sum all versions if you wanted)
23:51amalloy$findfn 1 [1 2 3] [3 1 2]
23:51sexpbot[]
23:51amalloy$findfn [1 2 3] 1 [3 1 2]
23:51sexpbot[]
23:51ohpauleez{"aleph" {"1.01" 10 "1.02" 15}}
23:51amalloyman, seriously? we don't have a rotate?
23:52ohpauleezamalloy: we have rotate, I'm almost certain of it
23:53amalloyohpauleez: i can't find it on the clojure cheatsheet, and sexpbot is usually better at it than i am
23:54amalloylikewise (find-doc "rotate") returns nothing
23:55ohpauleezamalloy: is there some weird thing you can do with cycle, if it's a seq
23:55ohpauleezI'm scouring my code, I could have sworn I've done a rotate before
23:55ohpauleezand I can't believe we have shuffle and not rotate
23:55amalloyi suppose so. it seems easier to do it by hand than hack it into a cycle op
23:55tomojrotations should be free
23:56tomojs/free/almost free/
23:56amalloysexpbot: botsnack
23:56sexpbotamalloy: Thanks! Om nom nom!!
23:56tomojof vectors anyway
23:56amalloytomoj: yes
23:56ohpauleezsure
23:56amalloybut you have to write the code
23:57technomancyI don't really see the utility of adding dependencies to something that isn't a project
23:57technomancyit's not like you could make it any more streamlined than editing :dependencies in a new project
23:58amalloytechnomancy: suppose that i like to have c.c.condition available in all my repls or some such
23:58amalloyor com.amalloy.rlyawesome
23:58tomojthe number of interfaces it seems you'd have to implement for free rotation is discouraging