Re: Reading from repl

2011-01-08 Thread Stuart Sierra
At the plain Clojure REPL (not running through swank or lein) the standard input is where you're typing, so you can't simultaneously read data from it. Swank and lein both manipulate standard input/output in strange ways. If you want direct access to standard input/output from a Clojure program

Re: Notice: c.c.json parser and clojure.lang.Ratio

2011-01-08 Thread Stuart Sierra
Ratios aren't valid JSON. If the recipient is Clojure, you don't need JSON at all, just pr-str and read-string. -S -- 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

Reading from repl

2011-01-08 Thread Andreas Kostler
I've stumbled upon this previous post: On Jun 26 2010, 6:52 am, Conrad wrote: > Hi everyone- I am running an emacs slimereplvia "lein swank". I want > to do some simple data input/output by writing a program that runs in > therepl. However, when I try to execute "(read)" through the slimereplit

Re: Boston meetup Jan 11?

2011-01-08 Thread Mark C
Boston Clojure Group: http://www.meetup.com/Boston-Clojure-Group/ On Jan 7, 12:16 pm, Eric Kobrin wrote: > Jeff posted this in a separate thread. We'll be hosting ameetupon > the 13th: > > 1st Boston ClojureMeetup > > Date:  Thursday, January 13th, 2011 > > Location:  Akamai Technologies > 8 Camb

Concurrency performance expectations

2011-01-08 Thread John
I am hoping to determine what are reasonable expectations for performance after parallelizing an application, especially when using clojure's reference types. I'm aware of Amdahl's law (http:// en.wikipedia.org/wiki/Amdahl's_law) but I'm still getting disappointing performance scaling in the number

Oddity: PersistentTreeMap does not implement SortedMap

2011-01-08 Thread Ken Wesson
I notice that clojure.lang.PersistentTreeMap does not implement SortedMap (let alone NavigableMap), unlike java.util.TreeMap. Any particular reason why? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: How to test for literal

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 9:15 PM, Andreas Kostler wrote: > Basically, I want the clojure equivalent of a clisp atom. > In clisp, atom is true for everything that is not a cons cell. > The closest match I found is creating a macro that returns true for > everything that is not a list: > clisp: > > (

Re: Notice: c.c.json parser and clojure.lang.Ratio

2011-01-08 Thread Michael Ossareh
On Sat, Jan 8, 2011 at 13:49, Stuart Sierra wrote: > There's no solution here that will be perfect for all cases. But I've made > the decision that c.c.json will always "downgrade" Clojure types to the > nearest equivalent JSON types. It does not promise round-trip preservation > of types not spec

Re: How to test for literal

2011-01-08 Thread Andreas Kostler
Basically, I want the clojure equivalent of a clisp atom. In clisp, atom is true for everything that is not a cons cell. The closest match I found is creating a macro that returns true for everything that is not a list: clisp: (atom 1) => true (atom '(1 2 3)) => false I hope that makes things

Re: How to test for literal

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 7:25 PM, Andreas Kostler wrote: > Ken, > Thanks for your reply. Is that about what you mean? > > (defmacro literal? [form] >  (list 'if `(not (list? ~form)) true false)) Sort of, but that isn't quite going to work. It will expand to (if (clojure.core/not (clojure.core/list

Re: How to test for literal

2011-01-08 Thread Andreas Kostler
Ken, Thanks for your reply. Is that about what you mean? (defmacro literal? [form] (list 'if `(not (list? ~form)) true false)) Andreas On 09/01/2011, at 8:59 AM, Ken Wesson wrote: > On Sat, Jan 8, 2011 at 6:49 PM, Andreas Kostler > wrote: >> Hello again, >> How do I test for a literal? The

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 5:15 PM, Stuart Halloway wrote: > Scopes will not make dynamic bindings linger in lazy seqs. Agreed that is a > terrible idea. In other words scopes would have only half-solved the problem anyway? Ack. -- You received this message because you are subscribed to the Google

Re: How to test for literal

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 6:49 PM, Andreas Kostler wrote: > Hello again, > How do I test for a literal? There are predicates for symbols and > keywoards etc: > symbol?, keyword? > Is there an equivalent for literals...like literal? Not at runtime. At macroexpansion time you can use list? and that's

How to test for literal

2011-01-08 Thread Andreas Kostler
Hello again, How do I test for a literal? There are predicates for symbols and keywoards etc: symbol?, keyword? Is there an equivalent for literals...like literal? Cheers Andreas -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: how do I improve indentation of reify methods in clojure-mode

2011-01-08 Thread Stuart Sierra
This is an unfortunate problem with clojure-mode being based on older Lisp modes for Emacs. It doesn't really know how to read Clojure code, just how to parse Lispy expressions in general. Phil Hagelberg's fork of clojure-mode [1] has experimental support for better indentation in forms like re

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Stuart Halloway
> On Sat, Jan 8, 2011 at 3:11 PM, Laurent PETIT wrote: >> 2011/1/8 Ken Wesson >>> >>> On Sat, Jan 8, 2011 at 2:09 PM, Laurent PETIT >>> wrote: 2011/1/8 Ken Wesson > > On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway > wrote: >> One goal of resource scopes [1] is to help

Re: Clojure job scheduler

2011-01-08 Thread Stuart Sierra
In a long-running process, Java's ScheduledThreadPoolExecutor [1] will handle this. Since Clojure's functions implement both Java Callable and Runnable, they can be passed as arguments to the .submit and .schedule* methods. -Stuart Sierra clojure.com [1] http://download.oracle.com/javase/6/do

Re: distributeted computing newby, clojure ...

2011-01-08 Thread Stuart Sierra
Clojure, the language, provides many tools to manage *concurrency*, safe access to mutable state from multiple threads. It does not currently offer much in the way of *parallelism*, making something faster by dividing the work across multiple threads or *distributed* across multiple machines. S

Re: Clojure 1.3 contrib development environment

2011-01-08 Thread Stuart Sierra
The current model for clojure-contrib (one source repository with many sub-modules) will be phased out after 1.3.0 final. See http://dev.clojure.org/display/design/Common+Contrib+Build One of the longer-term goals of this reorganization is to create distributions that package up useful collecti

Re: Notice: c.c.json parser and clojure.lang.Ratio

2011-01-08 Thread Stuart Sierra
There's no solution here that will be perfect for all cases. But I've made the decision that c.c.json will always "downgrade" Clojure types to the nearest equivalent JSON types. It does not promise round-trip preservation of types not specified by JSON, such as sets. In this case, that means Ra

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Laurent PETIT
2011/1/8 Ken Wesson > On Sat, Jan 8, 2011 at 3:11 PM, Laurent PETIT > wrote: > > 2011/1/8 Ken Wesson > >> > >> On Sat, Jan 8, 2011 at 2:09 PM, Laurent PETIT > >> wrote: > >> > 2011/1/8 Ken Wesson > >> >> > >> >> On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway > >> >> wrote: > >> >> > One go

how do I improve indentation of reify methods in clojure-mode

2011-01-08 Thread B Smith-Mannschott
I'm using (emacs) clojure-mode 1.7.1 and I'm not happy with the how it indents method definitions, e.g. in reify: | (reify ItemListener |(itemStateChanged | [this e] | (f (selected? e The fact that Protocols method name, arg list and method body are all indented to ne

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 3:11 PM, Laurent PETIT wrote: > 2011/1/8 Ken Wesson >> >> On Sat, Jan 8, 2011 at 2:09 PM, Laurent PETIT >> wrote: >> > 2011/1/8 Ken Wesson >> >> >> >> On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway >> >> wrote: >> >> > One goal of resource scopes [1] is to help with sc

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Laurent PETIT
2011/1/8 Ken Wesson > On Sat, Jan 8, 2011 at 2:09 PM, Laurent PETIT > wrote: > > 2011/1/8 Ken Wesson > >> > >> On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway > >> wrote: > >> > One goal of resource scopes [1] is to help with scoping activities at > >> > the REPL. That said, I think this is a

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 2:09 PM, Laurent PETIT wrote: > 2011/1/8 Ken Wesson >> >> On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway >> wrote: >> > One goal of resource scopes [1] is to help with scoping activities at >> > the REPL. That said, I think this is a "ramping up" problem -- I rarely if >

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Nicolas Buduroi
On Jan 8, 12:25 pm, Brian Goslinga wrote: > I find that if your code is functional, laziness works quite well > (except for the rare expensive function + chunking problem). > > Perhaps your code isn't very functional? (your mention of binding > suggests that) That's a valid observation, most of t

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Nicolas Buduroi
Didn't knew about scope, it looks like an interesting feature. Still as you point this is pretty much a problem BKAC! On Jan 8, 12:33 pm, Stuart Halloway wrote: > One goal of resource scopes [1] is to help with scoping activities at the > REPL. That said, I think this is a "ramping up" problem -

Re: ANN: ClojureQL 1.0.0 now released

2011-01-08 Thread Tim Robinson
Thank you for making this. It's a great idea and really enjoyable to use. Tim On Jan 5, 7:14 am, LauJensen wrote: > Hey everybody, > > Just a quick heads up that ClojureQL 1.0.0 is now released. All > interfaces should be final and there are no known bugs. Works out of > the box with PostgreSQL a

Re: Clojure job scheduler

2011-01-08 Thread Trevor
Thanks, everyone for all you help. I noticed a few questions I should answer. re: email option: I really just planned on sending a gmail to indicate the job succeeded or failed. Being somewhat new to programming the straightest path, for me, would be using clojure code (I'm not a network guru, so

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Laurent PETIT
2011/1/8 Ken Wesson > On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway > wrote: > > One goal of resource scopes [1] is to help with scoping activities at the > REPL. That said, I think this is a "ramping up" problem -- I rarely if ever > hit it anymore. > > > > Stu > > > > [1] http://dev.clojure

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 12:33 PM, Stuart Halloway wrote: > One goal of resource scopes [1] is to help with scoping activities at the > REPL. That said, I think this is a "ramping up" problem -- I rarely if ever > hit it anymore. > > Stu > > [1] http://dev.clojure.org/display/design/Resource+Scope

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Stuart Halloway
One goal of resource scopes [1] is to help with scoping activities at the REPL. That said, I think this is a "ramping up" problem -- I rarely if ever hit it anymore. Stu [1] http://dev.clojure.org/display/design/Resource+Scopes > I've been doing a lot of Clojure lately and, of all thing, > col

Re: distributeted computing newby, clojure ...

2011-01-08 Thread Nurullah Akkaya
I have a simple library that mimics newLISP's net-eval command, which will allow you to evaluate expressions in parallel on remote network nodes, http://nakkaya.com/net-eval.html Regards... -- Nurullah Akkaya http://nakkaya.com On Sat, Jan 8, 2011 at 4:12 AM, Nick Zbinden wrote: > Hallo, > >

Re: REPL+Laziness: the worst combination ever!

2011-01-08 Thread Brian Goslinga
On Jan 7, 7:03 pm, Nicolas Buduroi wrote: > I've been doing a lot of Clojure lately and, of all thing, > collection's laziness coupled with a REPL is what makes me loose the > most time. I really love having laziness built-in by default and I'm a > REPL-driven development addict, but sometimes I j

Re: gen-class for methods returning own class for chained calls

2011-01-08 Thread Alyssa Kwan
N/m, this is a known issue. http://dev.clojure.org/jira/browse/CLJ-84 On Jan 8, 11:23 am, Alyssa Kwan wrote: > Hi everyone! > > I'm having trouble getting the following to compile from "lein > compile": > > (ns foo.Bar >   (:gen-class >    :methods [[chain [] foo.Bar]])) > > (defn -chain [this]

CfP: Development Languages, Practices & Techniques at Agile 2011

2011-01-08 Thread Dean Wampler
Apologies for the duplicate messages; Venkat Subramaniam and I are co-hosting at track at Agile 2011 (Salt Lake City, August) on Development Languages, Practices, and Techniques. The goal is to explore the edges of Agile practice, to find out what's working for developers, what isn't working, and t

gen-class for methods returning own class for chained calls

2011-01-08 Thread Alyssa Kwan
Hi everyone! I'm having trouble getting the following to compile from "lein compile": (ns foo.Bar (:gen-class :methods [[chain [] foo.Bar]])) (defn -chain [this] this) My project.clj has foo.Bar declared as a :namespace. Perhaps I'm not understanding the compile error. Is there a way t

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-08 Thread Tim Daly
Sweet! Thanks for the pointer. It is a challenge to reverse-engineer someone else's code. It is even more challenging to understand how it relates to the algorithm and the idea. This will help a lot. Tim Daly On 1/8/2011 6:22 AM, Robert McIntyre wrote: You may find http://blog.higher-order.ne

Re: Clojure job scheduler

2011-01-08 Thread Ken Wesson
On Sat, Jan 8, 2011 at 12:04 AM, Michael Gardner wrote: > On Jan 7, 2011, at 9:19 PM, Ken Wesson wrote: > >> On the other hand, running a job scheduler from outside Clojure >> results in cranking up a big, slow to start up, expensive JVM process >> every single time a task needs to run, each of wh

Re: Knuth's literate programming "tangle" function in Clojure

2011-01-08 Thread Robert McIntyre
You may find http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ useful for a clear explanation of PersistentVectors. Maybe even get in touch with the guy for an addition to the book? Thanks for your work on a literate clojure. sincerely, --Robert McIn

Re: distributeted computing newby, clojure ...

2011-01-08 Thread Eric Lavigne
FlightCaster and Backtype are two startups that have used Clojure for distributed computing. If I were going to do some distributed computing in Clojure, I would start by looking at the tools they use. http://www.datawrangling.com/how-flightcaster-squeezes-predictions-from-flight-data

Clojure 1.3 contrib development environment

2011-01-08 Thread Saul Hazledine
Hello, I was just using the very useful clojure.contrib.trace and had a worry about using it with clojure 1.3. At the moment I just (use ' clojure.contrib.trace). As I see it, in future I will have to update my project.clj to include clojure.contrib.trace, run lein deps and restart my developmen

Re: Clojure job scheduler

2011-01-08 Thread Jeff Rose
We use the Quartz library for job scheduling in our Clojure projects. It's nice to have this done within the JVM so that we can easily deploy to a new server without needing to configure cron (and the differences with cron across platforms...). http://www.quartz-scheduler.org/ If you want to call