Re: clojure.contrib.enum Exception

2008-12-20 Thread Lauri Oherd
Last version of Clojure should be at the moment of writing this SVN 1176. Clojure's source repo (and also Clojure contrib) has moved to Google Code. See http://groups.google.com/group/clojure/browse_thread/thread/6b4a5284d61a682a/42495079592facd7 for more details. Lauri On Sun, Dec 21, 2008 at

clojure.contrib.enum Exception

2008-12-20 Thread Andrew Baine
Any help is much appreciated: user> (require :verbose 'clojure.contrib.enum) (clojure.core/load "/clojure/contrib/enum") ; Evaluation aborted. java.lang.Exception: Unable to resolve symbol: gen-and-load-class in this context (enum.clj:42) [Thrown class clojure.lang.Compiler$CompilerException]

Re: doc strings for multimethods?

2008-12-20 Thread Jason
Thanks all. The patch looks interesting to me, although I'd only use it if it was integrated into the main build. -Jason --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: recur rationale?

2008-12-20 Thread Stuart Halloway
You propose a clever trick, but unfortunately it would require even more cleverness. What if foo, bar, and baz live in different libraries, and you reload one of the libraries as part of a dynamic update at runtime? How would the inline copies know they needed to update? I am happy with e

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Meikel Brandmeyer
Hi, Am 21.12.2008 um 00:28 schrieb Chouser: As far as I can tell, libs aren't really documented anywhere (besides in the docs strings for 'ns' and the various helper function). If I've missed it somewhere, please correct me, but It probably belongs at http://clojure.org/namespaces There is an

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Chouser
On Sat, Dec 20, 2008 at 2:47 PM, Christian Vest Hansen wrote: > > Q: >> On Sat, Dec 20, 2008 at 11:25 AM, chris wrote: >>> I am unclear as to the difference between refer, import use, and >>> require. > > Good material for the FAQ, no? > > Or maybe just the docs. Regardless, this is a good expla

Re: December monads

2008-12-20 Thread jim
I also think this would be a great addition to clojure-contrib. Because of the way most monad tutorials are written, monads seem to be pretty hard to get your head around. Also, many of the reasons for the standard monads in Haskell don't exist in impure functional languages like Clojure. So th

Re: for FAQ: what are use/require/import/refer?

2008-12-20 Thread Stuart Sierra
On Dec 20, 12:44 pm, chris wrote: > 1.  Is using defs the best way to go about this?  They are global > variables; they model static state of the system, essentially.   Yes, global variables are probably best as Vars (which is what def creates). > 2.  How do defs handle updating when I reload a

Re: recur rationale?

2008-12-20 Thread Mark Engelberg
On Sat, Dec 20, 2008 at 9:06 AM, Stuart Sierra wrote: > Leaving that aside, I actually find loop/recur more intuitive than > Scheme-style "helper functions." It really gets down to the essence > of what a loop is. loop/recur is almost exactly like Scheme's "named let" (basically loop/recur is a

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Christian Vest Hansen
Q: > On Sat, Dec 20, 2008 at 11:25 AM, chris wrote: >> I am unclear as to the difference between refer, import use, and >> require. A: On Sat, Dec 20, 2008 at 5:40 PM, Chouser wrote: > 'require' finds a .clj file in your classpath (which must define a > matching namespace) and loads it into Clo

Re: Help Needed Getting Clojure-Mode working with XEmacs

2008-12-20 Thread CuppoJava
Syntax highlighting doesn't seem to work when I open .clj files. And I cannot open the REPL using C-c C-z. I'm not sure if there's an error log that I can show you. I don't know how to access it. Thanks for your help --~--~-~--~~~---~--~~ You received this message

Re: December monads

2008-12-20 Thread r
Hi, Although I am not a big fan of monads (I can't help the feeling this abstraction is more difficult than the problem to solve) this starts looking like a nice framework that should probably go into clojure-contrib (perhaps with policy of not using this mechanism in other clojure-contrib libs).

Re: Blogging About Clojure?

2008-12-20 Thread David Nolen
For syntax highlighting in WordPress this is a good solution. It was originally written to be used for the EmacsBlog so it should handle Clojure just fine. David On Fri, Dec 19, 2008 at 7:09 PM, Jason wrote: > > Hi Randall, > > I'm in the same boa

Re: for FAQ: what are use/require/import/refer?

2008-12-20 Thread chris
That really helped out a lot, thanks guys! As long as we are on the subject of helping out newbs... I like to program from the repl. I have a namespace that maintains some state, mainly integration with openGL. It has some essentially static variables that can't get initialized until openGL is

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Brian Doyle
Instead of require call use and should get you what you want. On Dec 20, 2008 9:15 AM, "chris" wrote: That helped, thanks Christophe. I have one more problem: I put it in a util file, under a util namespace: (ns lambinator.util) (defmacro sets! [vars & rest] `(do ~@(map (fn [flds] `(set! (.

Re: for FAQ: what are use/require/import/refer?

2008-12-20 Thread Brian Doyle
This would make an excellent FAQ question and answer! On Sat, Dec 20, 2008 at 9:53 AM, Stuart Sierra wrote: > > This might make a good FAQ question: > > On Dec 20, 11:25 am, chris wrote: > > I am unclear as to the difference between refer, import use, and require. > > Hi Chris, > > require: Load

clojure.lang.Script

2008-12-20 Thread janus
I wanted to use clojure.lang.Script in order to use SciTe editor, however, I am not getting any result. Has anyone used Script before, if yes, please I need your help. First ,I need direction on how to use it .Or anyone really used Scite with Clojure, if yes, please copy you code and send to me.

Re: recur rationale?

2008-12-20 Thread Stuart Sierra
On Dec 20, 9:29 am, verec wrote: > At about 72:54 of the clojure sequence talk, Rich explains that he > doesn't want to provide "false guaranties" to people used to "true > tail calls" even though he could detect such "tail position calls" and > basically transforms them into what recur currently

for FAQ: what are use/require/import/refer?

2008-12-20 Thread Stuart Sierra
This might make a good FAQ question: On Dec 20, 11:25 am, chris wrote: > I am unclear as to the difference between refer, import use, and require. Hi Chris, require: Load a Clojure library from a file on classpath. Use this when you want to load a library, but leave it in its own namespace.

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Meikel Brandmeyer
Hi, Am 20.12.2008 um 17:25 schrieb chris: I am unclear as to the difference between refer, import use, and require. require loads a lib from the classpath. The you can access the public names of the lib's namespace via full qualified names. (require 'foo.bar) (foo.bar/baz "Hurray") refer le

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Chouser
On Sat, Dec 20, 2008 at 11:25 AM, chris wrote: > > I am unclear as to the difference between refer, import use, and > require. 'require' finds a .clj file in your classpath (which must define a matching namespace) and loads it into Clojure. 'refer' brings definitions from some other already-loa

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread chris
nm, I need to use 'use'. I am unclear as to the difference between refer, import use, and require. Chris On Dec 20, 9:15 am, chris wrote: > That helped, thanks Christophe. > > I have one more problem: > > I put it in a util file, under a util namespace: > > (ns lambinator.util) > > (defmacro s

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread chris
That helped, thanks Christophe. I have one more problem: I put it in a util file, under a util namespace: (ns lambinator.util) (defmacro sets! [vars & rest] `(do ~@(map (fn [flds] `(set! (. ~vars ~(first flds)) ~(second flds))) (apply array-map rest Now I want to use it outside that na

December monads

2008-12-20 Thread Konrad Hinsen
My monad code needed a small fix to work with the December 17 release. I have replaced the original file with the corrected one at http://groups.google.com/group/clojure/web/monads.clj Konrad. --~--~-~--~~~---~--~~ You received this message because you

Re: Persistent storage

2008-12-20 Thread chris
Couldn't you look at slime/swank as a sort of object protocol? They already communicate through a sexy protocol of some sort (or maybe it was sex-p, I dunno). Could we perhaps get different swank backends to talk to each other and get clojure/CL interop that way? That was off-topic, I know. Ch

Re: Help Needed Getting Clojure-Mode working with XEmacs

2008-12-20 Thread Wayne R
It's going to be difficult to help you unless you more specifically detail the problem you're having. In what way is it not working? -Wayne On Dec 20, 1:25 am, CuppoJava wrote: > Hi everyone, > I'm trying to get clojure-mode working under XEmacs and am having > troubles. > > I managed to get it

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 3:20 pm, verec wrote: > Though I wonder how complicated it would be to "coalesce" any such > set of mutually recursive functions into a single "JVM method" where > such "local gotos" bytecodes exist and are documented -- that's what > the Java "continue xyz" and "break xyt" translate

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 3:03 pm, "Christian Vest Hansen" wrote: > On Sat, Dec 20, 2008 at 3:29 PM, verec > > When they don't apply. As I understand things, this magic > transformation would have you think that clojure has true TCO, when > the tail-call -> recur transformation in reality only works for > sel

Re: recur rationale?

2008-12-20 Thread Christian Vest Hansen
On Sat, Dec 20, 2008 at 3:29 PM, verec wrote: > > At about 72:54 of the clojure sequence talk, Rich explains that he > doesn't want to provide "false guaranties" to people used to "true > tail calls" even though he could detect such "tail position calls" and > basically transforms them into what

Re: recur rationale?

2008-12-20 Thread verec
On Dec 20, 2:46 pm, Randall R Schulz wrote: > On Saturday 20 December 2008 06:29, verec wrote: > > > I'm just curious about examples where such a "magic transformation" > > would result in violated assumptions. > > Write some Clojure code and use recur freely, without regard to whether > it's i

Re: recur rationale?

2008-12-20 Thread Randall R Schulz
On Saturday 20 December 2008 06:29, verec wrote: > At about 72:54 of the clojure sequence talk, Rich explains that he > doesn't want to provide "false guaranties" to people used to "true > tail calls" even though he could detect such "tail position calls" > and basically transforms them into what

Re: doc strings for multimethods?

2008-12-20 Thread Randall R Schulz
On Friday 19 December 2008 23:00, Lauri Oherd wrote: > Docstrings for individual defmethods are not possible. Except that "not possible" is not the same thing as "not allowed" or "not available." > You can find more info about it there: > http://groups.google.com/group/clojure/msg/f7751913e8759

recur rationale?

2008-12-20 Thread verec
At about 72:54 of the clojure sequence talk, Rich explains that he doesn't want to provide "false guaranties" to people used to "true tail calls" even though he could detect such "tail position calls" and basically transforms them into what recur currently does. I'm just curious about examples wh

Re: doc strings for multimethods?

2008-12-20 Thread J. McConnell
On Fri, Dec 19, 2008 at 8:05 PM, Jason wrote: > > Am I mistaken, or is there currently no nice syntax for giving doc > strings to methods? Sure, I can do > > (defmulti #^{:doc "documentation"} my-method my-dispatch-fn) > > but for consistency with defn and defmacro it would be nice to have a > d

Re: Loading a resource file from the class path?

2008-12-20 Thread blackdog
On Sat, 20 Dec 2008 03:12:30 -0800 "Darren Austin" wrote: > > Hey folks, > > I am probably missing something obvious here, but is there an good way > to open a resource file that is relative to the current class path? I > want to bundle up some data files with my .clj source in a .jar file. >

Re: Loading a resource file from the class path?

2008-12-20 Thread Mike DeLaurentis
I've never done that in Clojure, but another developer at the company I work for made a java utility that allows you to refer to classpath resources as URLs. It's on sourceforge in a package called "OpenHMS Common Utilities": http://openhms.sourceforge.net/common-util/ There's a class called com

Loading a resource file from the class path?

2008-12-20 Thread Darren Austin
Hey folks, I am probably missing something obvious here, but is there an good way to open a resource file that is relative to the current class path? I want to bundle up some data files with my .clj source in a .jar file. >From the clojure code, I need to open these data files. I looked at Class

Re: Listen on changes to refs

2008-12-20 Thread Christian Vest Hansen
On Sat, Dec 20, 2008 at 3:49 AM, Rowdy Rednose wrote: > > Validators seem like an easy way to do it, I'll try that. Thanks > Chouser! Just a caution. Validators can run even if the ref does not change. For instance when a transaction is aborted by another validator. > > Afaik Rich only thinks a

agents, memory usage and threads

2008-12-20 Thread prhlava
Hello, What is you experience with using agents on multi core CPU when agents hold a considerable amount of memory allocated? What I found that when the JVM memory usage goes to around 26% of available RAM, only one thread runs at the time from then on. Is this JVM optimising? What I am trying