#clojure logs

2008-09-16

08:08jamii_Can clojure arithmetic be overloaded eg (+ (QPoint. 0 0) (QPoint. 10 10))
08:08rhickeyjamii_: no
08:14jamii_Thats annoying. Is this just something noone has got around to or is intentionally like that?
08:14rhickeyslow math is annoying too
06:06Chouserrhickey: congrats on the release.
06:07Chousernot 1.0 yet? :-)
06:12rhickeyChouser: thanks
06:13rhickeystill on the fence about what 1.0 means
12:57abrooksrhickey: I poked around a bit but wasn't able to see in the logs or your recent post what Subversion revision the 20080916 release was based on.
12:57cemerickrhickey: Congrats. :-) With which svn rev does the new release correspond?
12:57cemerickwow, spooky
12:59rhickeyrelease is based on the latest - rev 1029
13:00Chouserthe blog post lists the checkin comments
13:00rhickeyI should put the rev somewhere...
13:05abrooksChouser: Ah, that should have clued me in.
13:06abrooksrhickey: BTW, I meant to express thanks and congratulations about the release.
13:07rhickeyabrooks: you're welcome!
14:58jgracinthis "no-tco" in jvm problem... is there a solution for this in JVM at all? I mean, is it just a matter of taking time to do it, or are there fundamental issues with adding that to JVM?
15:01rhickeyjgracin: I think there are some issues having to do with security, but deemed possible: http://blogs.sun.com/jrose/entry/tail_calls_in_the_vm
15:13jgracinrhickey: thanks for the link, interesting read. The only problem I see in the article is disallowing calls to java.lang.Class.* and others.
15:14jgracinhow does one do that?
15:15ChouserAh! A function's 0th local is always for itself!
15:16rhickeyjgracin: it doesn't disallow all calls to those, just doesn't TCO them, which you won't care about in those cases because they don't mutually recurse to your code
15:16rhickeyChouser: yes, implicit this
15:17Chouseroh. huh.
15:17Chouserwell anyway, that simplifies things...
15:20jgracinrhickey: I see. But how is JVM going to know that my "tailcall" call is calling one of the forbidden methods? Should such methods have some kind of marker so that JVM knows it shouldn't discard the stack... I guess so...
15:34ChouserIs there something already like s: ((fn s [r] (if r (lazy-cons r (s (rest r))))) (range 5))
15:39rhickey#(take-while identity (iterate rest %))
15:45rhickeyBetter: #(take-while seq (iterate rest %))
15:50Chousernice
15:52ChouserThere's no need it emit thisfn if it's not given a name, right? Since there's no other way to refer to it.
15:52rhickeyChouser: right
17:01Chouservars are set up sufficiently during analyze that they can be resolved (no eval or special code needed)
17:02rhickeyChouser: I thought you might need to do something for require/use
17:04Chouserah, I haven't gotten that far. I'm eval'ing ns for now.
17:04ChouserIf we want to use ns to describe dependencies on other cljs files... well, I haven't thought about that at all.
17:06Chouserso for now the only thing that seems to fall back to runtime resolution are browser-supplied globals (window, document, etc.)
17:06Chouserwhich seems about right to me.
17:06rhickeysounds good
17:07ChouserIt does work to provide a window/window.clj that defs a bunch of those, and then in the cljs you can say (ns foo (:use window)) and get the browser globals to resolve
17:07Chouserbut I can't tell if that's a good idea or not. :-)
17:08ChouserAnyway, I'm going to work on stacking vars next.
17:09rhickeyis there any notions of threads?
17:09Chouserno, none at all.
17:10ChouserThere is a bug in some versions of IE that will interrupt your one JS thread with some asynchronous event handling.
17:10rhickeytake note of the counter trick in vars to avoid a map lookup every reference
17:11rhickeythe basic idea is each var has a counter. if it is zero, it's not thread/stack bound, so use the root binding, if not zero look up in map
17:11rhickeypush bindings increments the counter for all bound vars, pop decrements
17:11ChouserBecause of no threads, I was thinking the current value of the var could reside in myns.foo, and the stack would be kept elsewhere (myns._foo_stack?)
17:11rhickeyon the JVM, this avoids a thread-local lookup followed by a map lookup
17:12rhickeysingle threaded that could work
18:41lisppaste8Apologies for the trouble today. The bot should stop bouncing in and out of your channel now.