Re: Could not apply function with keyword

2010-07-19 Thread Meikel Brandmeyer
Hi,

On Jul 19, 8:56 am, boyan  wrote:

> I have a question about  apply function.
> For examle,create a hash map:
>
> user=> (hash-map :a 1 :b 2)
> {:a 1, :b 2}
>
> It works fine,but if i want to use apply:
>
> user=> (apply hash-map :a 1 :b 2)
> java.lang.IllegalArgumentException: Don't know how to create ISeq from:
> java.lang.Integer (NO_SOURCE_FILE:0)
>
> Why it throw this exception?Is apply could not work with keyword? Any
> solution?

The last argument to apply has to be a sequence (or a thing you can
call seq on).

(apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Could not apply function with keyword

2010-07-19 Thread Michael Wood
On 19 July 2010 09:00, Meikel Brandmeyer  wrote:
> Hi,
>
> On Jul 19, 8:56 am, boyan  wrote:
>
>> I have a question about  apply function.
>> For examle,create a hash map:
>>
>> user=> (hash-map :a 1 :b 2)
>> {:a 1, :b 2}
>>
>> It works fine,but if i want to use apply:
>>
>> user=> (apply hash-map :a 1 :b 2)
>> java.lang.IllegalArgumentException: Don't know how to create ISeq from:
>> java.lang.Integer (NO_SOURCE_FILE:0)
>>
>> Why it throw this exception?Is apply could not work with keyword? Any
>> solution?
>
> The last argument to apply has to be a sequence (or a thing you can
> call seq on).
>
> (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)

Or, perhaps what he was trying to do:

user=> (apply hash-map [:a 1 :b 2])
{:a 1, :b 2}

-- 
Michael Wood 

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cljr and user.clj

2010-07-19 Thread Rick Moynihan
On 16 July 2010 21:23, liebke  wrote:
> Rick,
>
> I think the problem is that additional classpaths are added,
> dynamically, after the user.clj file is evaluated. It does get
> evaluated if it's in ./ or ./src, which are added at launch in the
> cljr scripts.

Ahhh, I hadn't realised that the pwd got added...  I was thinking that
the . was referring to ~/.cljr... obviously having it refer to the pwd
makes much more sense!  Good to know!

> I have added ~/.cljr to the classpath defined in the launch scripts,
> so you can place your user.clj there.
>
> Thanks for catching that, I like to use user.clj too :-)

Excellent!  I've re-installed and it works; thanks for fixing it!

On that topic, what is the suggested/recommended way for updating
cljr?  I nuked ~/.cljr, downloaded the installer again and ran it
but I was wondering it might be possible to update using lein (or a
cljr command).

Anyway thanks again, for another excellent little project!

R.

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojure.string namespace missing from API page?

2010-07-19 Thread Btsai
Thank you Tom :)

On Jul 18, 12:10 pm, Tom Faulhaber  wrote:
> The official doc for clojure and clojure-contrib have moved as well.
> They are now at:
>
> http://clojure.github.com/clojure/
>
> and
>
> http://clojure.github.com/clojure-contrib/
>
> I have not got them completely up-to-date with the 1.2 beta split, so
> for the moment just look at the master branch. I expect to have that
> fixed in the next few days.
>
> You are correct, clojure.string is not there. I'll get that added
> today. Thanks for catching it!
>
> Tom
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Aleph and Conjure

2010-07-19 Thread Victor S
Can conjure be used to build web app over aleph? Or what does it take
to build highly scalable web apps in clojure similar to node.js and
express.js?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Victor S
Hi,

Just a curiosity question, I'm not sure how far off the JVM is from
running on your GPU, but I imagine that with the hundreds and even
thousands of cores, a GPU might, theoretically show us just what
Clojure can do...

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Finding vars from macros?

2010-07-19 Thread Ryan Twitchell
Hi all,

First off, clojure is great.  I've been playing with it off and on for
a few
months now, and am really impressed.

While using debug-repl I noted a minor oddity.  This is just an
example; not
having a real problem with that package itself.

user=> (require 'clojure.contrib.debug)
nil
user=> (clojure.contrib.debug/debug-repl)
java.lang.Exception: Unable to resolve symbol: debug-repl in this
context (NO_SOURCE_FILE:58)

debug-repl is a macro, and (clojure.contrib.debug/debug-repl) expands
first to
(debug-repl nil).  The above works fine after a (use
'clojure.contrib.debug) in
place of the require.

I'm guessing the expansion happens in the user namespace, and as a
consequence
the symbol "debug-repl" in the expansion can't be found.  Working
around this
is easy enough, but I am now curious about the impact of this behavior
on macro
design.

Would it be generally safe to say that it's good design to qualify
symbols with
namespaces in macros?  That is, when you expect them to expand to a
specific
var.  Or am I missing some finer details?

As an aside, I'd also like to mention that I was originally working
with this
in code, not at the repl.  And instead of NO_SOURCE_FILE:58, it gave
me
my-file.clj:58 even though the line referred to is line 58 in the
debug.clj
file.  Very confusing!

Ryan Twitchell

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Compojure & Conjure & Aleph

2010-07-19 Thread Victor S
Hello,

I'm Coming here view PHP to RoR ro Node.js to Clojure (still
investigating) and am mostly interesting in building scalable web
applications.

I hear aleph being compared to node.js but how do the other two
frameworks compare in performance to the their counterparts, such as
express.js and sinatra and rails?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Leiningen 1.2.0 released! -- bug?

2010-07-19 Thread LordGeoffrey
I did the upgrade. seemed okay. I a resumed doing the enlive tutorial, 
and now when i :

user=> (load "tutorial/scrape1")
nil

nothing comes back.
type returns, nothing.
type (+ 1 1), and i get:
user=> 2

Odd.
From then on works as expected. Even when (load "scrape1")

--
tutorial : http://github.com/swannodette/enlive-tutorial/
source for scrape1:

(ns tutorial.scrape1
  (:require [net.cgrand.enlive-html :as html]))

(def *base-url* "http://news.ycombinator.com/";)

(defn fetch-url [url]
  (html/html-resource (java.net.URL. url)))

(defn hn-headlines []
  (map html/text (html/select (fetch-url *base-url*) [:td.title :a])))

(defn hn-points []
  (map html/text (html/select (fetch-url *base-url*) [:td.subtext 
html/first-child])))


(defn print-headlines-and-points []
  (doseq [line (map #(str %1 " (" %2 ")") (hn-headlines) (hn-points))]
(println line)))

--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Could not apply function with keyword

2010-07-19 Thread Sanel Zukan
Hi,

> (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)

...or we could be more explicit and put:

user=> (apply hash-map :a 1 :b 2 {})
{:a 1, :b 2}

Best.


On Jul 19, 9:00 am, Meikel Brandmeyer  wrote:
> Hi,
>
> On Jul 19, 8:56 am, boyan  wrote:
>
> > I have a question about  apply function.
> > For examle,create a hash map:
>
> > user=> (hash-map :a 1 :b 2)
> > {:a 1, :b 2}
>
> > It works fine,but if i want to use apply:
>
> > user=> (apply hash-map :a 1 :b 2)
> > java.lang.IllegalArgumentException: Don't know how to create ISeq from:
> > java.lang.Integer (NO_SOURCE_FILE:0)
>
> > Why it throw this exception?Is apply could not work with keyword? Any
> > solution?
>
> The last argument to apply has to be a sequence (or a thing you can
> call seq on).
>
> (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil)
>
> Sincerely
> Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Nicolas Oury
This is a moving area (GPUs and CPUs seems to be in a slow process of
converging), but most GPUs are
good at single instruction a lot of data.

(Disclaimer: I have mostly looked at nvidia gpus of ~6months ago)
Most architectures are made to execute a lot of times the same instruction
on a different block of data.
You can have if...then...else... in your GPU programs, but every processor
will execute both branchs (with a tag saying wether
or not it is *really* executing it or not)

This makes GPUs bad at computing typical JVM programs, or even to exploit
Clojure's ease of concurrency.
(Again, this might change. Intel wants to put x86 in their GPU, nvidia wants
to make CPUs...)

It is perfectly possible to use a native interface and OpenCL/Cuda/Stream to
progrm your GPU though.

A small CLojure library does that if I remember well, but  don't recall the
name.

But you will have to be explicit in how you want your program to use the
GPU

No free lunch, at least for now.

On Mon, Jul 19, 2010 at 3:30 AM, Victor S  wrote:

> Hi,
>
> Just a curiosity question, I'm not sure how far off the JVM is from
> running on your GPU, but I imagine that with the hundreds and even
> thousands of cores, a GPU might, theoretically show us just what
> Clojure can do...
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Could not apply function with keyword

2010-07-19 Thread Meikel Brandmeyer
Hi,

On Jul 19, 11:13 am, Sanel Zukan  wrote:

> ...or we could be more explicit and put:
>
> user=> (apply hash-map :a 1 :b 2 {})
> {:a 1, :b 2}

Which looks somehow self-explaining but is wrong in general. Note the
difference for a non-empty map.

user=> (apply hash-map {:a 1 :b 2})
{[:a 1] [:b 2]}
user=> (apply hash-map [:a 1 :b 2])
{:a 1, :b 2}

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
Hi,

I'm currently thinking about the next step for better user-assistance in
Eclipse/counterclockwise.

But the questions I'm facing are general - enough so that they can be posted
here.

Preliminary info:
user assistance (code completion, var documentation, etc.) is mainly
obtained from a running instance of a REPL for the project.

Currently in ccw, I "try to be smart" by reacting as such when a file is
saved by the user: I automatically reload all the project's namespaces into
the project's running REPL (if there is one).
That way, user-assistance in the IDE is as accurate as possible, and I avoid
desynchronisation (technically speaking, I currently "obtain" this feature
by AOT-compiling the project's namespaces, but that's an implementation
detail) between what is saved in the project's files, and what is loaded in
the REPL.


In the future, I intend to be even smarter :-)
  * By being more "incremental" regarding which namespaces to call "reload"
on.
  * And also by providind ways for people with "corner-case projects" to
disable the "automatic reload" feature for the whole project, or for
specific namespaces.

  * But one question(*) remains open: should I stop to use the user-created
REPL as the target of these "automatic reloads" ? Currently, if the user has
not launched any REPL, he cannot benefit from IDE assistance requiring a
running REPL.
a. So having an "IDE-dedicated live server REPL" seems like I could
relieve the user from explicitly launching a REPL (it's weird and
counter-intuitive for a user to have to somehow "manually" trigger the IDE
user assistance !).
b. But if I do so, then the "automatic reloads" will now happen on the
"IDE-dedicated server REPL", not on the REPL(s) the user will manually
launch. And again there will be a desynchronization between the user's REPL
loaded code and the project's saved files content ...


Users of Counterclockwise, Enclojure, La Clojure, please speak ! What
behaviour do you expect from your IDE in this area ? (please do not answer
in general terms, but try to the same precision-level of this email, or even
more precise).

Users of Emacs / swank, vimClojure (etc.), please speak ! Share with us your
workflows, why you think the goal I'm trying to achieve is good or not, so
that we could think of better workflows to provide to IDE users if it seems
appropriate.


Thanks in advance,

-- 
Laurent


(*) and many more, but I'd like to start with this one :-)

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Finding vars from macros?

2010-07-19 Thread Meikel Brandmeyer
Hi,

using proper syntax-quote, ie. the backtick, normally takes care of
these problems. What you describe might happen if someone used normal
quote, ie. the apostrophe, in the macro expansion. Since there is no
clojure.contrib.debug and the debug-repl by George Jahad does the
right thing, it's hard to tell what's going on without really seeing
the code you refer to.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread ajuc
Look at Penumbra:
http://github.com/ztellman/penumbra

Greetings.

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Compojure & Conjure & Aleph

2010-07-19 Thread David Nolen
On Sun, Jul 18, 2010 at 10:38 PM, Victor S  wrote:

> Hello,
>
> I'm Coming here view PHP to RoR ro Node.js to Clojure (still
> investigating) and am mostly interesting in building scalable web
> applications.
>
> I hear aleph being compared to node.js but how do the other two
> frameworks compare in performance to the their counterparts, such as
> express.js and sinatra and rails
> ?
>

Aleph is probably too new and in flux to be making any kind of comparison
beyond micro-benchmarking. In my various tests I've also find Ring 0.2.5 by
itself running on top of Jetty to be only a little bit slower than Aleph.
Mainly what Aleph buys you at the moment is the ability to experiment with
Clojure's concurrency primitives in a web application.

In general the web development landscape with Clojure is still new territory
and there's still a need for more literature, documentation, and benchmarks
so newcomers can make an informed decision. Feel to join in ;)

David

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Timothy Baldridge
> Most architectures are made to execute a lot of times the same instruction
> on a different block of data.
> You can have if...then...else... in your GPU programs, but every processor
> will execute both branchs (with a tag saying wether
> or not it is *really* executing it or not)

This is kindof true...although it's not as bad as it sounds. IIRC the
current break-point is 16 threads will be executing the same
instruction in modern NVidia GPUs. This is called the "Warp size".
Modern GPUs can execute hundreds of threads at one time, so it is
possible to have some fairly branch heavy code. It may run slower than
non-branch code, but can often still out perform CPUs.


I would look at something like scriptjure:
http://github.com/arohner/scriptjure combined with Penumbra. This way
you could code in Clojure, have the code translated to CUDA or OpenCL
code, and then executed on the GPU and have the results returned as a
sequence.

Timothy

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Patch to make leiningen at least try to be portable...

2010-07-19 Thread Mike Meyer
Ok, I submitted a patch to the leiningen issue tracker on github to
make the lein.sh script work on systems that aren't GNU/Linux
derivatives or imitators. Since I couldn't find a place to upload the
patch I just added it to the comment, wherein github's markdown
apparently mangled it, resulting in a request to repost it as a pull
request or to "the list".

Having neither the original nor my patched version (nor the patch)
still on disk, I extracted this from the page sources and fixed the
HTMLification. Looks right to me, and has all the fixes I remember in
it.

Not having a git clone of leiningen (nor even sure how to get one),
nor the ability to read minds to know which list "the list" is, I'm
sending this to the only clojure-related list I subscribe to, in hopes
that someone who might actually be able to fix this issue reads it.

 http://github.com/downloads/technomancy/leiningen/leiningen-$VERSION-standalone.jar";
 exec $HTTP_CLIENT "$LEIN_JAR" "$LEIN_URL"
 elif [ "$1" = "upgrade" ]; then
-if [[ $VERSION == *SNAPSHOT ]]; then
+if [ $SNAPSHOT = "YES" ]; then
 echo "The upgrade task is only meant for stable releases."
 echo "See the \"Hacking\" section of the README."
 exit 1

-- 
Mike Meyer  http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Leiningen 1.2.0 released! -- bug?

2010-07-19 Thread Phil Hagelberg
On Sun, Jul 18, 2010 at 9:11 PM, LordGeoffrey
 wrote:
> I did the upgrade. seemed okay. I a resumed doing the enlive tutorial, and
> now when i :
> user=> (load "tutorial/scrape1")
> nil
>
> nothing comes back.
> type returns, nothing.
> type (+ 1 1), and i get:
> user=> 2

There are a few timing issues with the repl task. Unfortunately the
ant library we are using to launch the project's sub-JVM doesn't
support stdin, so we have to use a socket repl and basically
re-implement a telnet client. But there are still a few timing issues
to work out with when the socket gets flushed. Unfortunately the
problems aren't possible to reproduce consistently.

It's tracked here: http://github.com/technomancy/leiningen/issues#issue/71

-Phil

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Paul Richards
On 17 July 2010 23:57, Laurent PETIT  wrote:
> Hi,
>
> 2010/7/17 Paul Richards 
>>
>> The "Programming Clojure" book states: "Functions that use dynamic
>> bindings are not pure functions.."  (P2.0, page 174).
>>
>> I do not understand why this must be the case, can someone explain why?
>
> Because then the result of the function does not *only* depend on its input
> arguments.
>

Hm, I'm still a little confused..

Are you saying that if a function make use of any value which is def'd
from outside, then it is not pure functional?

In this small example:

(def forty-two 42)

(defn func [] (* forty-two forty-two))

(defn other-func [] (binding [forty-two 6] (func)))


In this example, which of these functions would be considered side
effect free, and which would be considered pure functional?  Is it the
case that both are side effect free, but only "other-func" is pure?
(This would seem to go against what the book says)

According to the book "other-func" is impure (since it uses "binding"
- aka dynamic bindings)..  Yet in this example it seems more pure than
"func".


-- 
Paul Richards
@pauldoo

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Stuart Halloway
"use" =  "rely on"

In your example, func relies on a variable which is (presumably, based on its 
use in other-func) intended for dynamic binding. Therefore, func is impure.

It is idiomatic to name such variables with earmuffs, e.g. *forty-two*.

Stu

> On 17 July 2010 23:57, Laurent PETIT  wrote:
>> Hi,
>> 
>> 2010/7/17 Paul Richards 
>>> 
>>> The "Programming Clojure" book states: "Functions that use dynamic
>>> bindings are not pure functions.."  (P2.0, page 174).
>>> 
>>> I do not understand why this must be the case, can someone explain why?
>> 
>> Because then the result of the function does not *only* depend on its input
>> arguments.
>> 
> 
> Hm, I'm still a little confused..
> 
> Are you saying that if a function make use of any value which is def'd
> from outside, then it is not pure functional?
> 
> In this small example:
> 
> (def forty-two 42)
> 
> (defn func [] (* forty-two forty-two))
> 
> (defn other-func [] (binding [forty-two 6] (func)))
> 
> 
> In this example, which of these functions would be considered side
> effect free, and which would be considered pure functional?  Is it the
> case that both are side effect free, but only "other-func" is pure?
> (This would seem to go against what the book says)
> 
> According to the book "other-func" is impure (since it uses "binding"
> - aka dynamic bindings)..  Yet in this example it seems more pure than
> "func".
> 
> 
> -- 
> Paul Richards
> @pauldoo
> 
> -- 
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Patch to make leiningen at least try to be portable...

2010-07-19 Thread Sean Devlin
This is be discussed in the lein group

http://groups.google.com/group/leiningen

On Jul 19, 10:39 am, Mike Meyer  wrote:
> Ok, I submitted a patch to the leiningen issue tracker on github to
> make the lein.sh script work on systems that aren't GNU/Linux
> derivatives or imitators. Since I couldn't find a place to upload the
> patch I just added it to the comment, wherein github's markdown
> apparently mangled it, resulting in a request to repost it as a pull
> request or to "the list".
>
> Having neither the original nor my patched version (nor the patch)
> still on disk, I extracted this from the page sources and fixed the
> HTMLification. Looks right to me, and has all the fixes I remember in
> it.
>
> Not having a git clone of leiningen (nor even sure how to get one),
> nor the ability to read minds to know which list "the list" is, I'm
> sending this to the only clojure-related list I subscribe to, in hopes
> that someone who might actually be able to fix this issue reads it.
>
>      
> --- lein        2010-07-10 17:02:11.0 -0400
> +++ lein-fixed  2010-07-10 17:11:20.0 -0400
> @@ -1,7 +1,12 @@
> -#!/bin/bash
> +#!/bin/sh
>
>  VERSION="1.1.0"
>
> +case $VERSION in
> +*SNAPSHOT) SNAPSHOT="YES" ;;
> +*) SNAPSHOT="NO" ;;
> +esac
> +
>  CLASSPATH="$(find lib/ -follow -mindepth 1 -maxdepth 1 -print0 2> /dev/null 
> | tr \\0 \:)"
>  LEIN_JAR="$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION-standalone.jar"
>  CLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.1.0/clojure-1.1.0.jar"
> @@ -71,9 +76,10 @@
>          echo "launched by either the lein-swank plugin or the lein-nailgun 
> plugin."
>          echo
>      fi
> -    $RLWRAP java -client $JAVA_OPTS -cp "src/:classes/:$CLASSPATH" 
> jline.ConsoleRunner clojure.main ${@:2}
> +    shift
> +    $RLWRAP java -client $JAVA_OPTS -cp "src/:classes/:$CLASSPATH" 
> jline.ConsoleRunner clojure.main "$@"
>  elif [ "$1" = "self-install" ]; then
> -    if [[ $VERSION == *SNAPSHOT ]]; then
> +    if [ $SNAPSHOT = "YES" ]; then
>          echo "The self-install task is only meant for stable releases."
>          echo "See the \"Hacking\" section of the README."
>          exit 1
> @@ -83,7 +89,7 @@
>      
> LEIN_URL="http://github.com/downloads/technomancy/leiningen/leiningen-$VERSION-...";
>      exec $HTTP_CLIENT "$LEIN_JAR" "$LEIN_URL"
>  elif [ "$1" = "upgrade" ]; then
> -    if [[ $VERSION == *SNAPSHOT ]]; then
> +    if [ $SNAPSHOT = "YES" ]; then
>          echo "The upgrade task is only meant for stable releases."
>          echo "See the \"Hacking\" section of the README."
>          exit 1
>
> --
> Mike Meyer           http://www.mired.org/consulting.html
> Independent Network/Unix/Perforce consultant, email for more information.
>
> O< ascii ribbon campaign - stop html mail -www.asciiribbon.org

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick
Automatically reloading namespaces into a REPL that I'm actively using  
is a very bad idea -- I expect to control what happens within REPLs I  
start, and subverting that is decidedly impolite IMO.  I can expect to  
see odd behaviour when that happens, insofar as I assume new code I've  
written hasn't yet been put into play.


(I actually didn't realize that this is how ccw's completion, etc were  
implemented, but I've not been able to verify that behaviour -- adding  
a new def to a source file and saving it does not seem to add the  
defined var to the REPL, so perhaps I'm misunderstanding things).


To answer your open question directly: if an IDE/plugin/whatever stops  
REPLs I've created (and potentially poured hours of time into to get  
data into particular states, etc), then I'll never touch that  
environment again.  Your suggestion (a) that code be automatically  
loaded in an IDE-managed and -started REPL is the right direction --  
that's an implementation detail that I rightfully don't care about one  
way or the other.


The "desynchronization" issue that you're worried about is not a  
concern as far as I'm concerned, and I suspect that'd be a typical  
reaction.  A REPL should have only one point of input in the base case  
-- the user of the REPL.  Tinkering with that is violating a variety  
of expectations.  If the user wants to have some new code she's  
written loaded into the REPL, she'll do that of her own accord -- and  
if there's a variety of changed files, then having a "reload all"  
command associated with each directory or project makes sense.


Cheers,

- Chas

On Jul 19, 2010, at 8:35 AM, Laurent PETIT wrote:


Hi,

I'm currently thinking about the next step for better user- 
assistance in Eclipse/counterclockwise.


But the questions I'm facing are general - enough so that they can  
be posted here.


Preliminary info:
user assistance (code completion, var documentation, etc.) is mainly  
obtained from a running instance of a REPL for the project.


Currently in ccw, I "try to be smart" by reacting as such when a  
file is saved by the user: I automatically reload all the project's  
namespaces into the project's running REPL (if there is one).
That way, user-assistance in the IDE is as accurate as possible, and  
I avoid desynchronisation (technically speaking, I currently  
"obtain" this feature by AOT-compiling the project's namespaces, but  
that's an implementation detail) between what is saved in the  
project's files, and what is loaded in the REPL.



In the future, I intend to be even smarter :-)
  * By being more "incremental" regarding which namespaces to call  
"reload" on.
  * And also by providind ways for people with "corner-case  
projects" to disable the "automatic reload" feature for the whole  
project, or for specific namespaces.


  * But one question(*) remains open: should I stop to use the user- 
created REPL as the target of these "automatic reloads" ? Currently,  
if the user has not launched any REPL, he cannot benefit from IDE  
assistance requiring a running REPL.
a. So having an "IDE-dedicated live server REPL" seems like I  
could relieve the user from explicitly launching a REPL (it's weird  
and counter-intuitive for a user to have to somehow "manually"  
trigger the IDE user assistance !).
b. But if I do so, then the "automatic reloads" will now happen  
on the "IDE-dedicated server REPL", not on the REPL(s) the user will  
manually launch. And again there will be a desynchronization between  
the user's REPL loaded code and the project's saved files content ...



Users of Counterclockwise, Enclojure, La Clojure, please speak !  
What behaviour do you expect from your IDE in this area ? (please do  
not answer in general terms, but try to the same precision-level of  
this email, or even more precise).


Users of Emacs / swank, vimClojure (etc.), please speak ! Share with  
us your workflows, why you think the goal I'm trying to achieve is  
good or not, so that we could think of better workflows to provide  
to IDE users if it seems appropriate.



Thanks in advance,

--
Laurent


(*) and many more, but I'd like to start with this one :-)

--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.googl

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hello Laurent,

please let me explain my philosophy before I go into details how VimClojure 
handles the clojure connection.

Vim is not an IDE like Eclipse or Netbeans. It is an editor which can be used 
with other tools to form an IDE, but on its own it is not.
The tools should only do what the user tells them to do. No more, no less.

While Vim's reality started deviate from these ideals long ago, I still feel 
that this is True Way™. And this is reflected in VimClojure's way of handling 
things.

So what does VimClojure's architecture look like:

There is of course Vim itself. It sits there. Does nothing. Waits for user 
input.
Then there is the server process running separately. It listens for connections 
from the Vim side and runs the requested commands. In particular you can 
arbitrary many repl, doc lookup, evaluation, whatever connections in parallel. 
You can forward the connection via ssh and you can embed the server in any 
application you can think of. I had both success with a web app and a swing app.
The client, which Vim shells out to, to plumb both parties together. The 
client-server connection works via a modified nailgun, but that's an 
implementation detail.
All this degrades gracefully and is not required to run a vanilla vim with 
syntax highlighting, indentation and builtin static completion. Doc lookup, 
code eval, macroexpand, etc. are just supplementary to the core tasks available 
also without the server.

One consequence of this architecture is that there is no continuous connection 
between both sides. However this is the only way Vim can handle such 
communication in a portable and stable way. The downside is that we cannot use 
interactive commands since the interaction is split over multiple connections. 
The upside is that one side going nuts doesn't affect the other too much. I can 
simply restart the server in the background with the Vim side noticing it, if 
the server goes banana. Some reloads and I can go on.

Starting the server is up to the user. Rule 1: Vim is not an IDE. There is a 
plethora of tools for handling classpaths questions. I personally use gradle; 
before that I used simple shell scripts with project relative CLASSPATH and 
that's it. ant+ivy, maven, leiningen, … all will they do a sufficient job. Vim 
is an editor. It has no business with Java classpaths. (For eclipse this is 
different: eclipse is expected to handle the classpath, no?) Besides that, you 
cannot portable start a background process from inside vim. (At least I'm not 
aware of how to do that)

I'm not sure I understand what you mean with „REPL“. I suppose it means „server 
instance“ in my settings. In that case there is only one. But it is not a repl. 
You can connect to it to obtain a repl connection (keeping book of the repl 
state etc.). But it is not in itself a repl.

As for a typical workflow of mine:

gradle runNailgun
Start vim
open clojure file
edit edit edit
lookup some docs
edit edit
save ; Note: nothing happens here. The file gets saved. That's it.
edit edit edit
Send some code via \et ; „eval toplevel“
Open a repl \sR ; „start repl“ R meaning in the namespace of the current buffer
repeat  3. - 10. as needed

You might note point 7: I do nothing on the server side on file safe. If I 
added function, it just isn't there for completion, yet. Only when I tell VC to 
evaluate the function via one of the \e* functions it is available for omni 
completion. I can live with such an inconsistent state, because I normally work 
on a very restricted set of functions. As soon as they are done, I do a 
complete sync by reloading the whole file etc if necessary. VC tries hard to 
keep line numbers as close to a synced state as possible. And as I said: if I 
mess up too much, I nuke the server and restart it without impact on my running 
vim. On the next interaction the namespaces are loaded cleanly from disk.

I agree with Chas, that strange things can happen. Imagine a 
pre-defonce-semantics-for-multimethods clojure version: you could loose your 
whole method definitions by a innocent looking file save. I prefer the „Launch 
rockets“-button to be more prominent. ;)

Puuh. I'm sorry this got so long, but I think I had to provide the necessary 
context to understand the why things are as they are with VimClojure. I hope I 
could answer your question.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Laurent PETIT
2010/7/19 Stuart Halloway 

> "use" =  "rely on"
>
> In your example, func relies on a variable which is (presumably, based on
> its use in other-func) intended for dynamic binding. Therefore, func is
> impure.
>
> It is idiomatic to name such variables with earmuffs, e.g. *forty-two*.
>
>
Sure.
But the OP is somehow true: it is "by convention" that it is declared pure.
Indeed, even func itself could have been rebound dynamically, thus making
the content of the result "theoretically unpredictable", given only the
values of its arguments.



> Stu
>
> > On 17 July 2010 23:57, Laurent PETIT  wrote:
> >> Hi,
> >>
> >> 2010/7/17 Paul Richards 
> >>>
> >>> The "Programming Clojure" book states: "Functions that use dynamic
> >>> bindings are not pure functions.."  (P2.0, page 174).
> >>>
> >>> I do not understand why this must be the case, can someone explain why?
> >>
> >> Because then the result of the function does not *only* depend on its
> input
> >> arguments.
> >>
> >
> > Hm, I'm still a little confused..
> >
> > Are you saying that if a function make use of any value which is def'd
> > from outside, then it is not pure functional?
> >
> > In this small example:
> >
> > (def forty-two 42)
> >
> > (defn func [] (* forty-two forty-two))
> >
> > (defn other-func [] (binding [forty-two 6] (func)))
> >
> >
> > In this example, which of these functions would be considered side
> > effect free, and which would be considered pure functional?  Is it the
> > case that both are side effect free, but only "other-func" is pure?
> > (This would seem to go against what the book says)
> >
> > According to the book "other-func" is impure (since it uses "binding"
> > - aka dynamic bindings)..  Yet in this example it seems more pure than
> > "func".
> >
> >
> > --
> > Paul Richards
> > @pauldoo
> >
> > --
> > 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 group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
That's interesting ! Thanks for the feedback.
Please note that it's not "impolite" in the sense that there's a policy: the
project is reloaded in the REPL when the file is saved - that's a kind of
"invitation" made by the user :-).
If you don't work from the files, but from the REPL, nothing will happen
automatically.
If you work from the files, then you simply do not save the files until
you're "happy" with the codebase. You can make several roundtrips between
the file's content and the REPL (even via keyboard shortcuts) without saving
the files. Ultimately, when you want to quit, you have to quit the REPL
anyway, and you have the option to save the files or not.

Does this answer make sense ?

There's also the problem of "I save file A", and all project namespaces are
reloaded as well. By maintaining a dependency graph of the namespaces
relationships (easily obtained dynamically via the REPL), I may be able to
only reload the expected namespaces. Some may see this as a feature -
ensuring that all functions which depend on namespace A macros are
recompiled -, I can see that some may see this as a recipe for disaster if
reloading the namespaces also reloads global-var-as-data contents. Proper
use of defonce may help there ?

Anyway, I didn't expect you reaction to be soo opinionated, and it's
refreshing to hear others thoughts.

Let's see how others react to what you wrote !

Cheers,

-- 
Laurent

2010/7/19 Chas Emerick 

> Automatically reloading namespaces into a REPL that I'm actively using is a
> very bad idea -- I expect to control what happens within REPLs I start, and
> subverting that is decidedly impolite IMO.  I can expect to see odd
> behaviour when that happens, insofar as I assume new code I've written
> hasn't yet been put into play.
>
> (I actually didn't realize that this is how ccw's completion, etc were
> implemented, but I've not been able to verify that behaviour -- adding a new
> def to a source file and saving it does not seem to add the defined var to
> the REPL, so perhaps I'm misunderstanding things).
>
> To answer your open question directly: if an IDE/plugin/whatever stops
> REPLs I've created (and potentially poured hours of time into to get data
> into particular states, etc), then I'll never touch that environment again.
>  Your suggestion (a) that code be automatically loaded in an IDE-managed and
> -started REPL is the right direction -- that's an implementation detail that
> I rightfully don't care about one way or the other.
>
> The "desynchronization" issue that you're worried about is not a concern as
> far as I'm concerned, and I suspect that'd be a typical reaction.  A REPL
> should have only one point of input in the base case -- the user of the
> REPL.  Tinkering with that is violating a variety of expectations.  If the
> user wants to have some new code she's written loaded into the REPL, she'll
> do that of her own accord -- and if there's a variety of changed files, then
> having a "reload all" command associated with each directory or project
> makes sense.
>
> Cheers,
>
> - Chas
>
> On Jul 19, 2010, at 8:35 AM, Laurent PETIT wrote:
>
> Hi,
>
> I'm currently thinking about the next step for better user-assistance in
> Eclipse/counterclockwise.
>
> But the questions I'm facing are general - enough so that they can be
> posted here.
>
> Preliminary info:
> user assistance (code completion, var documentation, etc.) is mainly
> obtained from a running instance of a REPL for the project.
>
> Currently in ccw, I "try to be smart" by reacting as such when a file is
> saved by the user: I automatically reload all the project's namespaces into
> the project's running REPL (if there is one).
> That way, user-assistance in the IDE is as accurate as possible, and I
> avoid desynchronisation (technically speaking, I currently "obtain" this
> feature by AOT-compiling the project's namespaces, but that's an
> implementation detail) between what is saved in the project's files, and
> what is loaded in the REPL.
>
>
> In the future, I intend to be even smarter :-)
>   * By being more "incremental" regarding which namespaces to call "reload"
> on.
>   * And also by providind ways for people with "corner-case projects" to
> disable the "automatic reload" feature for the whole project, or for
> specific namespaces.
>
>   * But one question(*) remains open: should I stop to use the user-created
> REPL as the target of these "automatic reloads" ? Currently, if the user has
> not launched any REPL, he cannot benefit from IDE assistance requiring a
> running REPL.
> a. So having an "IDE-dedicated live server REPL" seems like I could
> relieve the user from explicitly launching a REPL (it's weird and
> counter-intuitive for a user to have to somehow "manually" trigger the IDE
> user assistance !).
> b. But if I do so, then the "automatic reloads" will now happen on the
> "IDE-dedicated server REPL", not on the REPL(s) the user will manually
> launch. And again there will be a des

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 20:50 schrieb Laurent PETIT:

> Please note that it's not "impolite" in the sense that there's a policy: the 
> project is reloaded in the REPL when the file is saved - that's a kind of 
> "invitation" made by the user :-).
> If you don't work from the files, but from the REPL, nothing will happen 
> automatically.
> If you work from the files, then you simply do not save the files until 
> you're "happy" with the codebase. You can make several roundtrips between the 
> file's content and the REPL (even via keyboard shortcuts) without saving the 
> files. Ultimately, when you want to quit, you have to quit the REPL anyway, 
> and you have the option to save the files or not.
> 
> Does this answer make sense ?

It does make sense, but it doesn't work for me. I work a lot in the repl but 
only with files. %) If I have correctly set up file in the classpath, where I 
edit my function and which a save quite often. (Sometimes in a broken state.) 
In the repl I only define small mock functions for quick testing of the 
functions which were defined in the file and sent over via code evaluation.

If you don't want to settle on one way, I would suggest, that you make the 
behaviour configurable.

> There's also the problem of "I save file A", and all project namespaces are 
> reloaded as well. By maintaining a dependency graph of the namespaces 
> relationships (easily obtained dynamically via the REPL), I may be able to 
> only reload the expected namespaces. Some may see this as a feature - 
> ensuring that all functions which depend on namespace A macros are recompiled 
> -, I can see that some may see this as a recipe for disaster if reloading the 
> namespaces also reloads global-var-as-data contents. Proper use of defonce 
> may help there ?

This is something I would support. I think it should be easy to get a clean 
system after some changes. Then all changed macros would be recompiled and the 
multimethod wouldn't require the defonce semantics, since it's easy to 
reconstruct the methods. I could imagine to provide such a „reload dependees“ 
feature also in VimClojure. Then everyone can choose whether to use it, or not.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Barry Dahlberg
As a Clojure newbie coming from Microsoft land I was surprised by the
answers here.

Eclipse / CCW is the IDE I've used most so far and I've always wondered why
it didn't just open the REPL for me and have it always there.  Having it up
to date with my latest code files is great because I mostly use it to test
things I've just written and saved.  Reloading all the namespaces etc is
something I haven't got my head around yet, especially since my brain has a
very small amount of RAM and I can't remember what is current.

Do people work with more than one REPL?  What do you do with them?  Are
there any good articles or videos around talking about this?

Cheers
Barry

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 20:41 schrieb Laurent PETIT:

> But the OP is somehow true: it is "by convention" that it is declared pure. 
> Indeed, even func itself could have been rebound dynamically, thus making the 
> content of the result "theoretically unpredictable", given only the values of 
> its arguments.

I would say it is pure „by implementation detail.“ Given the direct link 
feature which was in place for clojure.core for a while it would be pure. 
Because then you can't rebind things anymore.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Compojure & Conjure & Aleph

2010-07-19 Thread Stefan Tilkov
On 19.07.2010, at 04:38, Victor S wrote:

> Hello,
> 
> I'm Coming here view PHP to RoR ro Node.js to Clojure (still
> investigating) and am mostly interesting in building scalable web
> applications.
> 
> I hear aleph being compared to node.js but how do the other two
> frameworks compare in performance to the their counterparts, such as
> express.js and sinatra and rails?
> 

Not a statement on performance, but I would claim that Ring matches Rack, and 
Compojure matches something somewhere between Sinatra and Rails. There's 
nothing as big and inclusive as Rails yet in the Clojure space (which may or 
not be a good thing, as you can compose libraries to your liking).

Stefan
--
Stefan Tilkov, http://www.innoq.com/blog/st/




-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Paul Moore
On 19 July 2010 19:41, Laurent PETIT  wrote:
> 2010/7/19 Stuart Halloway 
>>
>> "use" =  "rely on"
>>
>> In your example, func relies on a variable which is (presumably, based on
>> its use in other-func) intended for dynamic binding. Therefore, func is
>> impure.
>>
>> It is idiomatic to name such variables with earmuffs, e.g. *forty-two*.
>>
>
> Sure.
> But the OP is somehow true: it is "by convention" that it is declared pure.
> Indeed, even func itself could have been rebound dynamically, thus making
> the content of the result "theoretically unpredictable", given only the
> values of its arguments.

I think the point being made here is that, because other-func uses
dynamic binding (and hence is "impure") you have to be more careful
about how you code it. For example, in the absence of "impure" code,
it is perfectly acceptable to name intermediate values freely - so

(defn demo1 []
  (+ (some-fn) 17))

and

(defn demo2 []
  (let [res (some-fn)]
(+ res 17)))

are exactly the same. That doesn't work with the impure other-func:

(defn other-func []
  (binding [forty-two 6] (func)))

vs

(defn other-func-2 []
  (let [res (func)]
(binding [forty-two 6] res)))

Transformations like naming intermediate values only work (at least,
without analysis) in the definition of pure functions.

When coming from an imperative language like Java or C, this seems
glaringly obvious - "of course" you have to be careful when moving
code round like that. The point is that in functional languages (and
in Clojure when you avoid "impure" functions) you *don't* have to be
careful - you can do as much of that type of refactoring as you want,
without worrying.

I hope that helps clarify things.
Paul.

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Brenton
Hi Paul,

Pure functions have two properties: they cannot produce side effects
and the return value is a function (in the mathematical sense) of its
arguments and nothing else. There are two corresponding questions that
you can ask when looking at a function to determine if it is pure.

1) When I call this function with the same arguments, do I always get
the same result?
2) Is it true that the only reason you would ever call this function
is to obtain the value that is returned from it?

If the answer to both of these questions is Yes, then you are looking
at a pure function.

Consider the following code:

(defn calc [x y] (+ x y))
(defn foo [x y] (calc x y))

Both are pure. If I call (foo 1 1) I will always get 2. There are no
side effects. Same for calc.

However, any caller can do this:

(binding [calc #(* 10 %1 %2)] (foo 1 1))

Does this mean that the function foo in now impure? No. It just means
that someone is abusing Clojure and looking for trouble.

An impure version of our code would look like this:

(declare *something*)
(defn calc [x y] (+ x y))
(defn foo [x y] (calc (/ x *something*) y))

The earmuffs are the idiomatic Clojure way of indicating that
something is intended to be dynamically bound. The caller must bind
*something* to a value or this code will not work. This is what
"Programming Clojure" means when it states: "Functions that use
dynamic bindings are not pure functions..", it is not referring to
functions which use binding internally (as in your example) but to
functions which depend on values that are dynamically bound outside of
said function.

If we wanted to have a default value for something, we could write:

(def *something* 42)
(defn calc [x y] (+ x y))
(defn foo [x y] (calc (/ x *something*) y))

In this case, there is nothing objective about foo that makes it pure
or impure. If *something* where a constant then it would be a pure
function, but if it is intended to be rebound, it is not. You only
know that is it impure based on the intention that is communicated by
the developer and the idiomatic use of earmuffs.

In summary: In some cases it is obvious, in others we only know by
intention and in call cases we can abuse Clojure and make every
function impure.

Brenton

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Meikel Brandmeyer
Laurent,

Am 19.07.2010 um 21:31 schrieb Meikel Brandmeyer:

> I would say it is pure „by implementation detail.“ Given the direct link 
> feature which was in place for clojure.core for a while it would be pure. 
> Because then you can't rebind things anymore.

Please ignore me. Of course dynamic binding was part of the question… geez

Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Finding vars from macros?

2010-07-19 Thread Ryan Twitchell
Cloning from http://github.com/GeorgeJahad/debug-repl.git, I see the
same
behavior (but a different namespace).  The (overloaded, no arg)
expansion of
the debug-repl macro returns a form by using a normal quote.

The difference being between normal quote and syntax quote does mostly
answer
my question though, thanks.

Ryan

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Finding vars from macros?

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 21:47 schrieb Ryan Twitchell:

> Cloning from http://github.com/GeorgeJahad/debug-repl.git, I see the
> same
> behavior (but a different namespace).  The (overloaded, no arg)
> expansion of
> the debug-repl macro returns a form by using a normal quote.

Yes. I think this is a mistake. The version here[1] is correct. But don't ask 
me, which debug-repl repo is now the correct one...

Sincerely
Meikel

[1]: 
http://github.com/GeorgeJahad/clojure/blob/debug-repl/src/clj/clojure/debug.clj#L60

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Peter Schuller
> Users of Emacs / swank, vimClojure (etc.), please speak ! Share with us your
> workflows, why you think the goal I'm trying to achieve is good or not, so
> that we could think of better workflows to provide to IDE users if it seems
> appropriate.

To the limited extent that I've developed with Slime (and this goes
for both Common Lisp and clojure), one annoyance I have perceived is
de-normalization of the image/running repl. While having a running
live repl is great in many ways, when it comes specifically to
developing your "files on disk" code, I tend to want my testing
environment to be as normalized as possible with respect to my source
code. So for example, ideally the removal of a function from a
namespace in the code would be reflected when reloading/recompiling
that file.

I understand why this doesn't happen automatically by default
(reloading just re-sets or adds what's defined in the file), in an
ideal world that is something that I'd like an IDE to "somehow" get
around. If it is possible to do that while at the same time allowing
my nice dynamic repl to be active, so much the better.

Examples of things affected in practice:

* (deftest ...) which mutates the vars in the namespace; removal of
tests don't "stick"
* moving functions between namespaces; things can either break for
bogus reasons or *not* break for bogus reasons that you don't notice
until you run 'mvn test' (or similar) separately

I also sympathize and agree that it can be hugely problematic if an
environment stomps on your carefully prepared REPL in ways you don't
expect. I'm not sure how to best reconcile these two concerns.

Possibly easy access to a fresh re-spawn:ed REPL with command line
history retained might make a fresh normalized REPL easily accessible
in a way that doesn't involve re-typing lots of stuff (while clearly
not preserving actual state other than history)?

-- 
/ Peter Schuller

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Zach Tellman
Hi Victor,

I've written Penumbra (http://github.com/ztellman/penumbra), which is
a wrapper for OpenGL that allows for some limited general purpose
computation.  I've also written Calx (http://github.com/ztellman/calx)
which is a wrapper for OpenCL, and it's designed for general purpose
computation on the GPU.

The thing is, though, that when people say "general purpose GPU", they
don't mean "my webserver runs ten times faster now!".  GPUs use the
space usually reserved for L1-3 caches for more computing power.  Each
compute kernel has a very limited amount of memory that's fast to
access (generally as fast as registers), but otherwise you have to
reach out to main memory, which is hundreds of times slower.

So basically, if you want to write GPU targeted stuff, use Calx.  It's
a pretty nice abstraction over the OpenCL API; certainly it's better
than writing it in C.  It's also not much slower than writing it in C,
because all you're doing is enqueueing computations, writes, and
reads.  Penumbra has a Clojure DSL that can run on the GPU, but the
further away you get from graphics operations, the leakier the
abstraction gets.  The day where you can write plain Clojure and run
it on the GPU is a long way off.

Zach

On Jul 19, 6:31 am, Timothy Baldridge  wrote:
> > Most architectures are made to execute a lot of times the same instruction
> > on a different block of data.
> > You can have if...then...else... in your GPU programs, but every processor
> > will execute both branchs (with a tag saying wether
> > or not it is *really* executing it or not)
>
> This is kindof true...although it's not as bad as it sounds. IIRC the
> current break-point is 16 threads will be executing the same
> instruction in modern NVidia GPUs. This is called the "Warp size".
> Modern GPUs can execute hundreds of threads at one time, so it is
> possible to have some fairly branch heavy code. It may run slower than
> non-branch code, but can often still out perform CPUs.
>
> I would look at something like 
> scriptjure:http://github.com/arohner/scriptjurecombined with Penumbra. This 
> way
> you could code in Clojure, have the code translated to CUDA or OpenCL
> code, and then executed on the GPU and have the results returned as a
> sequence.
>
> Timothy

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 21:56 schrieb Peter Schuller:

> To the limited extent that I've developed with Slime (and this goes
> for both Common Lisp and clojure), one annoyance I have perceived is
> de-normalization of the image/running repl. While having a running
> live repl is great in many ways, when it comes specifically to
> developing your "files on disk" code, I tend to want my testing
> environment to be as normalized as possible with respect to my source
> code. So for example, ideally the removal of a function from a
> namespace in the code would be reflected when reloading/recompiling
> that file.

It seems it does that already:

Clojure 1.2.0-master-SNAPSHOT
user=> (require 'test.file2)
WARNING: prn already refers to: #'clojure.core/prn in namespace: test.file2, 
being replaced by: #'test.file2/prn
nil
; function prn is removed here from the file
user=> (require :reload 'test.file2)
nil
user=> (test.file2/prn 5)
java.lang.Exception: No such var: test.file2/prn (NO_SOURCE_FILE:4)

I haven't tested what happens to the deftest stuff, but the „moving function“ 
could be addressed.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
:reload reloads the specified namespace

There is also :reload-all, which reloads the specified namespace as well as
all namespaces import'ed, use'd, and require'd in the specified namespace.

ex:

(require '[some.ns.foo :as foo] :reload-all)



On Mon, Jul 19, 2010 at 4:09 PM, Meikel Brandmeyer  wrote:

> Hi,
>
> Am 19.07.2010 um 21:56 schrieb Peter Schuller:
>
> > To the limited extent that I've developed with Slime (and this goes
> > for both Common Lisp and clojure), one annoyance I have perceived is
> > de-normalization of the image/running repl. While having a running
> > live repl is great in many ways, when it comes specifically to
> > developing your "files on disk" code, I tend to want my testing
> > environment to be as normalized as possible with respect to my source
> > code. So for example, ideally the removal of a function from a
> > namespace in the code would be reflected when reloading/recompiling
> > that file.
>
> It seems it does that already:
>
> Clojure 1.2.0-master-SNAPSHOT
> user=> (require 'test.file2)
> WARNING: prn already refers to: #'clojure.core/prn in namespace:
> test.file2, being replaced by: #'test.file2/prn
> nil
> ; function prn is removed here from the file
> user=> (require :reload 'test.file2)
> nil
> user=> (test.file2/prn 5)
> java.lang.Exception: No such var: test.file2/prn (NO_SOURCE_FILE:4)
>
> I haven't tested what happens to the deftest stuff, but the „moving
> function“ could be addressed.
>
> Sincerely
> Meikel
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Peter Schuller
> I haven't tested what happens to the deftest stuff, but the „moving function“ 
> could be addressed.

Cool. I had not yet run into the moving function case with clojure (I
did several times with Common Lisp), so that might be a non-issue. I
was just presuming that no magic was going on.


-- 
/ Peter Schuller

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 22:20 schrieb Peter Schuller:

>> I haven't tested what happens to the deftest stuff, but the „moving 
>> function“ could be addressed.
> 
> Cool. I had not yet run into the moving function case with clojure (I
> did several times with Common Lisp), so that might be a non-issue. I
> was just presuming that no magic was going on.

It turns out you shouldn't also listen to me. I think I will stop writing 
emails for today. I got caught by the last-var-wins feature.

Clojure 1.2.0-master-SNAPSHOT
user=> (require 'foo.bar)
nil
user=> (foo.bar/baz)
5
; Remove function baz here from file
user=> (require :reload 'foo.bar)
nil
user=> (foo.bar/baz)
5

In my stupidity I chose prn as function name, which removed from the namespace 
on reload, because clojure.core/prn „overwrites“ the Var again. Maybe such a 
functionality could be also implemented for normal reload? But then what 
happens to other namespaces which refer to this Var? I admit, this is not a 
trivial question.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
You got me thinking that all the stuff I and you were talking about
concerning namespace dependency graph, etc. for only reloading the
appropriate namespaces should be possible to be run from the running REPL,
and thus provided as a regular tool to be available to all environments:
REPL, any IDE / back-end server etc.

In its "pure" form it could recompute the dependency graph of the namespaces
every time "on-the-fly".

With this function, even from the REPL could you be sure that you have all
the functions depending on the macros of some modified namespace up-to-date.
It is even possible to solve the "functions should be removed if no more in
the namespace" issue, by adding temporary watchers to the namespace vars,
and then removing all the vars whose watchers were not triggered and are not
defonce vars (this defonce issue being the last problem I currently see: how
to know that defonce vars have been removed ? The only solution I
temporarily envision is to rebind the defonce macro during the reload with a
decorator which will store information about defonced vars).

Of course, some corner cases will still exist: direct access to vars in
other namespaces via other-ns/the-var while not explicitly requiring/using
other-ns (maybe "oddly" relying on other-ns to be loaded preliminary, by
other means).

2010/7/19 Meikel Brandmeyer 

> Hi,
>
> Am 19.07.2010 um 22:20 schrieb Peter Schuller:
>
> >> I haven't tested what happens to the deftest stuff, but the „moving
> function“ could be addressed.
> >
> > Cool. I had not yet run into the moving function case with clojure (I
> > did several times with Common Lisp), so that might be a non-issue. I
> > was just presuming that no magic was going on.
>
> It turns out you shouldn't also listen to me. I think I will stop writing
> emails for today. I got caught by the last-var-wins feature.
>
> Clojure 1.2.0-master-SNAPSHOT
> user=> (require 'foo.bar)
> nil
> user=> (foo.bar/baz)
> 5
> ; Remove function baz here from file
> user=> (require :reload 'foo.bar)
> nil
> user=> (foo.bar/baz)
> 5
>
> In my stupidity I chose prn as function name, which removed from the
> namespace on reload, because clojure.core/prn „overwrites“ the Var again.
> Maybe such a functionality could be also implemented for normal reload? But
> then what happens to other namespaces which refer to this Var? I admit, this
> is not a trivial question.
>
> Sincerely
> Meikel
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Meikel Brandmeyer 

> Hello Laurent,
>
> please let me explain my philosophy before I go into details how VimClojure
> handles the clojure connection.
>
>
>1. Vim is *not* an IDE like Eclipse or Netbeans. It is an editor which
>can be used with other tools to form an IDE, but on its own it is not.
>2. The tools should *only *do what the user tells them to do. No more,
>no less.
>
> Well, by activating the "automatic builder" feature of an IDE, I /suppose/
users typically think this is a way to tell the IDE to do automatic
rebuilds. "rebuild" here meaning AOT compilation of the strict necessary
files, and reload of what has been changed :-)


> While Vim's reality started deviate from these ideals long ago, I still
> feel that this is True Way™. And this is reflected in VimClojure's way of
> handling things.
>
> So what does VimClojure's architecture look like:
>
>
>- There is of course Vim itself. It sits there. Does nothing. Waits for
>user input.
>- Then there is the server process running separately. It listens for
>connections from the Vim side and runs the requested commands. In 
> particular
>you can arbitrary many repl, doc lookup, evaluation, whatever connections 
> in
>parallel. You can forward the connection via ssh and you can embed the
>server in any application you can think of. I had both success with a web
>app and a swing app.
>- The client, which Vim shells out to, to plumb both parties together.
>The client-server connection works via a modified nailgun, but that's an
>implementation detail.
>- All this degrades gracefully and is not required to run a vanilla vim
>with syntax highlighting, indentation and builtin static completion. Doc
>lookup, code eval, macroexpand, etc. are just supplementary to the core
>tasks available also without the server.
>
>
OK, so in spirit we're not so far from each other. I too try to minimize the
impacts of the several moving parts on the "core part" that is the editor.



>
> One consequence of this architecture is that there is *no* continuous
> connection between both sides. However this is the only way Vim can handle
> such communication in a portable and stable way. The downside is that we
> cannot use interactive commands since the interaction is split over multiple
> connections. The upside is that one side going nuts doesn't affect the other
> too much. I can simply restart the server in the background with the Vim
> side noticing it, if the server goes banana. Some reloads and I can go on.
>
> Starting the server is up to the user. Rule 1: Vim is *not* an IDE. There
> is a plethora of tools for handling classpaths questions. I personally use
> gradle; before that I used simple shell scripts with project relative
> CLASSPATH and that's it. ant+ivy, maven, leiningen, … all will they do a
> sufficient job. Vim is an editor. It has no business with Java classpaths.
> (For eclipse this is different: eclipse is *expected* to handle the
> classpath, no?) Besides that, you cannot portable start a background process
> from inside vim. (At least I'm not aware of how to do that)
>
> I'm not sure I understand what you mean with „REPL“. I suppose it means
> „server instance“ in my settings. In that case there is only one. But it is
> not a repl. You can connect to it to obtain a repl connection (keeping book
> of the repl state etc.). But it is not in itself a repl.
>

You're right. This is another point. Currently there is confusion in ccw
between a REPL and a "server instance". I intend to remove this confusion in
the future, when really implementing the possibility of having several
concurrent REPL clients on the same "server instance".


>
> As for a typical workflow of mine:
>
>
>1. gradle runNailgun
>2. Start vim
>3. open clojure file
>4. edit edit edit
>5. lookup some docs
>6. edit edit
>7. save ; Note: nothing happens here. The file gets saved. That's it.
>8. edit edit edit
>9. Send some code via \et ; „*e*val *t*oplevel“
>10. Open a repl \sR ; „*s*tart *r*epl“ R meaning in the namespace of
>the current buffer
>11. repeat  3. - 10. as needed
>
>
> You might note point 7: I do nothing on the server side on file safe. If I
> added function, it just isn't there for completion, yet. Only when I tell VC
> to evaluate the function via one of the \e* functions it is available for
> omni completion. I can live with such an inconsistent state, because I
> normally work on a very restricted set of functions. As soon as they are
> done, I do a complete sync by reloading the whole file etc if necessary. VC
> tries hard to keep line numbers as close to a synced state as possible. And
> as I said: if I mess up too much, I nuke the server and restart it without
> impact on my running vim. On the next interaction the namespaces are loaded
> cleanly from disk.
>
> I agree with Chas, that strange things can happen. Imagine a
> pre-defonce-

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
>>In my stupidity I chose prn as function name, which removed from the
namespace on >>reload, because clojure.core/prn „overwrites“ the Var again.
Maybe such a functionality >>could be also implemented for normal reload?
But then what happens to other >>namespaces which refer to this Var? I
admit, this is not a trivial question.

I don't think anything gets removed (unloaded), at least that's the way I
remember it.

Things get a little tricky with :reload-all.  For example (I don't have a
repl handy to verify, but this is how I remember it):

-
original files:
-

(ns some.ns.foo1
  "namespace foo 1"
  (:gen-class)
  (:require [some.ns.foo2 :as foo2]))

(defn func-a
  []
  (foo2/func-x "abc"))

(defn func-b
  []
  (str "123"))


(ns some.ns.foo2
  "namespace foo 2"
  (:gen-class))

(defn func-x
  [z]
  (str z))

(defn func-y
  []
  (str "456"))

-
save and go to REPL:
-

user=> (require '[some.ns.foo1 :as foo1])
user=> (require '[some.ns.foo2 :as foo2])
user=> (foo1/func-a)
"abc"
user=> (foo1/func-b)
"123"
user=> (foo2/func-x "def")
"def"
user=> (foo2/func-y)
"456"


-
change files:
-

(ns some.ns.foo1
  "namespace foo 1"
  (:gen-class)
  (:require [some.ns.foo2 :as foo2]))

(defn func-a
  []
  (foo2/func-x "abc"))


(ns some.ns.foo2
  "namespace foo 2"
  (:gen-class))

(defn func-x
  [z]
  (str z "new"))

(defn func-y
  []
  (str "456" "new"))

-
save and go back to REPL:
-

user=> (require '[some.ns.foo1 :as foo1] :reload-all)
user=> (foo1/func-a)
"abcnew"
user=> (foo1/func-b)
"123"
user=> (foo2/func-x "def")
"def"
user=> (foo2/func-y)
"456"


Notice, the removed function in foo1 still exists, because it was not
overwritten by anything.  Also, notice that we specified :reload-all for
foo1, which then reloads foo2 in the context of foo1, so when calling a
function in foo1 that calls foo2, we get the updated output.  But, when
calling foo2 functions directly, we get the old functions.

This could all be BS, so verify before taking my word for it, as stated I
don't have a repl to verify, but from memory it seems that this is the
behavior.

 - Mark


On Mon, Jul 19, 2010 at 4:41 PM, Meikel Brandmeyer  wrote:

> Hi,
>
> Am 19.07.2010 um 22:20 schrieb Peter Schuller:
>
> >> I haven't tested what happens to the deftest stuff, but the „moving
> function“ could be addressed.
> >
> > Cool. I had not yet run into the moving function case with clojure (I
> > did several times with Common Lisp), so that might be a non-issue. I
> > was just presuming that no magic was going on.
>
> It turns out you shouldn't also listen to me. I think I will stop writing
> emails for today. I got caught by the last-var-wins feature.
>
> Clojure 1.2.0-master-SNAPSHOT
> user=> (require 'foo.bar)
> nil
> user=> (foo.bar/baz)
> 5
> ; Remove function baz here from file
> user=> (require :reload 'foo.bar)
> nil
> user=> (foo.bar/baz)
> 5
>
> In my stupidity I chose prn as function name, which removed from the
> namespace on reload, because clojure.core/prn „overwrites“ the Var again.
> Maybe such a functionality could be also implemented for normal reload? But
> then what happens to other namespaces which refer to this Var? I admit, this
> is not a trivial question.
>
> Sincerely
> Meikel
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Barry Dahlberg 

> As a Clojure newbie coming from Microsoft land I was surprised by the
> answers here.
>
> Eclipse / CCW is the IDE I've used most so far and I've always wondered why
> it didn't just open the REPL for me and have it always there.


Several reasons.
  a. having a REPL automatically loaded for *each* open project could
consume a lot of memory if not done right. That's the main reason why I've
delayed it, because if I want to do it right, I have to think carefully
about the feature (could dependent projects share the same REPL instance ?
should I launch REPL for a project only the first time a file of this
project is opened ? etc.)
  b. and really a. is the main reason I can think of at the moment.


> Having it up to date with my latest code files is great because I mostly
> use it to test things I've just written and saved.  Reloading all the
> namespaces etc is something I haven't got my head around yet, especially
> since my brain has a very small amount of RAM and I can't remember what is
> current.
>
> Do people work with more than one REPL?  What do you do with them?  Are
> there any good articles or videos around talking about this?
>

Some people have reported that they launch several REPLs when the first one
is busy for a long time. What they really do, though, is that they launch a
new java environment with the project files and dependencies. When we have a
proper REPL client in ccw, we'll also have a way to launch several
concurrent REPLs for the same java environment. This will be *much* better.

>
> Cheers
> Barry
>
>  --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Peter Schuller 

> > Users of Emacs / swank, vimClojure (etc.), please speak ! Share with us
> your
> > workflows, why you think the goal I'm trying to achieve is good or not,
> so
> > that we could think of better workflows to provide to IDE users if it
> seems
> > appropriate.
>
> To the limited extent that I've developed with Slime (and this goes
> for both Common Lisp and clojure), one annoyance I have perceived is
> de-normalization of the image/running repl. While having a running
> live repl is great in many ways, when it comes specifically to
> developing your "files on disk" code, I tend to want my testing
> environment to be as normalized as possible with respect to my source
> code. So for example, ideally the removal of a function from a
> namespace in the code would be reflected when reloading/recompiling
> that file.
>
> I understand why this doesn't happen automatically by default
> (reloading just re-sets or adds what's defined in the file), in an
> ideal world that is something that I'd like an IDE to "somehow" get
> around. If it is possible to do that while at the same time allowing
> my nice dynamic repl to be active, so much the better.
>
> Examples of things affected in practice:
>
> * (deftest ...) which mutates the vars in the namespace; removal of
> tests don't "stick"
> * moving functions between namespaces; things can either break for
> bogus reasons or *not* break for bogus reasons that you don't notice
> until you run 'mvn test' (or similar) separately
>
> I also sympathize and agree that it can be hugely problematic if an
> environment stomps on your carefully prepared REPL in ways you don't
> expect. I'm not sure how to best reconcile these two concerns.
>

Yes, that's currently the most important point I'd missed so far. So I think
IDEs may not simply have to provide "white/black" behaviour concerning
dynamic feature, but also a middle path (though I guess by reading the
comments that I may still make the default behaviour be "automatically
reload", and for people wanting the maximum safety, "don't automatically
reload").

>
> Possibly easy access to a fresh re-spawn:ed REPL with command line
> history retained might make a fresh normalized REPL easily accessible
> in a way that doesn't involve re-typing lots of stuff (while clearly
> not preserving actual state other than history)?
>
> --
> / Peter Schuller
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi,

Am 19.07.2010 um 23:01 schrieb Mark Rathwell:

> Notice, the removed function in foo1 still exists, because it was not 
> overwritten by anything.

This is true if the function name is not used in anything the namespace refers 
to. Take eg. my first example with prn. There the reload overwrites the 
previous Var (ie. the Var is removed from the namespace) by the 
clojure.core/prn function. If the function was still there it would again 
overwrite the c.c/prn. This is the new last-var-wins behaviour. (which I 
generally like, but which also didn't bite me up to now besides this example)

>  Also, notice that we specified :reload-all for foo1, which then reloads foo2 
> in the context of foo1, so when calling a function in foo1 that calls foo2, 
> we get the updated output.  But, when calling foo2 functions directly, we get 
> the old functions.

No. This is wrong. There is only one some.ns.foo2. It doesn't matter where 
things are loaded from.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Laurent,

Am 19.07.2010 um 23:16 schrieb Laurent PETIT:

> Well, by activating the "automatic builder" feature of an IDE, I /suppose/ 
> users typically think this is a way to tell the IDE to do automatic rebuilds. 
> "rebuild" here meaning AOT compilation of the strict necessary files, and 
> reload of what has been changed :-)

Yes. That's fine. „Every automatic system is only as good as you can turn it 
off.“ ;)

Meikel


-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Leiningen 1.2.0 released!

2010-07-19 Thread Daniel Gagnon
Impressive list of new features!

By the way, what's left to do for the Windows support to stop being
experimental?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
>>  Also, notice that we specified :reload-all for foo1, which then reloads
foo2
>> in the context of foo1, so when calling a function in foo1 that calls
foo2,
>> we get the updated output.  But, when calling foo2 functions directly, we
get the old functions.

>No. This is wrong. There is only one some.ns.foo2. It doesn't matter where
things are loaded from.

You are correct, my mistake.  For some reason I had been operating under
this assumption.


On Mon, Jul 19, 2010 at 5:42 PM, Meikel Brandmeyer  wrote:

> Hi,
>
> Am 19.07.2010 um 23:01 schrieb Mark Rathwell:
>
> > Notice, the removed function in foo1 still exists, because it was not
> overwritten by anything.
>
> This is true if the function name is not used in anything the namespace
> refers to. Take eg. my first example with prn. There the reload overwrites
> the previous Var (ie. the Var is removed from the namespace) by the
> clojure.core/prn function. If the function was still there it would again
> overwrite the c.c/prn. This is the new last-var-wins behaviour. (which I
> generally like, but which also didn't bite me up to now besides this
> example)
>
> >  Also, notice that we specified :reload-all for foo1, which then reloads
> foo2 in the context of foo1, so when calling a function in foo1 that calls
> foo2, we get the updated output.  But, when calling foo2 functions directly,
> we get the old functions.
>
> No. This is wrong. There is only one some.ns.foo2. It doesn't matter where
> things are loaded from.
>
> Sincerely
> Meikel
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread j-g-faustus
I haven't tried CCW, but I am happy with Enclojure 6.8. (In 6.9 the
file navigator which lists the functions and vars in the file doesn't
work yet, and the navigator is perhaps 50% of the value I derive from
an IDE.)

> Am 19.07.2010 um 20:50 schrieb Laurent PETIT:
> > If you work from the files, then you simply do not save the files until 
> > you're "happy" with the codebase.

I wouldn't want to have the REPL autoload anything just because I save
a file, simply because most of the files I am editing are in a broken
state most of the time, and could stay that way for days.

Saving is something I do out of habit, because I'm going out for
lunch, because I want access to the files from another tool (backup,
version control, move to different editor or computer, whatever).
I'm thinking of "save" as "save the text in this file" rather than
"recompile and reload everything", I don't want "save" to give me
exception stacktraces and a boatload of warnings.

I once used a Java IDE that tried to recompile the project every time
I saved. I never got used to that either and found it a constant
nuisance. And it's even worse in a REPL-based language where a reload
may mess up carefully arranged global state.


I'm working similarly to Meikel, using the REPL for testing of simple
draft/mock functions and using "evaulate expression" at least as often
as "load file" - the file as a whole is broken and won't load, but I
just finished this particular function and want to test it.

I normally start out with a sketch or skeleton of the whole project,
with multiple files and lots of partial drafts, and fill out the
details over time (days or weeks).
Being able to finish and test functions one by one is one of the great
benefits of REPL-based development IMHO. I wouldn't want anything that
forces me to have every file in a loadable state all the time.

Perhaps relatedly, someone doing a usability study of how newspapers
journalists work told me that journalists (at least the ones she were
studying) didn't write articles by starting at the beginning and
finishing at the end.
Instead they wrote down snippets, sentence fragments, nifty turns of
phrase etc. in whatever order they happened to think of them, spread
the fragments out on the screen and copy/pasted the parts together to
assemble a complete article.
According to her this was a surprisingly efficient way of working,
they could finish an article in no time compared to writing it in a
more traditional start-to-finish fashion. Perhaps because the time you
need to think of what to say about X can be spent to say something
about Y.

This is somewhat similar to my preferred way of working with code, I
start out with a jumble of fragments and assemble them into complete
code over time.
The Java development style where you need the whole file (or even
worse, the whole project) to compile in order to test a single method
is a lot slower, at least for me.


> a. So having an "IDE-dedicated live server REPL" seems like I
> could relieve the user from explicitly launching a REPL (it's weird
> and counter-intuitive for a user to have to somehow "manually"
> trigger the IDE user assistance !).

I can't tell. I have the REPL running 100% of the time I am using a
Clojure IDE, so this is an issue I never encounter. But if you need a
"server REPL" for internal reasons that's fine by me, as long as it
doesn't mess with the REPL I am using.

> I may still make the default behaviour be "automatically
> reload", and for people wanting the maximum safety, "don't automatically
> reload").

I'm perfectly fine with that :)


For what I would like:

* I would be happy to have a one-click option (button or keyboard
shortcut) to reload everything that is currently loaded.

* If there is some way to undefine vars that were loaded from file
when the vars are deleted from the file and the file is reloaded, I
think I would like that too. It would save many a REPL restart to
check that newly refactored code doesn't depend on something that was
deleted. (Although it might come back to bite me if I have overridden
the file definition in the REPL and a reload removes both of them, I
expect I would eventually learn not to avoid that.)
Or perhaps a one-click manual "restart REPL and reload current files",
somewhat analogous to a Java "clean and build".


I should mention that my working habits were formed with Emacs and
Allegro Common Lisp and a decade with various Java IDEs.
We adjust to the tools we are using, at least to some extent, and
people coming to Clojure from elsewhere may have different
expectations.

If we want to move the state of Clojure IDEs forward, we may have to
break some expectations for people like me, and "but that's how we did
it in X twenty years ago" is not a sufficient reason to keep something
in and of itself.

I don't think it is possible to please everyone simultaneously, so if
you think you have a better idea and can find at least a few people
who prefer it your way, I'd say

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector

I'm using Eclipse/Counterclockwise these days but one of the first things I did 
was to figure out how to turn off the automatic build-on-save behavior. I save 
all of the time -- usually every "complete thought" which may be as little as a 
symbol or a line or a small expression -- and when I do that it's because I 
want to save (so that my changes won't be lost if my machine crashes, etc.), 
not because I want to trigger any other behaviors. The vast majority of my 
saves occur in states in which my code is incomplete and probably even 
nonsensical. The idea of not saving until everything is perfect doesn't make 
any kind of reasonable sense to me.

I would certainly hope that it remains possible to disable the automatic 
building, but I would also argue that it'd be most sensible for it to be off by 
default. When someone wants to build isn't it reasonable for them to say so? 
They could do that with another single keystroke or click -- just not the same 
one used for saving. I understand that auto-completion and documentation and 
other features depend on the most recent build, but it seems natural enough to 
me to require a rebuild if I want that information to be updated. Tying saving 
and building together is cute, but it doesn't seem right to me that it's the 
default (and I'd probably always want it off).

  -Lee


On Jul 19, 2010, at 2:50 PM, Laurent PETIT wrote:

> That's interesting ! Thanks for the feedback.
> Please note that it's not "impolite" in the sense that there's a policy: the 
> project is reloaded in the REPL when the file is saved - that's a kind of 
> "invitation" made by the user :-).
> If you don't work from the files, but from the REPL, nothing will happen 
> automatically.
> If you work from the files, then you simply do not save the files until 
> you're "happy" with the codebase. You can make several roundtrips between the 
> file's content and the REPL (even via keyboard shortcuts) without saving the 
> files. Ultimately, when you want to quit, you have to quit the REPL anyway, 
> and you have the option to save the files or not.
> 
> Does this answer make sense ?
> 
> There's also the problem of "I save file A", and all project namespaces are 
> reloaded as well. By maintaining a dependency graph of the namespaces 
> relationships (easily obtained dynamically via the REPL), I may be able to 
> only reload the expected namespaces. Some may see this as a feature - 
> ensuring that all functions which depend on namespace A macros are recompiled 
> -, I can see that some may see this as a recipe for disaster if reloading the 
> namespaces also reloads global-var-as-data contents. Proper use of defonce 
> may help there ?
> 
> Anyway, I didn't expect you reaction to be soo opinionated, and it's 
> refreshing to hear others thoughts.
> 
> Let's see how others react to what you wrote !
> 
> Cheers,

--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspec...@hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.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 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


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector

On Jul 19, 2010, at 5:22 PM, Laurent PETIT wrote:
> Some people have reported that they launch several REPLs when the first one 
> is busy for a long time. What they really do, though, is that they launch a 
> new java environment with the project files and dependencies. When we have a 
> proper REPL client in ccw, we'll also have a way to launch several concurrent 
> REPLs for the same java environment. This will be *much* better.

I'm in this camp. I often have a long process running in the REPL and want to 
try out other things at the same time. In fact, I sometimes use the REPL just 
for the sake of calling doc or find-doc, and I may want to do that halfway 
through editing an expression in a REPL... so I need another REPL for that. 
When I've wanted to do this kind of thing in my recent CCW work I've actually 
run the second REPL in a completely different way, from a clj script in a 
Terminal window. Obviously silly, but I'm still wrapping my head around the way 
things work in CCW and Clojure more generally. In the Lisp environments I've 
used it was generally easy to open a second REPL ("Listener") that acted just 
like the first (with access to the same state, etc.). I've never known or had 
to care about how this was being done internally.

 -Lee

--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspec...@hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.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 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


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector

On sketching-in-nonlinear-order, that's definitely how I write too, both code 
and prose (and email!). This has implications not only for the automatic build 
behavior we were discussing but also for the structure-based editing discussion 
from a week or two ago. If you piece together your code in a nonlinear way then 
the assumptions that structure-based editors sometimes make -- e.g. that 
whenever you type "(" you want an immediately following ")" -- will usually be 
wrong and it will be a nuisance to undo all of the system's "helpfulness." 

 -Lee

On Jul 19, 2010, at 7:11 PM, j-g-faustus wrote:
> 
> I normally start out with a sketch or skeleton of the whole project,
> with multiple files and lots of partial drafts, and fill out the
> details over time (days or weeks).
> Being able to finish and test functions one by one is one of the great
> benefits of REPL-based development IMHO. I wouldn't want anything that
> forces me to have every file in a loadable state all the time.
> 
> Perhaps relatedly, someone doing a usability study of how newspapers
> journalists work told me that journalists (at least the ones she were
> studying) didn't write articles by starting at the beginning and
> finishing at the end.
> Instead they wrote down snippets, sentence fragments, nifty turns of
> phrase etc. in whatever order they happened to think of them, spread
> the fragments out on the screen and copy/pasted the parts together to
> assemble a complete article.
> According to her this was a surprisingly efficient way of working,
> they could finish an article in no time compared to writing it in a
> more traditional start-to-finish fashion. Perhaps because the time you
> need to think of what to say about X can be spent to say something
> about Y.
> 
> This is somewhat similar to my preferred way of working with code, I
> start out with a jumble of fragments and assemble them into complete
> code over time.
> The Java development style where you need the whole file (or even
> worse, the whole project) to compile in order to test a single method
> is a lot slower, at least for me.

--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspec...@hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.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 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


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Rick Moynihan
On 19 July 2010 22:25, Laurent PETIT  wrote:
>
> 2010/7/19 Peter Schuller 
>> I also sympathize and agree that it can be hugely problematic if an
>> environment stomps on your carefully prepared REPL in ways you don't
>> expect. I'm not sure how to best reconcile these two concerns.
>
> Yes, that's currently the most important point I'd missed so far. So I think
> IDEs may not simply have to provide "white/black" behaviour concerning
> dynamic feature, but also a middle path (though I guess by reading the
> comments that I may still make the default behaviour be "automatically
> reload", and for people wanting the maximum safety, "don't automatically
> reload").

The middle way, seems like a nice option.  How about, having save as
just save, providing a save-all-and-reload-all option; and using
editor overlays to indicate un-evaluated sexpressions (that haven't
yet been sent to the repl).  In light of this, you might also be able
to show vars that exist in the current repl environment, that don't
yet exist in a file (though this is arguably more complex).

Just my 2 pence worth; but I agree with others that save should be
just save, and evaluate should be separate...  I come from the
SLIME/Emacs camp, and yes desynchronisation is sometimes a problem,
but its pretty easy to clean the environment and evaluate everything
again.

R.

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Aleph and Conjure

2010-07-19 Thread Matt
I don't have any experience with aleph, node.js, or express.js. But
assuming you can use those technologies with Ring, then you should be
able to do it with Conjure.

-Matt Courtney

On Jul 18, 8:26 pm, Victor S  wrote:
> Can conjure be used to build web app over aleph? Or what does it take
> to build highly scalable web apps in clojure similar to node.js and
> express.js?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Haskell?

2010-07-19 Thread Jared
I am curious; for the people with Haskell experience why did you
decide to use Clojure? I am asking this because Haskell and Clojure
seem to solve similar types of problems. When would you want to use
Haskell instead of Clojure and visa-versa?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Raoul Duke
On Mon, Jul 19, 2010 at 4:34 PM, Jared  wrote:
> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?

or, how about CAL?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Wilson MacGyver
1 word. JVM.

the amount of java libs to be tapped is amazing. My experience with
haskell libs has been mixed bag.

In the case of clojure, XML parsing, database connection,
kicking up a web server, natural language parsing.
"There is a Jar for that"

OTH, there are situations where we can't use JVM. This is
where we fall back to other languages/runtime. Sometimes
it's haskell, sometimes it's c/c++, sometimes it's objective-c.

On Mon, Jul 19, 2010 at 7:34 PM, Jared  wrote:
> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
Omnem crede diem tibi diluxisse supremum.

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Mark Engelberg
On Mon, Jul 19, 2010 at 4:34 PM, Jared  wrote:
> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?

I think stateful things are too hard to do in Haskell, and they are an
important part of most real-world programs.  Clojure's blend of
persistent data structures with a variety of reference-type objects
that can contain them feels much more pragmatic to me.  Also, I'm just
happier working in a dynamically-typed language.

As a side note, years ago, I wanted to write something in Haskell that
worked like Clojure's memoize (which is implemented in a half-dozen or
so lines of code in Clojure's core), and asked about it on the Haskell
mailing list.  I was pointed to a PhD dissertation on the topic of how
to write memoize in Haskell.  All I could think was, "Do I really want
to be using a language where memoize is a PhD-level topic?"

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Sean Corfield
On Mon, Jul 19, 2010 at 4:34 PM, Jared  wrote:
> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?

The JVM. So I can mix'n'match Clojure into applications that I already
build on the JVM with several other languages.
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick
Saving a file is not an invitation to do anything with the REPLs that  
I started -- it's an invitation to save the file! :-D


And no, I write a lot of code in the REPL at all.  I *load* a lot of  
code into REPLs, yes, multiple active REPLs, all the time.  Actually  
writing code in what is almost always a 2nd-class environment  
(compared to a proper editor) doesn't make any sense to me.


I see three issues here:

(a) Should ccw provide the richest possible editing experience, e.g.  
code completion, symbol navigation, etc, etc?


(b) Should the implementation of (a) automatically and silently modify  
the state of a running program initiated by the user?


(c) To what extent should running REPLs be "synchronized" with the  
codebase in question?


I'd answer an emphatic "yes", "no", and "probably not much",  
respectively.


What's odd to me about this "debate" is that issue (c) would appear to  
be a very difficult problem to solve in general for very little gain.   
Certainly at the edges, people are going to have unusual and/or long- 
running build processes that either the tool will not know how to  
invoke "properly" (i.e. as they would be in the normal course of  
development), or that will be simply too long-running to fit within an  
interactive setting.  This is to say nothing of automatically ns- 
unmap'ing deleted vars, dealing with files that are in an interim  
state (which, as many have mentioned, is the case 98% of the time),  
and other stuff that I'm surely not thinking of.


As far as I can tell, the advantage of all the work associated with  
tackling (c) isto help people avoid understanding how to work with  
REPLs (perhaps to somehow nudge the environment as a whole a hair  
closer to an image-based environment?...though that's speculation on  
my part).  Knowing how to work with REPLs, and understanding the  
relationship between them and source files and (if one uses AOT)  
classfiles is paramount to being able to use Clojure effectively IMO.   
If anyone were to get the impression that REPLs are really just an  
editor feature, are managed automatically, and are not a natural  
outcropping of Clojure being a lisp, they'd be at a disadvantage.


Totally FWIW, I think enclojure's REPL support is stellar (some are  
probably tired of hearing me say that).  I think ccw (or any other  
"integrated environment") would do well to ape it as much as possible  
(something I aim to help with, but I'm underwater at the moment).


- Chas

On Jul 19, 2010, at 2:50 PM, Laurent PETIT wrote:


That's interesting ! Thanks for the feedback.
Please note that it's not "impolite" in the sense that there's a  
policy: the project is reloaded in the REPL when the file is saved -  
that's a kind of "invitation" made by the user :-).
If you don't work from the files, but from the REPL, nothing will  
happen automatically.
If you work from the files, then you simply do not save the files  
until you're "happy" with the codebase. You can make several  
roundtrips between the file's content and the REPL (even via  
keyboard shortcuts) without saving the files. Ultimately, when you  
want to quit, you have to quit the REPL anyway, and you have the  
option to save the files or not.


Does this answer make sense ?

There's also the problem of "I save file A", and all project  
namespaces are reloaded as well. By maintaining a dependency graph  
of the namespaces relationships (easily obtained dynamically via the  
REPL), I may be able to only reload the expected namespaces. Some  
may see this as a feature - ensuring that all functions which depend  
on namespace A macros are recompiled -, I can see that some may see  
this as a recipe for disaster if reloading the namespaces also  
reloads global-var-as-data contents. Proper use of defonce may help  
there ?


Anyway, I didn't expect you reaction to be soo opinionated, and it's  
refreshing to hear others thoughts.


Let's see how others react to what you wrote !

Cheers,

--
Laurent

2010/7/19 Chas Emerick 
Automatically reloading namespaces into a REPL that I'm actively  
using is a very bad idea -- I expect to control what happens within  
REPLs I start, and subverting that is decidedly impolite IMO.  I can  
expect to see odd behaviour when that happens, insofar as I assume  
new code I've written hasn't yet been put into play.


(I actually didn't realize that this is how ccw's completion, etc  
were implemented, but I've not been able to verify that behaviour --  
adding a new def to a source file and saving it does not seem to add  
the defined var to the REPL, so perhaps I'm misunderstanding things).


To answer your open question directly: if an IDE/plugin/whatever  
stops REPLs I've created (and potentially poured hours of time into  
to get data into particular states, etc), then I'll never touch that  
environment again.  Your suggestion (a) that code be automatically  
loaded in an IDE-managed and -started REPL is the right direction --  
t

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick

Forgot one thing:


On Jul 19, 2010, at 2:50 PM, Laurent PETIT wrote:




Anyway, I didn't expect you reaction to be soo opinionated, and it's  
refreshing to hear others thoughts.


Strong opinions, weakly held, 24/7. ;-)

- Chas

--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: terracotta?

2010-07-19 Thread Chas Emerick
I can't respond to that, but presumably these issues are irrelevant if  
one were using terracotta to coordinate asynchronous independent  
computation, e.g. using agents heavily?


- Chas

On Jul 16, 2010, at 8:00 AM, peter veentjer wrote:


To repeat myself again:

The big problem with a MVCC based STM, is that there is a central
clock
that needs to be touched by independent transactions. That was one of
the
reasons for me to get not started on a distributed STM.

So you will get something up and running on your laptop, but it will
not be
of great value in a scalable system (since it limits scalability).

The best way forward imho is to remove the central clock either by:
- a vector clock (most expensive read validations instead of a simple
long comparison, more complex infrastructure since you don't want to
have ever growing timestamps in your system).
- use a different (d)stm mechanism. The cool thing about mvcc/tl2 is
that you
can go back to previous history.. with other stm mechanisms this might
be
more tricky.

Or you could try to enter the nosql domain, so dealing with various
levels
of consistency and perhaps broken failure atomicity (since some of
them only
guarantee atomicity over a single 'record' and not over records
spanning
multiple machines that are modified in a single transaction.


On Jul 16, 4:51 am, Alex Miller  wrote:

Hi,

I used to be a tech lead at Terracotta but I am now a full-time
Clojure dev.  I think it would be very interesting to explore the new
Terracotta Toolkit product to provide a distributed store for Clojure
data structures.  I think it actually comes out in GA next week
although it's been available to try for a while.  If only I had 47
hours per day I would be all over giving it a try.  If someone is
banging on it and needs help, I'm happy to connect you to the right
people or give you some pointers.

Also, Sergio is doing some awesome work with Terrastore and I'd  
highly

recommend giving it a shot if it fits your needs!

I'd really like to hear some detailed use cases for what you want out
of Clojure/Terracotta integration. Is it shared Clojure data?  
Locking?

Coordination? Caching? Remote code execution?

Alex

On Jul 15, 7:51 pm, Paul Stadig  wrote:

If anyone is interested, the latest version of my terracotta TIM  
is athttp://github.com/pjstadig/tim-clojure-1.0.0andit tries to be  
a Clojure

1.0.0 compatible TIM, which shows how its a bit out-of-date.


I am very open to collaboration, and I would love pull requests,  
or any

patches that anyone sends.



Paul
http://paul.stadig.name/(blog)
703-634-9339 (mobile)
pjstadig (twitter)
p...@stadig.name (jabber)


On Thu, Jul 15, 2010 at 12:35 PM, scx   
wrote:

Hi --



I'm noob to both Clojure and Terracotta but if you're willing to
tolerate basic questions from me, I'd be very interested in helping
out.



On Jul 12, 3:36 am, peter veentjer  wrote:

I don't think it every is going to scale.



MVCC/TL2 based STM designs rely on a central clock, so if you can
update the clock in 0.1 ms on all machines, the maximum  
throughput is
1/0.0001 = 10.000 transactions/second... no matter how many  
machines
you throw at it. Even on a single machine the central clock can  
cause
scalability problems (10/20M transactions/second and this will  
degrade

when you throw more cores at it).


This is one of the reasons I dropped the TL2 approach for  
Multiverse
and switched over to the SkySTM model (with some magic of my  
own) that

doesn't relied as much on a central mechanism.



On Jul 11, 6:50 pm, scx  wrote:



hi --


i've seen paul standig's work with clojure +terracotta.   
wondering if

anyone has continued his work?



--
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 group, send email to
clojure+unsubscr...@googlegroups.com >

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


--
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Rayne
Because monads make me cry, and I like the JVM.

On Jul 19, 6:34 pm, Jared  wrote:
> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Haskell?

2010-07-19 Thread Laurent PETIT
Because I saw Haskell as a good language to shape my mind, and then I found
Clojure a

2010/7/20 Jared 

> I am curious; for the people with Haskell experience why did you
> decide to use Clojure? I am asking this because Haskell and Clojure
> seem to solve similar types of problems. When would you want to use
> Haskell instead of Clojure and visa-versa?
>
> --
> 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 group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Haskell?

2010-07-19 Thread Laurent PETIT
2010/7/20 Laurent PETIT 

> Because I saw Haskell as a good language to shape my mind, and then I found
> Clojure a
>

... and then I found Clojure, a good language to shape my mind, have things
done, and (eventually I hope), help pay the bills.
(yeah, the short answer is "JVM" ;-) )

... wait .., that's unfair: I also find Clojure more pragmatic in certain
areas ( "there's a story for mutation")


>
> 2010/7/20 Jared 
>
> I am curious; for the people with Haskell experience why did you
>> decide to use Clojure? I am asking this because Haskell and Clojure
>> seem to solve similar types of problems. When would you want to use
>> Haskell instead of Clojure and visa-versa?
>>
>> --
>> 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 group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi,

On Jul 19, 11:09 pm, Laurent PETIT  wrote:

> You got me thinking that all the stuff I and you were talking about
> concerning namespace dependency graph, etc. for only reloading the
> appropriate namespaces should be possible to be run from the running REPL,
> and thus provided as a regular tool to be available to all environments:
> REPL, any IDE / back-end server etc.
>
> In its "pure" form it could recompute the dependency graph of the namespaces
> every time "on-the-fly".
>
> With this function, even from the REPL could you be sure that you have all
> the functions depending on the macros of some modified namespace up-to-date.
> It is even possible to solve the "functions should be removed if no more in
> the namespace" issue, by adding temporary watchers to the namespace vars,
> and then removing all the vars whose watchers were not triggered and are not
> defonce vars (this defonce issue being the last problem I currently see: how
> to know that defonce vars have been removed ? The only solution I
> temporarily envision is to rebind the defonce macro during the reload with a
> decorator which will store information about defonced vars).
>
> Of course, some corner cases will still exist: direct access to vars in
> other namespaces via other-ns/the-var while not explicitly requiring/using
> other-ns (maybe "oddly" relying on other-ns to be loaded preliminary, by
> other means).

I had hopes that this discussion
http://groups.google.com/group/clojure-dev/browse_thread/thread/b9d15561e8a3b5aa/0541da4e70ad682d
triggers something, but Stephen obviously didn't have the time to work
further on this topic.

Sincerely
Meikel

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en