Re: code golf

2008-12-17 Thread Timothy Pratley
>>`{0~@(cons 0 (take-nth 2 %2))} o_O I tried the `...@v} splice in but never imagined doing that! nice :) On the subject of splice in, am I alone in thinking (str ~...@v) is more readable than (apply str v)? Of course the former doesn't work as there is no preceding syntax- quote, but bea

Re: code golf

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 9:53 PM, Mark Engelberg wrote: > > This shaves 14 characters off of Chouser's solution: > (defn enc[s e](apply str(map(apply hash-map(take-nth 2 e))s))) Which leads me to this, though it fails for reasons that escape me: (defn enc[s e](apply str(map`{~@(take-nth 2 e)}s))

Re: code golf

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 9:53 PM, Mark Engelberg wrote: > > This shaves 14 characters off of Chouser's solution: > (defn enc[s e](apply str(map(apply hash-map(take-nth 2 e))s))) Very nice! --Chouser --~--~-~--~~~---~--~~ You received this message because you are

Re: code golf

2008-12-17 Thread Mark Engelberg
78? I count 72 after you take out all the superfluous spaces. But I agree that it says nothing significant about the language. It's a fun optimization puzzle, though, and can help understand whether the built-in library of functions is fairly rich. --~--~-~--~~~---~-

Re: code golf

2008-12-17 Thread rzeze...@gmail.com
On Dec 17, 9:53 pm, "Mark Engelberg" wrote: > This shaves 14 characters off of Chouser's solution: > (defn enc[s e](apply str(map(apply hash-map(take-nth 2 e))s))) > > rzezeski:  The problem statement  is somewhat ambiguous about what to > do if the character is missing from the mapping.  It sa

Re: code golf

2008-12-17 Thread Mark Engelberg
This shaves 14 characters off of Chouser's solution: (defn enc[s e](apply str(map(apply hash-map(take-nth 2 e))s))) rzezeski: The problem statement is somewhat ambiguous about what to do if the character is missing from the mapping. It says you can just "skip it", and this short solution does

Re: Superficial barriers to entry

2008-12-17 Thread falcon
Good post! I have been going through the same problems myself. It looks like enclojure is going to have a Netbeans 6.5 release very soon (still alpha though). I've also tried to figure out the best way to learn Clojure. After flailing about a bit, last night I printed out all the documents on c

Re: code golf

2008-12-17 Thread rzeze...@gmail.com
On Dec 17, 8:09 pm, Chouser wrote: > > I don't think I agree with the premise of the question, that golf > answers help anyone learn about other languages. > > But I can't deny that golfing is fun! > > (defn enc[s e](apply str(map(into{}(for[[o _ n](partition 3 4 e)][o n]))s))) > > I can't figu

Re: code golf

2008-12-17 Thread Stephen C. Gilardi
On Dec 17, 2008, at 8:09 PM, Chouser wrote: But I can't deny that golfing is fun! Yes it is! (defn enc[s e](apply str(map(into{}(for[[o _ n](partition 3 4 e)][o n]))s))) Nice job as usual, Chouser! Here's my stroke--now shown to have landed well into the rough: (defn enc[p t](let[a app

Re: code golf

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 6:15 PM, rzeze...@gmail.com wrote: > > Neat challenge on stackoverflow: > http://stackoverflow.com/questions/372668/code-golf-how-do-i-write-the-shortest-character-mapping-program > > I added an implementation in Clojure. One that I'm sure could be > greatly improved on.

Re: macro recursion

2008-12-17 Thread Meikel Brandmeyer
Hi Mark, Am 17.12.2008 um 23:48 schrieb Mark Volkmann: Here's an example from Stuart Halloway's book. (defmacro chain ([x form] (list '. x form)) ([x form & more] (concat (list 'chain (list '. x form)) more))) (macroexpand '(chain arm getHand getFinger getNail) ; I added the getNail part.

Re: FAQ

2008-12-17 Thread kkw
How about: What's the recommended way of getting Clojure up and running? - Download the latest snapshot with SVN - Create the Clojure.jar file with Ant - Test by starting up the REPL with "java -cp clojure.jar clojure.lang.Repl" Kev On Dec 18, 9:24 am, lpetit wrote: > Hello, > > > * Is there a

Superficial barriers to entry

2008-12-17 Thread Mibu
I recommended clojure to a dozen friends or so and after a while none of them stuck with it. I know clojure being a lisp and being at the current development stage is not for everyone, but after I probed why people gave up with it I saw the barriers to entry were largely superficial and can be eas

Re: A quasiquote for Clojure?

2008-12-17 Thread James Reeves
On Dec 17, 8:25 pm, Chouser wrote: > > ~x not in a syntax-quote yielded the form (unquote x) from the reader > > I very much like the sound of this. > > +1 I'm for this as well. I've been using keywords as a substitute, but an unquote would be more intuitive. - James --~--~-~--~~---

code golf

2008-12-17 Thread rzeze...@gmail.com
Neat challenge on stackoverflow: http://stackoverflow.com/questions/372668/code-golf-how-do-i-write-the-shortest-character-mapping-program I added an implementation in Clojure. One that I'm sure could be greatly improved on. I don't really care for the extremely obfuscated examples. Sure, it's

Re: Patch available: unifies entry points, fixes (read-line) for clojure.main/repl, provides source-only jar

2008-12-17 Thread Stephen C. Gilardi
On Dec 17, 2008, at 2:27 PM, Rich Hickey wrote: Thanks! You're welcome! Wow, that's a lot of changes. I'm not sure about this one: - Exceptions caught by the repl now cause the rest of the input line to be skipped. In what way is that the right thing to do? The idea was that the seque

macro recursion

2008-12-17 Thread Mark Volkmann
Here's an example from Stuart Halloway's book. (defmacro chain ([x form] (list '. x form)) ([x form & more] (concat (list 'chain (list '. x form)) more))) (macroexpand '(chain arm getHand getFinger getNail) ; I added the getNail part. The result is (. (. (. arm getHand) getFinger) getNail)

Re: FAQ

2008-12-17 Thread lpetit
Hello, > * Is there an IDE for Clojure? > > Answer: There are plug-ins for Eclipse clojure-dev/> and NetBeans .  There's also > Emacs. Sincerely, clojure-dev (Eclipse plugin) is still currently in infancy. I think it's not fair for the emacs ver

test-is: templates, composition, source lines!

2008-12-17 Thread Stuart Sierra
Hi folks, Just committed (on Google code) some new features to clojure.contrib.test-is: * failure reports include source file and line number when possible * Experimental: (are ...) uses clojure.contrib.template. The old each= is now "(are (= _1 _2) ...)". The old all-true is now "(are _ ...)"

Re: A quasiquote for Clojure?

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 2:53 PM, Rich Hickey wrote: > > Moving syntax-quote out of the reader might be a big deal. But I think > scenarios like this could be covered if: > > ~x not in a syntax-quote yielded the form (unquote x) from the reader > > unquote would not be defined by Clojure, so still

Re: A quasiquote for Clojure?

2008-12-17 Thread Rich Hickey
On Dec 17, 4:30 am, Meikel Brandmeyer wrote: > Hi, > > I'd like to propose/put up for discussion a change to the unquote > handling. > I basically ran into the following problem: > > I'd like to embed a DSL into my system. Using macros it should be > possible > to define a language, which looks

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Stephen C. Gilardi
On Dec 17, 2008, at 2:31 PM, Chouser wrote: On Wed, Dec 17, 2008 at 2:10 PM, Randall R Schulz wrote: Since Chouser asked on #clojure which REPL (I was using the Contrib REPL), I tried this with the stock REPL and the hang does not occur. Specifically, this line causes the JVM to shut do

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 2:10 PM, Randall R Schulz wrote: > > Since Chouser asked on #clojure which REPL (I was using the Contrib > REPL), I tried this with the stock REPL and the hang does not occur. Specifically, this line causes the JVM to shut down, even if there are agent threads in their po

Re: Patch available: unifies entry points, fixes (read-line) for clojure.main/repl, provides source-only jar

2008-12-17 Thread Rich Hickey
On Dec 16, 5:13 pm, "Stephen C. Gilardi" wrote: > The enclosed patch updates clojure.main to fix a bug and implement > changes discussed here recently. Details below. Feedback welcome. > > --Steve > > [1] clojure.main no longer calls gen-class. Instead there is now a > stub clojure.main class w

Re: Listen on changes to refs

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 7:26 AM, Rowdy Rednose wrote: > > Now before I start working on a small and handy framework to handle > stuff similar to what's called biz objects / biz models in the java > world - has by any chance someone already implemented something in > that direction? It's not a fr

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 10:57, Randall R Schulz wrote: > On Monday 15 December 2008 17:58, Randall R Schulz wrote: > > ... > > This sequence of evaluations ends in the REPL hanging: > > 1:1 user=> (.. Runtime (getRuntime) (addShutdownHook (new Thread > shutdown-agents))) nil > 1:2 user=> (de

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Rich Hickey
On Dec 17, 1:57 pm, Randall R Schulz wrote: > On Monday 15 December 2008 17:58, Randall R Schulz wrote: > > > Hi, > > > I've just started using agents and as I've done that, I've noticed > > that once you use an agent, exiting the REPL leads to a hang (with > > zero CPU usage). As Rich pointed

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Randall R Schulz
On Monday 15 December 2008 17:58, Randall R Schulz wrote: > Hi, > > I've just started using agents and as I've done that, I've noticed > that once you use an agent, exiting the REPL leads to a hang (with > zero CPU usage). As Rich pointed out to me, this is avoided by > calling (shutdown-agents).

Re: (con)current confusion

2008-12-17 Thread Raoul Duke
hi, > Got it working! Removed the overzealous use of dosync in defn do-year. Might I beg a small summary write-up of your experience and/or conclusions, recommendations? :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: reload library, blowing away old public symbols

2008-12-17 Thread Chouser
On Tue, Dec 16, 2008 at 6:21 PM, Randall R Schulz wrote: > > On Tuesday 16 December 2008 15:05, Allen Rohner wrote: >> > On Dec 16, 4:32 pm, Stuart Halloway wrote: >> > > Hi all, >> > > >> > > I sometimes need to (re)load a library, removing public symbols >> > > from previously loaded version of

Re: A quasiquote for Clojure?

2008-12-17 Thread Meikel Brandmeyer
Hi, Am 17.12.2008 um 18:21 schrieb David Nolen: You can have unresolved symbols within a macro with: ~'symbol I don't think this is really an alternative. (def x 5) (sql col1 from table1 where col2 = ~x) (sql `(~'select ~'col1 ~'from ~'table1 ~'where ~'col2 ~'= ~x)) (def *cmd* "/usr/bin/

Re: Recursive traversal of an object

2008-12-17 Thread Stuart Sierra
Hi Itay, The only decomposable object which is not a collection (as far as I know) is a String: (seq "hello") ;=> (\h \e \l \l \o) But usually that's not what you want if you're traversing a data structure. If you're interacting with Java code that returns Iterators, Enumerables, or some weird

Re: FAQ

2008-12-17 Thread Meikel Brandmeyer
Hi, Am 17.12.2008 um 17:34 schrieb Stuart Sierra: * Is there an IDE for Clojure? Answer: There are plug-ins for Eclipse and NetBeans . There's also Emacs. There is also Vim. Sincerely Meikel smime.p7s Description: S/MIME cry

Re: building Gorilla with latest clojure-contrib

2008-12-17 Thread Meikel Brandmeyer
Hi Mark, Am 17.12.2008 um 17:56 schrieb Mark Volkmann: When I build Gorilla with the latest version of clojure and clojure-contrib (from Google Code this morning) I get: java.io.FileNotFoundException: Could not locate clojure/contrib/cond__init.class or clojure/contrib/cond.clj on classpath Lo

Re: Blogging About Clojure?

2008-12-17 Thread David Nolen
Lots of possibilities, but a simple solution is that you could find a hosting service that supports easy WordPress setup and pick a minimal theme that's to your liking. David On Tue, Dec 16, 2008 at 1:05 PM, Randall R Schulz wrote: > > Hi, > > Wordy though I am, I've never done any blogging bef

Re: A quasiquote for Clojure?

2008-12-17 Thread David Nolen
You can have unresolved symbols within a macro with: ~'symbol David On Wed, Dec 17, 2008 at 3:30 AM, Meikel Brandmeyer wrote: > > Hi, > > I'd like to propose/put up for discussion a change to the unquote > handling. > I basically ran into the following problem: > > I'd like to embed a DSL into

Re: FAQ

2008-12-17 Thread J. McConnell
On Wed, Dec 17, 2008 at 12:06 PM, Rich Hickey wrote: > On Dec 17, 11:50 am, "J. McConnell" wrote: >> On Wed, Dec 17, 2008 at 10:32 AM, Rich Hickey wrote: >> >> > The Clojure FAQ will be here: >> >> >http://code.google.com/p/clojure/wiki/FAQ >> >> > Suggestions for entries welcome here. >> >> I

Re: Microsoft SQL Server and the sql contrib

2008-12-17 Thread Michael Reid
On Wed, Dec 17, 2008 at 11:00 AM, Scott Jaderholm wrote: > Thanks for the idea. Although those are definitely necessary steps, > unfortunately the problem still persists. > Can you get a similar Java program work correctly? i.e. we want to try and separate if this is specific to JDBC in Clojure

Re: FAQ

2008-12-17 Thread Rich Hickey
On Dec 17, 11:50 am, "J. McConnell" wrote: > On Wed, Dec 17, 2008 at 10:32 AM, Rich Hickey wrote: > > > The Clojure FAQ will be here: > > >http://code.google.com/p/clojure/wiki/FAQ > > > Suggestions for entries welcome here. > > I recently found out about Google Moderator > (http://moderator.a

building Gorilla with latest clojure-contrib

2008-12-17 Thread Mark Volkmann
When I build Gorilla with the latest version of clojure and clojure-contrib (from Google Code this morning) I get: java.io.FileNotFoundException: Could not locate clojure/contrib/cond__init.class or clojure/contrib/cond.clj on classpath Looking at the contents of clojure-contrib.jar I see that i

Re: FAQ

2008-12-17 Thread J. McConnell
On Wed, Dec 17, 2008 at 10:32 AM, Rich Hickey wrote: > > The Clojure FAQ will be here: > > http://code.google.com/p/clojure/wiki/FAQ > > Suggestions for entries welcome here. I recently found out about Google Moderator (http://moderator.appspot.com/), which might be a good fit here. From what I'

Re: FAQ

2008-12-17 Thread Chouser
On Wed, Dec 17, 2008 at 11:34 AM, Stuart Sierra wrote: > > Suggestions, based on common questions in the group: These are good, Stuart, thanks! Except... > * Why doesn't #([%]) work? > > Answer: Because it expands to "(fn [x] ([x]))". #() always assumes > that the thing inside it is a functio

Re: FAQ

2008-12-17 Thread Rich Hickey
On Dec 17, 11:34 am, Stuart Sierra wrote: > On Dec 17, 10:32 am, Rich Hickey wrote: > > > The Clojure FAQ will be here: > > >http://code.google.com/p/clojure/wiki/FAQ > > > Suggestions for entries welcome here. > > Suggestions, based on common questions in the group: > > * Is there a repositor

Re: FAQ

2008-12-17 Thread Stuart Sierra
On Dec 17, 10:32 am, Rich Hickey wrote: > The Clojure FAQ will be here: > > http://code.google.com/p/clojure/wiki/FAQ > > Suggestions for entries welcome here. Suggestions, based on common questions in the group: * Is there a repository for Clojure libraries? Answer: Yes, see http://code.googl

Recursive traversal of an object

2008-12-17 Thread Itay Maman
Hi, I am trying to write a function that recursively traverses a given object - applying a function to each node. Something along these lines: (defn traverse [f os] (f os) (when (coll? os) (doseq [o os] (traverse f o Although this fragment seems to be doing the job, I am not s

Re: Microsoft SQL Server and the sql contrib

2008-12-17 Thread Scott Jaderholm
Thanks for the idea. Although those are definitely necessary steps, unfortunately the problem still persists. On Tue, Dec 16, 2008 at 5:47 PM, Wayne R wrote: > > Have a look at > http://dertompson.com/2007/10/06/connection-to-mssql-server-express-2005-with-jdbc/ > > Apparently using JDBC with MS

FAQ

2008-12-17 Thread Rich Hickey
The Clojure FAQ will be here: http://code.google.com/p/clojure/wiki/FAQ Suggestions for entries welcome here. Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: building with Ant vs building with Maven

2008-12-17 Thread mledu
I also have found that building with Maven: java -cp clojure.jar clojure.main does not work although it does when compiling with ant. Since Swank-clojure was recently changed to call clojure.main and not lang.Repl my maven build wouldn't work in slime. --~--~-~--~~~-

Clojure issue tracker

2008-12-17 Thread Rich Hickey
As a benefit of moving to Google Code, Clojure has also acquired an issue tracker: http://code.google.com/p/clojure/issues/list Please note the following very carefully: This is not an invitation to have (now thousands) of people give me a todo list! Nor is it a collective wishlist. I would pr

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Stuart Halloway
Something flakey there. I clicked the star several times and nothing happened. I then checked in Firebug that the star is backed by JavaScript, and when I tried it again it worked. Odd. Randall, let me know if you need anything else upvoted. :-) Stuart > On Wednesday 17 December 2008 06:55,

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:55, Rich Hickey wrote: > ... > > Added issue: > > http://code.google.com/p/clojure/issues/detail?id=7 > > Rich I tried to vote / star this issue, but it seems to have no effect. There was one star when I entered and that remains the case even after two attempts

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Meikel Brandmeyer
Hi, On 17 Dez., 15:40, Rich Hickey wrote: > The point of that page is that it is extremely frustrating to get > reports about macros where people haven't taken the simplest steps of > generating the expansions and looking at them. I cannot identify myself with this point of view. Maybe the peop

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Rich Hickey
On Dec 17, 9:38 am, Meikel Brandmeyer wrote: > Hi, > > On 17 Dez., 15:27, Randall R Schulz wrote: > > > user=> (macroexpand '(dcmfail)) > > (new BufferedWriter (FileWriter. "stand-back")) > > > I'm guessing it works for you 'cause in the macro expansion context you > > have an import in effect

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Rich Hickey
On Dec 17, 9:26 am, "Mark Volkmann" wrote: > On Wed, Dec 17, 2008 at 8:14 AM, Meikel Brandmeyer wrote: > > > Hi, > > > On 17 Dez., 14:55, MikeM wrote: > >> ((sorted-map 'a 1 'b 2) "a") => ClassCastException > > >> I would think that sorted-maps and hash-maps should both give nil for > >> this

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Rich Hickey
On Dec 17, 9:31 am, Randall R Schulz wrote: > On Wednesday 17 December 2008 06:21, Meikel Brandmeyer wrote: > > > Hi Randall, > > > ... > > >http://clojure-log.n01se.net/macro.html > > That's a long way to go get a macro expansion! > The point of that page is that it is extremely frustrating t

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Meikel Brandmeyer
Hi, On 17 Dez., 15:27, Randall R Schulz wrote: > user=> (macroexpand '(dcmfail)) > (new BufferedWriter (FileWriter. "stand-back")) > > I'm guessing it works for you 'cause in the macro expansion context you > have an import in effect. I (use ...) the module bearing the failing > macro definition

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:26, Mark Volkmann wrote: > ... > > It appears that you can create a sorted-map where all the keys are > symbols and you can create a sorted-map where all the keys are > strings, but you can't create a sorted-map where some of the keys are > symbols and some are str

Re: Clojure's code has moved to Google Code

2008-12-17 Thread Rich Hickey
On Dec 17, 8:22 am, Rich Hickey wrote: > I've moved Clojure's source repo to Google Code: > > http://code.google.com/p/clojure/ > > as well as Clojure contrib: > > http://code.google.com/p/clojure-contrib/ > > All new checkins will occur there. > There's also a read-only list/feed that will br

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:21, Meikel Brandmeyer wrote: > Hi Randall, > > ... > > http://clojure-log.n01se.net/macro.html That's a long way to go get a macro expansion! How many people here are familiar with DrScheme? I wonder how long it will be before some industrious person creates a c

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:21, Meikel Brandmeyer wrote: > Hi Randall, > > On 17 Dez., 15:12, Randall R Schulz wrote: > > user=> (dcmfail) > > java.lang.IllegalArgumentException: Unable to resolve classname: > > BufferedWriter (repl-1:2) > > This doesn't help, I know, but it works for me. >

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Mark Volkmann
On Wed, Dec 17, 2008 at 8:14 AM, Meikel Brandmeyer wrote: > > Hi, > > On 17 Dez., 14:55, MikeM wrote: >> ((sorted-map 'a 1 'b 2) "a") => ClassCastException >> >> I would think that sorted-maps and hash-maps should both give nil for >> this, but perhaps the sorted-map implementation requires a ca

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:14, Meikel Brandmeyer wrote: > Hi, > > On 17 Dez., 14:55, MikeM wrote: > > ((sorted-map 'a 1 'b 2) "a") => ClassCastException > > > > I would think that sorted-maps and hash-maps should both give nil > > for this, but perhaps the sorted-map implementation requires

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Meikel Brandmeyer
Hi Randall, On 17 Dez., 15:12, Randall R Schulz wrote: > user=> (dcmfail) > java.lang.IllegalArgumentException: Unable to resolve classname: > BufferedWriter (repl-1:2) This doesn't help, I know, but it works for me. What does macroexpand say for your macros? See below link for the Chouserian

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Meikel Brandmeyer
Hi, On 17 Dez., 14:55, MikeM wrote: > ((sorted-map 'a 1 'b 2) "a") => ClassCastException > > I would think that sorted-maps and hash-maps should both give nil for > this, but perhaps the sorted-map implementation requires a cast? Obviously a string is not a symbol. A sorted-map only makes sense

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 05:48, Rich Hickey wrote: > On Dec 16, 3:52 pm, Randall R Schulz wrote: > > ... > > > > Which takes us back to why the dot-suffix notation was not working > > in a macro but (new ...) was. ... > > Could you please post a short code example (reducing the problem as >

Re: unexpected partition behaviour

2008-12-17 Thread Remco van 't Veer
On Wed, Dec 17, 2008 at 1:55 PM, Rich Hickey wrote: > > > > On Dec 17, 3:43 am, "Remco van 't Veer" wrote: >> Hi all, >> >> First off, thanks for clojure! I've been playing with it for a couple >> days now and love it! >> >> Doing ruby in my day job, I've found some quirks I don't really >> und

Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread MikeM
With SVN 1162, ((hash-map 'a 1 'b 2) "a") => nil ((sorted-map 'a 1 'b 2) "a") => ClassCastException I would think that sorted-maps and hash-maps should both give nil for this, but perhaps the sorted-map implementation requires a cast? --~--~-~--~~~---~--~~ You rec

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Rich Hickey
On Dec 16, 3:52 pm, Randall R Schulz wrote: > On Tuesday 16 December 2008 12:37, Rich Hickey wrote: > > > On Dec 16, 2:32 pm, Stuart Halloway wrote: > > > Hi Randall, > > > > The syntactic sugar forms are reader behavior, and occur too soon: > > > at read time, not macro expansion time. > > >

Clojure's code has moved to Google Code

2008-12-17 Thread Rich Hickey
I've moved Clojure's source repo to Google Code: http://code.google.com/p/clojure/ as well as Clojure contrib: http://code.google.com/p/clojure-contrib/ All new checkins will occur there. Rich --~--~-~--~~~---~--~~ You received this message because you are sub

Re: unexpected partition behaviour

2008-12-17 Thread Rich Hickey
On Dec 17, 3:43 am, "Remco van 't Veer" wrote: > Hi all, > > First off, thanks for clojure! I've been playing with it for a couple > days now and love it! > > Doing ruby in my day job, I've found some quirks I don't really > understand. Most of them are obviously me being new to clojure and a

Re: Circular Require Change?

2008-12-17 Thread Meikel Brandmeyer
Hi, On 17 Dez., 13:45, Rich Hickey wrote: > I hope to re-enable the detection of the 'mistake' case, just requires > some time to work out how to distinguish from the AOT case. I'm just guessing now (and maybe this doesn't help in the AOT case): currently require uses a list of namespaces it lo

Re: Circular Require Change?

2008-12-17 Thread Rich Hickey
On Dec 17, 12:43 am, Kevin Martin wrote: > I unfortunately ran into circular requires today. In previous > versions of Clojure a circular require was answered with an > exception. The text of this was something along the lines of "Cannot > load 'a' because already loading 'a'. It looks as th

unexpected partition behaviour

2008-12-17 Thread Remco van 't Veer
Hi all, First off, thanks for clojure! I've been playing with it for a couple days now and love it! Doing ruby in my day job, I've found some quirks I don't really understand. Most of them are obviously me being new to clojure and a lisp "beginner". But the following keeps bugging me: user

Circular Require Change?

2008-12-17 Thread Kevin Martin
I unfortunately ran into circular requires today. In previous versions of Clojure a circular require was answered with an exception. The text of this was something along the lines of "Cannot load 'a' because already loading 'a'. It looks as though this was changed with svn revision 1131 Sun No

Re: Listen on changes to refs

2008-12-17 Thread Rowdy Rednose
That's great news. Thanks Dave! Re-reading http://clojure.org/agents I found it mentioned somewhere at the end, almost like a small, unimportant footnote, easy to overlook... Now before I start working on a small and handy framework to handle stuff similar to what's called biz objects / biz mode

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-17 Thread Rich Hickey
On Dec 17, 2008, at 4:16 AM, Rowdy Rednose wrote: > > If Rich adds watchers for refs, would watchers be notified inside the > transaction? No, only on commit. Rich > > > I'm actually trying to get a notification after a transaction > successfully finished. Although there might be use cases f

Re: (con)current confusion

2008-12-17 Thread bOR_
Got it working! Removed the overzealous use of dosync in defn do-year. --~--~-~--~~~---~--~~ 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

Re: (con)current confusion

2008-12-17 Thread bOR_
Hmm. Starting to get it, I think. I now just made a small number of agents, and gave them one function (do-a-years-worth-of-simulations) to compute each. However, that didn't fool them either (still only uses 1 processor), while passing two agents a fibonnaci function does get both processors runn

A quasiquote for Clojure?

2008-12-17 Thread Meikel Brandmeyer
Hi, I'd like to propose/put up for discussion a change to the unquote handling. I basically ran into the following problem: I'd like to embed a DSL into my system. Using macros it should be possible to define a language, which looks like usual Clojure. Simply quote the form and pass it to a func

Re: Listen on changes to refs

2008-12-17 Thread Rowdy Rednose
If Rich adds watchers for refs, would watchers be notified inside the transaction? I'm actually trying to get a notification after a transaction successfully finished. Although there might be use cases for firing events inside the transaction. On 17 Dez., 00:37, Stuart Sierra wrote: > On Dec 16

Re: Listen on changes to refs

2008-12-17 Thread Rowdy Rednose
The structure of the wikibook page has changed and that link doesn't work any more. This will: http://en.wikibooks.org/wiki/Clojure_Programming/Concepts#Mutation_Facilities On 16 Dez., 20:58, Rowdy Rednose wrote: > Can I listen on changes done to refs? > > Let's say in a scenario like that > o