Re: Invoking Java method through method name as a String

2009-02-22 Thread Timothy Pratley
> I guess I'm still stuck on how to expand the vector of arguments in place... One way is (apply function vector) -> (function v1 v2 v3) > and I'm really not very sure what you're doing with the '&' in the > parameters for the str-invoke. Is that a way of slurping all the remaining > parameters

Re: Directed Graphs for Contrib

2009-02-22 Thread Frantisek Sodomka
+1 on that! Graphs are common and many people are going to write similar algorithms to yours. Also, as a library, it is going to have nice interface (than if put together with Datalog) and will be much easier to reuse. Frantisek PS: Graphs are my favorite data structure, so I am lobbying for th

Re: Directed Graphs for Contrib

2009-02-22 Thread Timothy Pratley
+1 :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-02-22 Thread Jan Rychter
Following up on my own post: Jan Rychter writes: > Rich Hickey writes: >> On Jan 26, 11:15 am, Cosmin Stejerean wrote: >>> On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey wrote: >>> >>> > On Jan 25, 4:10 pm, Laurent PETIT wrote: >>> > > #- makes sense (CL didn't always make things the wrong way

Issue 52 looks solved

2009-02-22 Thread Frantisek Sodomka
Hello! Just a quick note: Issue 52: Make set/union accept any number of arguments http://code.google.com/p/clojure/issues/detail?id=52 seems to be solved already by: SVN 1276 http://code.google.com/p/clojure/source/detail?r=1276 added multi-arg clojure.set/union/difference/intersection, patch fr

SLIME and clojure problem

2009-02-22 Thread Jan Rychter
I have a problem that I am unable to solve by myself. I've been trying to use parts of the weld framework by Mark McGranaghan. However, clojure fails to compile it with an error I don't understand: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol [Thrown class

Re: Feedback sought on yet another cells implementation!

2009-02-22 Thread Anand Patil
Hi Tim, thanks for the feedback! On Feb 21, 11:16 am, Timothy Pratley wrote: > (1) auto-agents by SS in contrib has a more convenient syntax [maybe > you can mimic it] Agreed, it is nicer. At the moment 'def-cell' is already a stretch for me, but maybe someday I'll get there. :) > (2) I can a

Re: nth with regex Matchers

2009-02-22 Thread Frantisek Sodomka
Thanks Chouser!! I needed it just to test the 'nth'. I had to ask, just couldn't figure it out :-) Yes, I prefer re-seq - especially with such nice tools like http://cljre.com/ from Mark McGranaghan http://groups.google.com/group/clojure/browse_frm/thread/bbc9fd453667d953/a79a738cbe7f41e9 Franti

Re: Directed Graphs for Contrib

2009-02-22 Thread MattH
+1! That'd be really useful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsub

Re: dependencies + observers + java interop: how to?

2009-02-22 Thread max3000
Thanks guys! It will take some time for me to wrap my head around this but it is more than I hoped for. Max On Feb 21, 9:22 pm, Jeffrey Straszheim wrote: > I have a "toy" version of Datalog working now here: > >  http://code.google.com/p/clojure-datalog/ > > By "toy" I mean it works but is i

Re: Directed Graphs for Contrib

2009-02-22 Thread Francesco Bellomi
+1 Francesco On Feb 22, 2:59 am, Jeffrey Straszheim wrote: > As part of my Datalog work I'm putting together some directed graph > algorithms, mostly things like finding strongly connected components, and > building dependency stratifications (think topological sort but with the > results group

Re: Feedback sought on yet another cells implementation!

2009-02-22 Thread Timothy Pratley
Thanks for the details Anand, I understand better now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group,

Re: Parenscript in clojure?

2009-02-22 Thread Jan Rychter
Konrad Hinsen writes: > On Feb 18, 2009, at 9:39, Jan Rychter wrote: > >> Is anyone working on a Parenscript >> (http://common-lisp.net/project/parenscript/) for Clojure? > > There's Chouser's ClojureScript in clojure.contrib. I don't know if > it is similar to Parenscript, but it has similar

Re: Clojure Naming Conventions

2009-02-22 Thread Laurent PETIT
2009/2/22 Chouser > > On Sat, Feb 21, 2009 at 5:36 PM, David Nolen > wrote: > > My point is simply that whether something is immutable or not has nothing > to > > do with how that data structure is being used in the program. > > Naming conventions signify usage. You could write a pure Java > >

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
On Sun, Feb 22, 2009 at 7:49 AM, Jan Rychter wrote: > > Konrad Hinsen writes: > >> On Feb 18, 2009, at 9:39, Jan Rychter wrote: >> >>> Is anyone working on a Parenscript >>> (http://common-lisp.net/project/parenscript/) for Clojure? >> >> There's Chouser's ClojureScript in clojure.contrib. I don

Re: Issue 52 looks solved

2009-02-22 Thread Jeffrey Straszheim
Does zero arguments return #{} ? Has intersection changed? On Sun, Feb 22, 2009 at 5:16 AM, Frantisek Sodomka wrote: > > Hello! Just a quick note: > Issue 52: Make set/union accept any number of arguments > http://code.google.com/p/clojure/issues/detail?id=52 > > seems to be solved already by: >

Re: Directed Graphs for Contrib

2009-02-22 Thread Jeffrey Straszheim
Just as a point of fact, I don't plan to make a complete *every algorithm you can think of* package, just the ones I need. However, it would be easy to add others submitted by the community. I could be a gathering place of graph algorithms. On Sun, Feb 22, 2009 at 7:31 AM, Francesco Bellomi < fr

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-02-22 Thread Rich Hickey
On Feb 22, 2009, at 4:41 AM, Jan Rychter wrote: > > Following up on my own post: > > Jan Rychter writes: >> Rich Hickey writes: >>> On Jan 26, 11:15 am, Cosmin Stejerean wrote: On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey wrote: > On Jan 25, 4:10 pm, Laurent PETIT wrote:

Re: Directed Graphs for Contrib

2009-02-22 Thread Rich Hickey
On Feb 22, 2009, at 10:11 AM, Jeffrey Straszheim wrote: > Just as a point of fact, I don't plan to make a complete *every > algorithm you can think of* package, just the ones I need. However, > it would be easy to add others submitted by the community. I could > be a gathering place of g

Re: Issue 52 looks solved

2009-02-22 Thread Frantisek Sodomka
user=> (union) #{} user=> (union #{1 2}) #{1 2} user=> (intersection #{1 2}) #{1 2} user=> (intersection #{1 2} #{2 3}) #{2} user=> (intersection #{1 2} #{2 3} #{2 4}) #{2} Don't take me too seriously when I post my messages :-) Anyway, Rich Hickey closed the issue, so please post anything that

Re: Invoking Java method through method name as a String

2009-02-22 Thread Richard Lyman
This is _so_ awesome!! Thanks a ton for your patient help Tim, and others. In the end I also had to switch the use of into-array to to-array, since into-array expects all the elements to be the same type, and my args were of varying types. Using to-array worked since it cast each element to the O

Re: Should (pop nil) throw an exception?

2009-02-22 Thread Frantisek Sodomka
Any thoughts on this one? Impatient Frantisek :-) On 21 Ún, 22:28, Frantisek Sodomka wrote: > Hello! > Currently, 'pop' throws an exception if the collection is empty: > > clojure.core/pop > ([coll]) >   For a list or queue, returns a new list/queue without the first >   item, for a vector, ret

[Solved] Re: Invoking Java method through method name as a String

2009-02-22 Thread Richard Lyman
I've added a section on the Wiki under the examples: http://en.wikibooks.org/wiki/Clojure_Programming/Examples#Invoking_Java_method_through_method_name_as_a_String Again, thanks! -Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: Should (pop nil) throw an exception?

2009-02-22 Thread bOR_
Perhaps some context help. Why would you want to continue popping an empty collection? If you are in a loop, when will you stop popping it? Perhaps there is a more logical idiom to use for the case you run into pop nil exceptions (doseq?) On Feb 22, 5:18 pm, Frantisek Sodomka wrote: > Any though

Re: SLIME and clojure problem

2009-02-22 Thread Telman Yusupov
Hi Jan, I'm not familiar with Weld, but based on the error message shown the cause might be the recent changes in making sequences fully lazy. Which version of clojure.contrib are you using? If it works for Mark, you might want to make sure that you're running the same version of Clojure and clo

Re: Parenscript in clojure?

2009-02-22 Thread Dan
> > I'm curious about what you need that's different from what > ClojureScript provides: a mechanism for compiling a subset of Clojure > to JavaScript code that behaves like you'd expect the Clojure code to > behave. > ParenScript is a subset of common lisp and a javascript generator that is meant

Re: Directed Graphs for Contrib

2009-02-22 Thread Frantisek Sodomka
Graphs has always inspired me and seeing implementation in Clojure will be no less inspiring. http://www.visualcomplexity.com/vc/ http://planarity.net/ Frantisek On 22 Ún, 16:11, Jeffrey Straszheim wrote: > Just as a point of fact, I don't plan to make a complete *every algorithm > you can thi

Re: Road to Clojure on c.l.l

2009-02-22 Thread Dan
On Sat, Feb 21, 2009 at 10:23 PM, Mibu wrote: > > comp.lang.lisp had a great Road to Clojure Survey thread which was > actually an x-is-better-than-y thread that turned into a full blown > flamewar. > > > http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/0d05837df1efe075 > > Thes

Re: Should (pop nil) throw an exception?

2009-02-22 Thread Vincent Foley
You would not be able to distinguish between an empty collection and pop returning a nil value. On Feb 21, 4:28 pm, Frantisek Sodomka wrote: > Hello! > Currently, 'pop' throws an exception if the collection is empty: > > clojure.core/pop > ([coll]) >   For a list or queue, returns a new list/que

Clojure Continuous Integration on Tapestry360

2009-02-22 Thread Howard Lewis Ship
I've set up two Clojure builds on the Tapestry360 Continuous Integration Site: http://tapestry.formos.com/bamboo A trunk build runs after any changes to clojure. The nightly build runs every morning. Clojure now produces Maven artifacts in the http://tapestry.formos.com/maven-snapshot-reposito

Re: SLIME and clojure problem

2009-02-22 Thread Jeffrey Chu
Hi, It looks like it's because the period `.' comes after the quote `"' in `cookies map".'; this seems to make the meta :arglists (.) - this may be a clojure bug. You may want to put the period before the double quotes. In the mean time, a check for this was added in the latest swank- clojure (

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-02-22 Thread Jan Rychter
Rich Hickey writes: [...] How about #_ ? >>> >>> I would prefer #-, but if you think you might want to have a reader >>> conditional system similar to CL in the future, #_ is fine as well. >>> >>> Actually, any character is better than plucking out multi-line >>> forms and >>> commenting t

Re: Parenscript in clojure?

2009-02-22 Thread Jan Rychter
>> I'm curious about what you need that's different from what >> ClojureScript provides: a mechanism for compiling a subset of Clojure >> to JavaScript code that behaves like you'd expect the Clojure code to >> behave. Dan writes: > ParenScript is a subset of common lisp and a javascript generato

validators for Refs

2009-02-22 Thread Mark Volkmann
All the documentation I've seen on validators for reference types says they should throw an exception if the value is invalid. I've never seen it explained that they should return true if the value is valid. That's seems to be the case though. Can someone confirm that? -- R. Mark Volkmann Object

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
On Sun, Feb 22, 2009 at 1:58 PM, Jan Rychter wrote: > > Exactly. I need it to be small, lightweight and produce small readable > Javascript. I don't want Javascript code to behave like Clojure, on the > contrary -- I want it to behave like Javascript. I just want lispy > syntax for it and, most i

Re: dotimes suggestion

2009-02-22 Thread David Nolen
In general, I find that multiple arguments types for a function confusing. If dotimes is going to take multiple types it should be a multifn. That seems to imply a performance hit. I think Clojure wisely does not (or rarely does not?) allow for multiple types to be passed into a function. On top o

Changed clojure.contrib.test-clojure to load without running, add run method

2009-02-22 Thread Stephen C. Gilardi
I changed clojure.contrib.test-clojure so that it can be loaded without running tests. Now to run the tests from the repl, please use code like this: Clojure user=> (require 'clojure.contrib.test-clojure) nil user=> (clojure.contrib.test-clojure/run) Lo

Re: validators for Refs

2009-02-22 Thread Chouser
On Sun, Feb 22, 2009 at 2:10 PM, Mark Volkmann wrote: > > All the documentation I've seen on validators for reference types says > they should throw an exception if the value is invalid. I've never > seen it explained that they should return true if the value is valid. > That's seems to be the ca

Re: Parenscript in clojure?

2009-02-22 Thread Dan
> > > Ah, ok. That is indeed quite different from ClojureScript, primaryly > because it has immutable collections. And nearly unreadable output. > :-) > > So now my question is -- in what way is ParenScript insufficient? It depends on common lisp instead of clojure? :) How does ClojureScript i

Re: dotimes suggestion

2009-02-22 Thread Mark Volkmann
On Sun, Feb 22, 2009 at 1:34 PM, David Nolen wrote: > In general, I find that multiple arguments types for a function confusing. > If dotimes is going to take multiple types it should be a multifn. That > seems to imply a performance hit. > I think Clojure wisely does not (or rarely does not?) al

Re: dotimes suggestion

2009-02-22 Thread David Nolen
I agree that this is initially confusion, but I think that if you spend more than a couple of days with Clojure you will understand the ubiquitous and liberal use of binding forms. On Sun, Feb 22, 2009 at 2:42 PM, Mark Volkmann wrote: > > On Sun, Feb 22, 2009 at 1:34 PM, David Nolen > wrote: > >

Re: validators for Refs

2009-02-22 Thread Mark Volkmann
On Sun, Feb 22, 2009 at 1:40 PM, Chouser wrote: > > On Sun, Feb 22, 2009 at 2:10 PM, Mark Volkmann > wrote: >> >> All the documentation I've seen on validators for reference types says >> they should throw an exception if the value is invalid. I've never >> seen it explained that they should ret

Re: dotimes suggestion

2009-02-22 Thread Mirko
On Feb 21, 9:53 pm, André Thieme wrote: > On 21 Feb., 18:24, Mark Volkmann wrote: > > > Currently the dotimes macro requires its first argument to be a vector > > for binding a variable to the number of times the body should be > > executed. Inside the body, that variable is bound to the value

Re: Parenscript in clojure?

2009-02-22 Thread jim
Seeing your comments, I've decided to try to get my Javascript generator suitable for public use. It'll take a day or two, I think. Have you got a catchy name for it? Jim Dan wrote: > > It depends on common lisp instead of clojure? :) > > How does ClojureScript integrates with Javascript libr

Re: dotimes suggestion

2009-02-22 Thread Mark Volkmann
On Sun, Feb 22, 2009 at 1:46 PM, David Nolen wrote: > I agree that this is initially confusion, but I think that if you spend more > than a couple of days with Clojure you will understand the ubiquitous and > liberal use of binding forms. I know I'm beating this to death and need to let this dro

Re: dotimes suggestion

2009-02-22 Thread Mark Volkmann
On Sun, Feb 22, 2009 at 1:54 PM, Mirko wrote: > In my practice, almost every project (no matter how short it is) > starts by writing raw code, and then, when I see what is being done > often, replacing parts with macros that simplify the code and make it > easier to read. But wouldn't it be nic

Nice Conversation between hardware lisp and hardware java architects

2009-02-22 Thread bOR_
Here is an interesting read, for those of you that (also) occasionally daydream about having a hardware jvm to play with ;). >From Cliff Click Jr.’s Blog's Blog "I had an email conversation between myself, David Moon & Daniel Weinreb. For the younger readers: David Moon is one of the original ar

Re: Parenscript in clojure?

2009-02-22 Thread Dan
As for names, all I can think of is: (js) It's like javascript but shorter and lisper. On the other hand it's not obvious how you should pronounce it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group

Re: Parenscript in clojure?

2009-02-22 Thread Dan
On Sun, Feb 22, 2009 at 3:12 PM, jim wrote: > > Seeing your comments, I've decided to try to get my Javascript > generator suitable for public use. It'll take a day or two, I > think. Have you got a catchy name for it? > > Jim > That would be great! My main reason to want this is for this li

Re: Parenscript in clojure?

2009-02-22 Thread jim
Looking at qooxdoo was down a little further on my list, since Kenny Tilton mentioned it. I'd like to do some web app type stuff, which why I took a crack at the parenscript thing in the first place. On Feb 22, 2:18 pm, Dan wrote: >  That would be great! My main reason to want this is for this

Becoming lazy

2009-02-22 Thread jim
Is there a summary of the changes to Clojure that the lazy sequences required. For instance fnseq doesn't exist any more, that I see. Also, lazy-cons went away. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "C

Re: Road to Clojure on c.l.l

2009-02-22 Thread Rayne
The reason I picked Clojure is because in order to distribute software you need people to download and install the CL you pick. That's like asking a doorknob to turn for you without touching it. --~--~-~--~~~---~--~~ You received this message because you are subscri

Atoms and Watchers

2009-02-22 Thread Mark Volkmann
I'm not sure, but I may have found a bug in Atom.java. The swap method calls compareAndSet. After that, if the new value differs from the current value, it calls notifyWatches. However, at that point compareAndSet would have already called notifyWatches. Is there are reason to do it again? -- R.

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
On Sun, Feb 22, 2009 at 2:40 PM, Dan wrote: > > It depends on common lisp instead of clojure? :) Oh, it requires Common Lisp to do the translation? Bleh. > How does ClojureScript integrates with Javascript libraries? It's almost > unthinkable now to do a site that is not based on some of the f

Re: validators for Refs

2009-02-22 Thread Rich Hickey
On Feb 22, 2009, at 2:48 PM, Mark Volkmann wrote: > > On Sun, Feb 22, 2009 at 1:40 PM, Chouser wrote: >> >> On Sun, Feb 22, 2009 at 2:10 PM, Mark Volkmann >> wrote: >>> >>> All the documentation I've seen on validators for reference types >>> says >>> they should throw an exception if the va

with-meta and concat

2009-02-22 Thread jim
In some old code, I did something like: (with-meta (concat [1 3] [8 4]) {:tail true})) which now fails. I believe it's because the result of concat is now some kind of reference. Does anyone have any advice on a workaround? Jim --~--~-~--~~~---

Re: Atoms and Watchers

2009-02-22 Thread Rich Hickey
On Feb 22, 2009, at 3:48 PM, Mark Volkmann wrote: > > I'm not sure, but I may have found a bug in Atom.java. The swap method > calls compareAndSet. After that, if the new value differs from the > current value, it calls notifyWatches. However, at that point > compareAndSet would have already cal

Re: Clojure.contrib: name changes in monads

2009-02-22 Thread Konrad Hinsen
Jim, > As long as your breaking things in monads, what would you think of > changing m-seq to this. ... > so that it doesn't accept a list of monadic values but instead lets > you call it with any number of mv's. > > Instead of: > > (m-seq [mv1 mv2 mv3]) > > you would write > > (m-seq mv1 mv2 mv3

Re: Becoming lazy

2009-02-22 Thread samppi
A good summary is here: http://clojure.org/lazier Note that all this has indeed been committed to the latest SVN of Clojure. I think that most of clojure.contrib has been updated too. On Feb 22, 1:32 pm, jim wrote: > Is there a summary of the changes to Clojure that the lazy sequences > require

Re: Clojure.contrib: name changes in monads

2009-02-22 Thread jim
I converted the code in the paper "Monadic Parsing in Haskell" to Clojure. Both m-plus and m-seq are used to combine lists of parsers. m-plus is used to build a parser that executes each parser in the list until one succeeds. m-seq is used to build a parser that executes all the parsers in the l

Re: Becoming lazy

2009-02-22 Thread Stephen C. Gilardi
On Feb 22, 2009, at 4:13 PM, samppi wrote: A good summary is here: http://clojure.org/lazier Over time there were at least two pages at clojure.org describing work on the lazy branch. "lazier" is an older one. The one that describes what is now checked into the main branch is: ht

Re: Becoming lazy

2009-02-22 Thread jim
Thanks, I had skimmed that link and then forgot about it. Jim On Feb 22, 3:13 pm, samppi wrote: > A good summary is here:http://clojure.org/lazier > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: with-meta and concat

2009-02-22 Thread Chouser
On Sun, Feb 22, 2009 at 4:07 PM, jim wrote: > > In some old code, I did something like: > > (with-meta (concat [1 3] [8 4]) >{:tail true})) > > which now fails. I believe it's because the result of concat is now > some kind of reference. > > Does anyone have any advice on a w

Re: with-meta and concat

2009-02-22 Thread jim
Thanks! That was exactly what I needed to get my old code to pass my unit tests. Now it's on to making changes to bring it up to date with the new lazy stuff. Jim On Feb 22, 3:32 pm, Chouser wrote: > > LazySeq extends AFn, so you can't change the metadata once the object > exists.  However, S

Re: SLIME and clojure problem

2009-02-22 Thread Jan Rychter
Jeffrey Chu writes: > It looks like it's because the period `.' comes after the quote `"' in > `cookies map".'; this seems to make the meta :arglists (.) - this may > be a clojure bug. > > You may want to put the period before the double quotes. Hah! Thanks! I didn't spot that! That indeed seem

Re: dotimes suggestion

2009-02-22 Thread Mirko
On Feb 22, 3:14 pm, Mark Volkmann wrote: > On Sun, Feb 22, 2009 at 1:54 PM, Mirko wrote: > > In my practice, almost every project (no matter how short it is) > > starts by writing raw code, and then, when I see what is being done > > often, replacing parts with macros that simplify the code an

Re: Changed clojure.contrib.test-clojure to load without running, add run method

2009-02-22 Thread Frantisek Sodomka
There was a functionality in build.xml to run tests from the command line. When you correctly set clojure.jar path, you could just do: ant test_clojure to run test-clojure tests. There is also: ant test_contrib which still works. "ant test_clojure" is broken by this change. (bad? ok? don't kno

Re: Atoms and Watchers

2009-02-22 Thread Timothy Pratley
"if the new value differs from the current value, it calls notifyWatches." I noticed that the 'changed' bool has been removed in favor of only notifying when different. Should this logic also be applied to reset() which currently does not check for delta? Regards, Tim. --~--~-~--~

Re: exclamation point at end of function names

2009-02-22 Thread Kevin Albrecht
I am also interested in the reasoning behind this. See my related question here: http://groups.google.com/group/clojure/browse_thread/thread/b04d49784c895030 --Kevin Albrecht On Feb 21, 5:47 am, Mark Volkmann wrote: > If I understand correctly, ending a function name with an exclamation > poi

Re: Changed clojure.contrib.test-clojure to load without running, add run method

2009-02-22 Thread Stephen C. Gilardi
On Feb 22, 2009, at 5:41 PM, Frantisek Sodomka wrote: There was a functionality in build.xml to run tests from the command line. When you correctly set clojure.jar path, you could just do: ant test_clojure Fixed. Thanks for the report. Regarding test_contrib, I would like to update it along

Re: dotimes suggestion

2009-02-22 Thread Raffael Cavallaro
On Feb 22, 2:54 pm, Mirko wrote: > > In lisp you would define it as (untested): > > (defmacro print-times (reps text) > `(do-times (i ,reps) > (print ,text)) > > (Not trying to force-feed lisp, just that I do not know the closure > syntax). user=> (defmacro repeat-times [n & body]

can't get watchers on Vars to work

2009-02-22 Thread Mark Volkmann
The code below registers a watcher with a Var, a Ref and an Atom. The watch Agent has a map value that is used to count the number of times each thing it is watching changes. The keys are reference objects and the values are change counts. The code correctly reports two changes to the Ref, three c

Re: can't get watchers on Vars to work

2009-02-22 Thread pmf
> (defn my-watcher-action [current-value reference] >   (let [change-count-map current-value >         old-count (change-count-map reference) >         new-count (if old-count (inc old-count) 1)] >   (assoc change-count-map reference new-count))) It seems to me that your problem is that you are n

suggestion for resultset-seq and duplicate column names

2009-02-22 Thread Rob
Hi, How about having this function call .getColumnLabel instead of .getColumnName. That way, you can do a join with duplicate column names and rename them in the SQL query... select name name1, name name2, ... from ... and resultset-seq won't throw an exception. ? Rob --~--~-~--~

Re: can't get watchers on Vars to work

2009-02-22 Thread pmf
On Feb 23, 1:55 am, pmf wrote: > > (defn my-watcher-action [current-value reference] > >   (let [change-count-map current-value > >         old-count (change-count-map reference) > >         new-count (if old-count (inc old-count) 1)] > >   (assoc change-count-map reference new-count))) > > It se

Re: dotimes suggestion

2009-02-22 Thread Mirko
On Feb 22, 6:19 pm, Raffael Cavallaro wrote: > On Feb 22, 2:54 pm, Mirko wrote: > > > > > In lisp you would define it as (untested): > > > (defmacro print-times (reps text) > > `(do-times (i ,reps) > > (print ,text)) > > > (Not trying to force-feed lisp, just that I do not know the closure > >