#clojure logs

2009-07-25

01:13codyKhahaha
01:13codyKgot some more time to work on that circular reference issue
01:13codyKwas actually a problem of binding / lazy map
01:13hiredmanthat'll do it
01:14codyKso seriously, do people just avoid using binding at all cost?
01:15hiredmannope
01:15hiredmanbut it is a common gotcha
01:15hiredmanthere has been some talk and proposals of various solutions
01:16hiredmanI never paid too much attention
01:17hiredmanmostly you just need to capture the dynamic environment (binding) in the static environment (a let)
01:17hiredman(binding [a 1] (let [a a] (map #(+ % a) (range 10))))
01:24codyKthat doesnt seem to be sufficient
01:24lisppaste8codyK pasted "binding / laziness" at http://paste.lisp.org/display/84162
01:25codyK::js method will succeed, ::html method will fail
01:25codyK(where fail == recurse indefinitely)
01:26codyKforcing the map in the ::html method, works fine
01:26codyKor does interpose force . . .
01:33iBongsimple question, trying to iterate over a an array from a java object, doseq gives (... doseq requires a vector binding)
01:34Lau_of_DKIs that a question?
01:34iBongNo, not technically I suppose
01:35iBonghow to iterate across a java array in clojure? (I'm out of my depth, trying to get my feet wet converting a java csv processing program to clojure)
01:36Lau_of_DKI believe doseq will get you where you need to go, depending a little on the purpose
01:36Lau_of_DK(its not lazy and primarily used for side-effects I believe)
01:37iBongsomething like (doseq java-array function)? from the error I surmised that either I was doing something very stupid syntactically or java-array's don't qualify as vectors
01:37arbschtiBong: that error suggests that your binding form is malformed. a syntax error perhaps?
01:37iBongprobably
01:38arbscht(doseq [x (into-array [1 2 3])] (println x))
01:38Lau_of_DKor (doseq [item (make-array String 20)] (println item))
01:41iBongah! I was indeed doing something very stupid (x was not inside brackets) thank you
01:44Lau_of_DKYou'll get used to it quickly :)
01:45iBonghope so, clojure is very cool, all my ruby code is .map .inject lambda x now, want to start using it seriously as soon as I can grok it
01:50iBonganother question, say I have 20 csv files I want to process with some function. Is it simple to fire up 20 threads?
01:51hiredmanI doubt you want 20 threads
01:52iBongan optimal number then?
01:52hiredmanmaybe 20 tasks executed on four or five threads
01:52hiredmanagents
01:53iBongwill rtfm, thanks
01:55hiredman,(map #(send-off %2 + %1) (range 10) (cycle (take 4 #(repeatedly (agent 0))))
01:55clojurebotEOF while reading
01:55hiredmanbah
01:55hiredman,(map #(send-off %2 + %1) (range 10) (cycle (take 4 #(repeatedly (agent 0)))))
01:55clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: sandbox$eval__3974$fn__3979
01:55hiredman:/
01:55iBonglol
01:55Lau_of_DK# too much
01:55iBongtoo bad emacs isn't lisp-aware in erc mode
01:56iBongthat's quite dense, will have to thoroughly google agents
01:56Lau_of_DKiBong: You can make it that I think :)
01:56hiredman,(map #(send-off %2 + %1) (range 10) (cycle (take 4 (repeatedly #(agent 0)))))
01:56clojurebot(#<Agent@151a9d4: 4> #<Agent@64cc22: 6> #<Agent@195f463: 2> #<Agent@1dfae24: 3> #<Agent@151a9d4: 4> #<Agent@64cc22: 6> #<Agent@195f463: 2> #<Agent@1dfae24: 3> #<Agent@151a9d4: 4> #<Agent@64cc22: 6>)
01:56Lau_of_DKiBong: hiredman is making it very complicated
01:56iBongIm dutr domronr hsd
01:56iBongIm sure someone has
01:56Lau_of_DKIts actually really easy
01:56hiredmanwhat!?
01:57hiredmanI am not
01:57Lau_of_DK(defn foo [a] (map parse-csv-file (get-list-of-csv-files)))
01:57hiredman,(pmap #(send-off %2 + %1) (range 10) (cycle (take 4 (repeatedly #(agent 0)))))
01:57Lau_of_DK(send-off (agent 0) foo)
01:57clojurebot(#<Agent@1827697: 12> #<Agent@37eaa5: 6> #<Agent@10e1899: 8> #<Agent@7118a4: 10> #<Agent@1827697: 12> #<Agent@37eaa5: 6> #<Agent@10e1899: 8> #<Agent@7118a4: 10> #<Agent@1827697: 12> #<Agent@37eaa5: 6>)
01:57Lau_of_DKThanks for spamming
01:57hiredmanLau_of_DK: that won't spread the work out over multiple agents
01:58Lau_of_DKNo, but I dont think showing him send-off, cycle, repeatedly and agent will make it very clear to him what youre doing, so I opted to show send-off :)
01:59hiredmanyou would take my example, and replace (range 10) with a list of csv files and + with the csv processing function
01:59hiredmanand capture the resulting sequence in a name somehow, most likely let, apply await, then reduce the results
02:00hiredmanperfectly cromulent
02:00Lau_of_DKhaha - I dont even know what cromulent mean, but I'll go look it up Mr. Scholar
02:00piyo`leveraging cromulent synergy
02:00hiredmanit's a made up word, but I am sure some dictionary has it
02:01hiredmanof course, wikictionary does
02:01hiredmanhttp://en.wiktionary.org/wiki/cromulent
02:01arbschtembiggening one's vocabulary :)
02:02Lau_of_DKhaha
02:03Lau_of_DKIf you dont, communication with hiredman will be absolutely unpossible
02:03Fossihi
02:03iBongI sheepishly admit I was only able to make sense of Lau's example
02:03iBongcopied and pasted the above for reference
02:05Lau_of_DKGreat :D
02:05Fossihiredman: the definition of cromulent is pretty broad though
02:05hiredmaniBong: first (agent 0) creates and agent holding the value 0, #(agent 0) creates an anonymous function that returns a new agent holding the value 0 everytime it is invoked
02:06hiredmanrepeatedly takes a function and creates a infinite lazy sequence of the result of invoking the function over and over again
02:07hiredmanso (repeatedly #(agent 0)) creates an infinte sequence of agents holding 0
02:07Lau_of_DK~clojureql
02:07clojurebotclojureql is a quite impressive piece of work
02:07Lau_of_DK~clojureql
02:07clojurebotclojureql is http://github.com/Lau-of-DK/clojureql/tree/master
02:07Lau_of_DKRight on both accounts
02:08hiredmantake of course takes the first n of a sequence
02:09hiredmanso (take 4 (repeatedly #(agent 0))) gives you a lazy-seq of four agents holding 0
02:09hiredman,(pl (λx.x 1))
02:09clojurebot1
02:11iBong*iBong senses the fog thinning slightly
02:12hiredmancycle repeats the same four agents over and over
02:12iBongI'll try to plug it in to the program and see if its faster ;)
02:12iBonghopefully learn something along the way
02:12hiredmanI wonder if you might as well just do a reduce of a pmap
02:12Lau_of_DKiBong: Generally I'd say, build working code first, if its too slow, then optimize
02:13iBongyeah, I could just grab the biggest function on the java class, but that would be cheating
02:14Lau_of_DKWhat I meant is, usually Clojure code runs quite fast without paying special attention to optimizing, so dont get ahead of yourself - This advice I got from Chouser has saved me lots of time in the past
02:15iBong20 files, 20 sheets per file, many agents for sheets in file? agents for files?
02:15iBonggood advice indeed
02:15iBongand QL looks very cool
02:15iBongcloned it for safe keeping
02:16hiredmanthere is overhead for managing threads and some for the agent system, so the work load has to be not insignificant for there to be a performance boost
02:17iBongit takes about 5 minutes now, so its not THAT slow, but a speed increase would noticeable, and the logic is quite simple so it seemed like a good learning experiment
02:18Lau_of_DKHow large are the files in terms of mb ?
02:18iBongbetween 5 and 15 on avg
02:18iBongnot taking every sheet, though its on the horizon
02:19Lau_of_DKOk - Then I'd probably dispatch threads, if its something you have to sit and look at
02:19iBongexcel files produced by an accounting organization that really should have gotten a database a long time ago
02:20hiredmanman, I wish scopes would land
02:20Lau_of_DKWhy?
02:20hiredmanso useful for resource management
02:23Lau_of_DKI never looked at it, what would be the typical use case?
02:31Lau_of_DK@ hiredman
02:33Fossitime for clojure and android
02:33Lau_of_DKWhich reminds me, anyone got Clojure going on the iphone?
02:34Fossihmmm. why should that be problematic? bad jvm implementation?
02:34JAS415how would i translate this to clojure: java.awt.Image image = java.awt.Toolkit.getDefaultToolkit().getDefaultToolkit().createImage(url);
02:34JAS415??
02:35JAS415tried a bunch of things but nothing seemed to work properly
02:35JAS415seems to die on the .getDefaultToolkit thing
02:35Lau_of_DK(Image. (.. (getDefaultToolkit) (getDefaultToolkit) (createImage url)) I think
02:36Lau_of_DKif you import java.awt.Toolkit
02:36JAS415hmm
02:36JAS415okay
02:37Fossiwithout the Image.
02:37Fossior well
02:37Fossimost likely you dont want it
02:37JAS415hmm
02:38JAS415seems to get confused on getDefaultToolkit stil
02:38JAS415i had assumed i'd need the class
02:38Fossiat least i guess createImage already returns an Image
02:38JAS415ahhh
02:38JAS415there we go
02:38JAS415okay
02:38JAS415it is
02:39JAS415(.. java.awt.Toolkit (getDefaultToolkit) (createImage url))
02:39slashus2JAS415: (.. (java.awt.Toolkit/getDefaultToolkit) (createImage url))
02:39slashus2Or that
02:39JAS415seems like the second getDefaultToolkit was unnecessary
02:39JAS415:-)
02:39JAS415oh ok
02:39JAS415so you can qualify them with /'s
02:39JAS415that will be useful too
02:40Fossi"/ is for static stuff
02:41hiredmanLau_of_DK: instead of using with-open everywhere, functions can register a function to be run when a scope is exited
02:42hiredmanso (reader …) which returns a Reader could register a function to close the reader it produces
02:42hiredmanonce you leave the (scope …)
02:42hiredmanand it throws an exception if not called within a scope
02:42Lau_of_DKJAS415: (Image. (.createImage (java.awt.Toolkit/getDefaultToolkit) url)) How about that?
02:43Lau_of_DKOh ok, thanks hiredman
02:43hiredman~scopes
02:43clojurebotPardon?
02:43hiredman~scope
02:43clojurebotscope is at http://paste.lisp.org/display/73838
02:45Lau_of_DKIn that example, what is the 'scope' ? I'm confused that a string in the REPL triggers something, I had expected a reference to foo
02:45Chouserhuh. When I push a patch authored by X that includes "Fixes #Y", assembla reports that X closed ticket Y.
02:45hiredmanChouser: cute
02:45hiredmanLau_of_DK: the string in the repl doesn't trigger something
02:46Lau_of_DKGit - Keeping you humble
02:46ChouserI mean, I guess that's right, but it's weird to see a change timestamped now when they're not even logged in.
02:47hiredman(when-scope :fails (prn "failed")) registers the action (prn "failed") to be performed if the scope fails to exit cleanly (uncaught exception, etc)
02:48hiredmanthe "exited" and "failed" just print'ed oddly
02:48Chouserwhere "the scope" is the outermost (scope ...) in the current dynamic context
02:48hiredman~horizon
02:48clojurebothorizons is http://gist.github.com/51721
02:48Chouserhm, was there talk of named or directed scopes, rather than all bubbling to the highest?
02:48hiredmanyeah
02:49Lau_of_DKAh ok
02:49Lau_of_DKWhat are you doing up Chouser?
02:49ChouserTomorrow's my turn to sleep in, so I'm taking advantage of it.
02:50Lau_of_DKAh I see
02:50Chouserbut I've pretty much used up my time now...
02:50Lau_of_DKBut did you get much done?
02:52Chousernot too bad. tested image-grid [OT] and cranked through 5 tickets
02:53Chouserhm.. I think that's an average of about 30 minutes per ticket. not so hot...
02:53Lau_of_DKI wouldnt know, were they complex?
02:54Chousereh, not really.
02:55ChouserI mean, I'm not creating patches or anything, just double-checking the patch and doing "paperwork".
02:55Chouseranyway, bedtime. Y'all have fun, now.
02:55Lau_of_DKThats geat
02:55Lau_of_DKgreat
02:55Lau_of_DKAl'right, good night
03:02Fossipeople are so cool. a repl on the android. <3
03:02Fossitime for breakfast first though :D
05:52JetienHello! I often like to write functions that don't care if the argument is a collection containing one element or just one element. Is there an elegant way to do this in clojure?
05:53Jetieni like to be a ble to write (f x) instead of (f (list x))
05:59ChousukeJetien: I think you'll need an if in the function
06:00Jetienokay
06:00Jetienthanks! :)
06:24alinphi
06:24alinpI have a folder with some subfolders and some files (clj files)
06:24alinphow can I include all of these in the classpath ?
06:25alinpI tried -cp "${MY_FOLDER}/*"
06:25alinpbut when doing the (require 'folder.examples) it doesn't work
06:25alinpdoesn't find the folder/examples.clj file
06:25alinpalthough it exists there
06:32rottcoddif you use -cp dir then it will look in dir/folder/examples.clj
06:33StartsWithKtry -cp ${MY_FOLDER}/sub1:${MY_FOLDER}/sub2 .. i assume subs have proper structure used by http://clojure.org/libs
06:38StartsWithKdocs for remove-ns say: Removes the namespace named by the symbol. Use with caution.
06:38StartsWithKwhat problems could i create if i remove a namespace?
06:46alinpthanks guys
08:33FossiIs Remco van 't Veer coming here?
09:11Fossiyay. got clojure to run on the android emulator. time for fun
11:12krumholt_hiredman, that (pl ..) is that in clojure-contrib?
11:25rhickeylisppaste8: url
11:25lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
11:26lisppaste8rhickey pasted "newnew syntax" at http://paste.lisp.org/display/84174
11:26rhickey:as might be :this
11:27rhickeybut the key is :volatile, allows keeping closure model, just a declaration affecting mutability in this scope, doesn't add new notion of 'field'
11:54StartsWithKrhickey: will you leave proxy and related functions?
12:04dbaser_
12:11rhickeyStartsWithK: yes
12:11rhickeybut you won't generally want to use proxy once new new exists
12:51Fossirhickey: i like how you kinda push/trash concurrency in practice at the same time in the concurrency speech :D
12:52rhickeyFossi: I don't think I trash it - I think it's very good and recommend it. I think doing the things it recommends is very hard work and easy to get wrong.
12:53Fossiyeah, i totally feel the same way
12:54Fossiand i guess prolly every person who read it
13:25angermanhow would i wrap a few functions into an (if body
13:25rhickeyangerman: they likely have side effects, so (do ...)
13:26clojurebotThey found no relationship between a programmer’s amount of experience and code quality or productivity.
13:27angermanrhickey: thanks. I thought about the (do but wasn't sure if it was the way to go.. :)
13:27angermanI tried just wrapping the consecutive calls into ()
13:28angermanyes. What I wanted was stmt; expr
13:53krumholthi i am trying agents and i send a function to an agent which will send itself to the same agent. how can i make this agent stop?
13:55mebaran151is there anything like a lazy conjoin?
13:55mebaran151I'd like to add an element to aset but not realize it until its done?
13:55mebaran151*until the collection is evaluated
14:14mebaran151nvm the delay macro has me covered
15:03angerman... egal is nota function i can relate to.
15:14angermancan someone help me on my macro: http://gist.github.com/154862
15:17Fossiprogramming with java ui frameworks is kinda weird in clojure
15:23angermanFossi: I think with a few macros (though I'm not good at macros yet) it's quite plesant compared to writing pure java
15:23Fossii love it. but currently i try to write a android app and all this state is giving me headaches ;)
15:28Fossiso far it's nice that state is so explicit in clojure (compared to scala, groovy, jython)
15:29Fossibut the 'interfaces' between stateful java code and mine is always tricky to get right somehow
15:30Fossiif only for the mass of code wrapped in do that you have to write
15:30angermanI'm just to stupid to get it right now.
15:32Fossiwell, look at the source?
15:32Fossibut i guess clojureql uses a pretty deep stack of macros
15:32angermanFossi: I am ... :(
15:34Fossiit would be nice if there was a tool/program that would clean up imports
15:34Fossithe only thing i miss about eclipse really
15:43hiredmankrumholt_: nope
16:16Anniepoohmm... lookinf for some foomap that does (foo #(+ %1 %2) '(1 2 3) '(10 20 30)) => (11 22 33)
16:16rhickey,(map + [1 2 3] [10 20 30])
16:16clojurebot(11 22 33)
16:19Fossi,(map #(+ %1 %2) '(1 2 3) '(10 20 30))
16:19clojurebot(11 22 33)
16:20Fossijust checking my sanity... ;)
16:20Anniepooah, nice
16:20Anniepoothanks!
16:20Fossido you put your source dirs into the 'swank-clojure-extra-classpaths' in emacs?
16:21Fossithere prolly has to be a smarter way of making it find the classes it needs for :use
16:21rhickeythere's no need for #(+ %1 %2), just map +
16:22Fossisorry, i should've tested locally
16:22Anniepooyah, I see
16:22Anniepoothat's one more insanely useful thing about Clojure
16:22Fossirhickey: you still code in other languages for work?
16:22clojurebotfor is not a loop
16:23Fossiclojurebot: for me, it is, sometimes
16:23clojurebotfor is not used often enough.
16:23Fossiclojurebot: for that, i agree
16:23clojurebotfor is a loop...in Java
16:26Fossiif i want to instantiate a gen-class from another gen-class, do i :use or import it?
16:27Anniepoothis is getting messy.
16:29AnniepooI have a structure, a 'widget' that has a set of children and a set of slaves.
16:30AnniepooI'm making each widget a structmap with a couple keys, :children, a vector of children, and
16:30Anniepoo:slaves, a vector of slaves
16:31Anniepoonow I need to traverse through this struct applying all sorts of changes to masters and slaves
16:31Anniepooand it's messy
16:33Fossino, it's beautiful :)
16:33AnniepooLOL
16:33Anniepoowell, I could use less beauty and more functionality at the moment
16:34Fossinaturally depending on whether you find a good abstraction of your problem and a nifty way to handle it ;)
16:34rhickeyAnniepoo: you know about get-in, update-in, assoc-in?
16:34Anniepoono, I don't
16:34rhickey,(doc get-in)
16:34clojurebot"([m ks]); returns the value in a nested associative structure, where ks is a sequence of keys"
16:34Anniepoohitting doc now
16:34Fossinested stuff still grows on me as well. takes a good while to grasp
16:35Anniepooah! This is perfect!
16:35Fossias a collegue of mine said: even if your operation takes 24 lines of comments for each line of code, it will still be half of what you would've written in java :)
16:37Anniepooit's striking - I actually started this project in Java. I felt my Clojure knowledge was too weak.
16:37AnniepooI realized I'd never get it done in time, and switched to Clojure
16:38Anniepooeven given the extra time for my noobishness in Clojure my productivity is much higher
16:39Anniepooactually, get-in won't work here
16:39Anniepoobecause I have a vector of each thing I need to map over
16:40Anniepoolike the 2nd slave of the 3rd son of the 2nd slave of the 3rd prince of king kickipoo
16:49Anniepoo(get-in {:foo [{:mep "yup"} {:mep "no way"}] :bar "nope"} [:foo 0 :mep])
16:50Anniepoowow, that's insanely neat
16:50MarkVolkmannI've been studying the Clojure STM implementation because I want to understand it better and be able to explain it to others.
16:51MarkVolkmannI have focused primarily on LockingTransaction.java and Ref.java.
16:51MarkVolkmannI have a question about Refs and being "bound".
16:51MarkVolkmannI can't see in the code how it is possible for a Ref to be unbound. That means that its tvals field is null. I don't see how that can happen.
16:53rhickeyMarkVolkmann: there was once a no-arg ctor and there may be again
16:53MarkVolkmannAh ... that makes sense. Thanks!
17:04Fossihmmm. i guess i should've started with the domain stuff instead of poking around android and opengles all evening
17:07MarkVolkmannI'm looking at how a ref gets "faults" in the doGet method of LockingTransaction.
17:08MarkVolkmannSince every Ref always has at least one TVal and the initial one has a "point" of zero, it seems that the line "ref.faults.incrementAndGet()" at the bottom of the doGet method will never execute. Is that correct?
17:09MarkVolkmannIOW, some TVal for each Ref will always precede the read point.
17:11Anniepoobeyond terseness is there some advantage to (swap! foo myfunc) over (reset! foo (myfunc @foo)) ??
17:17hiredmanreset! there is a race condition
17:17Anniepooah, thanks
17:17hiredmanwell, potential
17:18Anniepooreset! isn't a transaction
17:18hiredmanso?
17:18Lau_of_DKDid anybody get some sweet UI's going with Java FX ?
17:18AnniepooI'm restating what you said
17:18hiredmanthat is not what I said
17:19hiredmanyou are presumably trying to set foo's value to some new value dependent on the old value
17:19rhickeyMarkVolkmann: no, another transaction could have changed the ref subsequent to this transaction starting, and there isn't enough history
17:19Anniepooyes
17:19hiredmanlike using inc
17:19Anniepoosure
17:19hiredmanso (myfunc @foo) executes and you get a new value for foo
17:20hiredmanand then the new value is written to foo
17:20hiredmanbut in that time, foo's value could have changed
17:20Anniepoook, that's what I meant
17:20hiredmanok, you are correct
17:20Anniepooswap! is ACI - not D
17:21Anniepoothanks
17:24Fossihmmm. not being connected through the repl to the phone is only half as productive
17:26Fossii still don't get how :state works
17:27hiredmanfor gen-class?
17:27Fossiyeah
17:27hiredmanit lates you create a place to store state
17:27Fossithe book is having a nice example, but that so doesn't fit my rl code
17:28Fossiyeah, and i can (swap! (.state this) (dosomething))
17:28Fossibut then, the state does not seem to be changed
17:29Fossiat least i get a nullpointer trying to access what i put in there in the next called method
17:30hiredmando you have an :init function?
17:32Fossiyes, as such: [[] {}]
17:32Fossiups
17:32Fossiyes, as such: [[] (atom {})] of course
17:32hiredmanoh
17:33hiredmandosomething returns a keyword or a symbol?
17:33Fossi(swap! (.state this) conj {:view view})
17:34Fossi(log-info (:view ( .state this)))
17:34FossiNPE
17:34Fossiin another method that is
17:34hiredmanuh
17:34Fossido i have to dereference it?
17:34hiredmanof course
17:35hiredman,(conj {} {:view 'view})
17:35clojurebot{:view view}
17:35hiredmanseems like you could just use assoc
17:35hiredman,(:view (atom {:view 1}))
17:35clojurebotnil
17:36Fossii could, but i'll prolly add a few more fields later
17:36hiredman,(:view @(atom {:view 1}))
17:36clojurebot1
17:36hiredman,(assoc {} :view 'view :bar 'bar)
17:36clojurebot{:bar bar, :view view}
17:36Fossinot being able to test this without deploying to the emulator really sucks :\
17:37Fossii guess making a proxied clojure api wouldn't be too hard
17:38Fossiok, that helped. next problem ;)
17:44lbjNo takers on the JavaFX question?
17:47Anniepoothe answer for me is no
17:48Anniepoobut it sounds itneresting
17:48Anniepooare you doing it?
17:48lbjSo for GUI's we've got Swing, a cut-short Qt implementation and Awt ?
17:48AnniepooSWT
17:48lbjAnniepoo: If the answer to the above question is no, then I might
17:49AnniepooI know that in general there's a feeling you shouldn't need to wrap libs
17:50lbjI think it was AWizzard who had encountered some un-beatable obstacle in regards to FX
17:50Anniepooyah, there's a fundamental problem with Clojure on android
17:51lbjI wasn't thinking android though, just for regular desktop apps
17:51Anniepoothe sandbox won't let dynamic compile happen
17:51lbjSwing always seems laggy somehow
17:51hiredmanthe prefered gui kit in #java seems be swing, surprisingly enough
17:51hiredmanAnniepoo: I don't think it's the sandbox
17:51Anniepooit's the bytecode verifier
17:52hiredmanthe asm library clojure uses emits jvm bytecode, but android runs on some other virtual machine
17:52Anniepoothis per George from the baclojure group - his day job is in Android - and a question he asked rhickey when he spoke at the not=-Javaone thing
17:53Anniepoook, believe hiredman, not me
17:53AnniepooI could be misunderstanding
17:53hiredman*shrug*
17:54hiredmanI can imagine the dalvik byte code verifier would choke on jvm byte code :P
17:59Fossiclojure works on android though
17:59hiredmanbut not eval
17:59Fossiit's only really slow for dynamic stuff
17:59hiredmanoh
18:00Fossiand slow for reflection and functional programming as is
18:00Fossisomebody used the dalvik compiler to compile the bytecode realtime
18:00Fossiby converting it with itself to run on the phone
18:00hiredmanyeah, so what happens is the jvm byte code is written to a file, then the translation tool is run, which turns jvm byte code into dalvik byte code then it loads the dalvik byte code
18:01Fossiwhich is slow in the first place
18:01Fossibut still, it *works* ;)
18:02hiredmanI don't think there is a "dalvik compiler" just a tool that transforms the bytecode
18:02Fossiyeah, well, same thing really pretty much
18:02hiredmanaltering the eclipse java compiler to emit dalvik byte code might be interesting
18:02Fossistill wwouldn't solve the clojure problem though
18:02hiredmansince ejc is written in java
18:03Fossisomebody spotted an asm version on the phone as well
18:03Fossiwould be much more promising :)
18:04Fossithen again, i don't care too much about eval and such. i'm glad i can write my 'static' bytecode in clojure
18:06hiredmanhttp://stackoverflow.com/questions/935103/how-do-i-execute-dalvik-op-codes
18:06hiredmananswer is "You cannot"
18:21Fossiporting java to clojure is more annoying than i thought
18:22Fossibut finally, it's 'running'. a black opengl screen :)
18:24lbjFossi, had a look at JMonkey ?
18:26Fossii searched around, but didn't find any engine that had explicit android support
18:26lbjArgh, forgot about the Android angle :)
18:26lbjHit me back when you find a way to execute on the iphone
18:27Fossi:)
18:27Fossii guess somebody will prolly do dual boot android at some point
18:27lbjProbably
18:28Fossiand i guess you could use clojure on jailbreaked iphones with some shitty jvm and no hardware support
18:28Fossibut that's not so interesting/useful :)
18:28Fossii guess since i want to do more gl and clojure i'll just roll my own
18:29Fossimy first project does not have big requirements anyway
18:29Fossi2d with a little isometric should be sufficient
18:29Fossiand maybe some candy effects. maybe a particle system or two
18:29lbjHave fun, paste link to Github when done :)
18:30Fossiwill do :)
18:31lbjGood night all
18:31Fossin8
19:43mebaran151java.util.Timer doesn't seem to like my proxy object: how do I directly subclass
19:46hiredmanmebaran151: you're proxy'ing TimerTask?
19:46hiredmanI think the best advice for Timer is to use a ScheduledThreadpoolExecutor instead
19:48rhickey,(.schedule (java.util.Timer.) (proxy [java.util.TimerTask] [] (run [] (prn "Hello World"))) (long 500))
19:48clojurebotjava.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
19:48hiredman:P
19:48hiredmanbut back when I used Timer proxy just worked
19:49mebaran151hiredman, I was trying
19:49rhickeywhat I posted up should work
19:49rhickeydoes it?
19:49mebaran151the timer class doesn't seem to recognize that method
19:50mebaran151says it can't find a matching method schedule
19:50hiredmanhttp://github.com/hiredman/clojurebot/blob/52a02ce8dae22034444fa42e6c2f8f4bb9b986b0/hiredman/schedule.clj is a bit of a wrper around scheduled threadpoolexec
19:50rhickeyexactly what I posted?
19:50hiredmanmebaran151: pastbin
19:50hiredmanlisppaste8: url?
19:50lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
19:50mebaran151rhickey, I'm testing yours now
19:52mebaran151I think it pasted
19:53lisppaste8mebaran151 pasted "TimerTask?" at http://paste.lisp.org/display/84193
19:53hiredmanyeah, you are missing the (long …)
19:54mebaran151oh it won't make the cast for me
19:54mebaran151I see
19:54mebaran151but isn't current time already long
19:54mebaran151oh, but I'm used period there, nvm
19:55mebaran151thanks all
19:55mebaran151I would have thought that the JVM would be smart enough to make lossless casts for me
20:09fsmImage quality getting better: http://tu.be/graphics/8ball.jpg
22:26liron_question.. why do we have to call (shutdown-agents) in order to terminate a script that uses agents?
22:45RaynesOh noes! A lispers worst nightmare... Mismatched parentheses!
23:07mebaran151setting java -Xmx should set the largest maximum memory a java app can use right?