Re: Parse SQL with Clojure?

2012-05-10 Thread Zmitro Lapcjonak


On Friday, May 4, 2012 4:56:03 AM UTC+3, dirtyvagabond wrote:

 Anyone know of a Clojure library to parse SQL statements? If not, would it 
 be sane to build one using parsec?



if there is no Clojure lib, you always may use Java lib. 

i relatively successfully tried : http://jsqlparser.sourceforge.net/

other variants zql, part of Apache Derby http://db.apache.org/derby/ and 
smth - were not usefull or hard to adopt. 
see sql parser java questions on stackoverflow.com
 
-- 
zmi la

-- 
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: Clojurescript One getting started problem

2012-05-10 Thread David Powell
What browser are you using?  I don't think browser-repl works in IE at the
moment.

-- 
Dave

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Clojurescript One getting started problem

2012-05-10 Thread David Nolen
Hmm wasn't aware of that if true. Should definitely open up a ticket for
that.

On Thursday, May 10, 2012, David Powell wrote:

 What browser are you using?  I don't think browser-repl works in IE at the
 moment.

 --
 Dave

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@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: Reducers

2012-05-10 Thread nicolas.o...@gmail.com
I can describe the background to understand my last email.

From the programming point of view, I have been told since yesterday
that what I explained has already been explained better in Stream
Fusion From Lists to Streams to Nothing at All from Coutts
Leschinskiy and Stewart:

metagraph.org/papers/stream_fusion.pdf

The article is very clear if you can get used to the strange Haskell
syntax and its lack of brackets.

off-topic
From the cultural/theoritical point of view, there is quite well
understood link between data-structures and
some categorical structures.
( I try stay informal and put fancy names and link to definitions
inside brackets )

Types of finite recursive data structures (think of a list) are
defined by being the smallest solution to an
equation like List = 1 + Any x List. Here 1 means the type that
contains only nil, Any means the type of anything, x corresponds to a
pair and + to a choice. So this reads: a list is either nil or a pair
of anything and another list.
Being the smallest solution means that it contains only finite data-structures.
( http://en.wikipedia.org/wiki/Initial_algebra )

An element of such a type is characterised by how they can be reduced/folded.
( http://en.wikipedia.org/wiki/Catamorphism )
fold: forall A, List - ((1 + Any x Acc) - Acc) - Acc
Meaning that there is a one to one mapping between lists and functions of type:
forall Acc, ((1 + Any x Acc) - Acc) - Acc
This is the type of #(reduce _ l): you give it a function that takes
either no arguments and give you
an initial Accumulator or take an element of the list and and the last
Accumulator and returns a new Accumulator, and it returns the last
Accumulators.

This one to one correspondence can be seen as (reduce _ l) in one
direction and  #(_ (fn [p] (and p (apply cons p))) in the other
direction.

This definition of lists (as functions) has been used in programming
languages without data constructors.
( System F for example, http://en.wikipedia.org/wiki/System_F ).

If you look to infinite data structures, like Streams, they are the
biggest solutions of similar equations:
Stream = 1 + Any x Stream (if you accept a Stream can finish early)

They are dual (which means you invert all arrows in all definitions) to Lists.
( see Final Coalgebra in http://en.wikipedia.org/wiki/Initial_algebra )

A stream is characterised as how it is unfolded/generated.
unfold : forall B, (B - 1 + Any x B) - B - Stream
(See how the arrows are reversed with respect to fold)
And so they are in one to one correspondence with :
exists Seed, (Seed x (Seed - 1 + Any x Seed))

Which means any Stream can be defined as a Seed, of a given type Seed
that you can choose freely,
and a way to grow from the seed, a function grow that takes a Seed and
tells you:
- either that the Stream is finished
- or the first element of the Stream and the Seed for the rest of the Stream.

For example the stream of even natural numbers can be seen as the seed
0 together with a function
grow = (fn [ seed ] [ seed (+ seed 2)  ]), saying that first element
is equal to the seed and the rest of the stream
is the one defined by a seed = seed + 2 .

A very good paper showing this style of programming, and more, is :

http://eprints.eemcs.utwente.nl/7281/01/db-utwente-40501F46.pdf
/off-topic

Sorry for the long off-topic.

Best regards,

Nicolas.

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


Some reflections about programming after Clojure exposure (yay - it rhymes!)

2012-05-10 Thread James
Hello group,-

I've been getting into the Clojure / Lisp territory slowly for the
past few months. When learning a new language, I get the most out of
first comprehending the general design principles and philosophy, and
then working down to concrete code.

What's funny is that appreciating Clojure-style programming has had an
immediate effect in the way I program in Ruby. (I'm by no means a
fluent Clojure dev yet.)

Here are some thoughts about this transformation of programming style:

http://jamesabbottdd.com/programming/lisp-and-brain-neurochemistry

Feedback most welcome.

Cheers,
James

-- 
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: Some reflections about programming after Clojure exposure (yay - it rhymes!)

2012-05-10 Thread Herwig Hochleitner
Good article, thanks for sharing!

An interesting angle to ponder is how Lisp and the Human Mind share
linked lists as a basic data structure. Remember how you had memorized
the ABC?
FP taught me how you can also build other data structures out of
linked lists, skip lists anyone?
Now take a look at the steps your mind takes, when finding the
successor of a particular letter in the alphabet :)

cheers

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


ClojureScript release 0.0-1211

2012-05-10 Thread Stuart Sierra
http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1211%7Cjar

Change list: http://build.clojure.org/job/clojurescript-release/11/


-- 
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: Clojurescript One getting started problem

2012-05-10 Thread David Nolen
Good to hear.

On Thursday, May 10, 2012, David Powell wrote:



 On Thu, May 10, 2012 at 11:44 AM, David Nolen 
 dnolen.li...@gmail.comjavascript:_e({}, 'cvml', 'dnolen.li...@gmail.com');
  wrote:

 Hmm wasn't aware of that if true. Should definitely open up a ticket for
 that.


 Hmm the latest version seems to work on IE9 at least.  I had trouble with
 it in the past though.  I think the latest change to serve the page from
 the browser-repl server might have fixed things actually - I don't think IE
 liked talking cross domain between file:// and http:// before.

 --
 Dave

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 '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 javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@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

Getting started

2012-05-10 Thread Zeno
Hi,
I have downloaded and unzipped Clojure 1.4.0 but when trying java -cp
clojure-1.4.0.jar clojure.main as stated on the getting started page
I get the following.

D:\Profiles\rcarthur\My Documents\Clojure1_4\clojure-1.4.0java -cp
clojure-1.4.0.jar clojure.main

Exception in thread main java.lang.NoClassDefFoundError: clojure/
main
Caused by: java.lang.ClassNotFoundException: clojure.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
320)
Could not find the main class: clojure.main.  Program will exit.

Any clues as to what I might be doing wrong?

Regards

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


[ANN] clojure-script for NodeJS

2012-05-10 Thread Michael Bradley, Jr.
I'm looking for folks to help me kick the tires and push this project 
forward:

https://github.com/michaelsbradleyjr/node-clojurescript

http://search.npmjs.org/#/clojure-script

-- 
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: Reducers

2012-05-10 Thread Nico Balestra
I'm with you Christian,
maybe a code example would be very helpful.

Thank you guys,
Nico

2012/5/10 Christian Romney xmlb...@gmail.com

 I would be indebted to you if you could point me in the direction of the
 reading material necessary to follow this discussion. I'm afraid I'm
 currently out of my depth, but very eager to understand.

 Sincerely,
 Christian Romney

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

Clojure.java.jdbc alias

2012-05-10 Thread WoodHacker
I'm working with leiningen for the first time and trying to use
clojure.java.jdbc. All the docs I see use 'sql' before the jdbc
commands. How do I set up the sql symbol. Nothing I've tried seems to
work.

Bill

-- 
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: [ANN] clojure-script for NodeJS

2012-05-10 Thread David Nolen
Looks neat.

Any reason to call the module clojure-script instead of just clojurescript?

David

On Thu, May 10, 2012 at 2:38 AM, Michael Bradley, Jr. 
michaelsbradle...@gmail.com wrote:

 I'm looking for folks to help me kick the tires and push this project
 forward:

 https://github.com/michaelsbradleyjr/node-clojurescript

 http://search.npmjs.org/#/clojure-script

  --
 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: [ANN] clojure-script for NodeJS

2012-05-10 Thread David Nolen
Just gave it a shot, works! Would be nice if it gave some feedback that it
was compiling / recompiling.

David

On Thu, May 10, 2012 at 2:38 AM, Michael Bradley, Jr. 
michaelsbradle...@gmail.com wrote:

 I'm looking for folks to help me kick the tires and push this project
 forward:

 https://github.com/michaelsbradleyjr/node-clojurescript

 http://search.npmjs.org/#/clojure-script

  --
 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: {ANN} Clojure-control 0.3.4 released

2012-05-10 Thread dennis zhuang
*A new release 0.3.5:*

--Now you can run a task with user@host rather than a pre-defined cluster
by:

  lein control run user@host task args

*Upgrade:*

   lein plugin install control 0.3.5



2012/5/10 dennis zhuang killme2...@gmail.com

 Clojure-control:  a clojure DSL for system admin and deployment with many
 remote machines via ssh

 Usage: https://github.com/killme2008/clojure-control

 *Release 0.3.4*

 - New function (local cmd) to execute command on local machine : (local
 tar zcvf app.tar.gz app/)
 - Custer name could be a symbol rather than keyword
 - (set-options!) now could accept several options: (set-options! :user
 deploy :parallel true)
 - New function (clear-options!) to clear global options.
 - Using host and user of cluster in task by host and user :
  (deftask test [] (println (str user @ host)))
 *
 *
 *Upgrade:*

lein plugin install control 0.3.4


 --
 庄晓丹
 Email:killme2...@gmail.com xzhu...@avos.com
 Site:   http://fnil.net
 Twitter:  @killme2008






-- 
庄晓丹
Email:killme2...@gmail.com xzhu...@avos.com
Site:   http://fnil.net
Twitter:  @killme2008

-- 
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.java.jdbc alias

2012-05-10 Thread David Powell
If you are working from the repl, use:

  (require '[clojure.java.jdbc :as sql])


Or use a similar require declaration in your ns header.

(ns example.whatever
  (:require [clojure.java.jdbc :as sql]))


-- 
Dave

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: [ANN] The Kiln, an Evaulation Strategy for Insanely Complex Functions

2012-05-10 Thread Marc Limotte
Hi Jeff,

What do you think about a Map interface for this?

I recently implemented something similar in a project of mine, which I
called an 'evaluating-map'.  It's not a Web project, but the pattern is a
general one.  In my case, a DSL for specifying a job to run.  I want the
DSL writer to have access to a lot of data/logic which can come from a lot
of different sources (a big ball of mud to use your term).

Like you, the mud-ball could contain values or functions.  These functions
can have references to other values in the ball of mud.  I expanded this
to include interpolated strings (e.g. foo is ${foo}) and collections of
values/Strings/functions which are handled recursively.  My code doesn't do
anything to manage state, although users are encouraged to provide memoized
functions and a helper is provided to assist with this.

Here's an example comparable to your example from the Kiln project.

(def m
  {:request foo
   :uri #(build-uri (:request %))   ; an anonymous function works, or
   :path (lfn [uri] (.getPath uri)) ; use lfn, a helper that returns a fn
   :dispatch
 (lfn [path] (condp = path
   /remove-user :remove-user
   /add-user :add-user
   /view-user :view-user))
   :action! action  ; assuming action is defn'ed elsewhere
   ... and so on ... })

lfn is the helper that I mentioned-- it pulls it's args as keys from the
ball-of-mud and returns a memoized fn of those args.

Eventually, you fire it.  Like Kiln, the concept is that you have a bunch
of code that sets it up and then at some point you mix in a few seed values
and kick it off.  My fire function does a bunch of other stuff, but the
relevant part boils down to (- m (assoc :request req) evaluating-map),
which is used like this:

(let [k (- m (assoc :request req) evaluating-map)
  result (try
   (:action! k)
   (render-template (:template k) ...other kiln data...)
   ... catch)]
  ; because it's a Map, you can do things like
  (log/debug (select-keys k [:uri :path]))
  result)

I didn't write support for glazes and cleanup.  I think glazes could be
done ring-style.  Cleanup requires some extra thought.  Those are nice
features of Kiln.

I think Kiln gives you more control over the execution and state, making
things like cleanup easy.  What I like about the Map interface, aside from
the convenience of being able to use standard collection functions (merge,
select-keys, dissoc, etc) is that you can construct the map from many
different sources.  I.e. you can merge maps which are constructed
dynamically at different points in your flow.  This was important for my
use-case, since DSL users are writing code that my core code knows nothing
about.  Using the example above, a subsequent user could replace the :uri
fn:

(merge m {:uri (lfn [request] (some-other-build-fn request))})

This new function would then be the input for the :path function.

My code for this abstraction isn't isolated, but you can see it in context
of another project
herehttps://github.com/TheClimateCorporation/lemur/blob/master/src/main/clj/lemur/evaluating_map.clj
.

Anyway, I like the project and thanks for sharing it.

Marc

On Sun, May 6, 2012 at 2:08 PM, Jeffrey Straszheim jstra...@akamai.comwrote:



 The Kiln is an evaluation strategy for insanely complex functions. It was
 designed based on two things: my experience with managing several large,
 complex, ever-changing web applications in Clojure, and my experience in
 dataflow approaches to modelling.

 I have released version 1.0.0 on Clojars. Also, there is quite a bit of
 documentation and explanation on the project Github page, including a full
 sample application presented in a somewhat “literate” style.

 Please take a look.

 http://github.com/straszheimjeffrey/The-Kiln


  --
 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: Getting started

2012-05-10 Thread Tom Maynard
 On 05/10/2012 03:53 AM, Zeno wrote: 

trying java -cp clojure-1.4.0.jar clojure.main as stated 


You need to specify the full path to clojure.jar (probably ./clojure.jar, 
if you're in that directory).  You could also put . in your classpath, 
but that's not recommended (can cause flakey problems down the road). 

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

Re: Some reflections about programming after Clojure exposure (yay - it rhymes!)

2012-05-10 Thread James
Thanks for the feedback.

An interesting angle to ponder is how Lisp and the Human Mind share
 linked lists as a basic data structure. Remember how you had memorized
 the ABC?

That's true - even though my recollection of the alphabet is patchy,
letters always occur in groupings. Specifically, 'ABC', 'PQR', 'MN',
and 'XYZ' seem to stand out immediately. Possibly because they are
often used as math variables. When trying to recollect a position of a
different letter than those my brain does a 'neighborhood
search' (linked lists)!

 FP taught me how you can also build other data structures out of
 linked lists, skip lists anyone?

This one could easily become a theme for a separate blog entry. I've
come to the shocking realization that Computer Science education has
this thing backwards. Sure, they encourage modularity and
composability when it comes to OO programming. Some enlightened souls
might mention the Unix philosophy of small components, loosely
coupled (short, focused functions, etc). But no-one in the world
talks about data structure composability! Yet data structures are
lower in the complexity hierarchy than objects.

If being compos-able is a virtue in programming, why not start at the
lower levels and demonstrate how basic data structures can produce
more complex ones?

The CompSci books are even worse - they jump straight ahead into the
Abstract Data Type, so they lead with generalization and leave the
details blurred.

You really have to become a member of a semi-underground programming
community to see the light here. Incredible.

Cheers,
James


On May 10, 2:46 pm, Herwig Hochleitner hhochleit...@gmail.com wrote:
 Good article, thanks for sharing!

 An interesting angle to ponder is how Lisp and the Human Mind share
 linked lists as a basic data structure. Remember how you had memorized
 the ABC?
 FP taught me how you can also build other data structures out of
 linked lists, skip lists anyone?
 Now take a look at the steps your mind takes, when finding the
 successor of a particular letter in the alphabet :)

 cheers

-- 
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: [ANN] clojure-script for NodeJS

2012-05-10 Thread Michael Bradley, Jr.
Four reasons, all interrelated. Whether they're good reasons, I'm not 100% 
positive, but felt this was the way to go:

*1.*  The coffee-script package on npm is one of my favorites, and was 
the inspiration for my clojure-script package. Thus, I wanted the package 
names to resemble one another.

*2.  *The npm package and the language it facilitates are two different 
things. So that way someone can say, I'm having an issue with 
clojure-script, and mean they're having trouble with my package and not 
with the language itself. 

*3.* From its early days, the npm registry only supports lower case package 
names, e.g. no camel case. So putting a - between coffee and script 
makes the coffee pop out in the text-heavy pages of the npm website. The 
same goes for clojure-script.

*4. *I felt weird about calling my GitHub repository 
michaelsbradleyjr/clojurescript, since it's really a distinct project 
from ClojureScript the language. So I named it node-clojurescript. 
However, it's officially not recommended to npm-publish packages with names 
that include the word node, since that' redundant. But for the same 
reasons I didn't want to name my repository clojurescript, I chose a 
package name that would implicitly indicate that clojure-script is a 
distinct entity from ClojureScript the language.



On Thursday, May 10, 2012 8:55:52 AM UTC-5, David Nolen wrote:

 Looks neat.

 Any reason to call the module clojure-script instead of just clojurescript?

 David

 On Thu, May 10, 2012 at 2:38 AM, Michael Bradley, Jr. 
 michaelsbradle...@gmail.com wrote:

 I'm looking for folks to help me kick the tires and push this project 
 forward:

 https://github.com/michaelsbradleyjr/node-clojurescript

 http://search.npmjs.org/#/clojure-script

 snip




-- 
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: [ANN] clojure-script for NodeJS

2012-05-10 Thread Michael Bradley, Jr.
Sure, maybe a spinner or something like that.

However, many use cases would exclude displaying such an indicator, e.g. if 
you're sending the compiled text to stdout, running a .cljs script directly 
or some other script that uses Node's `require` to load a .cljs script, 
etc. That is, in those cases it probably wouldn't be appropriate to send 
extra stuff to stdout or stderr, because the developer may expect to have 
exclusive control over them.
 
But when using ncljsc's -c / --compile flag, perhaps together with the -w / 
--watch and -W / --watch-deps flags, then it would make sense to have a 
busy compiling indicator.

Thanks for the suggestion. I'll definitely look into it.



On Thursday, May 10, 2012 8:58:33 AM UTC-5, David Nolen wrote:

 Just gave it a shot, works! Would be nice if it gave some feedback that it 
 was compiling / recompiling.

 David

 On Thu, May 10, 2012 at 2:38 AM, Michael Bradley, Jr. 
 michaelsbradle...@gmail.com wrote:

 I'm looking for folks to help me kick the tires and push this project 
 forward:

 https://github.com/michaelsbradleyjr/node-clojurescript

 http://search.npmjs.org/#/clojure-script

  -- 
 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: The Kiln, an Evaulation Strategy for Insanely Complex Functions

2012-05-10 Thread Paul deGrandis
Marc,

Nicely done!  I've done something similar before as well.

This was basically my point earlier: Dispatch tables (and maps in
general), unification, and closures seem to solve the same problem,
are composable, don't introduce nouns/types/metaphors, are open for
extension and closed for modification, and if crafted well, can be
shipped around to any reader.  Using RabbitMQ and Clojure as my data
format, I can easily create loosely coupled, highly cohesive services
that can be replicated, redundant, etc.

I think the project looks interesting, but the benefits, tradeoffs,
and design decisions aren't clear to me.

Paul

On May 10, 11:11 am, Marc Limotte mslimo...@gmail.com wrote:
 Hi Jeff,

 What do you think about a Map interface for this?

 I recently implemented something similar in a project of mine, which I
 called an 'evaluating-map'.  It's not a Web project, but the pattern is a
 general one.  In my case, a DSL for specifying a job to run.  I want the
 DSL writer to have access to a lot of data/logic which can come from a lot
 of different sources (a big ball of mud to use your term).

 Like you, the mud-ball could contain values or functions.  These functions
 can have references to other values in the ball of mud.  I expanded this
 to include interpolated strings (e.g. foo is ${foo}) and collections of
 values/Strings/functions which are handled recursively.  My code doesn't do
 anything to manage state, although users are encouraged to provide memoized
 functions and a helper is provided to assist with this.

 Here's an example comparable to your example from the Kiln project.

 (def m
   {:request foo
    :uri #(build-uri (:request %))   ; an anonymous function works, or
    :path (lfn [uri] (.getPath uri)) ; use lfn, a helper that returns a fn
    :dispatch
      (lfn [path] (condp = path
                    /remove-user :remove-user
                    /add-user :add-user
                    /view-user :view-user))
    :action! action                  ; assuming action is defn'ed elsewhere
    ... and so on ... })

 lfn is the helper that I mentioned-- it pulls it's args as keys from the
 ball-of-mud and returns a memoized fn of those args.

 Eventually, you fire it.  Like Kiln, the concept is that you have a bunch
 of code that sets it up and then at some point you mix in a few seed values
 and kick it off.  My fire function does a bunch of other stuff, but the
 relevant part boils down to (- m (assoc :request req) evaluating-map),
 which is used like this:

 (let [k (- m (assoc :request req) evaluating-map)
       result (try
                (:action! k)
                (render-template (:template k) ...other kiln data...)
                ... catch)]
   ; because it's a Map, you can do things like
   (log/debug (select-keys k [:uri :path]))
   result)

 I didn't write support for glazes and cleanup.  I think glazes could be
 done ring-style.  Cleanup requires some extra thought.  Those are nice
 features of Kiln.

 I think Kiln gives you more control over the execution and state, making
 things like cleanup easy.  What I like about the Map interface, aside from
 the convenience of being able to use standard collection functions (merge,
 select-keys, dissoc, etc) is that you can construct the map from many
 different sources.  I.e. you can merge maps which are constructed
 dynamically at different points in your flow.  This was important for my
 use-case, since DSL users are writing code that my core code knows nothing
 about.  Using the example above, a subsequent user could replace the :uri
 fn:

 (merge m {:uri (lfn [request] (some-other-build-fn request))})

 This new function would then be the input for the :path function.

 My code for this abstraction isn't isolated, but you can see it in context
 of another project
 herehttps://github.com/TheClimateCorporation/lemur/blob/master/src/main/c...
 .

 Anyway, I like the project and thanks for sharing it.

 Marc

 On Sun, May 6, 2012 at 2:08 PM, Jeffrey Straszheim jstra...@akamai.comwrote:









  The Kiln is an evaluation strategy for insanely complex functions. It was
  designed based on two things: my experience with managing several large,
  complex, ever-changing web applications in Clojure, and my experience in
  dataflow approaches to modelling.

  I have released version 1.0.0 on Clojars. Also, there is quite a bit of
  documentation and explanation on the project Github page, including a full
  sample application presented in a somewhat “literate” style.

  Please take a look.

 http://github.com/straszheimjeffrey/The-Kiln

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

Re: Reducers

2012-05-10 Thread Christian Romney


On Thursday, May 10, 2012 8:02:09 AM UTC-4, Nicolas Oury wrote:

 I can describe the background to understand my last email. 


Thank you very much for taking the time to post all of that–I've got some 
reading to do for sure. 

-- 
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: Getting started

2012-05-10 Thread Chris McBride
Also you generally don't invoke the clojure jar directly. Instead have lein 
do that for you. 
http://www.unexpected-vortices.com/clojure/brief-beginners-guide/development-env.html#clojure-projects

On Thursday, May 10, 2012 4:53:51 AM UTC-4, Zeno wrote:

 Hi, 
 I have downloaded and unzipped Clojure 1.4.0 but when trying java -cp 
 clojure-1.4.0.jar clojure.main as stated on the getting started page 
 I get the following. 

 D:\Profiles\rcarthur\My Documents\Clojure1_4\clojure-1.4.0java -cp 
 clojure-1.4.0.jar clojure.main 

 Exception in thread main java.lang.NoClassDefFoundError: clojure/ 
 main 
 Caused by: java.lang.ClassNotFoundException: clojure.main 
 at java.net.URLClassLoader$1.run(URLClassLoader.java:200) 
 at java.security.AccessController.doPrivileged(Native Method) 
 at java.net.URLClassLoader.findClass(URLClassLoader.java:188) 
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307) 
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 
 301) 
 at java.lang.ClassLoader.loadClass(ClassLoader.java:252) 
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 
 320) 
 Could not find the main class: clojure.main.  Program will exit. 

 Any clues as to what I might be doing wrong? 

 Regards

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

[ANN] Clojure/core Roadshow

2012-05-10 Thread Christopher Redinger
Clojure/core wants to take our training course on the road this summer! We 
are looking for the cities that are the most interested in learning more 
about Clojure so we can bring our training there. I've posted more details 
about the roadshow on our blog, at:

http://clojure.com/blog/2012/05/07/clojure-core-roadshow.html

One particular point - If your organization is interested in having us do 
some training but don't have enough students to warrant a private training, 
let's talk about how we can partner to bring an open training to your area 
and get some interest from the local community. This is also true for user 
groups that are interested in bringing this kind of training to their city.

We're going to kick things off with an initial training in Durham, NC on 
June 26th - June 29th. Go to http://roadshow.clojure.com/durham.html to 
learn more about and register for this class.

The actual site where you can register your interest in training is at: 

http://clojure.com/roadshow

Hope to see you on the road!

Christopher
Clojure/core

-- 
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: {ANN} Clojure-control 0.3.4 released

2012-05-10 Thread Rostislav Svoboda
I took the steps from your README.md and it seems like something's
missing :( see below

Bost

bost@bost-desktop:~/dev$ rm -rf mycontrol/
bost@bost-desktop:~/dev$ lein1 version
Leiningen 1.7.1 on Java 1.7.0_04 Java HotSpot(TM) Client VM
bost@bost-desktop:~/dev$ lein1 plugin install control 0.3.5
[INFO] Unable to find resource 'control:control:jar:0.3.5' in
repository central (http://repo1.maven.org/maven2)
Installing shell wrapper to /home/bost/.lein/bin/clojure-control
Copying 2 files to /tmp/lein-f0119cb7-6660-4181-aeed-149113f38fc1/lib
Including control-0.3.5.jar
Including clojure-1.3.0.jar
Including tools.cli-0.2.1.jar
Created control-0.3.5.jar
bost@bost-desktop:~/dev$ lein1 new mycontrol
Created new project in: /home/bost/dev/mycontrol
Look over project.clj and start coding in mycontrol/core.clj
bost@bost-desktop:~/dev$ cd mycontrol/
bost@bost-desktop:~/dev/mycontrol$ lein1 control init
bost@bost-desktop:~/dev/mycontrol$ cat
classes/ control.clj  .gitignore   project.clj  README   src/
   test/
bost@bost-desktop:~/dev/mycontrol$ cat control.clj
(defcluster :default-cluster
  :clients [
{:host localhost :user root}
  ])

(deftask :date echo date on cluster  []
  (ssh date))
bost@bost-desktop:~/dev/mycontrol$ lein1 control run default-cluster date
Empty hosts for cluster default-cluster
Exception in thread main java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.RuntimeException: Empty hosts for cluster
default-cluster (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
... 5 more
Caused by: java.lang.RuntimeException: Empty hosts for cluster default-cluster
at control.core$do_begin.invoke(core.clj:353)
at leiningen.control$run_control.invoke(control.clj:30)
at leiningen.control$run.doInvoke(control.clj:97)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.control$control.doInvoke(control.clj:136)
at clojure.lang.RestFn.invoke(RestFn.java:464)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:262)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 16 more

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


Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Ant
Hi all,

I am battering my head against the following problem which I'm sure is
straightforward if only I knew how. I want to partition the following
list:

'(aa123 x y z bb123 ccq23 3 yg)

into the following:

((aa123 x y z) (bb123) (ccq23 3 yg))

The predicate is:

#(re-matches #^(\w)\1.* %)

partition-by doesn't work, since it splits the sequence when the
result of applying the predicate changes. I want to partition when the
predicate becomes a particular value.

Any clues on how to accomplish this would be gratefully received!

Thanks,

Anthony.

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


How do I modify the clojure.org website?

2012-05-10 Thread Brent Millare
I put an issue [clj-989] about an out of date link clojure. It doesn't seem 
like anyone payed any attention to it yet. Is there a way I can be more 
active in making these changes such as having permission to modify the 
website?

-- 
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: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Ant
After posting, I had the idea of checking out the source for partition-
by, and solved the problem:

(defn partition-when
  Applies f to each value in coll, splitting it each time f returns
   the specified value.  Returns a lazy seq of partitions.
  [f value coll]
  (lazy-seq
(when-let [s (seq coll)]
  (let [run (cons (first s) (take-while #(not= value (f %)) (next
s)))]
   (cons run (partition-when f value (seq (drop (count run) s
  )
)
  )
)

So, I can see basically how this function works, but am not sure what
the when-let gives you. Could someone explain? The documentation makes
no sense to me at the moment:


(when-let bindings  body)

bindings = binding-form test

When test is true, evaluates body with binding-form bound to the value
of test


What test?

Thanks,

Anthony.

-- 
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: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Jack Moffitt
    (when-let [s (seq coll)]
      (let [run (cons (first s) (take-while #(not= value (f %)) (next
 s)))]
       (cons run (partition-when f value (seq (drop (count run) s
      )
    )
  )
 )
...
 What test?

(seq coll) is the test here. when-let (and if-let, etc) bind only when
the right hand side is truthy.

(when-let [x true]
  (println this prints))

(when-let [x false]
  (println this does not print))

It's a common shortcut for:

(let [x (something-something)]
  (when x
 ))

jack.

-- 
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: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Softaddicts
(seq coll) is the test, if the collection is empty seq returns nil, hence 
nothing gets done
in the (let ...) form.

Luc


 After posting, I had the idea of checking out the source for partition-
 by, and solved the problem:
 
 (defn partition-when
   Applies f to each value in coll, splitting it each time f returns
the specified value.  Returns a lazy seq of partitions.
   [f value coll]
   (lazy-seq
 (when-let [s (seq coll)]
   (let [run (cons (first s) (take-while #(not= value (f %)) (next
 s)))]
(cons run (partition-when f value (seq (drop (count run) s
   )
 )
   )
 )
 
 So, I can see basically how this function works, but am not sure what
 the when-let gives you. Could someone explain? The documentation makes
 no sense to me at the moment:
 
 
 (when-let bindings  body)
 
 bindings = binding-form test
 
 When test is true, evaluates body with binding-form bound to the value
 of test
 
 
 What test?
 
 Thanks,
 
 Anthony.
 
 -- 
 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
 
--
Softaddictslprefonta...@softaddicts.ca sent by ibisMail from my ipad!

-- 
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: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Alan Malloy
https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L189
is a more general version of partition-by, which can easily handle
your requirements.

On May 10, 2:11 pm, Ant ant...@gmail.com wrote:
 Hi all,

 I am battering my head against the following problem which I'm sure is
 straightforward if only I knew how. I want to partition the following
 list:

 '(aa123 x y z bb123 ccq23 3 yg)

 into the following:

 ((aa123 x y z) (bb123) (ccq23 3 yg))

 The predicate is:

 #(re-matches #^(\w)\1.* %)

 partition-by doesn't work, since it splits the sequence when the
 result of applying the predicate changes. I want to partition when the
 predicate becomes a particular value.

 Any clues on how to accomplish this would be gratefully received!

 Thanks,

 Anthony.

-- 
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: Partitioning a list when the result of a predicate becomes a certain value.

2012-05-10 Thread Alan Malloy
On May 10, 3:19 pm, Jack Moffitt j...@metajack.im wrote:
     (when-let [s (seq coll)]
       (let [run (cons (first s) (take-while #(not= value (f %)) (next
  s)))]
        (cons run (partition-when f value (seq (drop (count run) s
       )
     )
   )
  )
 ...
  What test?

 (seq coll) is the test here. when-let (and if-let, etc) bind only when
 the right hand side is truthy.

 (when-let [x true]
   (println this prints))

 (when-let [x false]
   (println this does not print))

 It's a common shortcut for:

 (let [x (something-something)]
   (when x
      ))


Not quite true in the general case, though. Consider

(let [x 1]
  (if-let [x foo]
x   ;; should be foo
x)) ;; should be 1

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


[ANN] clojure.java.jdbc 0.2.1 on Maven Central

2012-05-10 Thread Sean Corfield
A minor update that includes a performance tweak for large result sets
(thank you Jürgen Hötzel) and a small API change - exposing
do-prepared-return-keys - to make life easier for the Korma team.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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: Reducers

2012-05-10 Thread Rich Hickey
IMO, Nicolas' material is a distraction in understanding reducers, except as 
historical background.

The reducers library is a rejection/avoidance of the primacy of 
recursively/generatively defined data structures and the operations thereon.

I recommend, rather than reading about stream fusion, one watches the Guy 
Steele presentation linked from the post:

Organizing Functional Code for Parallel Execution 
or, foldl and foldr Considered Slightly Harmful:

http://vimeo.com/6624203

Which boils down to - stop programming with streams, lists, generators etc if 
you intend to exploit parallelism, which the reducers library does.

Rich

On May 10, 2012, at 1:26 PM, Christian Romney wrote:

 
 
 On Thursday, May 10, 2012 8:02:09 AM UTC-4, Nicolas Oury wrote:
 I can describe the background to understand my last email. 
 
 Thank you very much for taking the time to post all of that–I've got some 
 reading to do for sure. 
 
 -- 
 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: Getting started

2012-05-10 Thread Rostislav Svoboda
On 10 May 2012 19:57, Chris McBride cmm7...@gmail.com wrote:
 Also you generally don't invoke the clojure jar directly. Instead have lein
 do that for you.
 http://www.unexpected-vortices.com/clojure/brief-beginners-guide/development-env.html#clojure-projects

No, please stop. Zeno, you MUST get the java -cp clojure-1.4.0.jar
clojure.main working! It is the very core the life and the universe.
If this does not work your system is completely broken and nothing can
be relied upon.

-- 
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: {ANN} Clojure-control 0.3.4 released

2012-05-10 Thread dennis zhuang
I am sorry, 0.3.5 will break the example with only :clients in cluster.
I've push 0.3.6 to clojars, upgrade control by:

  lein plugin install control 0.3.6

Sorry for this issue,thanks.

2012/5/11 Rostislav Svoboda rostislav.svob...@gmail.com

 I took the steps from your README.md and it seems like something's
 missing :( see below

 Bost

 bost@bost-desktop:~/dev$ rm -rf mycontrol/
 bost@bost-desktop:~/dev$ lein1 version
 Leiningen 1.7.1 on Java 1.7.0_04 Java HotSpot(TM) Client VM
 bost@bost-desktop:~/dev$ lein1 plugin install control 0.3.5
 [INFO] Unable to find resource 'control:control:jar:0.3.5' in
 repository central (http://repo1.maven.org/maven2)
 Installing shell wrapper to /home/bost/.lein/bin/clojure-control
 Copying 2 files to /tmp/lein-f0119cb7-6660-4181-aeed-149113f38fc1/lib
 Including control-0.3.5.jar
 Including clojure-1.3.0.jar
 Including tools.cli-0.2.1.jar
 Created control-0.3.5.jar
 bost@bost-desktop:~/dev$ lein1 new mycontrol
 Created new project in: /home/bost/dev/mycontrol
 Look over project.clj and start coding in mycontrol/core.clj
 bost@bost-desktop:~/dev$ cd mycontrol/
 bost@bost-desktop:~/dev/mycontrol$ lein1 control init
 bost@bost-desktop:~/dev/mycontrol$ cat
 classes/ control.clj  .gitignore   project.clj  README   src/
   test/
 bost@bost-desktop:~/dev/mycontrol$ cat control.clj
 (defcluster :default-cluster
  :clients [
{:host localhost :user root}
  ])

 (deftask :date echo date on cluster  []
  (ssh date))
 bost@bost-desktop:~/dev/mycontrol$ lein1 control run default-cluster date
 Empty hosts for cluster default-cluster
 Exception in thread main java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
 Caused by: java.lang.RuntimeException: Empty hosts for cluster
 default-cluster (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
... 5 more
 Caused by: java.lang.RuntimeException: Empty hosts for cluster
 default-cluster
at control.core$do_begin.invoke(core.clj:353)
at leiningen.control$run_control.invoke(control.clj:30)
at leiningen.control$run.doInvoke(control.clj:97)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.control$control.doInvoke(control.clj:136)
at clojure.lang.RestFn.invoke(RestFn.java:464)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:262)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 16 more

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




-- 
庄晓丹
Email:killme2...@gmail.com xzhu...@avos.com
Site:   http://fnil.net
Twitter:  @killme2008

-- 
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: How do I modify the clojure.org website?

2012-05-10 Thread Alex Miller
I updated the link for you.   

On Thursday, May 10, 2012 5:03:26 PM UTC-5, Brent Millare wrote:

 I put an issue [clj-989] about an out of date link clojure. It doesn't 
 seem like anyone payed any attention to it yet. Is there a way I can be 
 more active in making these changes such as having permission to modify the 
 website?

-- 
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: Getting started

2012-05-10 Thread Sean Corfield
On Thu, May 10, 2012 at 4:56 PM, Rostislav Svoboda
rostislav.svob...@gmail.com wrote:
 No, please stop. Zeno, you MUST get the java -cp clojure-1.4.0.jar
 clojure.main working! It is the very core the life and the universe.

I'm sorry but that's a silly comment.

Starting with Leiningen instead of downloading the Clojure JAR file
would save the vast majority of folks a lot of pain when they first
get started with Clojure.

Why force them to wrestle with Java classpath issues if they don't
have a Java background?

(or were you being sarcastic?)
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

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