Getting the all the key values from hashmaps inside a vector

2011-04-20 Thread Dave
Wracking my brain this afternoon trying to figure this one out. I'm fairly new to Clojure and Lisp in general. I have a data structure that is a vector of maps and I want to get all the values for a particular key out of all of the maps into another vector. For example, let's say this is the

Re: Feedback Request

2011-04-19 Thread Dave Ray
Thanks. At the moment Seesaw has a ToWidget protocol which it uses to implicitly convert things to Swing components (String - JLabel, Action - JButton, etc). So it should be pretty extensible beyond the default conversions that are supplied. Dave On Tue, Apr 19, 2011 at 10:41 AM, pepijn (aka

Feedback Request

2011-04-18 Thread Dave Ray
) How bad am I abusing Clojure and what could I do to improve it? It's not particularly functional, but I'm currently using Swing's insanely imperative style as an excuse for that. Thanks! Dave -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: ANN: Gloss, a byte-format DSL

2010-11-23 Thread Dave Newton
, a few common file formats I needed, etc. Just need to get my Lisp fu back, and I can go back to being productive again. Dave On Tue, Nov 23, 2010 at 12:03 PM, Zach Tellman ztell...@gmail.com wrote: When writing Calx [1], I discovered it was a huge pain to deal with mixed C datatypes in Java

Re: logging recommendation

2010-11-23 Thread Dave Newton
file is annoying sometimes, but it works. I've only had issues with Log4J enterprisily. Everywhere else, it's always worked great 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.com

Re: Parameterized SQL queries?

2010-11-10 Thread Dave Newton
will have information regarding this. 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.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe

Re: compiling a protocol with types

2010-11-05 Thread Dave Newton
I thought there was some minor magic to get types in there though, wasn't that one of the interesting things Rich pointed out at a recent NYC Clojure meetup (Sept, maybe)? Dave On Nov 5, 2010 10:59 AM, Kevin Downey redc...@gmail.com wrote: for defining an interface you should use definterface

Re: Reloading java classes

2010-11-04 Thread Dave Newton
JRebel is still the best answer. Loading a class at runtime is non- trivial. I don't know how it deals with handling existing instances of the class, though; I still think CLOS got that right. Dave On Nov 4, 2010 10:03 PM, Seth wbu...@gmail.com wrote: All i need to do is a function to reload

Re: Getting this error regarding duck-streams/spit ...

2010-10-26 Thread Dave Ray
, Dave On Tue, Oct 26, 2010 at 12:46 AM, Btsai benny.t...@gmail.com wrote: I don't think it's a mistake or accident that spit exists in clojure.core.  In 1.2, duck-streams became deprecated and functions such as spit were incorporated into clojure.core: http://clojure.github.com/clojure

Re: Let usage question

2010-10-20 Thread Dave Ray
Not only did my question get answered, but I learned several new things in the process. Thanks! Dave On Wed, Oct 20, 2010 at 1:52 PM, Alan a...@malloys.org wrote: When you work with a lazy sequence, Clojure (java really) automatically garbage-collects elements you're done with. It can only

Let usage question

2010-10-19 Thread Dave Ray
-entry? trimmed)] (map parse-entry filtered))) Is this style of let considered good/bad stylistically? Are there technical tradeoffs between this and a bunch of nested forms? Thanks! Dave -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Nil Coalesce

2010-08-17 Thread Dave Jack
Neither particularly short nor particularly clever: (defn nil-coalesce [coll subs] (loop [[c cs :as coll] coll [s ss :as subs] subs acc []] (if coll (recur cs (if (nil? c) ss subs) (conj acc (if (nil? c) s c))) acc))) On Tue, Aug

Re: Installing Clojure on OS X

2010-08-17 Thread Dave
I usually do: 1) lein new your-project-name 2) cd your-project-name, add :dev-dependencies [[swank-clojure 1.3.0- SNAPSHOT]] to your project.clj, and run lein deps 3) run lein swank 4) Connect from emacs with M-x slime-connect and accept the default options it gives you. I haven't had any

Re: System calls

2010-08-09 Thread Dave
in get-msms-pts-OSX.))) it would run all three commands, and then print this error: No message. [Thrown class java.lang.NullPointerException] Can you see why this would be? Thanks again for your help, -Dave On Aug 8, 12:00 am, j-g-faustus johannes.fries...@gmail.com wrote: On Aug 7, 4:46 pm

Re: System calls

2010-08-07 Thread Dave
at that a bit more. Does anyone know why this doesn't seem to work: (defn test-execute [ls-arg1 ls-arg2] (execute (str ls - ls-arg1)) (execute (str ls - ls-arg2))) Thanks again. -Dave On Aug 6, 11:06 pm, j-g-faustus johannes.fries...@gmail.com wrote: On Aug 6, 11:50 pm, Dave david.dreisigme

Re: (java.io BufferedReader FileReader) versus [clojure.contrib.duck-streams :only (read-lines)]

2010-08-06 Thread Dave
Hi Nikita, Your function works! Could you explain the - a bit? Thanks, - Dave On Aug 5, 5:53 pm, Nikita Beloglazov nikelandj...@gmail.com wrote: See my variant of your application:https://gist.github.com/efdb66487e899446332f I don't know if it works, because I can't test :( My thoughts

Re: (java.io BufferedReader FileReader) versus [clojure.contrib.duck-streams :only (read-lines)]

2010-08-06 Thread Dave
Awesome! Thank you so much for your help -- I really appreciate it. On Aug 6, 12:43 pm, Nikita Beloglazov nikelandj...@gmail.com wrote: Hi Dave, There are really 2 functions, - and - First - Sometimes you need to perform several functions on after another. You can write something like

System calls

2010-08-06 Thread Dave
***) commands below in a terminal it works fine. I copied execute from here: http://www.magpiebrain.com/2010/06/20/executing-a-command-line-program-with-clojure/ Thanks! -Dave * (ns msms (:gen-class) (:use [clojure.contrib.duck-streams :only

Re: System calls

2010-08-06 Thread Dave
Also, this only shows the 2nd call (with ls-arg2): (defn test-execute [ls-arg1 ls-arg2] (execute (str ls - ls-arg1)) (execute (str ls - ls-arg2))) so maybe the difficulty above is some problem with how the multiple system calls are performed. If I only use this: (defn get-msms-pts-OSX ;;

(java.io BufferedReader FileReader) versus [clojure.contrib.duck-streams :only (read-lines)]

2010-08-05 Thread Dave
/Fortran 95 background. Thanks, -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.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: (java.io BufferedReader FileReader) versus [clojure.contrib.duck-streams :only (read-lines)]

2010-08-05 Thread Dave
] (**) but instead I get hold-coords = [x3 y3 z3]. Any idea about how I could get (**) instead? Thanks! -Dave On Aug 5, 2:46 pm, Nikita Beloglazov nikelandj...@gmail.com wrote: Hi, Dave Why do you use 2 parenthesis before with-open in the first variant? And, as I know, it's not good practice to use def

Re: (java.io BufferedReader FileReader) versus [clojure.contrib.duck-streams :only (read-lines)]

2010-08-05 Thread Dave
Thanks Nikita, I really appreciate your help. -Dave On Aug 5, 5:53 pm, Nikita Beloglazov nikelandj...@gmail.com wrote: See my variant of your application:https://gist.github.com/efdb66487e899446332f I don't know if it works, because I can't test :( My thoughts about your example You

Re: Redcar and Clojure

2010-07-31 Thread Dave Byrne
Update: I've integrated enclojure into Redcar, and its been merged into the main repository. I am planning to continue to improve the clojure experience in Redcar. If you want to check it out, you can get the redcar source here: http://github.com/danlucraft/redcar On Jul 10, 12:01 pm, Dave

Re: Weird Segmentation fault while running Clojure

2010-07-30 Thread Dave Jack
clojure.contrib.logging$fn__1511$fn__1513.invoke(Ljava/lang/Object;)Ljava/lang/Object;+6 Perhaps a logging jar? HTH, Dave On Fri, Jul 30, 2010 at 7:32 AM, Baishampayan Ghose b.gh...@ocricket.com wrote: Hello, We have a Clojure web application which uses Compojure. Today, the server segfaulted all

Rincanter problem

2010-07-29 Thread Dave
I can't get Rincanter to install. I get the message: Unable to resolve artifact: Missing: -- 1) org.incanter:incanter-full:jar:1.2.0-SNAPSHOT Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file

Re: Rincanter problem

2010-07-29 Thread Dave
Joel helped me figure it out: http://joelboehland.com/posts/all-your-datasets-r-belong-to-us.html#comment-65157543 On Jul 29, 6:55 am, Dave david.dreisigme...@gmail.com wrote: I can't get Rincanter to install.  I get the message: Unable to resolve artifact: Missing: -- 1

Re: Newbie style question - implementing binary search

2010-07-28 Thread Dave Snowdon
Thanks. That does look clearer. Dave On Jul 27, 4:15 pm, Joost jo...@zeekat.nl wrote: I think the main thing that's confusing here is that you're messing with offsets and split collections at once. At least is was confusing to me. :) I think for binary search (which implies random lookup

slime-fancy

2010-07-28 Thread Dave
If I use lein swank and have (slime-setup '(slime-repl)) in my .emacs, the repl doesn't work (try (+ 1 2)). Changing this to (slime-setup '(slime-repl)) fixes the problem. Anyone know why this should be? SBCL, CCL64, KAWA and QiII work fine with (slime-setup '(slime-repl)). -- You received

Re: slime-fancy

2010-07-28 Thread Dave
Thanks Alex, that worked. -- 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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this

Newbie style question - implementing binary search

2010-07-27 Thread Dave Snowdon
really use a binary search to locate items in real clojure programs so please don't just point me at a library function and tell me to use that. What I'm interested in is how I would re-implement chop in more idiomatic clojure and would be very grateful for any pointers you can give me. thanks Dave

Enclojure uberjar

2010-07-27 Thread Dave
Has anyone been able to do something similar to lein uberjar using Enclojure? I always end up with the message: [WARNING] JAR will be empty - no content was marked for inclusion! This happens even if I make a new project where: 1) Create a project with lein new myproject 2) Edit the project

Redcar and Clojure

2010-07-10 Thread Dave Byrne
Does anyone use Redcar editor with Clojure? I am thinking about writing a Clojure REPL plugin, but wanted to make sure no one else has already done this. Would anyone find this useful, or is there no need for it with the plethora of other options (emacs/slime/swank, counterclockwise, etc.)? --

Re: Request for comments: DefaultMap

2010-07-08 Thread Dave Jack
Hi Michal, I needed to change your containsKey implementation to always return true in order to support the merge-with use case. Hi Stu, merge-with* seems like a useful addition, though its semantics differ slightly from merge-with's. The original merge-with modifies the vals only if there are

Re: Make a loop in a loop

2010-07-07 Thread Dave M
, only a single value from each range exists; the other values in the range are either garbage or don't exist (have not been computed) yet. I think this use of range is considered idiomatic Clojure. -Dave -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Clojure Enhancement Proposals or wish list

2010-06-10 Thread Dave Pawson
-- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- 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 Note that posts from new members are moderated - please be patient with your

contrib command-line

2010-06-10 Thread Dave Pawson
http://richhickey.github.com/clojure-contrib/command-line-api.html Where might I find information on the 'cmdspec' mentioned please? TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message because you are subscribed to the Google Groups Clojure

Re: contrib command-line

2010-06-10 Thread Dave Pawson
On 10 June 2010 12:57, Steve Purcell st...@sanityinc.com wrote: On 10 Jun 2010, at 12:22, Dave Pawson wrote: http://richhickey.github.com/clojure-contrib/command-line-api.html Where might I find information on the 'cmdspec' mentioned please? If you click on the source link there is a nice

Re: contrib command-line

2010-06-10 Thread Dave Pawson
On 10 June 2010 12:57, Steve Purcell st...@sanityinc.com wrote: On 10 Jun 2010, at 12:22, Dave Pawson wrote: http://richhickey.github.com/clojure-contrib/command-line-api.html Where might I find information on the 'cmdspec' mentioned please? If you click on the source link there is a nice

Re: numerator fn

2010-06-07 Thread Dave Pawson
On 7 June 2010 07:58, Steve Purcell st...@sanityinc.com wrote: On 7 Jun 2010, at 04:28, Dave Pawson wrote: On 6 June 2010 13:35, Moritz Ulrich ulrich.mor...@googlemail.com wrote: Note the Added in Clojure version 1.2 in the documentation of numerator ;-) Not until I'd blown up the text

numerator fn

2010-06-06 Thread Dave Pawson
/numerator TIA -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- 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 Note that posts from new members are moderated - please

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 10:37, Kevin Downey redc...@gmail.com wrote: what version of clojure are you using? --- Clojure 1.1.0 user= On Sun, Jun 6, 2010 at 2:33 AM, Dave Pawson dave.paw...@gmail.com wrote: user= (def pie 22/7) #'user/pie user

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 10:48, Kevin Downey redc...@gmail.com wrote: http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs. http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a Have no meaning to me. sorry. -- Dave Pawson XSLT XSL

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 11:00, Kevin Downey redc...@gmail.com wrote: numerator is added after 1.1.0 was released Thanks Kevin. documentation ahead of software! Nice change.. if confusing! regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message

Re: numerator fn

2010-06-06 Thread Dave Pawson
On 6 June 2010 13:35, Moritz Ulrich ulrich.mor...@googlemail.com wrote: On Sunday, June 6, 2010, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 11:00, Kevin Downey redc...@gmail.com wrote: numerator is added after 1.1.0 was released Thanks Kevin. documentation ahead of software

Re: repl, Linux, up-arrow to repeat

2010-06-05 Thread Dave Pawson
On 5 June 2010 12:23, Ramakrishnan Muthukrishnan vu3...@gmail.com wrote: On Sat, Jun 5, 2010 at 4:48 PM, Dave Pawson dave.paw...@gmail.com wrote: On many interactive shells I use up-arrow to repeat the last command. Is that possible with the clojure repl, Linux? You can use rlwrap or jline

Re: do clojure and la(tex) have something in common ?

2010-05-29 Thread Dave Pawson
On 29 May 2010 15:44, Perry Trolard trol...@gmail.com wrote: On May 28, 10:35 pm, Dave Pawson dave.paw...@gmail.com wrote: Which Saxon have you wrapped please? saxon655 or Saxon9he? Currently I'm wrapping the last Saxon 9B before the switch to the three-way split. I plan to stick

Re: Newbie (with no Java experience) - how best to learn?

2010-05-28 Thread Dave Pawson
On 28 May 2010 08:30, Alex Ott alex...@gmail.com wrote: Re all Dave Pawson  at Thu, 27 May 2010 20:08:53 +0100 wrote:  DP Is there a wiki where all these info sources could be collected please?  DP Sounds really quite useful to the newbie. Just FYI - I have special page (http://alexott.net

Re: do clojure and la(tex) have something in common ?

2010-05-28 Thread Dave Pawson
in my wrapper. (I say somewhat because Saxon stays one result element ahead of realization.) Thanks Perry. Which Saxon have you wrapped please? saxon655 or Saxon9he? regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message because you

Re: promoting contrib.string to clojure, feedback requested

2010-05-27 Thread Dave Pawson
documentation? +1 for modifiers at the end Let's not forget those of us who search for functions using tab-completion in the repl. And those who search forlornly in http://bit.ly/bPRHP1 trimX makes sense on those grounds, given the rate of expansion of clojure. regards -- Dave Pawson XSLT XSL-FO FAQ

Re: var function not documented at clojure.core-api.html

2010-05-27 Thread Dave Pawson
. Another list to search. 510+17. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- 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 Note that posts from new

Re: var function not documented at clojure.core-api.html

2010-05-27 Thread Dave Pawson
On 27 May 2010 16:43, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Thu, May 27, 2010 at 03:44:46PM +0100, Dave Pawson wrote: Thanks. Another list to search. 510+17. No need to search. From a Repl session: user= (doc var) - var Special Form  Please see http

Re: Newbie (with no Java experience) - how best to learn?

2010-05-27 Thread Dave Pawson
- please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
a good programmer, who keeps the documentation up to date, then extracts and tests the code You have a system that is long lived and contains the history for those who want it, the user manual etc etc. HTH -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
/ The example language happens not to be clojure. It could be with no change in syntax. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: do clojure and la(tex) have something in common ?

2010-05-25 Thread Dave Pawson
and can be extracted using xslt, just as can the the documentation for that code. Since it's xml, two characters require escaping. Then only if you don't want to annotate the code inline. regards -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk -- You received this message

Re: Does emacs suppress output from thread ?

2010-05-18 Thread Dave Fayram
...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- -- Dave Fayram dfay...@gmail.com -- 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 Note

Re: Actors not good for concurrency model

2010-05-18 Thread Dave Fayram
://groups.google.com/group/clojure?hl=en -- -- Dave Fayram dfay...@gmail.com -- 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 Note that posts from new members are moderated - please be patient

Re: Does emacs suppress output from thread ?

2010-05-18 Thread Dave Fayram
, May 18, 2010 at 4:39 AM, Dave Fayram dfay...@gmail.com wrote: It doesn't suppress output, it just doesn't propagate it to your repl buffer. Check for that output in your *inferior-lisp* buffer; it should be faithfully reproduced there. You might want to consider using an alternative means

Re: convert this to loop/recur?

2010-05-17 Thread Dave Fayram
at http://groups.google.com/group/clojure?hl=en -- -- Dave Fayram dfay...@gmail.com -- 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 Note that posts from new members are moderated - please

Re: Actors not good for concurrency model

2010-05-17 Thread Dave Fayram
this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- -- Dave Fayram dfay...@gmail.com -- You received this message because you are subscribed to the Google Groups Clojure group. To post

clojure.contrib.shell broken with clojure commit 37d8f7a

2010-05-10 Thread Dave Jack
%) instead of byte? (untested) -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.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Translation from Common Lisp 2

2010-03-18 Thread Dave M
... (game-action weld chain bucket attic          (if ((and (have 'bucket) (alter-var-root (var *chain-welded*) (fn ^ Your if-condition is nested one form too deeply; try (if (and (have 'bucket) ...) ...) I haven't tried it, so there might be other problems. -Dave -- You

Re: Funding Clojure 2010

2009-12-16 Thread Dave
I'm not using Clojure in any real way yet, but just funded. Why? Because I respect the effort, wish I could do the same thing, and would want people to support me if they loved what I was doing and/or found it useful or joyous. Dave -- You received this message because you are subscribed

Re: Is str supposed to be able to output lazy strings?

2009-12-06 Thread Dave M
: (apply str (seq [1 2 3])) = 123 Additionally, the following works too in Cloure 1.0.0: (apply str [1 2 3]) = 123 ...though it does not follow from the API docs, which imply that the last argument to apply should be seq, and (seq? [1 2 3]) = false. -Dave -- You received this message because you

Re: Space usage of lazy seqs

2009-12-02 Thread Dave M
mean VisualVM (jvisualvm)? -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.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Java Class Factory

2009-12-02 Thread Dave M
with Dictionary being abstract, I think you need a macro to do what you want to do: (defmacro new-container [type] `(new ~(*containers* type))) -Dave Thanks, -- Miki -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Q: is there a better way to do this

2009-09-23 Thread Dave Jack
When it useful to be able to deref inside a dosync without ensuring? When you deref and alter/set the same ref, the ref is protected from modification as well. I couldn't think of an example of what I think you had in mind, something that requires a transaction but is tolerant of modification

Re: Q: is there a better way to do this

2009-09-23 Thread Dave Jack
On Sep 23, 9:23 am, Dave Jack dav...@gmail.com wrote: Maybe @ should expand to ensure rather than deref inside a transaction, instead? Should've thought about this more. How is the reader supposed to know that this code is called in a transaction? And it would leak if you deref'd inside

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Dave Rothlisberger
I can't speak for getting real work done, but out of academic / enlightening-in-its-simplicity interest, I think everyone should read Leo Brodie's Starting Forth: http://www.forth.com/starting-forth/sf1/sf1.html On Apr 10, 2:13 am, CuppoJava patrickli_2...@hotmail.com wrote: Hi everyone, I

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Dave Griffith
There is a small but particularly nasty corner of the third circle of Hell reserved for people who mandate environment variables. Don't go there. On Feb 25, 3:47 pm, Stephen C. Gilardi squee...@mac.com wrote: On Feb 25, 2009, at 1:27 PM, Mark Colburn wrote: #!/bin/sh DP=${0%/*} java

Re: Constant expression optimization

2008-12-31 Thread Dave Griffith
Note, however, that your JVM may very well know that java.lang.Math.log (0.5) is a constant, and optimize the calculation out of the JIT compiled code. This wouldn't show up in the bytecode, and is extremely difficult to actually check. Whether or not any JVM actually does this probably

Re: Constant expression optimization

2008-12-31 Thread Dave Griffith
No, but the semantics of java.lang classes are fully specified in the Java spec, and JVM implementers are allowed to rely on them. It's entirely possible that there are special case optimizations for java.lang.Math calls. --~--~-~--~~~---~--~~ You received this

Re: Constant expression optimization

2008-12-31 Thread Dave Griffith
Can't find the chapter and verse, but a bit of googling shows that GCJ does this optimization http://gcc.gnu.org/ml/gcc-patches/2003-05/msg02312.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group.

Re: How to encapsulate local state in closures

2008-12-29 Thread Dave Griffith
It looks like the mutable locals use case is covered by the with- local-vars binding form. That said, I'm not sure how useful this would be. Even in Java 5, 95% of my local vars are immutable, i.e annotated as final and never have any mutating methods called on them. Most of the rest are

Re: Listen on changes to refs

2008-12-17 Thread Dave Griffith
I'm actually trying to get a notification after a transaction successfully finished. Well that's easy. Agent sends are buffered in a transaction, and only sent upon successful commit. The coolness of this is hard to overestimate. --Dave Griffith

Re: Listen on changes to refs

2008-12-16 Thread Dave Griffith
Right now, you add listeners to agents, but not refs. IIRC, there was talk of adding listeners to refs to enable just the sort of reactive programming you describe, but I don't know the status. --~--~-~--~~~---~--~~ You received this message because you are

Re: Getting Started with Gen-Class

2008-12-15 Thread Dave Newton
--- On Mon, 12/15/08, CuppoJava wrote: And i get the message Unable to resolve symbol: compile in this context when i type (compile) at the REPL. How are you running the REPL? It's working for me whether I build with Ant or Maven, rev 1160. Dave

Re: Java interop question

2008-12-14 Thread Dave Newton
--- On Sun, 12/14/08, David wrote: work (.getName java.lang.Integer) ; Evaluation aborted. Why does the second expression fail? Would that work in Java? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Java interop question

2008-12-14 Thread Dave Newton
Sneaky, but I bet I'll get confused by the extra functionality at some point. --- On Sun, 12/14/08, Rich Hickey richhic...@gmail.com wrote: There used to be a long answer as to why: http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b Now there is a short one - it does work!

Re: iteration idioms

2008-12-13 Thread Dave Newton
--- On Sat, 12/13/08, Stephen Parker wrote: On 12 Dec 2008, at 23:10, Mark Fredrickson wrote: [...] insert 3 before every item less than or equal to 5 in a seq: (def bar [24 6 5 5 7 5 8 2]) (insert-before-if #(= 5 %) 3 bar) = (3 24 3 6 3 5 3 5 3 7 3 5 3 8 2) Er... Dave

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 unique

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
] wrote: On Thursday 11 December 2008 06:33, Dave Griffith wrote: 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 unique item in a collection, but I can't find it anymore. What

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Dave Newton
way. 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.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Dave Griffith
that a parser could theoretically have. On the downside, you can't tell until runtime whether a given function call has an acceptable arity, which pretty much any other popular language can check at edit-time. --Dave Griffith --~--~-~--~~~---~--~~ You received

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 the Google

Re: Extending Clojure's STM with external transactions

2008-12-08 Thread Dave Griffith
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 group. To post to this group, send email

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

2008-12-08 Thread Dave Griffith
to be 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 Griffith

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

2008-12-08 Thread Dave Griffith
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   public. What do you plan to do

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 group. To post

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 Groups

Re: Running clojure-contrib.jar

2008-12-06 Thread Dave Newton
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 --~--~-~--~~~---~--~~ You received this message

Extending Clojure's STM with external transactions

2008-12-03 Thread Dave Griffith
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 see how it works. --Dave Griffith

Re: DISCUSS: replace (rand)

2008-12-02 Thread Dave Newton
. 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 clojure@googlegroups.com

Re: Clojure Code Analysis Tools

2008-12-02 Thread Dave Griffith
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 received this message because you are subscribed

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

Re: Clojure for LISP programmers....

2008-11-17 Thread Dave Newton
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 group. To post to this group, send email to clojure@googlegroups.com

Re: Clojure for LISP programmers....

2008-11-16 Thread Dave Newton
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 --- On Sun, 11/16/08, Brian W [EMAIL

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

2008-11-13 Thread Dave Newton
each arg to be equal to each other, not the reality 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

Re: REPL special variables

2008-11-12 Thread Dave Newton
? 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.com To unsubscribe from this group, send email to [EMAIL PROTECTED

<    2   3   4   5   6   7   8   >