Re: Is it possible to tell programatically if I'm in a transactional context?

2008-12-11 Thread Dave Griffith
Excellent! This is a great way of making code fail-fast for a class of bugs that would normally only occur under load (i.e. at the worst possible time). --Dave Griffith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: frequency of each unique item in collection

2008-12-11 Thread Dave Griffith
(defn frequencies [coll] (reduce (fn [map val] (assoc map val (if (contains map val) (get map val) 1)) #{}) ) On Dec 11, 9:21 am, bOR_ <[EMAIL PROTECTED]> wrote: > Hi all, > > I thought I remembered there was a method in the api somewhere that > would count the frequency of each uniq

Re: Extending Clojure's STM with external transactions

2008-12-09 Thread Dave Griffith
Since it requires changes to the Clojure runtime, it probably doesn't make much sense to put it in contrib. I've posted it as an attachment to the group. --Dave Griffith --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Is it possible to tell programatically if I'm in a transactional context?

2008-12-08 Thread Dave Griffith
nd is perfectly fine, although it looks like exposing a method in LockingTransaction would be more performant. --Dave Griffith On Dec 8, 6:07 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Hi Dave, > > It looks like LockingTransaction.getRunning would need to be made   > publ

Is it possible to tell programatically if I'm in a transactional context?

2008-12-08 Thread Dave Griffith
prohibitted in transactions, but questions were raised as to whether there was any way to actually prevent it. Looking through the API, I couldn't find any way of detecting when execution was occuring in a transactional context or not. --Dave Gri

Re: Extending Clojure's STM with external transactions

2008-12-08 Thread Dave Griffith
used for production purposes. Contents may have settled during shipping. All models over 18. Where should I send the patch? --Dave Griffith --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: A newbie question on Agents and ants

2008-12-07 Thread Dave Newton
--- On Sun, 12/7/08, Michael Wood wrote: > Is there an explanation that's a little smaller than 607MB? The slides and the code? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Re: Elegant but very slow

2008-12-07 Thread Dave Newton
threading/concurrency. That's just my impression; you'll get far more definitive answers than this. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Running clojure-contrib.jar

2008-12-06 Thread Dave Newton
or files and/or commands you're using? Like get the classpath via: > echo %CLASSPATH% I'm reasonably sure it shouldn't be trying to load a Main-Class from the contrib jar, so I suspect the classpath is not being set properly. Dave --~--~-~--~~~

Re: neo4j-clojure

2008-12-06 Thread Dave Newton
--- On Sat, 12/6/08, Julian Morrison wrote: > A wrapper for neo4j, which is a non-relational database > using [...] traversable relationships. Hey, wait... Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Running clojure-contrib.jar

2008-12-06 Thread Dave Newton
d to "run clojure." [...] Plus I'm pretty suspicious of that semicolon. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Extending Clojure's STM with external transactions

2008-12-04 Thread Dave Griffith
> Maybe if the external commit > can be delayed until the end of the transaction, when it is certain > that the in-memory operations succeeded, it could work. I think this > is the most promising way of implementing this. This was my plan. As near as I can tell, the current STM implementation co

Extending Clojure's STM with external transactions

2008-12-03 Thread Dave Griffith
ld be pretty easy to extend the STM with features like timeouts and such. Thoughts? Am I missing anything? Has this already been attempted in some way I was unable to google for? My temptation is to try to implement something as a quick spike and

Re: Clojure Code Analysis Tools

2008-12-02 Thread Dave Griffith
elicensed as Apache 2.0.I don't know if that's something you might be interested in eventually, but it's something to think about. It's early days for Clojure, but who knows what the future might bring. Dave Griffith --~--~-~--~~~---~--~~ You re

Re: DISCUSS: replace (rand)

2008-12-02 Thread Dave Newton
o be the same. A Sun v. Sun comparison? What about JDK/JVM implementations from different vendors? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: Distributed concurrent applications in Clojure?

2008-11-26 Thread Dave Griffith
One big issue to note is that, because of Refs, Clojure agent semantics can't simply be remoted the way Erlang processes can be. This is because a message send could include a references to a Ref, thus exposing mutable state remotely. This breaks, well, just about everything. If you restrict th

Re: Slightly off-topic: building DSLs incrementally in Java

2008-11-24 Thread Dave Newton
nd Polyglot [2] compilers have been used to produce some pretty fun Java extensions, although none so fun as Roman numerals. 269 just provides an official way to abuse the compiler ;) Dave [1] http://jastadd.cs.lth.se/web/extjava/index.shtml [2] http://www.cs.cornell.edu/pro

Re: Bureaucracy has reached Wikibooks

2008-11-20 Thread Dave Newton
the chaff--I'm actually not in favor of completely unrestricted access to the wiki. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Re: strings

2008-11-18 Thread Dave Newton
--- On Tue, 11/18/08, joejoe wrote: > Yeah I got so fed up with trying to do it I > almost gave up, then I found the (reverse string). That doesn't actually do what your spec said, though. Dave --~--~-~--~~~---~--~~ You received this message beca

Re: POLL: Domain name for project hosting site.

2008-11-17 Thread Dave Newton
of the cloject; me likey. > - clojury > - openjure - Nondisclojure (Stealth Clojure projects in Java houses) - 4LeafClojure (it's good luck, top o' the mornin' to ye) - Code4Clojure - SeekingClojure Dave --~--~-~--~~~---~--~~ You received

Re: Clojure for LISP programmers....

2008-11-17 Thread Dave Newton
g guy steele just sat down next to me" and my friend (he's young) texted back "cool ask him who guy steele is". Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&q

Re: Clojure for LISP programmers....

2008-11-17 Thread Dave Newton
Another flaw may be corrected if invokedynamic or similar gets implemented in a shipping version.) 'Nuff said. It seems like our time could be better spent doing something else; the horse has been sufficiently beaten. Dave --~--~-~--~~~---~--~~ You received

Re: Clojure for LISP programmers....

2008-11-16 Thread Dave Newton
s of problems getting things to work, although I've been doing a lot of Java lately, and more Scheme than CL, so that may have helped. I'm sure other folks would also be interested in your contributions towards a CL => Clojure document; sounds like a good opportunity. Dave ---

Re: Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-11-13 Thread Dave Newton
lity of being a list of (expected to be) equal pairs. That's probably just me, I'm sure, but I find the original more readable and precise--something I think is key in tests, as tests are also documentation. Dave --~--~-~--~~~---~--~~ You received th

Re: REPL special variables

2008-11-12 Thread Dave Newton
is context In which environment/build? It's working fine for me. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Re: Readable names

2008-11-12 Thread Dave Newton
vely recently that we're seeing similarly-functional non-Lisp/Smalltalk IDEs. > If it's only brevity that you're after then aget > could be abbreviated still, I guess: ag anyone? There's "terse", and there's "concise". I know

Re: (string?) bug

2008-11-11 Thread Dave Newton
ur own (stringish? ...) function then--since Clojure is strongly Java-interop returning a T for a non-String would make (string? ...) seem less useful, but that's just my opinion. Dave --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: (string?) bug

2008-11-09 Thread Dave
=> (string? (new java.lang.StringBuilder "hello")) > false Wouldn't it be a StringBuilder, not a String? user=> (. (new java.lang.StringBuilder "hello") getClass) #=java.lang.StringBuilder user=> (string? (. (new java.lang.StringBuilder "hello") toString

Re: (string?) bug

2008-11-09 Thread Dave Newton
t it be a StringBuilder, and not a String? user=> (. (new java.lang.StringBuilder "hello") getClass) #=java.lang.StringBuilder user=> (string? (. (new java.lang.StringBuilder "hello") toString)) true Dave --~--~-~--~~~---~--~~ You receiv

<    3   4   5   6   7   8