#clojure logs

2009-10-03

00:00ngoc(def h (remove (fn [[k v]] (= k :a)) h))
00:00ngoc(h :b) --> java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)
00:00hiredmanremove is part of the sequence library
00:30ngocHow to cast Integer to int? (class 1) -> java.lang.Integer
00:31hiredmanare you in a tight inner loop?
00:32ngocNo, I want to pass argument to a Java method
00:32ngoc(import '[java.util Timer TimerTask])
00:32ngoc(def timer (Timer.))
00:32ngoc(def task
00:32ngoc (proxy [TimerTask] []
00:32ngoc (run [] (println "hi"))))
00:33hiredmanI see
00:33ngoc(.schedule timer task 1000) -> java.lang.IllegalArgumentException: No matching method found: schedule for class java.util.Timer (NO_SOURCE_FILE:0)
00:33ngocI think the argument type is incorrect
00:34hiredmanngoc: have you looked at the javadoc for Timer?
00:34hiredman.schedule takes a float
00:35hiredman(find-doc "float") or (find-doc "int")
00:36ngocNo, it takes a long: void schedule(TimerTask task, long delay)
00:36hiredmanpardon, I mistyped
00:36hiredmanbut it does not take an int
00:39ngocThanks, this works: (.schedule timer task (clojure.core/long 1000))
00:41hiredmanif you use a scheduledthreadpoolexecutor you don't need to proxy
00:46ngocah, it take a runnable or callable, thanks
00:49pjb3Does anyone know if there is already a function that is like assoc but if the map already has a value for the key it will conj the value onto the exiting value instead of replacing it?
00:49pjb3assoc-conj maybe?
00:50ngocpjb3: I think keys in a map are unique
00:51pjb3ngoc: right
00:51pjb3so here's what I want to do
00:51pjb3(def m {:x 1 :y 2})
00:51hiredman,(merge-with conj {:a nil} {:a 1} {:a 2})
00:51clojurebot{:a (2 1)}
00:52pjb3hiredman: that looks like it, I'll try that
00:52hiredmanI would look at update-in and merge-with
00:52hiredmanthere is also assoc-in
00:53hiredmanbut that is not it
01:10pjb3Here's how I implemented that function I mentioned earlier:
01:10pjb3http://gist.github.com/200412
01:12arbschtpjb3: must it be a vector?
01:12pjb3arbscht: no, I guess not
01:13pjb3arbscht: just in the right order
01:20pjb3Updated with tests: http://gist.github.com/200412
01:20pjb3arbscht: Is there a better way to do this that doesn't use vectors? Should I use a list instead of a vector?
01:37arbschtpjb3: no, it depends what you intend to use it for
01:38pjb3arbscht: Well, I don't need to access into random elements, so it doesn't need to be a vector
01:38pjb3any sequence would do
01:39pjb3I just wanted it in the order they are added, which is easier with a vector, they end up in the reverse order if you conj on to a list
01:40arbschtthat's fine
01:58ngocWhat is "future" form used for?
01:59kotarakngoc: It does things in the background. Threads requiring the result can derefence it. When the future is not finished, they will block. Otherwise they get the result and continue. It's for syncronisation.
02:02ngockotarak: Can it be used for multithreaded processing?
02:08kotarakngoc: what do you mean be multithreaded processing? Distributing the work on multiple processes?
02:08kotarakeg. like pmap (the parallel map)?
02:18ngockotarak: Sorry, I think I understand it now: If I save the future to a var, I can take out the result later: (def f (future-call (fn [] (+ 1 2)))), then later @f will become 3
02:20ngocAPI doc without example usecase is really hard to understand for newbie
02:21kotarak,(doc future)
02:21clojurebot"([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block."
02:22kotarakHmm... seems rather clear....
02:22kotarakBut maybe, it's just because we know it should mean..
03:26hiredmanis anyone making snapshot clojure builds available?
04:49hiredman~ant
04:49clojurebotants is http://clojure.googlegroups.com/web/ants.clj
04:49hiredmanuseless git
05:17namorNoob question: How would you `read' from a String?
05:19hiredmanread-string
05:19leafwnamor: read from where ?
05:20namorI have that String (which I received over a socket), and I want to call 'read' on it, so that I get a data structure.
05:21namorBut read only accepts Streams...
05:21yasonnamor: (StringReader. yourstring) creates a Java stream
05:22hiredmanread-string
05:22hiredmanseriously, the function is called read-string
05:22namorOk, that's easy. Thanks. (Indeed a noob question...)
05:25namorYay, works.
05:27hiredmanhttp://www.thelastcitadel.com/lab/appengine.m4v
05:27hiredmanhow easy is that
07:36vyI plan to host Clojure documentation pages in a wiki, to encourage the collabration and sharing among Clojure users. And, maybe, improvements can be back patched to the official Clojure documentation as well if developers agree on the content. Are there any such projects already done? If I'm not mistaken, there is an unofficially categorized version of Clojure documentation somewhere.
07:47ambientno projects that I'm aware of
07:49ambientthe general documentation for clojure is pretty good, imo. it's the API functionality by example that I'd wish there was more of
07:49ambientespecially clojure-contrib
07:50ambienthow to use immutable data structures, parallel programming and functional style for dummies in 24 hours :p
07:50ambienteach of those really should be their own separate book
07:52hoeckvy: there is http://en.wikibooks.org/wiki/Clojure_Programming
07:53ambienttake python for example, you can just say that x=x+1 and that's almost the whole language. 1 core mutable state seems so easy for me to get (might be just because I've done it so much) but twisting the whole mental model to fit clojure requires work. clojure being a lot closer in philosophy of how i think programming should be done </rant>
08:00LauJensennice python tutorial, thx
08:02ambientnp
08:03LauJensen:)
09:25sgtzx_LauJensen: not sure if you noticed, but I submitted your brian's functional brain to Reddit
09:25sgtzx_LauJensen: quite a few clojure fans there, well, theoretically
09:25LauJensensgtzx_, Yea I noticed some 5000 hits coming from there, so I read the comments and noticed you were the initiator
09:26sgtzx_5k? nice
09:27LauJensenYea - In total 8000 people stopped by yesterday, so it's nice that Clojure is drawing so much attention these days
09:27sgtzx_indeed!
09:27sgtzx_LauJensen: og i danmark, er det mange clojure fans?
09:28LauJensenYea I think we're coming up on approximately 6 Clojurians now
09:28sgtzx_that's a good start
10:59jhawk28has anyone ported the lisp from the Intro to AI to clojure yet?
12:55duck11231is there a way to find the set of all the namespaces that are required to be loaded to load a ns?
12:56duck11231got it
12:57duck11231I wanted to look at clojure.org, but that was down, so I remembered ClojureCategorized
13:14gcvanyone have any experience using visualvm with Clojure? I can't get it to profile my own code, so I'm wondering if it requires AOT compilation.
13:15LauJensenI tried it out 2 days ago, worked fine w/o AOT
13:16gcvmy classes show up in the heap dump, but not in the profiling results
13:18duck11231Is it possible, given a namespace, to modify that namespaces name and try to require the new name?
13:19duck11231I'm trying to find a way to discover all of my test namespaces without resorting to looking for files.
13:20duck11231I've found that if I start my compilation, and then start editing a file in emacs, the srarch for test/**/*.clj method chokes on the emacs autosave files
13:21hoeck1duck1123: I've completely disabled auto-saving and auto-backup in emacs for this reason (cluttering dirs)
13:22duck1123I have my backups go to ~/.save works great for me
13:22duck1123but I haven't done anything with my auto-saves
13:23technomancyhoeck1: you can set it to put all your autosaves/backups within ~/.emacs.d/
13:23clojurebotemacs is best configured for Clojure with instructions at http://technomancy.us/126
13:23duck1123also, I'm concerned that the testing wouldn't work if the source directory wasn't present
13:24duck1123I played with modifying namespaces before, but I abandoned it in favor of a less evil approach
13:24hoeck1technomancy: yeah, could do that, but I never needed autosaves anyway, especially when working on versioned files it makes no sense (to me)
13:25technomancyhoeck1: you never need it until you need it. =)
13:25duck1123I've had either emacs or the computer crash when I was editing a one off file that was never part of any scm that I hadn't saved in a while
13:26technomancyit's nice if you accidentally discard uncommitted changes to the wrong file
13:28hoeck1I have the (bad?) habit of pressing C-x C-s every ten seconds or so
13:28duck1123I even do it in firefox sometimes
13:29technomancyholding down C-n in firefox is more annoying to me.
13:58gcvturns out that to get VisualVM to do the right thing, namespaces must have at least two segments, just like the rule for AOT compilation. with a one-segment namespace, it skips instrumenting the generated classes in the JVM
14:02jo42question about the add2 example from http://clojure.org/functional_programming
14:02technomancyis that a JVM limitation or a Clojure-specific thing?
14:02jo42how does z take the value of 4?
14:02technomancy(no single-segment namespaces)
14:05gcvI can easily run code with a single-namespace from the REPL, but read this: http://groups.google.com/group/clojure/msg/58e3f8e5dfb876c9
14:06gcvjudging by that post, and by VisualVM's (bad) behavior earlier, it seems related to the way the JVM expects to see namespaces
14:10gcvjo42: 4 is the argument to the function on the third line of the example, which was def'd to add2
14:15LauJensenOla mon kotarak
14:15kotarakSalut
14:16kotarakLauJensen: I'm working on my blog. :)
14:16LauJensenWeee :) Where's it at ?
14:17kotarakLauJensen: Currently on my hard disk. Working on the layout. Just a sec
14:17cschreiner,classpath
14:17clojurebotjava.lang.Exception: Unable to resolve symbol: classpath in this context
14:17LauJensenkotarak, Please start with "Why I use Vim and how it's ruined my life" :D
14:18kotarakLauJensen: I will start with "Functional programming in Vim and poor man's closures..."
14:18LauJensenpoor mans ?
14:19kotarakLauJensen: well. you have to specify manually the values to close over. But you'll see in my post.
14:19LauJensenCan't wait
14:20kotarakLauJensen: what do you say for the layout? http://62.104.91.23
14:20LauJensensec
14:21kotaraksoso, fullrate.dk...
14:21kotaraknz and no were faster ;)
14:22LauJensendone loading
14:22LauJensenI think it's very nice :)
14:22jo42to me it seems as if make-adder [x] takes 1 argument referred to as x, having the value 2
14:22kotarakLauJensen: have only 160kbit upstream at the moment...
14:23LauJensenConsider wordpress.com ?
14:23LauJensenAnyway, lets go priv
14:24gcvjo42: correct, make-adder returns a function whose parameter is z
14:25jo42ok, i understand now
14:25jo42thks
14:36gcvis clojure.lang.Reflector.invokeMatchingMethod a sure sign of reflection going on? it dominates my profiling results, even though I type-hinted nearly everything *warn-on-reflection* pointed out.
14:38Chousukeare you using arrays?
14:39gcvyou mean Java arrays? no
14:41chousergcv: pretty sure sign, yeah. You're using *warn-on-reflection*?
14:42gcvyeah, I loaded the code using *warn-on-reflection*
14:43chouserbut no warnings? hm.
14:44gcvcould invokeMatchingMethod be called by something like the instance? function? I do use that for some dispatching, and it happens fairly often
14:45chouseryou should be able to check the stack trace to invokeMatchMethod to see what's causing it to be called
14:45chouserwith sufficient type hinting, I believe it's possible to avoid all calls to it
14:48gcvI'd better figure out why it gets called, then. the code spends more time in that method than it does doing IO, and I fully expected the whole benchmark I'm playing with to be IO-limited.
14:55Rayneshttp://www.google.com/trends?q=Clojure&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=0 Clojure is certainly skyrocketing.
14:56technomancyRich's speaking schedule is certainly contributing.
14:56technomancyhe's making quite the splash
14:56kotarakKorean?
14:56technomancythat big spike must be the 1.0/book release
14:56kotarakwow
14:56technomancyeither that or the peepcode. =)
15:09hiredmanhttp://www.thelastcitadel.com/lab/appengine.m4v
15:59ambienti've been thinking lately if I should be using Clojure or F#
15:59LauJensenGo with F#
15:59ambientplatform independence is not such a huge deal for me
16:00cschreineryeah, go with F#
16:00ambientim not sure F# has such a good support for concurrency as clojure
16:01ambientthere really aren't that many options for a functional programming language with a great library support
16:02konrhow can I find out which are the dependencies of a library when they are not on the README?
16:02LauJensenambient... :) We can't make the decision for you, but if you are really torn between the two, something tells me you're not levering the power of Clojure to a very great extent, so maybe F# comes more natural for you.
16:02ambientLauJensen I was just wondering if somebody had some experience in both and could provide some insight into the matter
16:03ambientbut even with great experience it's a hard question to answer in a general sense so I digress
16:08ambientkonr check the imports on top of the files
16:16LauJensenambient, how widely is F# used in industry ?
16:17ambientnone that I'm aware of
16:17ambientbut microsoft is including it as a full language into VS 2010
16:17hiredmanthere was a presentation I saw somewhere (extremely boring) about F# starting to show up in the industry
16:18LauJensenAmazing what MS marketing department can do - truely amazing
16:19LauJensenFirst they make Vista, then they inject tons of bloat slowing it to a crawl, then they sell millions of licenses - wait a year or two - strip the bloat, sell it as Windows 7 and make millions again
16:19somnium,(str >=)
16:19clojurebot"clojure.core$_GT__EQ___4493@1adff28"
16:20hiredman,(str '>=)
16:20clojurebot">="
16:20hiredman,(name '>=)
16:20clojurebot">="
16:22somnium,(map #(str (quote %)) '(>= = <=))
16:22clojurebot("p1__2375" "p1__2375" "p1__2375")
16:22somniumdoh
16:22hiredmanthe list is already quoted
16:23hiredmanand if you are only doing this on symbols you should use name instead of str
16:23somniumif you have an arglist that may contain one of these, how would you filter to get "=" as a str?
16:24somnium,(apply str (re-seq #"[A-Z]" (str >=)))
16:24clojurebot"GTEQ"
16:24hiredmanI would call symbol on the string
16:24somniumright now doing this, to avoid using a macro just to get to the symbols
16:24somniumkinda ugly though
16:24hiredman,(filter (partial = (symbol ">")) '(> < = + -))
16:24clojurebot(>)
16:28somniumpartial = curry?
16:29hiredman,(doc partial)
16:29clojurebot"([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
16:44kanakHi I'm trying to use swank-clojure for both sbcl and clojure. I got to the last step, but I don't know what this means: M-- M-x slime clojure
16:44kanakCan anyone help me? Thanks
16:45somniummeta dash, meta x
16:45LauJensenor: Alt - Alt x
16:45kanakthanks. but what about the space? When i type a space it shows up as a dash
16:46somniumalt - enter alt x enter
16:46arbschttype "slime" first, it will prompt again for "clojure"
16:46kanakwoo that works. thank you guys so much :) :)
16:46arbschtfor convenience, you can define something like this in your emacs init file: (defun slime-clojure () (interactive) (slime 'clojure))
16:47arbschtthen you can use M-x slime-clojure
16:47technomancykanak: I'll clarify in the readme.
16:47kanakthat would be really neat :)
16:47criosambient: have you already read this? : http://www.atalasoft.com/cs/blogs/rickm/archive/2008/03/21/clojure-impressions.aspx
16:48technomancyI don't use CL, so I hear about all that stuff secondhand. =)
16:49criosambient: for what matters... http://stackoverflow.com/questions/915145/f-vs-clojure
16:49crios"The closest thing to Clojure on .NET platform is IronScheme"
16:49ambientso really is a good resource :)
16:50kanakanother question. so should my (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl"))) line be above or below the (clojure-slime-config) line? I just got a "symbol's value as variable is void: slime-lisp-implementations" error. (it's currently below the clojure-slime-config line)
16:50arbschtcrios: surely clojure-clr is closer
16:51LauJensenarbscht, if not I think Rich needs to have a talk with the good people behind IronScheme :)
16:52technomancykanak: you'll need to put it somewhere that will run after that list is defined... I recommend: (eval-after-load 'slime '(add-to-list [...]))
16:52technomancyonce again; that should be in the readme; heh
16:53kanaktechnomancy. thank you so much. it works now :)
17:06hiredmanflash works on my freebsd machine to the point where I can watch stuff on hulu, but not to the point where I can watch rich's talk on infoq
17:06technomancyrich is a good speaker, but not good enough for me to suffer through having flash installed to watch him.
17:11hiredmanI have a build.xml that will grab the appengine sdk, compojure, clojure, and contrib and generate the skeleton of an appengine clojure project, I have tentatively named it clambango (it was the first thing that popped into me head) but I don't feel right taking that name, any suggestions?
17:14ambientgaejure?
17:14technomancyplease, no more puns on the name clojure. =\
17:14Chousukeno more jures, please.
17:14Chousuke:P
17:15ambientheh
17:15technomancyhiredman: take a name from literature or a beverage.
17:15technomancyI recommend Fingolfin or Darjeeling.
17:16hiredmanClojure on Cyclotrons
17:16criosapplejure
17:16crios:)
17:16ChousukeApple will sue.
17:16Chousuke:P
17:16crioslol
17:16technomancyhttp://en.wikipedia.org/wiki/Fingolfin <= extremely badass
17:17ambientganja, it's almost like jure and has google app in it
17:17hiredmanI saw some eye-pod contact lens cases at target a while back
17:17technomancy(especially the last three paragraphs)
17:17ChousukeI still remember when I first tried reading the Silmarillion in English. It was a bit too much for me at the time.
17:18LauJensenAnybody have some tips on how to do fast 2d painting with Swing?
17:18technomancyChousuke: have you heard Nightfall on Middle Earth?
17:18ChousukeI couldn't understand the word "comprehend" ;P
17:18ambientLauJensen fast? opengl
17:18LauJensenswing
17:18ChousukeLater I tried to read it again but it really got a bit boring after the first half ;/
17:19Chousuketechnomancy: Probably not. :P
17:19hiredmanthe first half?!
17:20Chousukehiredman: yes?
17:20technomancyChousuke: http://en.wikipedia.org/wiki/Nightfall_in_Middle-Earth <= if you like heavier music, it's phenomenal
17:21ambientLauJensen then draw everything into a memory buffer which you blit using the fastest method available. i can't really see any faster ways unless it's hardware accelerated
17:21ambienthave done very little java 2d though
17:21hiredmanChousuke: I think it got boring a little before then
17:21Chousukehiredman: heh.
17:22LauJensenk
17:22ChousukeWhich reminds me, I still have to read LoTR in English. I've read it twice, but in Finnish :/
17:22ambienti think there were some options in java2d that could use some hardware accel
17:22ambientbut they are so crappy that i just used straight opengl
17:24ambienthttp://www.gamedev.net/reference/articles/article2418.asp
17:25technomancyChousuke: didn't Tolkien study Finnish? IIRC it was an influence on Quenya
17:25LauJensenThanks.... Maybe I should pick up penumbra again, it is bundled with x-platform dependencies now ?
17:25Chousuketechnomancy: yeah.
17:27ambientLauJensen well if you don't know opengl it would mean learning new stuff. java bufferstrategy might be enough for your purposes. *shrug*
17:27Chousuketechnomancy: Some Quenyan words are rather amusing to a Finn as a result. For example, the word "amme" which AFAIK means "mother" in Quenya is "bath tub" in Finnish :P
17:27LauJensenYou're probably right, and since it's for blogging it's best to keep it simple
17:27LauJensenI'll let the Tellerman supply the GL version :)
17:27technomancyheh
17:27ambientEpäharavoitseskentelehdittelemattomimmaistuttelevaisuudellammekaankopashan <- actual finnish word
17:28criosambient: ??
17:28ambientcrios just taking part into the off-topic Tolkien discussion
17:28Chousukeambient: no Finn can tell you what that actually means though :)
17:29ambientyou would probably have to write AI program to interpret it
17:29criosis that a real Finnish work??
17:29criosword
17:29ambientyes
17:29Chousukeyes and no.
17:29criosand what does it mean?
17:30Chousukeit's apparently possible to derive such a word using all the possible word derivation facilities Finnish has but it's nonsensical :P
17:30ambientRyypiskentelemättömyydellänsäkään <- this might be even interpreted
17:30criosvery lispy, in that sense
17:30ambientderived from "ryypiskellä"
17:30Chousuketechnomancy: http://www.saunalahti.fi/~alboin/finn_que.htm :D
17:31technomancywow
17:31LauJensenambient, I think I'll go with what you linked
17:32ambientLauJensen yeah haven't tried it but it looks like it makes an hardware accelerated double-buffer, which is completely fine for simple pixel per pixel graphics
17:39danleiworks in german, too: donauschifffahrtsdampferkapitänsmützenhalterung(... ad lib)
17:39Chousukeis that a single word or a compound of multiple words though? :
17:40danleicompund ... was the first finnish one a non-compund one?
17:40Chousukeyes.
17:40ambientit was just a single word
17:40danlei*compound
17:40danleiwow
17:41Chousukeits base being the verb "haravoida", which comes from "harava", meanin a rake :P
17:42danleio.O
17:42danleiimpressive language, I must say :)
17:42Chousukebut really, it's just trivia. no-one uses words like that. Though they do get fairly complicated at times.
17:42ambientharavattomuuksilla = with the absence of any rakes
17:43danleihm, I guess it's an agglutinative language (don't know anything about finnish)
17:43danleilike turkish perhaps
17:43Chousukeyeah
17:44criosmmm... the most long Italian word should be: "precipitevolissimevolmente" :)
17:44ambientit's a total bitch to stem :s
17:44ambientporter stemmer for english is so easy :\
17:44criosdanlei: :D I don't ask as you know it
17:45danlei:)
17:45danleiwell, I also know "una penna", but that's not really that impressive I guess ;)
17:45criosno, itsn't
17:46danleibut italian is on my languages-to-learn-list
17:46technomancyItalian is awesome; it's like Latin, but useful.
17:46technomancyand with fewer edge-cases
17:47danleiyes
17:47danleibut my university insists in latin first :)
17:48crioswell, knowing Latin you can then study French, Italian, Spanish, Portugese ...
17:48Chousukeand English :P
17:48criosmmm
17:48hiredmanEsperanto
17:49danleikind of, yes. but esp. french derived quite a bit from latin
17:49criosEngish should be born from old German + French languages
17:49danleiit's almost an isolating language (spoken) these days
17:50criosdanlei: French?
17:50danleiyes
17:51danleifor example, you can't really hear the different forms in the singular of regular verbs
17:52hiredmanI heard frenchs kids either drop the gender from nouns, or use either gender, these days
17:52danleithus, inflection (which ubiquitous was in latin) is almost only visible in the written form (at least for a big part)
17:52ambientyet one thing i like about finnish that it is genderless
17:54criosEnglish is also genderless... isnt'it?
17:54Chousukebut there are many other things that make life hell for anyone trying to learn it. :P
17:54ambientcrios he/she
17:54ambientin finnish that is "hän"
17:54Chousukeconsonant gradation being the worst I suppose.
17:54danleilost it's neuter though
17:55danlei*its
17:55Chousukeheh, in colloquial speech it's actually pretty common to just call everyone and everything with the nonpersonal pronoun :P
17:56Chousukethat is, everything is just "it"
17:56ambienttrue
17:56ambientit's practical
17:56criosin French, il / elle
17:56danleiin my dialect (of german), we can say "et" (it) for feminine things
17:57danleibut we have some rests of a dual left, which is quite seldom in german dialects
17:57Chousukeanother interesting feature is that literary Finnish is basically a constructed language.
17:57Chousukeno-one speaks it :)
17:57hiredmanhttp://www.languagehat.com/archives/003043.php
17:59criosso what language do Finnish peoplo speak?
17:59crios[people]
17:59criosEnglish?
17:59ambientonksul = do you have? when literally that would be "onko sinulla"
17:59ambientetc..
17:59ambientdepends on location
18:00criosIs it similar to Sweden?
18:00hiredmanI read somewhere that dutch was dying out as a spoken language
18:00danleihuh?
18:00danleilast time I was in holland, I had not the impression :)
18:00hiredmansomething about dutch speakers mostly just speaking english
18:01Chousukecrios: we speak spoken Finnish ;)
18:01danleihm
18:02danleiI mostly was near the belgian border, most people were speaking dutch and french (but almost every young person knows english, more or less)
18:02Chousukecrios: the thing is, literary Finnish combines features from several dialects (and apparently some vestigial stuff too), and as a result it doesn't match any spoken dialect.
18:03ubiihey folks, just starting to hack around with clojure a bit and was wondering which clojure-based web framework(s) are worth looking at
18:03somniumis contemporary finnish literature written using that language?
18:03arbschtubii: try compojure
18:03criosChousuke: I understand - [similar to the "Sardish" language, spoken in Sardinien]
18:04ubiiarbscht: thx
18:04ambientsomnium all finnish is written using the literal form, it's just never spoken that way
18:04Chousukesomnium: yeah. it's called the "Book language" in Finnish :P
18:05somniuminteresting, some written japanese uses an archaic form, but most novels are written in more or less colloquial language. I don't know anyone who tries to write English in Elizabethan these days...
18:05danleihow about people in television (say in the news). do they use this book language?
18:06hiredmanubii: I would check out conjure too
18:06hiredman~conjure
18:06clojurebotIt's greek to me.
18:06Chousukesomnium: there's actually a national agency that determines what's "proper Finnish" and occasionally tries to promote new words and stuff
18:06hiredmanclojurebot: useless pile of junk
18:06clojurebotexcusez-moi
18:06danleis/in/on/
18:06Chousukedanlei: not quite
18:07hiredmanclojurebot: you heard me
18:07clojurebothiredman: I'm just giving you a second chance
18:07Chousukedanlei: they use a "relaxed" version of it :P
18:07danlei:)
18:07hiredmanclojurebot: I swear, one of these days...
18:07clojurebotI don't understand.
18:08Chousukedanlei: sometimes there are people who are overformal and try to "speak like a Book". They just end up sounding creepy.
18:09somniumhas anyone experimented with ring?
18:09ubiinot feeling the love from github right now. looks like it is "overcapacity", so will have to wait to look at either compojure or conjure :(
18:09danleiChousuke: where I live, it's a bit similar: because we have a fairly strong dialect (almost lëtzebuergesch), people tend to "hypercorrect", which mostly sounds pretty strange
18:10criosBTW: were you aware that some Italian scientist is trying to locate Troy in Finland?
18:10ubiihiredman: thx
18:10crioshttp://www.centrostudilaruna.it/felicevincilocationoftroy.html
18:10somniumI hope conjure moves toward a unique vision instead of just cloning rails
18:10technomancycrios: I guess that would explain how Odysseus got so lost on the way home!
18:10ubiisomnium: nope, but I am interested in taking a look at ring, as it is similar to rack in the ruby world
18:11crios[Chousuke: http://www.ibs.it/ame/book/9781594770524/vinci--felice/the-baltic-origins.html]
18:11technomancycrios: also makes the Briton's claim to Trojan ancestry slightly more believable. =)
18:12hiredmanhttp://www.thelastcitadel.com/lab/appengine.m4v is a video of my appgengine skeleton project generator thing
18:12crios:)
18:12ambienti wish they find the first stargate under my city :(
18:12ubiihaving not done much research on the various clojure web frameworks, are most of them MVC-based are any of them more component based like IOWA (ruby) or Seaside (smalltalk)?
18:12ambientand then i win in a computer game and get to be part of the expedition
18:13technomancyubii: MVC is a pretty OO-centric mindset
18:15ubiiambient: hopefully, unlike Skippy, you can figure out to use Earth as the source point and get the gate to dial the first time
18:16Chousukecrios: interesting :)
18:16crioswell, maybe in Finland they should speak Greek :D
18:16crioshttp://www.philipcoppens.com/troy.html
18:16criosWell, time to go
18:16crios(bed)
18:16crios'night
18:18ambienthiredman opening that link just killed my firefox :(
18:18somniumI'm working on a component-based system (mostly an odd collection of macros and functions grafted onto compojure at this point). functional style seems very powerful, (-> request (logic) (logic) (db-side-effects) (render)), can store the input, return-value, and source code at any point in the chain
18:19hiredmanambient: :(
18:21hiredmanrecordmydesktop makes an ogv and I used ffmpeg to turn it into a m4v
18:23ubiiI use IOWA, which is a ruby component-based web framework, because all of the sites that I support run on it, but I also used more traditional MVC-based ruby frameworks, such as rails, merb, and ramaze
18:24ubiiIOWA was written by Avi Bryant who later went on to write Seaside, which is a smalltalk web framework
18:24somniumI looked at seaside, I found the obligatory gui to be rather unpleasant
18:24somniumI guess it might grow on you, I prefer emacs at this point :)
18:25ubiinow that github is accessible again, it appears that conjure is very rails like and uses a MVC approach
18:25licoresse,(doc pprint)
18:25clojurebot"clojure.contrib.pprint/pprint;[[object] [object writer]]; Pretty print object to the optional output writer. If the writer is not provided, print the object to the currently bound value of *out*."
18:27somniumI think something like a smalltalk-gui-lite should be embeddable via javascript for a web framework, since capturing source is just wrapping a function. lots of cool development tools are possible.
18:29ubiijust curious if anyone here has written a production web app, using clojure and one of the clojure-based web frameworks
18:30ubiiif so, what did you use and how well has it stood up in a production environment?
18:30technomancymost uses of Clojure so far have not been web-facing to my knowledge
18:31somniumI'm still using rails for work... clojure web tools aren't quite mature enough yet
18:31ubiithe reason why I ask, is that I am looking at the viability of moving away from ruby to something like clojure and wondering if any of the web frameworks are ready for prime time
18:31ubiiah, well that answers that, thx
18:32somniumyou could always wrap struts2 :)
18:32technomancyconsider it an opportunity to blaze a new trail. =)
18:32ambientwrap JSF...
18:33Makoryuubii: Even if you're stuck using Java libraries from Clojure, that's still a lot less painful than using Java libraries from Java
18:34ubiiwell, one nice that about clojure is that it provides you the ability to leverage a ton of Java goodness, including I am assuming the ability to run on one of the many robust Java application servers
18:34ubiis/that/thing/
18:35hiredmanhttp://github.com/hiredman/appengine-helper
18:35hiredmanyou check that out, then ant -buildfile pathtothat/build.xml -Dname=projectname setup
18:36ambientquite useful
18:36hiredmanand it will setup an appengine project in ./projectname/
18:36ubiinice
18:36hiredmanant runserver will run the developement webserver
18:36hiredman(from inside the project directory)
18:37hiredmanmy first buid.xml
18:39ubiihow about clojure itself, how mature is it and what kind of stability and performance should I expect out of it?
18:39hiredmancompojure doesn't seem to distribute prebuilt jars anywhere
18:39ubiialso, what type of apps are most of you using clojure for?
18:39hiredmanso setup rebuilds compojure from source everytime :(
18:40ambientubii i use clojure for prototyping/general purpose
18:41ambientprocedural audio/graphics atm
18:41somniumhiredman: did you push to appengine with all of compojure.http without issues? multipart (using commons.fileupload) was causing problems with appengine security environment. (maybe its not now? I don't know)
18:42hiredmansomnium: ah
18:42hiredmanI haven't gotten that far
18:43ubiibeen getting tired of drinking the ruby Kool-Aid lately, so I have been exploring other languages, such as erlang and lisp, which is how I got interested in clojure
18:43somniumjust using everything but multipart from compojure.http seems to fix it
18:43technomancyubii: you're not the only one. =)
18:47hiredmansomnium: hmmmm
18:47somniumI think clojure has improved my ruby style a lot, its made me very conscious of side effects and mutating values.
18:50ubiiI am thinking about buying Programming Clojure (http://www.pragprog.com/titles/shcloj/programming-clojure) and was curious if it is worth it or if there are more useful resources on the net, to help me get started
18:50licoresseubii: def. worth it
18:51licoressebut I find the structure of the book a little confusing
18:51ambientone could do fine with the resources on the net but the book is ok too
18:51licoressebut I only have the digital version
18:52somniumif its something I really intend to read carefully I always print it out and put it in a notebook
18:53sproingiei just copy it to my kindle
18:53somniumthis is the clearest free web tutorial I found -> http://java.ociweb.com/mark/clojure/article.html
18:54sproingieclojure book reads all right on kindle. font size in code examples never changes tho, and it's pretty small
18:54licoresseI only have an iPod, not a printer in our house
18:54ubiisomnium: sweet, thx for the link
18:54licoresseI could use a larger screen though
18:54sproingieseems to be the same problem for all tech books on kindle
18:55ubiiI have a unlimited Safari Library subscription, but unfortunately, the do not yet have the Programming Clojure book
18:56sproingiegot mine from pragprog.com
18:56ubiithey did have the PeepCode video on clojure, so I watched that
18:56ubiisproingie: yep, was thinking about buying both versions from them
18:57sproingiethey have some nice books. the scala book is very nice.
18:59ubiisproingie: yes they do, I bought half a dozen or so books from them, as well as some of their videos
19:00kanak(newbie question): When should my variables be surrounded by asterisks: like so *variable*?
19:02sproingieit's a convention for dynamically-scoped variables
19:02sproingieor more commonly in clojure, special ones where changing them has some systemwide side-effect
19:04kanaksproingie, thank you.
19:05somniumhow do you reset/clear a namespace?
19:07somniumsomething like (doseq [v (ns-map n)] (ns-unmap n v)) ?
19:07Makoryukanak: The reason you're supposed to mark globals that way in Common Lisp is that it has no way of declaring a lexically scoped global
19:07Makoryu(Except functions)
19:08kanakMakoryu, the variables i create using def in clojure are lexically scoped right (unless i use bindings)?
19:09somniumhmm, just wiped out every var in user...
19:09Makoryukanak: Yep.
19:10Makoryukanak: CL's DEFVAR/DEFPARAMETER only work that way for reasons of compatibility with older Lisp dialects. Clojure has no such concerns
19:10kanakMakoryu: does this mean that I mark my variables with a ** when I think they might be used with bindings?
19:10Makoryukanak: .....Good question.
19:11MakoryuHonestly, no idea
19:11MakoryuThe only example of bindings that I've seen is... the one on the Clojure site that rebinds str
19:11kanakMakoryu: :). When might i want to use dynamic variables?
19:11Chousukeif you intend them to be thread-locally bound by the user, use the asterisks
19:17ubiiwhat editor or IDE do most of you use for writing clojure code?
19:17ubiiI am assuming emacs or vim
19:18kanakI'm using Emacs with swank-clojure
19:18ambientemacs, i just started using irc inside it even..
19:19somniumslime + paredit beats any ide experience I've ever had
19:19ambienti've been wondering about paredit, is it hard to learn and does it replace some of the functionality of slime or does it add on top of it?
19:20arbschtemacs, vim, enclojure are popular
19:21somniumit just adds utilities, C-k scoops up an s-expression, C-<right> adds the rightmost symbol to an s-expression, C-<left> the opposite
19:21somniumapparently it can do more, but that makes editing lisp code a breeze already
19:23ubiimostly a vim guy myself, but I really should start using emacs more
19:26ambientyep, i use vim also most of the time. lisp is just inherently suited for emacs
19:26Makoryuambient: Ever used TextMate? Paredit is basically the bracket matching feature with extra checking
19:27ambientnope, don't have a mac
19:27ubiiis there a clojure bundle for TextMate?
19:29technomancyubii: yeah, but it's not very featureful
19:29technomancyparedit is highly badass
19:30Makoryuubii: I think so, but I wouldn't bother with it. You'd have to struggle with the indentation.
19:30ubiiok, thx
19:30technomancyambient: paredit is orthogonal to slime
19:30technomancyyou can even use it for JS
19:30technomancythough it's designed for lisp
19:31ubiispend most of my time on linux, even though I have a couple of Macs
19:31ambientspend most of my time on windows vista, because i have crappy hardware :|
19:32ubiiambient: feel for you, I try my best to avoid anything Windows
19:32Makoryuambient: That's *almost* an oxymoron
19:33Makoryuambient: Whatever hardware you've got, Vista is probably the worst way to get any usefulness at all out of it
19:33somniumambient: if your hardware can handle vista surely you could run linux
19:33ambientsomnium: nope, wireless drivers suck
19:33somniumthey've gotten a lot better
19:33santosh(def mouse
19:33santosh (fn [a]
19:33santosh (print a)
19:33santosh (if (< a 100)
19:33santosh (recur (+ a 4)))))
19:33santosh
19:33santoshmouse(10)
19:33somnium...
19:33Makoryusantosh: LEARN TO PASTE
19:33santoshwill this work?
19:34santoshMakoryu : ok ..i will
19:34Makoryusantosh: http://gist.github.com/ http://paste.lisp.org/
19:34MakoryuPick one
19:34santoshMakoryu : Thanks :)
19:34somniumI have a laptop from 2003 and its wireless works with ubuntu
19:35somniumright out of the box
19:35ambientwell you're lucky then
19:35ambientmine disconnects every 2 minutes or so
19:35somniumwell, I have to plug it into lan during the install, but it finds the drivers automatically
19:35ubiiambient, which wireless card do you have and what linux distro(s) have you tried?
19:36ambientubuntu 32 and 64 bits, intel 4965 AGN
19:36santoshMakoryu: http://paste.lisp.org/display/88125
19:37Chousukesantosh: the function definition will work, but the mouse(10) thing won't :P
19:37santoshim just started clojure today ...was trying the pasted example ..but it won't work as expected...
19:37santoshoh
19:37ubiiheck, even the wireless support in openbsd is good these days, had no problem getting the wireless card on my thinkpad x61 to work
19:37santoshoops ..its still java style call :D
19:37Chousukesantosh: also, you should use two spaces for indentation instead of a tab. :)
19:38Chousukeand defn instead of def, but that's nitpicking.
19:39Chousuke(yes, indentation is more important than your code!)
19:39Chousuke;P
19:43ubiiambient: the iwiwifi driver, which supports the 4965AGN is now part of the kernel, as of 2.6.24, so I would think it should work
19:43ambientit works. it's just that it's bugged
19:44ambientwhich causes random disconnects in short intervals
19:46somniumambient: when was the last time you tried it? ubuntu seems to put a priority on wireless support
19:46ubiihmm, my X61 has a 4965AGN REV=0x4 and doesn't see to have any issues
19:47ambientsomnium: about a week ago
19:48ubiiI am running Ubuntu 9.04, but it also worked on 8.10 and 8.04
19:51raekspeaking about a lenovo X61?
19:51ubiiyep
19:52raekI have a X61s
19:52ubiiambient: a quick google search indicates that you are not alone, I guess there are several bugs associated with the driver for this card
19:52ambienti know
19:53ubiiraek: how do you like yours, I love mine, though since I work mostly from home, I always have an external keyboard, mouse, and monitor hooked up to it
19:53ubiiI love the keyboards on them
19:54ubiiambient: maybe I don't use my wireless enough to notice it, since I typically have it connected via Ethernet
19:55ubiiambient: in any case, hopefully they will resolve the issue soon, because no one should have to suffer Vista if they don't need to
19:56ambientthey haven't solved in about two years so i don't really expect much
19:56raekubii: I love my thinkpad, except for one thing
19:56raekthe heat generated by the wifi card
19:57ubiiyep, it can get a bit warm
19:57ambientiwconfig power on, its disabled by default
19:57raekwhen the ac adapter i pluged in, you cannot use its power management
19:57raekambient: is that all?
19:57ambientwell i can
19:58ambientit drops the temp to half for me
19:58ubiiyeah, I think I had to do the same thing
19:58ubiiit helps
19:59ubiiof course, it really isn't much of a factor now, since I am using an external keyboard
19:59ubiibtw, is it a sin to use an Apple keyboard on my X61? :)
19:59raekwell, apple keyboards are nice..
19:59kanakubii: I'm using the apple mouse with my dell laptop because the touchpad is broken
20:00raekif you paint the enter key blue, I guess it's okay...
20:00ubiiraek: the only thing I dislike about the x61 is that the native resolution is limited to 1024x768
20:01kanakraek: I see an enter key, and i want to paint it blue. no colors anymore i want to turn them blue
20:01ubiithis is why I have it hooked up to a 24" monitor running 1920x1200
20:01raekyes, it's limiting to not be able to have two 80 character columns of text beside each other
20:03ubiiI wish I would had waited until the x200 or the x301 came out, as both have better native resolutions
20:03ubiioh well
20:03raeka friend of mine has the x300
20:03ambienti hear the quality in lenovo laptops is dropping
20:03raekit's NICE.
20:04ubiiI will say that the lcd on the X61 is in no way as nice as on my Macbook Pro
20:04ubiibut then again, the MacBook Pro was twice as much
20:05santoshChousuke : Thanks for your help and suggestions
20:06ubiiguess I will try setting up emacs, slime, and paredit
20:06ubiilater all, thx for the help
20:07ambientapt-get install emacs-snapshot-gtk -> install elpa -> package-install clojure-mode -> clojure-install
20:09ubiiambient: sweet, thx
20:22ben_mHey there :)
20:22arbschthello
20:23ben_mCan anyone recommend a clojure/Java game development library?
20:23ben_mOne that doesn't require OpenGL would be great, but at this point, I'd take anything ;)
20:23kanak(how do i specify default values in a struct?
20:23ambienti dont think there's a clojure game dev lib currently. jmonkeyengine seems to be the most widely used game engine for java
20:24ben_mI should've specified 2D :D
20:25ben_mI've tried to use sdljava, but I just can't get it to work.
20:25ben_mUnsatisfiedLinkError stuff :/
20:26arbschtben_m: jgame might be enough for 2D games. lwjgl can also be useful for 2D games using opengl
20:27ben_mlwjgl looks pretty good, yeah
20:27ben_mThe problem is that my PC has a broken video card and the onboard chip can't handle OpenGL, apparently.
20:27ben_mSo I'm looking for non-gl alternatives...
20:27ambientopengl does have software rendering options also
20:29ben_mSo I've heard, but lwjgl refused to do stuff for me, because of opengl.
20:30hamzahey guys, is there a range equivalent that will return numbers indefinitly from 1 to infinity?
20:32hiredman(iterate inc 0)
20:32ben_mhamza: (iterate inc start)
20:33hamzathanks.
20:35drhodesI've got a macro, it compiles, if I copy and paste the macroexpand-1 output, it works. When the macro is invoked normally it fails. Is that supposed to be possible?
20:36arbschtdrhodes: paste your code
20:38drhodesarbscht: http://paste.lisp.org/display/88129
20:39drhodesit's not trying to do OO btw, just reduce some boilerplate
20:40hiredmanuh
20:40hiredmanit looks like you are making a bunch of symbols prefixed by ":" is there a reason you are doing this?
20:41drhodesnot particularly
20:41hiredmanthen I would recomend you don't do that
20:42drhodesok, thanks for the tip
20:42hiredmandrhodes: what is the exception you get?
20:43hiredmanI imagine it's something about symbols cannot be cast as keywords or some such
20:43hiredmanbeccause keywords start with a :
20:43drhodesUnable to resolve symbol: ::vcbnm in this context
20:44drhodesbut I've tried it a dozen ways from friday. ok. I'll go with taking those out and trying some more, thanks guys.
20:44somniumbut copy and paste works ? reader is probably creating (keyword :vcbnm) when you paste
20:45drhodesok :)
20:45hiredmandrhodes: my guess is macroexpand prints out a bunch of symbols that start with : and when you paste that into clojure, it reads them as keywords
20:45drhodesI don't enough about the reader.
20:45hiredmankeywords and symbols are different
20:45hiredman,:x
20:45clojurebot:x
20:45hiredman,::X
20:45clojurebot:sandbox/X
20:46hiredman,x
20:46clojurebotjava.lang.Exception: Unable to resolve symbol: x in this context
20:46hiredman.'x
20:46hiredmaner
20:47raek,':x
20:47clojurebot:x
20:47raek:x
20:47raek,:x
20:47clojurebot:x
20:47hiredmanthat is a quote keyword
20:47hiredmanquoted
20:48raek,(class :x)
20:48clojurebotclojure.lang.Keyword
20:48raek,(class ':x)
20:48clojurebotclojure.lang.Keyword
20:48hiredmankeywords are sort of self quoting
20:50somniumdrhodes: key thing is at end of macro expansion datastructures are fed right to the compiler
20:50somnium,(read-string "[::foo ::bar]")
20:50clojurebot[:sandbox/foo :sandbox/bar]
20:56somniumare double colons some kind of reader-macro?
20:57somnium,(list (keyword ":foo") :foo ::foo)
20:57clojurebot(::foo :foo :sandbox/foo)
20:58hiredmandouble colons qualify the keyword in the current namespace
20:58hiredmanalso if you have an alias for a namespace setup double colons resolve keywords in those
20:58hiredman,(require '[clojure.zip :as zip])
20:58clojurebotnil
20:58hiredman,:zip/foo
20:58clojurebot:zip/foo
20:59hiredman,::zip/foo
20:59clojurebot:clojure.zip/foo
20:59somniumcool
21:06somnium,(symbol "foo" (str (ns-name *ns*)))
21:06clojurebotfoo/sandbox
21:07somniumis there a similar way to qualify a symbol?
21:08somnium,(symbol "foo" (ns-name *ns*))
21:08clojurebotjava.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String
21:09hiredman,(resolve 'foo)
21:09clojurebotnil
21:09hiredmanbah
21:12santosh(def hello (print "hello"))
21:16somnium,(+ 2 2)
21:16clojurebot4
21:17somniumI thought he used to do something else
21:21chouser, 1foo
21:21clojurebotInvalid number: 1foo
21:21chouser, `foo
21:21clojurebotsandbox/foo
21:21somniumah, so its not just for macros
21:24hiredman(+ 2 2)
21:24clojurebot4
21:24hiredman(+ 2 3)
21:24clojurebot*suffusion of yellow*
21:26drhodesGreat! it works, keywords are not symbols, thanks helpful clojure chan :]
21:27somniumdrhodes: out of curiosity, what was it for?
21:28drhodeswell this started in python as a code generation scheme, built a parser for custom architecture modeling language (yuk yuk yuk)
21:29drhodesbut macros preclude the need of 2/3 of all that.