#clojure logs

2010-05-28

00:25slyrusany slime/swank-clojure users/hackers around?
00:26lancepantzi'm new to it, but yeah
00:27scott_i'm also new to it
00:27slyrusthings seem ok for a the first dozen or so commands, but then it hangs :(
00:27scott_it breaks if I enter something that raises an error
00:27lancepantzslime-repl hangs?
00:27scott_i'm not sure how well set up mine is
00:28slyrusyeah
00:28slyrus*inferior-lisp ...* still works
00:30slyrusit seems to have something to do with error handling as it's usually seems to be when I type a form that should trigger an error
00:31slyrusdunno if it's the emacs-lisp side of thing or the clojure side of things that's hanging
00:31slyrus(or where to begin debugging either, for that matter)
00:31slyrusanyone know the clojure equivalent of (sb-thread:list-all-threads) ? :)
00:32lancepantzyeah, i'm not experienced enough to be any help
00:34technomancyslyrus: you could try starting swank with lein swank and connecting with M-x slime-connect
00:34technomancythen you could see if reconnecting fixed it
00:40slyrushmm... I guess I have to figure out how to use leiningen then...
00:42technomancyslyrus: or maven if that's the way you roll
00:43slyrusack! that's even worse! :)
00:43slyrusI roll with ASDF. doesn't help me much here :)
00:44technomancyslyrus: http://vimeo.com/8934942 is a pretty good intro
00:46slyrustechnomancy: I appreciate the suggestion, but I'm not sure how adding the complexity of leinengen into the mix is going to make this easier to debug
00:47technomancyslyrus: sure; I assumed you were using a build tool when I suggested that
00:47slyrussure, emacs is a great build tool! :)
00:47RaynesEmacs is a great *
00:49slyruscoming from a lisp background, I'm not used to packaging code into things that have a "main". Losing the main function was one of the things I really liked when I moved from c-like languages to lisp.
00:50lancepantzyou don't have to use it
00:50lancepantzand i think you'd be surprised at how simple lein swank is
00:50slyrusyeah, but you can't run lein swank without it
00:50slyrusor if you can I'm doing something wrong
00:51lancepantza main function?
00:51slyrusyeah
00:51lancepantzmaybe i don't know what i'm doing right :)
00:52lancepantzbut i don't see how a main function would impact lein swank
00:52slyrusnot having one seems to make lein swank unhappy
00:52technomancyyou don't need a main function for lein swank
00:52lancepantzi'd guess you had an unrelated error
00:53slyrusoh, perhaps I'm misreading this error: "[null] Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main"
00:54lancepantzyeah, i think that would be caused by clojure not being on your classpath
00:54slyrushrm... ok
00:55lancepantznot even sure if that is possible with lein though
00:55lancepantzmaybe it didn't bootstrap properly?
00:55slyrusyeah, that's what I thought!
00:57slyruswho knows, but trying to figure out why various shell scripts/environment variables can't find all sorts of crazy jars seems like a losing battle. teaching slime how to find the jars I want is pretty straightforward.
00:58slyrusperhaps I'm just thinking about things the wrong way, but I really don't want all the crap in ~/.m2
00:59technomancyit becomes worth it as soon as you add in a dependency that pulls in a transitive dependency. working with that by hand is way more trouble than it's worth.
01:00lancepantzi have my issues with lein, but it does solve that exact problem pretty well
01:00technomancyfor trivial projects you can just brute-force your way through it. but it's a lot of unnecessary work.
01:02zakwilsonI have :dev-dependencies [[swank-clojure "1.2.1"]] in a project.clj file and lein deps says it's missing on one computer, but not another. I'm guessing something is missing or misconfigured.
01:02zakwilsonThe machine that isn't working is running Mac OS 10.5. Not sure where to start troubleshooting.
01:02technomancyzakwilson: java 1.5 maybe?
01:03zakwilsonNow running Leiningen 1.1.0 on Java 1.6.0_15 Java HotSpot(TM) 64-Bit Server VM
01:04technomancyhard to say then
01:05slyrusoh, I see... lein deps copies the clojure-xxx and clojure-contrib-xxx jars into lib which lein swank then finds.
01:08slyrusok, I've got some random jar I want another file to depend on. How do I make it such that the lein :dependencies can find that jar?
01:10lancepantzif its a standard library, see if it's on clojars
01:10lancepantzlein searches 3 or 4 other public repos
01:11slyrusno, it's not a "standard library", not that I no who the standard bearers are, I just know it's something I've built here
01:11lancepantzi meant commonly used
01:12slyrusI don't want some automagic downloader that finds the jar, I've already got the dang thing locally
01:13lancepantzyou can either set up a private maven repo or put it in your .m2
01:13lancepantz*commence bitching* :)
01:13slyrusack!
01:14technomancythere are very few instances where something like that doesn't belong on clojars
01:14slyrusso I guess I have to learn maven to use lein. I was trying to avoid that.
01:14slyrus???
01:14slyruswhat is clojars?
01:14technomancyit's a community jar repository: http://clojars.org
01:15slyrusbut I already have the jar here. why would I want to put (and require my stuff to find it) on clojars?
01:15technomancyif your build isn't repeatable on more than one machine it's not much of a build
01:16slyruscould be. I don't really care about builds. I just want my SLIME repl to work!
01:16technomancyI mean, you can just put it in lib if you just want to do a hack job
01:17technomancywhich is fine for this situation probably
01:17technomancyI was just saying you probably don't want a private m2 repo
01:18technomancyhttp://www.catonmat.net/blog/wp-content/uploads/2008/11/edsger-dijkstra-quick-and-dirty.jpg
01:18technomancy^ but sometimes that's just what you need to get the job done. even if it causes edsger dijkstra to look down upon you in disapproval.
01:18slyrusoh, but I have to copy it to {the-directory-with-my-project.clj}/lib, I can't just tell the project.clj where to find it in the local filesystem?
01:20lancepantzcorrect
01:21dnolenslyrus: there's also lein install, which I find convenient
01:21lancepantzthen he'd have to build that jar with lein though
01:27zakwilsonhttp://gist.github.com/416794 <-- I'm having issues getting a parallel map for a fast f and large coll to scale to more cores. It's perfect with two, but doesn't improve further with four.
01:50chouserpmap doesn't work well for fast f
02:00zakwilsonchouser: I'm well aware. That's why I wrote a version that partitions the collection and runs (pmap #(doall (map f %)) the-partitioned-collection)
02:01zakwilsonAnd applies concat to that
02:01chouserheh, I just wrote that myself
02:01chouserno traction
02:02chouserdo you care about pmap's laziness?
02:02zakwilsonNo. I'm content with a strict version for this.
02:02chouseris your input a seq? lazy? or a vector?
02:02zakwilsona map
02:03chouseryou want to transform both keys and values?
02:04zakwilsonYes, in this case
02:12chouserwouldn't happen to be a sorted map, would it?
02:12chouserif so, subseq might be better than partition
02:13zakwilsonNot sorted. Just your ordinary, average 27,000 element persistenthashmap
02:15chouserthere's a branch of clojure that modifies vectors to work with the forkjoin library. Sounds to me that you want something like that for maps.
02:16zakwilsonI've heard of it. Seems possible, though I'd love to have a general-purpose pmap for fast fs and big colls. I'm going to test mine a bit more - I have reason to believe it may actually not be a problem with zpmap itself.
02:18chouserpart of the problem with seqs here is that the thread that processes the last partition has to walk the whole seq up to the start of that partition (or wait for a thread that does)
02:19chouserso if the speed of f approaches the speed of walking the seq, there's really just nothing left to parallelize
02:19chouseryou'd really want to exploit the structure of the map itself
02:20chousersubseq on a sorted map lets you do that to some extent
02:21SinDocWhere can we define member data for a deftype?
02:22chouserSinDoc: (deftype Foo [member data here])
02:22chouserbut are you sure you don't want defrecord?
02:23SinDocno, I'm not sure
02:23RaynesIf you aren't sure, you probably want defrecord.
02:23chouserright
02:23chouserdeftype is more primitive
02:24SinDocThe question is whether the fact that defrecord implements IPersistentSeq is useful for me
02:24SinDoca priori, i'd say no
02:24chouserIPersistentMap perhaps?
02:25SinDocsure, I hadn't checked
02:25SinDocbut if it's implied by the fact that I want member data, then I guess I should use defrecord
02:29SinDoci guess member data DOES imply the use of defrecord
02:29zakwilsonchouser: I had the impression that I wouldn't have that issue with a map or a vector.
02:30chouserwalking a seq of a map is still O(n), even if looking up any one key is nearly O(1)
02:31chouserbuilding a subseq on a sorted map is O(log n), so it might be a win for partitioning
02:31chouserthough I must say 27,000 items doesn't seem like very many.
02:32chouser,(time (let [r (range 27000), m (zipmap r r)] (zipmap (map inc (keys m)) (map inc (vals m)))))
02:32chouserclojurebot: ping?
02:32clojurebotPONG!
02:32chouser,(time (let [r (range 27000), m (zipmap r r)] (zipmap (map inc (keys m)) (map inc (vals m)))))
02:33Chousukeclojurebot is a bit slow sometimes :P
02:33chouserhuh. well, on my box that map of 27000 items is built and then a new one created with inc'ed keys and values, all in 65 msecs
02:33zakwilson58ms here
02:36chouserhard to beat
02:36zakwilsonMy problem isn't zpmap not being faster than map or pmap. My problem is that it isn't getting more out of four cores than two.
02:43zakwilsonI need sleep. Thanks for looking at this. I'll revisit it tomorrow.
02:48SinDocI guessed wrong. Things seem clearer after reading http://clojure.org/datatypes
02:49SinDocThe Datatypes page isn't linked from the sidebar and that makes people miss it
02:55chittoorhola!
02:55RaynesHai.
03:13Licenser_I found something very ugly :(
03:13Licenser_if a var is a string you can't use with-meta :(
03:33vegaiwhat's the proper way to launch a jar made by lein jar?
03:33vegaiI keep getting
03:33vegaiFailed to load Main-Class manifest attribute from
03:35RaynesI'm not entirely certain that 'lein jar' produces executable jars.
03:35Licenser_vegai: you have to tell your project.lcj what the main class is
03:35RaynesI think only 'lein uberjar' does that.
03:35RaynesLicenser_: Am I wrong?
03:35Licenser_Raynes: yes and no
03:35RaynesIt has to be one or the other mate.
03:36Licenser_you need to run it with java -cp your.jar:lib/clojure.jar... main.class.thingy.main
03:36vegaiRaynes: same effect with uberjar
03:36RaynesSo it does create executable jars.
03:36RaynesMy mistake. :)
03:36Raynesvegai: What he said.
03:36vegaiaye
03:37Licenser_Raynes: what exactly is a executable jar?
03:37Licenser_no jar is executable
03:37RaynesLicenser_: If a jar has a Main-Class attribute, it's executable.
03:37vegaicould info about this be added to http://github.com/technomancy/leiningen ?
03:37Licenser_problem is that you have to add -cp and since sun is silly -cp and -jar isn't compatible
03:37vegaiand could lein new perhaps do some of this automatically?
03:37Licenser_vegai: there is a info in the page
03:38Licenser_look at the parameters for the project.cljk
03:38vegaiLicenser_: yes, but a preferred way to run leinized application might be nice
03:39Licenser_vegai: I am not sure if there is anythi8ng like that
03:52Licenser_I have the following problem and am running out of ideas: I want to make a jtree (swing) backed with a nested map. Problem is, the threeModel interface requires nodes to keep track of parents/silbigs so I'd have to return the "path" to the node as node to keep track of where they are. Now if I do that the nodes themself render as vectors not as strings and I don't find a way to attatch the path to the string, since it not even has meta data. Any ideas here?
03:55RaynesOh man.
03:55RaynesHow did I not know about clojure-http-client.
03:56Raynesclj-apache-http depends on the internet. It will be nice to get rid of all those jars in sexpbot.
04:00Licenser_Is it possible to extend a class with Proxy?
04:00Licenser_it seems when I try that it only recognizes the methods already published by class :(
04:01RaynesI think you'd need gen-class for that.
04:04Licenser_I don't want stinking gen-class :( it is AOT :(
04:05Licenser_hmm I could overwrite the toString of a vector to get what I want but that'd be hugely ugly in my eyes and very badly hacked :(
04:05vegaiwell, some sort of docs lein needs
04:05vegaior fools like me will be scared
04:05hoeckLicenser_: proxy subclasses or implements interfaces
04:06hoeckgenclass is only required if you need the performance or a stable classname
04:06vegaiI was going to do a small task on clojure, but now I've fought with lein more time than it would've taken me to do the thing in python in the first place ;)
04:07vegai(sorry if that's a bit of a troll)
04:07Licenser_hoeck: but I could not use proxy to create an Object that had the aditional .path method, clojure refused to do that
04:07hoeckproxy cannot create new methods
04:07Licenser_see that is my problem
04:07hoeckbut
04:08hoeckyou could create a protocol: (defprotocol Path (path [t ...])) and then let your proxy implement that
04:08Licenser_that works?
04:08hoeckor use gen-interface to create an interface with a `path' method
04:09Licenser_when I use defprotocol could I call (path obj) ?
04:12hoeckLicenser_: http://gist.github.com/416900
04:12hoeckLicenser_: yes, (path x) works also
04:12Licenser_wooh!
04:13hoeckLicenser_: are you actually subclassing anything or only implement swing interfaces?
04:13Licenser_no I just need some way to store the Path data with the object itself
04:13Licenser_this is just for ugly swing stuff
04:14hoeckand you don't subclass a, say, javax.swing.JTree$Node ?
04:14Licenser_no it is ugly
04:15hoeckthen using deftype may be a bit more idiomatic, since it can also implement arbitrary interfaces
04:15hoeckjust my 2c
04:15Licenser_:/ I find this very badly(not) documented
04:15Licenser_hoeck: I kind of don't see through all that
04:15Licenser_will deftzpe even create java objects?
04:16cemerickLicenser_: you realize you're working with prerelease stuff, right? :-)
04:18hoeckwell, (doc deftype) says it all, but its a bit terse :)
04:19Licenser_cemerick: psst :P
04:19hoeckLicenser_: *everyting* in clojure is a java object :P
04:19cemerickhrm?
04:19Licenser_cemerick: don't tell me those things, I might get scared :P
04:20cemerickha
04:20Licenser_hmm I think the documentation is wrong
04:21hoeckwhich part of it?
04:21Licenser_deftype seems to require you to supply this for the implementation of functions http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/defprotocol does show it does not
04:24hoeckright, that needs an update
04:24Licenser_also it should be Foo. not Foo
04:28Licenser_weee it works I love you hoeck! purely platonic of cause
04:30RaynesLicenser_: I'm going to teach you English. First lesson: The word you're looking for is "course". "Of course!" "Of course I love bananas!"
04:30RaynesLicenser_: :D
04:31hoeckRaynes: aren't you the father of sexpbot?
04:32hoecksexpbot could pm all the non-native speakers and correct their grammar and spelling mistakes :P
04:33Chousuke:P
04:33ChousukeOn some channels it feels the natives need that more.
04:33sparievhoeck: as a non-native speacker, I would appreciate such a service :)
04:34hoeckspariev: me too :P
04:34sparievRaynes, what your waiting for ? :)
04:35ChousukeNLP isn't trivial :P
04:35sparievoh, I missed *are* :)
05:01LajlaChousuke, are you a native?
05:05ChousukeLajla: nope
05:06LajlaChousuke, am I? Does 6 years old count for you?
05:07LajlaChousuke, what is your native language then?
05:10ChousukeLajla: Finnish
05:13Licenser_I have a question to resolve
05:14Licenser_if I do: (resolve 'some-existig-var) it returns the var, if I do (resolve 'non-existing-var) it returns nil, but if I do (resolve 'some.namespace) it throws a very odd excepotion
05:17LajlaChousuke, hyvin?
05:17LajlaMiksi ovat suomalaiset kaikkialla?
05:18LajlaMiksi olette mun maailmasessa? =(
05:18LajlaJa mun kanavissa?
05:21ChousukeIRC is a Finnish invention after all P
05:23LajlaChousuke, onko?
05:24LajlaAjattelen että sari sanoi sitä aikoinaan.
05:25Chousukejuu. Mutta puhutaan täällä englantia :P
05:25LajlaMutta ajattelen että kaikki suomalaiset ovat salaliitossa tuhota maailman.
05:25Licenser_I think I found a evilish bug in clojkure
05:26Licenser_the new changes to core & contrib make it impossible to (require 'c.c.seq-utils)
05:26Licenser_the ns exists but breaks stuff horrible
05:26LajlaChousuke, en koskaan, IRC on suomalainen.
05:26LajlaOlen teidän suomalaisessa salatiitossa.
05:27Chousuke:P
05:27LajlaTuhoamme maailman, mä ja suomalaiset.
05:28LajlaNyt olen tullut kuolemaksi, maailmojen tahoaja.
05:29Lajlatuhoaja*
05:29Licenser_gesundheit Lajla
05:30LajlaLicenser_, näe, olemme tuhoanut, mä ja suomalaiset.
05:31Lajlayhdeksi, olemme tuhoanut maailman kohta.
05:31Lajlamuahahahahhahaha
05:33Lajlachouser, mutta pidä musta kii, ja älä päästä koskaan.
05:33LajlaEh, Chousuke.
05:34hoeckLajla: stop hitting the `ä'-key :P
05:34Chousuke:P
05:34Lajlahoeck, I also have æ
05:34Lajlapædantic
05:34LajlaEncyclopædia Britannica
05:35Lajlahoeck, welcne cræft cænnst þu?
05:36hoeckis æ the same as ä?
05:36LauJensenhoeck: no its ae fused
05:36LajlaLauJensen, not per se.
05:36LajlaIn Old English, it was a sound on its own.
05:37LajlaThe same sound as in man
05:37LajlaOld English wrote the sounds in man, and in father differently.
05:37LauJensenWell Im Danish and we're the guys you stole it from
05:37LauJensenAnd we still use both æ ø and å regularily
05:37LajlaAs in, cræft (craft, skill) versus nama (name)
05:37LajlaHmm, I guess it's the reverse.
05:38LajlaTHe Anglo-Saxon switched to the Latin alphabet long before the Norse.
05:39LauJensenIn Danish, æ is ae fused together, and sounds like it as well
05:40LajlaLauJensen, substituting æ for ae is not allowed is it?
05:41LajlaAs in, it's considered a seperate letter, not just a typographic ligature.
05:41LauJensenYes, and aa for å and oe for ø
05:41LajlaRight?
05:41LajlaAhh, no way.
05:41LauJensenYea, its syntactic sugar
05:41LajlaIn Finnish, if ä isn't available a is praeferred.
05:41LajlaI always thought it was considered a seperate letter.
05:42Lajlaseparate
05:43LauJensenYou can write whatever you want in Danish. For instance our 3.rd biggest city Århus, is now officially changing to writing Aarhus instead, just for kicks
05:43LauJensenSame with Ålborg, you can freely write Aalborg on your mail and nobody would be confused
06:04LajlaLauJensen, ahh and æ exchanged for ae too?
06:05LajlaAs far as I know, å originated from ae, as in, an a with a small e over it.
06:06LauJensenLajla: Lets talk about it once we've learned everything there is to know about Clojure :)
06:08LajlaLauJensen, but etymology of gliphs is far more important than Clojure. =(
06:08LajlaChousuke, tanssikaamme Ievan Polkkasta.
06:14Licenser_cooookies
06:15LajlaLicenser_, ruisleipää. =(
06:15LajlaLajla muuten ruisleiväks.
06:16vegaiLajla: mitä ihmettä
06:16vegaioh, you're playing with a translator?
06:17Lajlavegai, ei ole hyvä suomalainen, tai on?
06:17Lajlavegai, are you?
06:18vegaisuomalainen? yes. A good one? debatable
06:18LajlaI don't think translators produce 'mun' in lieu of minun that often.
06:19LajlaErr, Suomi*
06:20Chousuke:P
06:21LajlaChousuke, don't laugh at my poor attempt at Finnish.
06:21LajlaI had less than poper education, my flatmate just happens to speak it over the phone with her mother, and a very dutchified variant too.
06:21ChousukeDonit's understandable.
06:21ChousukeDon
06:21Chousukesdfhksadlkj
06:21ChousukeDon't worry*
06:22LajlaI heard Finns living in Finland only two times, and that to me sounded like 'Finnish with a heavy Swedish accent.' =(
06:22clojurebot{1024 1024, 2048 2048, 3072 3072, 4096 4096, 5120 5120, 6144 6144, 7168 7168, 8192 8192, 9216 9216, 10240 10240, 11264 11264, 12288 12288, 13312 13312, 14336 14336, 15360 15360, 16384 16384, 17408 17408, 18432 18432, 19456 19456, 20480 20480, 21504 21504, 22528 22528, 23552 23552, 24576 24576, 25600 25600, 26624 26624, 32 32, 1056 1056, 2080 2080, 3104 3104, 4128 4128, 5152 5152, 6176 6176, 7200 7200, 8224 8224, 9248 9248,
06:22clojurebot"Elapsed time: 796.294 msecs"
06:22ChousukeHave you actually studied Finnish or how did you learn it?
06:22Chousukewow, that was late.
06:23LajlaChousuke, I will train under your tutelage and address you as 'mun opettaja, maailmojen tuhoaja'
06:23Chousuke:P
06:23LajlaChousuke, well, I watched my flatmate talk it with her mother and the rest from IRC.
06:23LajlaTHere are actually a lot of finns on IRC I've come to notice.
06:24Chousukethat's pretty impressive.
06:24ChousukeFinnish grammar is far from trivial. I'm Finnish, and I haven't a clue about it.
06:24ChousukeI'm lucky that I just know it :P
06:25LajlaNahh, Finnish grammar is actually quite simple once you get to know it, Finnish is ideal for me, I suck at learning word lists, but all words are derived from each other and the grammar is very regular.
06:25LajlaIf you see a word like 'nettiyhteyttä' for the first time you just know it means 'internet connexion'.
06:26Chousukewell, that does help
06:27Chousukethough you need to be able to recognise where one word ends and another begins
06:27bozhidarI think that Russian grammar is one of the hardest ones around
06:28ChousukeDoes it have 15 noun cases like Finnish? :P
06:28LajlaChousuke, well, it's fairly obviously netti + yksi + eys + partitive case.
06:28LajlaChousuke, well, Russian is often said to be hard, but Czech is a lot harder.
06:28bozhidarI'm not sure what those noun cases are, but it has 8 "padezha"(I don't know the English word for it)
06:29LajlaRussian is just one of the harder languages that people have interest in learning.
06:29LajlaRussian has six case I think.
06:29Lajlaseven if you count the new vocative.
06:29LajlaNominative, accusative, genetitive, locative/praepositional, dative, instrumental.
06:29bozhidarLajla: I stand corrected
06:29ChousukeLajla: heh, I wouldn't have thought of "yhteys" having any relation to "yksi" if you hadn't mentioned it :)
06:29bozhidarИванка Радева дава винаги твърди предложения ;-)
06:30bozhidara mnemonic to remember them
06:30ChousukeWhat are the cases in Finnish anyway?
06:30LajlaChousuke, hmm, well, I guess most English speakers also don't in 'unity' and 'unit'
06:31LajlaChousuke, taking yks: yks, yhden, yhtä, yhden, yhdessä, yhdestä, yhteen, yhdeltä, yhdellä, yhdelle, yhtenä, ydeksi from the top of my head.
06:31Chousukeyeah, but the names of those?
06:31LajlaThere are some more, but I think those are only limited to literary speech, as I never really learnt Finnish I don't know those.
06:31LajlaAhh
06:32Chousukealso the first should be "yksi"
06:32Chousukethough it's yks in speech
06:32Lajlanominative, genetive, partitive, accusative, inessive, ablative, ... , .. allative, dative, ...,essive, translative
06:32LajlaChousuke, oh yeah, that's true.
06:32Chousukeyeah there's the "comitative" case which is "yksine" which means something like "with (his) single ..."
06:33LajlaTo be honest, I more or less vary yks and yksi depending on the stress on the word.
06:33LajlaAhh, yes, and also an absessive or something.
06:33Lajlayksettä or something.
06:33LajlaMeaning 'without one'
06:33ChousukeI think that needs to be yhdettä
06:34LajlaEhh, that is correct.
06:34Chousukeyksittä in plural I suppose. if that makes sense.
06:35LajlaBut I guess Finnish is hard for people that learn it by just memorizing all parts, I'm too lazy to go through lists and lists of grammar and words and rather just extrapolate a pattern, which is easier in Finnish because it's regular and all words are derived from one another.
06:35LajlaHmm, plural is yhdittä I would gather.
06:35Chousukethat sounds wrong to me.
06:36ChousukeI think the plural inhibits consonant gradation in this case.
06:36LajlaAh,, it seems you're right according to wiktionary.
06:36LajlaI never really use the plurals of yks I guess.
06:36LajlaSingular not that often too, more in derivations like yhteen.
06:36LajlaOr yhdeksi.
06:36LajlaOr wait, that are cases too.
06:40ChousukeOne of the things I like about Finnish is that neologisms are commonly coined and adopted
06:40ChousukeThere aren't that many words in use that are obviously non-Finnish :/
06:41LajlaChousuke, actually, some estimates place the surviving Finnish vocabulary in Finnish to be at 300 words.
06:41LajlaFor instance, tyttö is a borrowing from a Germanic language, compare English: daughter.
06:41ChousukeYeah, I've heard that too
06:42LajlaFinnish is quite unique in that it has even borrowed words of close kinship like 'äiti', it's very unusual for a language to borrow words for things such as 'mother' and 'daughter'.
06:42LajlaFinnish seems to borrow and naturalize words easily, but borrows grammar very hard.
06:42ChousukeThe words are integrated so well into the language that you can't tell foreign words from native ones :P
06:43Lajlakahdeksan is also from kaksi + dek (IE, compare latin: decum) as in 'two from ten'
06:43LajlaYap, Finnish adjusts loans to Finnish phonology.
06:43ChousukeI hope we're not inhibiting Clojure discussions with this off-topic rambling :P
06:44Chousukeseems like most people are idling right now though.
06:44Licenser_I never idle I just dn't pay attention :P
06:44ChousukeAlso I had no idea kahdeksan was formed like that. :P
06:45LajlaClosure is probably excellent to model Finnish grammar in.
06:45LajlaI once started doing it in Scheme, never finnish.
06:45Licenser_Lajla: because concurrency is very important in finnish?
06:45LajlaLicenser_, no, because lisps just happen to be.
06:45LajlaLicenser_, I think you should serve me.
06:46LajlaAnd address me as 'Mine overlord'
06:46Chousukewill you be digging for precious minerals?
06:47LajlaAll Finland has of that is Ukon Kivi man.
06:47Lajla'ukkonen' is also an awesome word.
06:47LajlaActually, 'thunder' has a similar origin, it's also a diminitive of 'thor' in a way I think.
06:47ChousukeIt's amusing how ukko means an old man nowadays
06:48LajlaChousuke, voinko panna ukot sun perseeseen?
06:49Chousukethat was just random :P
06:49LajlaTai kahdeksan katanaa, jos olet sadomasokisti?
06:49vegai:-o
06:50Lajlahttp://thisdomainisirrelevant.net/1035
07:14npoektophi! trying to do (use 'clojure.contrib.repl-utils) and then (apropos ...). It says "Unable to resolve symbol". But it should be there: http://richhickey.github.com/clojure-contrib/repl-utils-api.html
07:17canderanpoektop: Working for me at my 1.2 REPL.
07:18bozhidarI don't have it either - 1.1 REPL
07:18Chousukethose docs are for the contrib master branch
07:18Chousukeare you using it or the 1.1 release?
07:19npoektopChousuke, 1.1
07:19npoektopok. it's ok
07:21bozhidarbtw I was wondering what might be causing an exception when trying to use slime-edit-definition in SLIME(M-. by default)
07:21bozhidarI only get NPEs when trying to use it
07:22bozhidarwith functions that I loaded myself into slime
07:22bozhidarbut it works great with stuff coming with clojure itself
07:23bozhidarif the fact that I'm not loading the whole source file causing this?
07:26canderaDoes it work if you eval the whole file via slime-eval-buffer?
07:27canderaI seem to recall that one of the various options will give SLIME enough info to locate things in source, while others will not. Which makes sense when you think about how it would know where something is if you just eval it from the middle of a buffer or whatever.
07:29bozhidarcandera: no, same problem with slime-eval-buffer
07:29canderaMaybe I'm thinking of slime-compile-file.
07:31bozhidarcandera: slime-compile-file throws an exception - Wrong number of args passed to: basic$eval--986$compile-file-for-emacs
07:31canderaYeah, OK, I thought that might happen. Sorry: I'm out of ideas, even ideas as lame as the first two. :p
07:32bozhidarthe file is pretty basic, just a couple defn, maybe a namespace declartion is required?
07:35canderaCould be - if you give it a namespace you can (require) it, and that will result in a load from a file, which might be enough to get SLIME to be able to understand it.
07:45Licenser_hmm the new defmulti, does not get a list of arguments any more?
08:54fogus_LauJensen: Is this the best URL for ClojureQL? http://gitorious.org/clojureql/
10:27clojurebot{1024 1024, 2048 2048, 3072 3072, 4096 4096, 5120 5120, 6144 6144, 7168 7168, 8192 8192, 9216 9216, 10240 10240, 11264 11264, 12288 12288, 13312 13312, 14336 14336, 15360 15360, 16384 16384, 17408 17408, 18432 18432, 19456 19456, 20480 20480, 21504 21504, 22528 22528, 23552 23552, 24576 24576, 25600 25600, 26624 26624, 32 32, 1056 1056, 2080 2080, 3104 3104, 4128 4128, 5152 5152, 6176 6176, 7200 7200, 8224 8224, 9248 9248,
10:27clojurebot"Elapsed time: 338.891 msecs"
10:29chouserwth!?
10:29Lajla,(factorial 40000)
10:35clojurebotjava.lang.Exception: Unable to resolve symbol: factorial in this context
10:42bhenry,(let [fact (fn [x] (apply * (range 1 (inc x))))] (fact 40000))
10:42clojurebotExecution Timed Out
10:42bhenry,(let [fact (fn [x] (apply * (range 1 (inc x))))] (fact 400))
10:42clojurebot640345228466238952623479703195030058507025830260029594586844459428023971691868314362784786474632646762943505750358568108482981628835174352289619886468029979373416541508381624264619423523070462443250151144486708906627739149181173319559964407095496713452904770203224349112107975932807951015453726672516278778900093497637657103263503315339653498683868313393520243737881577867915063118587026182701698197400629830253085912983461622
10:43fogus_clojurebot is not self-aware!
10:44fogus_or is it?
10:50Ankouhi, I've read that you should work against the seq abstraction and work with vectors and so on whenever possible. But is it better to work with seqs or to do stuff like (vec (map f [1 2 3]))?
10:51chouserthat example *is* working with seqs. 'map' is a seq function.
10:52chouserto achieve the same thing without using the seq abstraction, you'd have do to something like...
10:53chouser(loop [v [1 2 3] i 0] (if (== i (count v)) v (recur (update-in v [i] f) (inc i)))) ; don't do this
10:55rhickeychouser: update-in is a bit much
10:56chouser(assoc v i (f (nth v i)))
10:57chouser(transient [1 2 3]) ... (persistent! v) ... assoc!
10:58rhickeywhy not conj? updating every element in a vector is much more expensive than creating a new one
10:59phobbsHello. I want to do something like this: (for [temp-func '(+ - *)] (temp-func 1 2)) concisely... but that returns (2 2 2), when it seems like it should return (3 -1 2)...
10:59cburroughsthe standard clojure-maven-plugin compile <executions> fragment runs after java compilation, which is no good if the java code depends on clojure code. Is there a way to make mvn compile compile clojure code first?
10:59chouserrhickey: why not vec?
10:59rhickeychouser: as in the original?
11:00chouseryes
11:00fogus_,(let [tf (juxt + - *)] (tf 1 2))
11:00clojurebot[3 -1 2]
11:00rhickeychouser: yes, of course that's fine
11:00fogus_phobbs: ^^
11:00rhickeybut the non-seq replacement isn't replace-in-place
11:00phobbsfogus: thanks! juxt is cool.
11:01fogus_phobbs: I love juxt
11:01phobbsfogus: but why does the code I provided behave differently?
11:01chouserphobbs: to get a sequence of functions, you want [+ - *] instead of '(+ - *)
11:02phobbswhat is the difference?
11:02phobbs,(for [tf [+ - *]] (tf 1 2))
11:02clojurebot(3 -1 2)
11:03Licenser_phobbs: '(+ - *) = (list '+ '- '*)
11:03chouser' prevents things from being evaluated, so you had a list of symbols.
11:03Licenser_all elements are not evaluated
11:03fogus_,('+ 1 2)
11:03clojurebot2
11:03chousersymbols are not the same as the functions they name
11:04phobbsoh
11:04phobbsthanks
11:04Licenser_(list + - *) should have worked too
11:04chouser(list + - *) would work too
11:04phobbsbut if I do ,(def temp-func '+)
11:04phobbs,(def tf '+)
11:04clojurebotDENIED
11:04phobbshaha
11:05phobbsok well if you do that
11:05fogus_we know what you mean
11:05Licenser_phobbs: nope won't work
11:05phobbshuh ok
11:05phobbsI thought I had already tested that. Well that explains it, thanks!
11:05Licenser_(def tf +) will so
11:05chouser(let [v [1 2 3]] (loop [v2 (transient []) i 0] (if (== i (count v)) (persistent! v2) (recur (conj! v2 (f (nth v i))) (inc i))))) ; don't do this either
11:05canderaSo I'm curious: given that a symbol is Runnable, what does it do when invoked?
11:06chouserlooks itself up in a map
11:06canderaBut in this case it was being applied to two integer arguments.
11:06chouser,('the-answer '{the-answer 42})
11:06clojurebot42
11:06chouser,('the-question '{the-answer 42} :not-found)
11:06clojurebot:not-found
11:06candera,('+ 2 2)
11:06clojurebot2
11:07chouser,('the-question 2 :not-found)
11:07clojurebot:not-found
11:07candera,('+ 2)
11:07clojurebotnil
11:07rhickey,(.run 'foo)
11:07clojurebotjava.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong number of args passed to: Symbol
11:07candera,('+ 1 2 3 4 5)
11:07clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: Symbol
11:07Licenser_,(.run forest run!)
11:07clojurebotjava.lang.Exception: Unable to resolve symbol: forest in this context
11:08phobbs,(.run 'forest run!)
11:08clojurebotjava.lang.Exception: Unable to resolve symbol: run! in this context
11:08canderaLooks like it takes one or two args. But what on earth does it do?
11:08phobbs,(.run 'forest 'run)
11:08clojurebotjava.lang.IllegalArgumentException: No matching method found: run for class clojure.lang.Symbol
11:09rhickey('foo {'foo 42})
11:09rhickey,('foo {'foo 42})
11:09clojurebot42
11:09chousercandera: it looks up the symbol in the first arg. If the first arg is not a map or the symbol is not found, it returns the second arg or nil if not given.
11:09canderaAh, got it. Makes sense.
11:10canderaConsistent with other map lookup APIs.
11:10Licenser_hmm I think we should make a clojure form that renames nil to a_cookie. Then you could say "
11:10fogus_candera: check this out http://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Symbol.java#L119
11:10Licenser_This function returns a_cookie"
11:10phobbsok, I have another question: I want to use multisets, so I figured lists should work.
11:11canderafogus_: Thanks. I wasn't quite curious enough to go source spelunking. ;)
11:11phobbs,(clojure.set/union '(1 2 3) '(2 3 4))
11:11clojurebot(4 3 2 1 2 3)
11:11fogus_I've had that page up for 6months waiting for this question. :p
11:11phobbsbut difference doesn't work with lists
11:11phobbs,(clojure.set/difference '(1 2 3) '(2 3 4))
11:11clojurebotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IPersistentSet
11:11phobbswhy can union accept lists but difference can't?
11:12phobbsis there a better way to do this?
11:12fogus_phobbs: why not use sets?
11:12phobbsmulti-sets can have repeats.
11:12phobbs#{1 1}
11:12phobbs,#{1 1}
11:12clojurebotDuplicate key: 1
11:12phobbsdoesn't work.
11:12fogus_oh, i missed the multisets comment
11:12fogus_sorry
11:15chouserphobbs: clojure.set functions are only sure to work with sets. Some of them might not be that strict, but their behavior is undefined.
11:16chouserwhat does difference mean on a multiset anyway? (difference [1 1 1] [1]) => [1 1] ?
11:17phobbsYeah, that's what I was intending
11:17phobbsI guess I could keep a map between elements and counts
11:17phobbsand implement difference myself
11:18chouserthat might be best
11:19rhickeythere's no such thing as a multiset
11:23hoeckphobbs: http://gist.github.com/410875
11:24phobbsrhickey: I meant the concept, http://en.wikipedia.org/wiki/Multiset
11:26phobbshoeck: that's awesome. Did you find that or just write it? thanks a lot
11:30hoeckphobbs: some days ago, someone needed a multiset for a project euler task
11:30rhickeyphobbs: smells like a map to me, but the operations are fine
11:31hoeckphobbs: but its only a minimal implementation, some things are missing
11:32jweissis there a functional way of taking a list of lists and basically "turning it sideways" - so that i get a new list of lists, but the rows and cols are inverted
11:33jweissie, [ [ 1 2 3 ] [ 4 5 6] ] -> [ [ 1 4] [2 5] [3 6]]
11:34chouserjweiss: those are vectors
11:34chouserjweiss: for seqs, (def transpose (partial apply map vector))
11:35chousermeh. probably should be 'list' instead of 'vector' there
11:36jweisschouser: sweet, thanks
11:36jweissyeah it works with vector input also - since they are also seqs right?
11:37chouserapply and map will seq across them, so yes a vector of vectors will work
11:44djpowellhmm - clojure.java.sh doesn't handle stderr very well
11:44djpowellyou need two threads to do it properly
11:47chouserdjpowell: bleh, really? do you have a failing test case?
11:48cgrandwhy does Var.bindRoot dissoc meta's :macro?
11:49djpowell- (sh "cmd" "/c dir c: 1>&2")
11:49djpowellchouser: stderr's buffer gets full and the call hangs
11:53djpowellJava's Process class could really have done with having nio support so that you could block on both streams from one thread - instead we just got the blatent intern project of ProcessBuilder which doesn't seem to make using Process any easier at all
11:54replacayeah, it would be nice to do some more work on getting a relly nice version of "sh"
11:55replacaone that let you easily manage the different ways you might want to use it
11:55djpowellsh reading a byte at a time is going to be a bit inefficient too if there is lots of output
11:56Licenser_does reduce increase the stack size further then the function it calles + 1?
11:56chouserthe most important issues are around the API -- what do you think of that?
11:56chouserthe implementation can be fixed
11:57digashI am getting this "java.lang.ClassFormatError: Invalid method Code length 68016 in class file" from compiler any suggestions?
11:57djpowellI haven't tried it yet - but it looks ok
11:59chouserdigash: do you have a large literal object?
11:59patrkrisrhickey: are locks taken in any particular order in the commit phase of a transaction? I see that for commutes it seems to be the case, but not for refs. Am I right?
11:59patrkrisrhickey: that didn't make sense - i meant for commutes and not for sets
11:59chouserdjpowell: btw, why use "cmd" instead of calling dir directly?
11:59Licenser_I know this from jruby,. it happens as chouser when your objects grow too much
11:59chouseroh, is dir not external on windows?
12:00djpowellyeah
12:00chouserblah
12:00chouserok
12:00djpowelland even if it was, you need "cmd /c" to enable the shell feature of redirection
12:00digashchouser: i am generating protocols from a macro, would that create a large literal?
12:01tmountaincan anyone tell me the easiest way to write a lazy seq to a file?
12:01djpowellchouser: I think Java is the same with unix? I think you'd need to use 'sh' or something to include pipes in your command line - not sure
12:01rhickeypatrkris: sets are flagged as owned previously, and won't be acquired and held otherwise, so the committer knows it owns them and doesn't need to sort
12:02chouserdigash: hm... protocols include a literal. are they really large protocols?
12:02patrkrisrhickey: oh yeah right - and that isn't the case for commutes. Thanks!
12:02chouserdjpowell: yeah, for piping you'd have to.
12:02digashchouser: not really, it works if i use definterface, but not with defprotocol
12:04tmountainnm, spit ... ;-)
12:04digashchouser: i will try to split it into multiple namespaces, maybe it will help
12:06Licenser_digash: do you use genclass?
12:06digashchouser: also i am getting quite a few "Warning: protocol #'com.pico... is overwriting method positi... of protocol Long...
12:07digashLicenser_: no genclass, i was using definterface which i believe does and then switched to defprotocol and start getting that error
12:10chousermy clojure repl startup time recently fell off some kind of cliff. Used to be 1 or maybe 2 seconds, now over 8
12:11Licenser_digash: *nods* okay was just a thought that a gen-class in your ns might cause this :)
12:12chouseroh, it appears to be something it my own setup. sorry for the noise.
12:23djpowellhmm - is there an easy way to create a new thread in clojure - an actual new thread - not just some potential thread-poolish thing
12:23arohnerdjpowell: (Thread.)
12:24djpowell(actually some sort of pluggable executor strategy might be nice)
12:24arohnerdjpowell: and clojure fns are all runnable, so (Thread. #(map foo bar))
12:55replacachouser: (re: sh) one thing I would like is a way to get output incrementally (or even just automatically redirect it to *out* when I'm doing something where I want the client to see the output)
12:58chouseryeah, that's often requested. I'm worried about people failing to close one of the streams which may keep zombie processes around
13:02replacachouser: I think what's necessary is an interface that makes it easy to do what you want, but no more. There are a lot of separate ways that you end up wanting to use a shell-out feature and I don't think that any language has packaged them up really nicely
13:03replacachouser: I certainly think the the "run and just give me a string back" needs to be on the menu, but it's not always what you want to eat
13:04chouseryeah, I've never seen a shell-out API that is both pleasant to use and feature-complete.
13:04replacachouser: It would be a great step forward if we could have a nice shell out in Clojure (compared to Python say, which is also always not-quite-right it seems)
13:04chouserI hoped that by ditching feature-complete as a goal, I could at least get pleasant-to-use. Not sure it worked.
13:05replacachouser: and I don't want us to cast in stone (or silly putty) something that doesn't meet our goal
13:05replacachouser: I think that we have the facilities to get both in Clojure. I don't think it has to be a single call, though it may be with the right keyword args
13:12jweisswhen in slime, and you "use" a file from the repl, and the compiler throws an error, how do you determine what line of the source file it choked on?
13:13chouserjweiss: you want to look at the final (not the root) exception, and you should see the filename and line number in the exception message itself
13:14chouserI don't know how to do that in slime, sorry.
13:17jweisschouser: all it says is "Don't know how to create ISeq from: clojure.lang.Symbol"
13:17jweissi guess i can try lein repl
13:18jweissoh wait there it is on the lein swank stdout :)
13:18jweisssweet
13:35jweisshm, i am trying to call str on a sequence, and println it. i am getting "clojure.lang.LazySeq@3e2"
13:36jweissso either str is not the right way (even though it seems to work at the repl) or I need to unlazify my code?
13:36replacaQ: does anyone know how to get any info about a protocol dynamically? It doesn't seem to own its symbol: (doc Streams) gives me an error for example.
13:50replacaoops, my bad -- I was comparing different versions of io and it changed
13:51zakwilsonhttp://gist.github.com/416794 <-- I'm having issues getting a parallel map for a fast f and large coll to scale to more cores. It's perfect with two, but doesn't improve further with four.
14:11timcharpercan anyone see this ?
14:11zakwilsonYes
14:12timcharperLimeChat is being lame.... I posted a whole stream of messages and none of them made it through
14:12timcharperback to ERC
14:21r2q2Where is a good tutorial for compojure?
14:25fogus_Can anyone comment on which is the cleaner syntax? http://gist.github.com/417513
14:26ysphr2q2: that's a good question, i started writing a compojure app a few weeks ago, i remember the groups post about changes in the latest version being helpful
14:26ysphi can't recall finding an actual up-to-date tutorial
14:27ysphhere it is http://groups.google.com/group/compojure/msg/519e8fd5cd76dacb
14:28chouserfogus_: my bikeshed is red
14:28chousererm, I mean "kontract"
14:28fogus_:P
14:29zakwilsonI think I like the keywords better, but it just doesn't matter much.
14:29chouserin general, clojure tends towards less grouping, though of course there are still things like gen-class that group where it might not be necessary
14:30chouserkontract reminds me of how defrecord/deftype don't group per protocol
14:30chousera.k.a. rhickey's bikeshed is blue so yours should be too
14:30fogus_contract seems very common-lispy to me.
14:31fogus_although I might need another group os parens for that. ;)
14:31fogus_I'm leaning towards kontract
14:32fogus_chouser: But I don't even own a bike! :(
14:32r2q2ysph: Thank you for your help!
14:33ysphfogus_: maybe you could throw a 'c' and a 'k' in there somehow
14:33ysphcontrakt
14:34ysphi guess that's about the same, oh well
14:34ysphr2q2: good luck
14:35fogus_I'll reserve contrakt for when the constraints are specified with infix notation. :O
14:40r2q2ysph: You too!
15:17phobbsI'm having some problems getting slime set up on emacs
15:17phobbsI get a bunch of these errors when I start slime:
15:17phobbsWARNING: group-by already refers to: #'clojure.core/group-by in namespace: swank.core.protocol, being replaced by: #'swank.util/group-by
15:18phobbsfurthermore, something in my emacs setup is stopping the slime buffer from appearing. It shows up when I use emacs-starter-kit.
15:19phobbsAlso, when I use a print statement, I get a message: error in process filter: slime-dispatch-event: Elisp destructure-case failed: (:write-string "<WHAT I PRINTED>")
15:20phobbsthe inability to print is really bothering me. The warnings don't seem to affect anything, and I don't seem to miss the *SLIME* buffer that much...
15:20phobbsthough who knows, since I haven't spent practically any time in it, besides what I've seen from emacs-starter-kit.
15:26arkrosthi! Tell me please what is the difference between class and type functions from clojure.core. It would be nice to see when they will return different results.
15:26chouser,(class #^{:type ::Foo} {})
15:26clojurebotclojure.lang.PersistentArrayMap
15:26chouser,(type #^{:type ::Foo} {})
15:26clojurebot:sandbox/Foo
15:28arkrostWhat can I use this for?
15:29chouserwell, you could make a multimethod that dispatches on type and have different maps be routed to different method implementations based on their :type metadata
15:29chouserbut that whole approach is less often useful now with protocols and records
15:30stuarthallowaypromotion of string to core is proceeding in a branch: http://github.com/stuarthalloway/clojure/tree/string
15:30stuarthallowayfeedback welcome!!
15:31stuarthallowaybad ideas are liebke's fault
15:31chouserheh
15:31liebkethanks
15:31stuarthallowayand man, that dude swears a lot
15:45_na_ka_na_if a future is created, what are the semantics of it getting executed in another thread? is it done immediately by cr8ing a new thread? or in a thread-pool? or not unitl one @'s it?
15:45arohner_na_ka_na_: it happens in the agent thread pool, starting immediately
15:45chouserthe send-off pool
15:46_na_ka_na_oh, but the docs don't say so ..
15:46_na_ka_na_reading the docs it appears it happens immediately?
15:46chouseryes, immediately
15:47_na_ka_na_but then that will give me an impression that (map #(future ..) (range 100)) will create a 100 threads?!
15:47chouserI would think so, yes.
15:48_na_ka_na_but you just said it uses the send-off pool?
15:48chouseryes
15:48_na_ka_na_isn't that pool of fixed size?
15:48chouserno
15:48chousersend is fixed-size. send-off grows
15:48_na_ka_na_oh ya ..
15:49mefestodoes `proxy` not like it when an interface has an overloaded signature?
15:49_na_ka_na_does it also mean that pmap is not lazy at all?!
15:50_na_ka_na_it will spawn (count coll) threads ?
15:50chouser_na_ka_na_: no, pmap throttles itself some.
15:51_na_ka_na_oh ok, just saw the source it throttles as map is lazy .. .
15:51kotarakmefesto: what is your problem exactly?
15:51mefestogetting an IllegalArgumentException: Wrong number of args (2)
15:51kotarakmefesto: code?
15:51mefestoone sec while i gist
15:51_na_ka_na_chouser: thanks
15:52kotarakmefesto: and a shameless plug: http://bit.ly/cS8AjJ
15:52hsjunnessonUsing leiningen I tried adding :jvm-opts ["-XstartOnFirstThread"] to the project file, but that didn't work with "lein swank". JAVA_OPTS=-XstartOnFirstThread" lein swank does though.
15:52chousermefesto: you can have multiple method bodies on each proxy method for the various arities
15:53kotarakmefesto: but not for different types, you to take care of that in the functions.
15:54mefestohttp://gist.github.com/417642
15:54kotarakmefesto: so (.foo the-proxy "some string") and (.foo the-proxy 5) has to be distinguished in the foo function
15:54mefestoi wanted to be able to treat a spring context similar to a map and do: (:beanName ctx)
15:55chouserkotarak: very nice treatment in the blog post.
15:55kotarakchouser: thanks :)
15:56mefestokotarak: thanks i think i see what im doing wrong. (btw great blog :)
15:57stuarthallowayso nobody has any (more) feedback on the string fns?
15:58chouser:else not :default
15:59stuarthallowaychouser: you're talking to me, aren't you
15:59chouserstuarthalloway: hi :-)
16:00chouserI like the type-dispatched functions. that was missing from some late versions in contrib, wasn't it?
16:00chouserthey're cond now because that's faster than mutlimethods?
16:00stuarthallowayyes, and some people like it the other way
16:01stuarthallowaychouser: yes, liebke and I perf-tested everything that wasn't a straight java passthrough
16:01chouseryou're talking about yourself, aren't you
16:01stuarthallowayi like the code as is
16:02stuarthallowayand I just committed :default -> :else
16:02stuarthallowaywith your name in the commit msg, so I hope I understood what you were about
16:02chousercapitalize seems like an odd inclusion.
16:03stuarthallowayrhickey thought so too
16:03stuarthallowaythe fns chosen came from an informal read of what people were using
16:03mefestokotarak, chouser: got it working, thanks :)
16:03chouserwhew, on his side of something for once.
16:03chouserthe only name I have any question about is trim-nl
16:04stuarthallowayif you were really on his side you wouldn't use string fns at all
16:04chouserand it's not terrible.
16:04chouserheh
16:04stuarthallowaywhat would you like to call it
16:04chousershould have known better.
16:04stuarthallowaybtw (and I plan to email the list about this)
16:04stuarthalloway... all these decisions are being made with Rich's input
16:04chousertrim-nl docs should perhaps reference string/trim instead of String.trim ?
16:04stuarthallowayrich and I have a phone call every day
16:05chouserI miss having all of Rich's imput logged somewhere.
16:05chouserinput
16:05stuarthallowaywhere was it before?
16:05chouserhere or on the group.
16:05stuarthallowayI am trying to take things off his plate, not hide him from the world !
16:06chouseryeah, it could be you're just party to what used to be only in his head. I guess that's a win. :-)
16:06riddochcI just read the thread on the string functions. It started to feel a little like bikeshedding...
16:06stuarthallowayso long as it continues the current trend of freeing him to focus on strategic things
16:07hamzagents, which function do i need to implement so that sort call will work on my defrecods? or is it possible?
16:07chouserthe main thing that bothers me about trim-nl is that with some fonts it's not obvious it isn't trim-n1
16:07stuarthallowayriddohc: hope the code doesn't feel that way!
16:07chouserbut I don't have any great suggestions.
16:07stuarthallowaychouser: how about trim-newline?
16:08riddochcstuarthalloway: I haven't looked at the code for it, yet, so I don't know.
16:08chouseryeah, actually -- that's not bad. I'm not a fan of long function names, but maybe worth it in this case.
16:08pedroteixeirawouldn't be better to use regexp replace for the "trim-nl" function?
16:08tomojchouser: I read that as "... trim-n1 ... trim-n1" :(
16:08chousertomoj: exactly
16:08chouserok, gotta go.
16:08chouserstuarthalloway: I have complete confidence you'll choose wisely
16:09chouserdespite that :default fiasco
16:09SinDocstuarthalloway: I get this when I try to run labrepl: http://gist.github.com/417488
16:09chouserstuarthalloway: actually, there's another :default in there still.
16:10stuarthallowaydoh!
16:10stuarthallowaySinDoc: abedra has forked labrepl and is fixing the warnings
16:10stuarthallowayas long as they are warnings they won't hurt you
16:11SinDocwarnings are my friends, yeah but the server doesn't start
16:11stuarthallowaySinDoc: hmm, that's odd
16:12SinDocBTW, I'm on IntelliJ
16:12stuarthallowaycan you try grabbing abedra's and see if it works for you
16:12stuarthallowayhe has renamed labrepl to embark
16:12stuarthallowaychouser: will remove the other :default in the next commit
16:12pedroteixeiraperhaps, overloadinf the function trim to take an argument to remove newlines is better than having trim-ln?
16:12SinDocstuarthalloway: OK. No problem; thanks!
16:13abedraSinDoc: all the labs work, I am just working on updating all the instructions
16:14fogus_riddochc: I prefer the term bike-shedding. :p
16:14SinDocabedra: Is the problem on my end then?
16:14riddochcfogus_: You mean, hyphenated?
16:16fogus_yes, that is more aesthetically pleasing
16:17liebkeok, this is a little confusing, but
16:17liebkeI am stuarthalloway, on liebke's box
16:17liebkewhile he is on my box making trimr run faster
16:17Raynestechnomancy: ping
16:17liebkeso if I offend anyone, remember that I am stuarthalloway
16:18liebkepedroteixeira: we decided that all the overloading would happen in replace
16:18liebkeso if you havea simple need, you can hit a named fn
16:18pedroteixeiraliebke: ok, cool :)
16:18liebkeif you have a need outside the anticipated defaults, use replace
16:19liebkeand man, pedroteixeira is hard to type...
16:20kotarakIs there a naming convention for protocols in contrib? Like ISomeInterface; maybe PSomeProtocol?
16:20pedroteixeirait is shorter than stuarthalloway ;)
16:20liebkefair enough, but it is full of vowels
16:20nDuffvowels are great -- at least for folks using dvorak, they're easy to type.
16:21liebkethe best thing about dvorak is switching into (or out of) it on your friend's keyboard
16:22liebkekotarak: not so much yet, thoughts?
16:22abedraSinDoc: i mean they all work on my embark project
16:24SinDocabedra: obviously, I should pull embark then
16:24kotarakliebke: Hmm.. I would maybe just go with CapitalInFront. This is sufficiently clear in usual clojure code, I'd say. Makes sense?
16:24liebkeagreed on cap conventions
16:24abedraSinDoc: yes, for now
16:24liebkeno need for I or P
16:25kotarakliebke: k
16:25SinDocabedra: So it's a fork and you plan to merge back later
16:25riddochcI have a set of shell aliases I use, 'asdf' and 'aoeu', to switch back and forth between qwerty and dvorak, so my wife can occasionally use my laptop.
16:25kotarakbtw, what should bugs be tagged like which should be fixed for 1.2? Is this rhickey's privilege to decide?
16:26kotarakI'm asking because I opened a ticket for the new reductions. (with patch)
16:26liebkekotarak: if I understand your question correctly, yes, Rich decides
16:26kotarakrhickey didn't react to email...
16:26liebkeI (stu) saw that. please mark it as 1.2 and assign to me (stu)
16:27kotarakk
16:27liebkethanks!
16:28abedraSinDoc: correct
16:28kotarakdone
16:29SinDocabedra: I noticed there's no pom.xml
16:31abedraSinDoc: yep, you'll have to use leiningen for now
16:31abedralein deps
16:31abedrathen ./script/repl
16:37phobbswhy would giving type hints slow something down?
16:38phobbsI'm using the example on clojure.org/transients
16:38phobbs(defn vrange2 [n]
16:38phobbs (loop [i 0 v (transient [])]
16:38phobbs (if (< i n)
16:38phobbs (recur (inc i) (conj! v i))
16:38phobbs (persistent! v))))
16:38phobbsbut on my machine,
16:38phobbs(defn vrange3 [n]
16:38phobbs (loop [ i (int 0) v (transient [])]
16:38phobbs (if (< i n)
16:38phobbs (recur (inc i) (conj! v i))
16:38phobbs (persistent! v))))
16:38phobbsis slower
16:38Raynes-> gist.github.com
16:38phobbsoh, sorry
16:39RaynesFor pastes that are over one or two lines, please paste them at a pastebin like gist.
16:39RaynesIsn't a biggy, you didn't know. <3
16:39lancepantzburn him!
16:39Raynes:)
16:39lancepantz:D
16:40Chousukephobbs: possibly because conjing the i into a vector ends up boxing it anywa
16:40Chousukephobbs: so you're just unboxing it with the int cast, for no gain
16:41phobbs http://gist.github.com/417710
16:42phobbsoh... can I make it a vector of ints to stop this? Or is there no way to avoid this overhead?
16:42LajlaChousuke, te pornotähdet.
16:43Chousukevectors of primitives will be in 1.2 I think? or is that for 1.3
16:43ChousukeLajla: Is there a point to your random interjections? :P
16:43kotarakArgh, is there a tutorial for maven on OS X (to compile contrib)?
16:44LajlaChousuke, it's like James Joyce, it keeps insanity away.
16:44phobbsChousuke: if you don't use transients, the type hint speeds it up. What's conj! doing that conj isn't?
16:44Chousukehmm :P
16:45Chousukephobbs: huh.
16:45RaynesCompiling contrib manually should be punishable by horrific death.
16:45Chousukephobbs: I can't see any reason why a type hint would speed that up at all
16:45Chousukephobbs: transients or no transients
16:46kotarakRaynes: when developing for contrib this not applicable, I think.
16:46Rayneskotarak: That's a special circumstance. ;)
16:46Rayneskotarak: Under Raynes Law, you're allowed to compile contrib yourself if you're contributing!
16:46RaynesIsn't it obvious? :p
16:47Chousukeisn't just mvn compile enough?
16:47Chousukemaybe mvn clojure:compile or something
16:47phobbsChousuke: speeds it up ~2x on my machine
16:47kotarakChousuke: yeah, but how to get a mvn in the first place?
16:48Chousukephobbs: that makes no sense.
16:48phobbsChousuke: Optimizing high-level languages makes no sense. I should be writing this sort of code in java.
16:49digashkotarak: if you on mac os $ sudo port install maven2
16:49Chousukebut is there any reason you're not using into? :P
16:49kotarakdigash: thanks
16:49phobbsChousuke: not really, I was just fooling around with the example code, that's all.
16:53_na_ka_na_Q: If I only use a commutative fn in my dosync transactions, will a transaction ever be re-tried?
16:54_na_ka_na_meaning I'm using the commute function to change the ref
16:57mefestoyeah i think it can be retried
16:58mefestoyou should be using side-effect-free fns for updating refs
17:05arkrost /exit
17:07_na_ka_na_mefesto: its a side effect free fn only, just want to understand why will it be re-tried? as its commute
17:08mefestowell afaik, the transaction will be retried automatically if some other thread happened to commit the tx before this one...
17:08mefestotx-a starts then tx-b starts, tx-b commits, tx-a retries, tx-a commits
17:09mefestoassuming tx-{a,b} use some of the same refs
17:09mefestobecause at the point that tx-b commits, the values that tx-a were working with are incorrect and needs to retry
17:11_na_ka_na_I agree with you completely if one were using ref-set or alter ... but this is commute .. doc of which says .. At the commit point of the transaction, sets the value of ref to be: (apply fun most-recently-committed-value-of-ref args)
17:11mefestoat least that's what i thought happens... i could be wrong :)
17:11mefestowhich is fine if it's only one ref we are talking about... but what if there are other refs involved?
17:11mefestomaybe if all refs involved were only using commute then it wouldn't matter?
17:12_na_ka_na_my original question was: If I *only* use a commutative fn in my dosync transactions, will a transaction ever be re-tried?
17:12_na_ka_na_thats what it seems but I'm not yet experienced enough to trust my understanding a 100% :P
17:13mefestoyeah after reading the doc on it again i think you are right...
17:14mefestosays, "you must accept last-one-in-wins behavior"
17:15_na_ka_na_Hmm
18:10OForerohi, I have a problem in the REPL
18:10OForero(use 'uk.ac.liv.oforero.currencies)
18:11OForeroresults in clojure.lang.Namespace.warnOrFailOnReplace(Namespace.java:84)
18:11OForerois there an option to tell the REPL to just relax and replace?
18:36mefestoOForero: (use :reload 'your.ns) ?
18:36OForerooki doki, thanks
19:39dysingersup
21:10konrJava hides the evaluable nature of data and thus binds the programmer into a never-ending cycle of suffering called Sunsara
21:10blbrown_win3is there a jason smith on here, that posts on the clojure groups forum. Calling mr smith
21:13blbrown_win3does anyone have examples for "embedding clojure" into a thread application, like a web server. If I am on a web server, I want to setup each request such that it loadeds in a seperate clojure untime
21:13tomojreally?
21:13tomojsounds slow
21:14blbrown_win3possibly, that is the ideal.
21:14tomojyou want a slow web server?
21:14blbrown_win3as slow as possible, yet
21:14blbrown_win3yes
21:14tomojstrange :)
21:14blbrown_win3possibly
21:20timmorgannoob question... why does this work: (map (fn [i] {:id i}) [1 2 3])
21:20timmorganbut this doesn't: (map #({:id %}) [1 2 3])
21:20timmorganjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
21:21tomoj#(foo) means (fn [...] (foo))
21:21tomoj#({:id %}) means (fn [i] ({:id i}))
21:22tomoj,({})
21:22clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
21:22timmorganok, so can I not create a map from within the #() from of fn?
21:22timmorgans/from/form
21:22konrhash-map
21:22tomojwell, you could, but it would probably not be any better
21:22timmorganhash-map, thanks
21:23tomojends up being one character longer than the fn version I think
21:23timmorganno the fn version is about 8 chars longer
21:23timmorganmaybe I'm not making sense
21:24tomojthe only hash-map version I can think of is: (map #(hash-map :id %) [1 2 3])
21:24tomojwhich is one character longer than the fn version
21:24timmorganok got it
21:24timmorganso #({}) freaks clojure out?
21:24timmorganis it the nested brackets?
21:24tomojwell, {} is a function
21:25tomoj,(map #({:a 1 :b 2 :c 3} %) [:a :b :c])
21:25clojurebot(1 2 3)
21:25tomoj#({}) is trying to call it with no args
21:25tomoj(#({:a 1 :b 2 :c 3} %) is silly, of course)
21:25timmorganok, let's say that I want to create a hash-map for each arg in a vector
21:26timmorgan(map #({:id %}) [1 2 3])
21:26timmorganI still don't get why that doesn't work
21:26timmorganI can use fn for this, but my brain needs to know why :-)
21:26tomojbecause you're trying to call {:id 1} as a function
21:26tomoj#({:id %}) means (fn [x] ({:id x}))
21:26tomoj,({:id 1})
21:26clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
21:27tomojyou can call {:id 1} as a function just fine, but it takes one argument
21:27tomoj,({:id 1} :id)
21:27clojurebot1
21:27timmorganI think there is some fundamental lisp-type thing I'm missing here -- why does it *call* the hash-map as a function, rather than just returning it
21:27tomojthat's just what #() means
21:28tomoj#(foo) means (fn [] (foo))
21:28tomojnot (fn [] foo)
21:28timmorganoh!
21:28timmorgan(I realize that's the second time you said that)
21:28tomojno problem :)
21:28timmorganthank you -- that's what I was missing
21:28tomojI used to get confused by it as well
21:29tomojso you can use #(hash-map :id %) if you want to use #(), but it's not much prettier :/
21:29clojurebotkotarak prefers hg
21:29timmorganok, I see now, thank you so much for your patience with me :-)
21:30timmorganwhat is clojurebot talking about?
21:30tomojsometimes she just randomly says something, not sure exactly why
21:31timmorganah, ok, funny
21:43jimtjoin #scala
21:46lancepantznooooooooooooooooooooooooo!
22:05jimtlancepantz: Yes, it is scary compared to Clojure.
22:06jimt(But seems to play better in the Android playground at the moment.)
23:29mebaran151what would be the best way to capture raw keyboard events?
23:30mebaran151like say I wanted to actual read the backspace key instead of allow it to immediately delete a character
23:42tomojmebaran151: in a terminal?
23:42tomojor like, swing or something?