#clojure log - May 10 2008

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

4:55 esquesque: hello

4:55 i was wondering if clojure had an equivalent of cl's return-from

12:08 Chouser: esquesque: I don't think so. There's been a related discussion recently: http://groups.google.com/group/clojure/browse_thread/thread/90eae0f570989254

12:14 asbjxrn: Anyone got hints for how to write a macro that uses variable capture?

12:20 I keep getting that "Can't use qualified name as parameter" error.

12:21 http://paste.lisp.org/display/60547 for an example of what I want.

15:28 Chouser: asbjxrn: try ~(symbol "x") instead of just x

15:46 hoeck: asbjxrn: or ~'x

15:56 Chouser: no way! so much better.

15:56 hoeck: thanks. :-)

16:13 hoeck: chouser: :)

21:01 asbjxrn: Chouser, I tried that. Same error, unfortunally.

21:04 rhickey: tried what?

21:05 asbjxrn: using ~'x instead of just x in my macro where I try to use variable capture.

21:06 I posted on the group as well: http://groups.google.com/group/clojure/browse_thread/thread/b4102f39dcc28569#

21:15 rhickey: ~' is the way to expose symbols without resolution, so maybe something else is wrong? Can you paste it on paste.lisp.org?

21:18 asbjxrn: http://paste.lisp.org/display/60547#1

21:20 Hmm. The namespace isn't clean when I do this, but I hope there nothing that interferes

21:22 Macroexpansion looks ok: http://paste.lisp.org/display/60547#2

21:24 rhickey: env is your problem - you probably want a gensym, try env#

21:25 asbjxrn: Doh.

21:37 Another question: How do I subclass a class? This feels like it should be elementary, but I haven figured it out. (Say I want to add a environment map to a JPanel, for example.)

21:37 rhickey: use proxy

21:39 in order to get state, close over it

21:39 asbjxrn: I thought so, but I've only seen how to add/override func... Ah. another doh....

21:41 rhickey: don't sweat it, it's a different way to look at things for sure

21:42 asbjxrn: Well, I'm coming from the lisp side of the fence, so closures shouldn't be a big conceptual step...

21:43 rhickey: right, but not the way you'd think of extending Java classes necessarily

21:44 there is a newer way in SVN, and it does allow for a single final state field - see src/genclass.clj

Logging service provided by n01se.net