Re: IllegalStateException "I/O in transaction" in REPL

2012-06-22 Thread dmirylenka
Thank you for the answers, and sorry for late reply.

It seems I figured out what the problem was.

My code was placed at the top level of a file sci-clustering/examples.clj,
and I was loading the namespace from REPL like this:(use 
'sci-clustering.examples :reload-all).

So it looks like clojure.core/use loads the libraries / namespaces inside a 
transaction, which makes sense.

Here is the code: http://pastie.org/4130967 ,
and here is the stack trace: http://pastie.org/4130930 .

Best regards,
Daniil.


On Friday, June 15, 2012 1:20:01 AM UTC+2, Stephen Compall wrote:
>
> On Thu, 2012-06-14 at 13:33 -0700, dmirylenka wrote: 
> > Could you please explain a bit more? 
> > 
> > I don't have any dosync in my code. 
>
> Look through your backtrace for a call to 
> clojure.lang.LockingTransaction.runInTransaction.  Its caller is using 
> dosync. 
>
>
> -- 
> Stephen Compall 
> ^aCollection allSatisfy: [:each|aCondition]: less is better 
>
>

-- 
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.java.jdbc 0.2.3 available on Maven Central

2012-06-22 Thread Vinzent

>
> given java.jdbc's position as the sort of lower level glue all these 
> libraries are built on, maybe better then including a DSL in java.jdbc 
> would be including an AST (some data representation of sql) and a 
> compiler for same.
>

Yeah, that's exactly what I wanted to suggest too. Seems like all would 
benefit from that. Though, the same idea has already been discussed on the 
list some time ago.


@Sean Corfield:

> jsql has completely different goals to ClojureQL/Korma and is mostly a 
> convenience for generating the sort of SQL that the update!, insert! 
> and delete! methods need under the hood (c.j.jdbc has to generate that 
> SQL anyway - might as well make the methods public). The 
> select/where/order-by has evolved out of our common usage at World 
> Singles where we have get-by-id and find-by-keys and similar CRUD 
> functions. jsql is deliberately very close to the "metal" of SQL and 
> is not intended to be composable etc. Folks wanting a full-blown DSL 
> should indeed use Korma (or ClojureQL). 


Ok, I see. I've misunderstood the goals. Though, it still duplicates 
significant part of clojureql\korma, right? What do you think about 
AST\compiler thing?

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

defpartial returns object instead of html string

2012-06-22 Thread Murtaza Husain

Hi,

I am using Chris Ganger's crate library to generate html on the client 
side. 


(defpartial html [] form)

(def form 
  [:div.form-horizontal
   [:fieldset
[:legend "Student Registeration"]
[:div.control-group
 [:label.control-label "Hello World"]]])

When I execute the above function in clojurescript repl as - (html) - I get 
- #<[object HTMLDivElement]>.

However when I execute it as (.log js/console (html)), the proper generated 
html is logged into the browser's console. 

How do I get it to return a HTML string instead of an object?

Thanks,
Murtaza

-- 
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: defpartial returns object instead of html string

2012-06-22 Thread Ben Smith-Mannschott
str

On Fri, Jun 22, 2012 at 11:58 AM, Murtaza Husain
 wrote:
>
> Hi,
>
> I am using Chris Ganger's crate library to generate html on the client side.
>
>
>     (defpartial html [] form)
>
>     (def form
>   [:div.form-horizontal
>    [:fieldset
>     [:legend "Student Registeration"]
>     [:div.control-group
>  [:label.control-label "Hello World"]]])
>
> When I execute the above function in clojurescript repl as - (html) - I get
> - #<[object HTMLDivElement]>.
>
> However when I execute it as (.log js/console (html)), the proper generated
> html is logged into the browser's console.
>
> How do I get it to return a HTML string instead of an object?
>
> Thanks,
> Murtaza
>
> --
> 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: defpartial returns object instead of html string

2012-06-22 Thread Murtaza Husain

Nope doesnt work.


On Friday, June 22, 2012 4:05:13 PM UTC+5:30, bsmith.occs wrote:
>
> str 
>
> On Fri, Jun 22, 2012 at 11:58 AM, Murtaza Husain 
>  wrote: 
> > 
> > Hi, 
> > 
> > I am using Chris Ganger's crate library to generate html on the client 
> side. 
> > 
> > 
> > (defpartial html [] form) 
> > 
> > (def form 
> >   [:div.form-horizontal 
> >[:fieldset 
> > [:legend "Student Registeration"] 
> > [:div.control-group 
> >  [:label.control-label "Hello World"]]]) 
> > 
> > When I execute the above function in clojurescript repl as - (html) - I 
> get 
> > - #<[object HTMLDivElement]>. 
> > 
> > However when I execute it as (.log js/console (html)), the proper 
> generated 
> > html is logged into the browser's console. 
> > 
> > How do I get it to return a HTML string instead of an object? 
> > 
> > Thanks, 
> > Murtaza 
> > 
> > -- 
> > 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: How to go about finding a Clojure job

2012-06-22 Thread Okan AKYÜZ
Dear Erol;

In our country (Turkey) there is no opertunity to find a functional
programing job. I guess your nation is Turk because of your name and
surname. Anyway there are same cool lisp jobs on
http://lispjobs.wordpress.com/

Okan Akyuz


2012/6/21 Erol Akarsu 

> Colin,
>
> I love Clojure language and have done small personal projects. Actually, I
> like all types of functional languages, had a lot of experience on xquery
> and related technologies, schema and lisp.
> May I learn what you are doing?
>
> Erol Akarsu
>
> On Monday, June 18, 2012 9:27:53 AM UTC-4, Colin Steele wrote:
>>
>> Or send me yours.  We're a full-on clojure shop in Charlottesville, VA.
>>
>> On Saturday, June 16, 2012 10:49:00 AM UTC-4, tbc++ wrote:
>>>
>>> I'm about to begin the process of looking for a new job, and would
>>> like to find one that focuses on Clojure. Can anyone suggest some good
>>> ways to go about this? It seems like posting my resume on this mailing
>>> list would be a bit off-topic.
>>>
>>> As far as location goes, I'm looking in the Denver, CO area, but am
>>> also open to 100% telecommute.
>>>
>>>
>>> Thanks,
>>>
>>> Timothy Baldridge
>>>
>>  --
> 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




-- 
Okan Akyüz

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-22 Thread brad bowman
On Thursday, June 21, 2012 12:58:19 PM UTC+10, John Gabriele wrote:
>
> On Jun 18, 10:23 pm, Chris Zheng  wrote: 
> > {snip} 
> > So basically, if a 'lead clojure evangelist' can either 'officially' or 
> > 'unofficially' recommend ONE emacs setup, along with a bunch of 
> > videos/tutorials that demonstrate how to code and how fast it is to 
> design 
> > and code using the repl. Then that be enough to get people at least 
> > interested. 
>
> People are very opinionated about their editor/IDE. I think the Getting 
> +Started docs are good --- they separate: 
>
>   * if you want just Emacs plus the repl, here you go (clojure-mode 
> readme) 
>   * if you want Emacs + inferior-lisp, do this (this doc needs work) 
>   * if you want Emacs + swank/slime, do this (swank-clojure readme) 
>
> and of course also info on Eclipse, Clooj, and other editors/ide's as 
> well. 
>

I'm right at the start of this process, completely unfamiliar with Clojure,
Leiningen, Emacs, Java and all of the projects with cute names.
I don't even know what I want.

I've cut and pasted various git-clone and lein commands, but have no idea
about the bigger picture.  I'm happy to dawdle along on my own, but if my
current (and hopefully temporary) ignorance can provide feedback on a
start-up guide then let me know.

At present I'm often wondering "what is this thing? why do I want it?".
Slime for example.  I don't especially want answers here, but something like
a glossary for the clojure ecosystem would be handy (not that I've looked 
hard).

Another document that might useful is a platform Rosetta stone
matching clojure tools and libraries to those that fill a similar role in 
other
languages (Java and Ruby for starters).  This is more of a "nice to have".

Thanks,

Brad

-- 
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 to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread Joseph Guhlin
I have a 2.5GB file, and will have other files, where the records are 
mutli-line (variable length) and are separated by // on a line by itself. 
What is the best way to read the record into a sequence of strings for 
parsing, and act on that record, and read the next record? It'd be great if 
it was lazy, as it's 2.5GB and there will be other / larger files in the 
future.

I have it reading the file just fine if there is only one entry, it was 
nice and easy as well as fast and concise, so I'd love to be able to do the 
entire thing in clojure if possible.

Thanks,
--Joseph

-- 
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 to go about finding a Clojure job

2012-06-22 Thread Erol Akarsu
Hello All,

I am interested in a job  with Clojure language. I am located in Richmond 
VA and would like to work remotely.

Thanks

Erol Akarsu

On Wednesday, June 20, 2012 8:18:10 PM UTC-4, Erol Akarsu wrote:
>
> Colin,
>
> I love Clojure language and have done small personal projects. Actually, I 
> like all types of functional languages, had a lot of experience on xquery 
> and related technologies, schema and lisp.
> May I learn what you are doing?
>
> Erol Akarsu
>
> On Monday, June 18, 2012 9:27:53 AM UTC-4, Colin Steele wrote:
>>
>> Or send me yours.  We're a full-on clojure shop in Charlottesville, VA.
>>
>> On Saturday, June 16, 2012 10:49:00 AM UTC-4, tbc++ wrote:
>>>
>>> I'm about to begin the process of looking for a new job, and would 
>>> like to find one that focuses on Clojure. Can anyone suggest some good 
>>> ways to go about this? It seems like posting my resume on this mailing 
>>> list would be a bit off-topic. 
>>>
>>> As far as location goes, I'm looking in the Denver, CO area, but am 
>>> also open to 100% telecommute. 
>>>
>>>
>>> Thanks, 
>>>
>>> Timothy Baldridge 
>>>
>>

-- 
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 to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread László Török
Hi,

untested but:

(require '[clojure.string :as str])

(with-open [reader (clojure.java.io/reader "path/to/the/file")]
   (let [lines (line-seq reader)
 records (map #(str/split % #"\/\/") lines)]
 ... do your processing here on the lazy record list
))

L
2012/6/21 Joseph Guhlin 

> I have a 2.5GB file, and will have other files, where the records are
> mutli-line (variable length) and are separated by // on a line by itself.
> What is the best way to read the record into a sequence of strings for
> parsing, and act on that record, and read the next record? It'd be great if
> it was lazy, as it's 2.5GB and there will be other / larger files in the
> future.
>
> I have it reading the file just fine if there is only one entry, it was
> nice and easy as well as fast and concise, so I'd love to be able to do the
> entire thing in clojure if possible.
>
> Thanks,
> --Joseph
>
> --
> 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




-- 
László Török

-- 
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 to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread Walter Tetzner

(defn read-records
  "Read the data from the given reader as a list of strings, where
each string is made up of multiple lines, separated by // on it's own
line."
  [reader]
  (->> (line-seq reader)
   (partition-by #{["//"]})
   (filter (comp not #{["//"]}))
   (map (partial apply str

-Walter

On Thursday, June 21, 2012 3:25:21 PM UTC-4, Joseph Guhlin wrote:
>
> I have a 2.5GB file, and will have other files, where the records are 
> mutli-line (variable length) and are separated by // on a line by itself. 
> What is the best way to read the record into a sequence of strings for 
> parsing, and act on that record, and read the next record? It'd be great if 
> it was lazy, as it's 2.5GB and there will be other / larger files in the 
> future.
>
> I have it reading the file just fine if there is only one entry, it was 
> nice and easy as well as fast and concise, so I'd love to be able to do the 
> entire thing in clojure if possible.
>
> Thanks,
> --Joseph
>

-- 
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 to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread Walter Tetzner


On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>
>
> (defn read-records
>   "Read the data from the given reader as a list of strings, where
> each string is made up of multiple lines, separated by // on it's own
> line."
>   [reader]
>   (->> (line-seq reader)
>(partition-by #{["//"]})
>(filter (comp not #{["//"]}))
>(map (partial apply str
>
 
Actually, you want the new lines:

(defn read-records
  "Read the data from the given reader as a list of strings, where
each string is made up of multiple lines, separated by // on it's own
line."
  [reader]
  (->> (line-seq reader)
   (partition-by #{["//"]})
   (filter (comp not #{["//"]}))
   (map (partial clojure.string/join "\n"

-- 
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: defpartial returns object instead of html string

2012-06-22 Thread Dave Sann
you can't

I believe that the code is designed to specifically bypass strings.

Why do you want a string in the client?



On Friday, 22 June 2012 20:38:09 UTC+10, Murtaza Husain wrote:
>
>
> Nope doesnt work.
>
>
> On Friday, June 22, 2012 4:05:13 PM UTC+5:30, bsmith.occs wrote:
>>
>> str 
>>
>> On Fri, Jun 22, 2012 at 11:58 AM, Murtaza Husain 
>>  wrote: 
>> > 
>> > Hi, 
>> > 
>> > I am using Chris Ganger's crate library to generate html on the client 
>> side. 
>> > 
>> > 
>> > (defpartial html [] form) 
>> > 
>> > (def form 
>> >   [:div.form-horizontal 
>> >[:fieldset 
>> > [:legend "Student Registeration"] 
>> > [:div.control-group 
>> >  [:label.control-label "Hello World"]]]) 
>> > 
>> > When I execute the above function in clojurescript repl as - (html) - I 
>> get 
>> > - #<[object HTMLDivElement]>. 
>> > 
>> > However when I execute it as (.log js/console (html)), the proper 
>> generated 
>> > html is logged into the browser's console. 
>> > 
>> > How do I get it to return a HTML string instead of an object? 
>> > 
>> > Thanks, 
>> > Murtaza 
>> > 
>> > -- 
>> > 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: defpartial returns object instead of html string

2012-06-22 Thread Dave Sann
actually - not quite true

You could always extract the html from the generated element using std 
browser functions, jquery or similar.


On Friday, 22 June 2012 23:16:56 UTC+10, Dave Sann wrote:
>
> you can't
>
> I believe that the code is designed to specifically bypass strings.
>
> Why do you want a string in the client?
>
>
>
> On Friday, 22 June 2012 20:38:09 UTC+10, Murtaza Husain wrote:
>>
>>
>> Nope doesnt work.
>>
>>
>> On Friday, June 22, 2012 4:05:13 PM UTC+5:30, bsmith.occs wrote:
>>>
>>> str 
>>>
>>> On Fri, Jun 22, 2012 at 11:58 AM, Murtaza Husain 
>>>  wrote: 
>>> > 
>>> > Hi, 
>>> > 
>>> > I am using Chris Ganger's crate library to generate html on the client 
>>> side. 
>>> > 
>>> > 
>>> > (defpartial html [] form) 
>>> > 
>>> > (def form 
>>> >   [:div.form-horizontal 
>>> >[:fieldset 
>>> > [:legend "Student Registeration"] 
>>> > [:div.control-group 
>>> >  [:label.control-label "Hello World"]]]) 
>>> > 
>>> > When I execute the above function in clojurescript repl as - (html) - 
>>> I get 
>>> > - #<[object HTMLDivElement]>. 
>>> > 
>>> > However when I execute it as (.log js/console (html)), the proper 
>>> generated 
>>> > html is logged into the browser's console. 
>>> > 
>>> > How do I get it to return a HTML string instead of an object? 
>>> > 
>>> > Thanks, 
>>> > Murtaza 
>>> > 
>>> > -- 
>>> > 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: defpartial returns object instead of html string

2012-06-22 Thread Murtaza Husain

Got some help on it from stackoverflow.

It is actually a DOM object that is returned, and the html can be extracted 
using outerHTML property.

Thanks,
Murtaza

On Friday, June 22, 2012 6:49:08 PM UTC+5:30, Dave Sann wrote:
>
> actually - not quite true
>
> You could always extract the html from the generated element using std 
> browser functions, jquery or similar.
>
>
> On Friday, 22 June 2012 23:16:56 UTC+10, Dave Sann wrote:
>>
>> you can't
>>
>> I believe that the code is designed to specifically bypass strings.
>>
>> Why do you want a string in the client?
>>
>>
>>
>> On Friday, 22 June 2012 20:38:09 UTC+10, Murtaza Husain wrote:
>>>
>>>
>>> Nope doesnt work.
>>>
>>>
>>> On Friday, June 22, 2012 4:05:13 PM UTC+5:30, bsmith.occs wrote:

 str 

 On Fri, Jun 22, 2012 at 11:58 AM, Murtaza Husain 
  wrote: 
 > 
 > Hi, 
 > 
 > I am using Chris Ganger's crate library to generate html on the 
 client side. 
 > 
 > 
 > (defpartial html [] form) 
 > 
 > (def form 
 >   [:div.form-horizontal 
 >[:fieldset 
 > [:legend "Student Registeration"] 
 > [:div.control-group 
 >  [:label.control-label "Hello World"]]]) 
 > 
 > When I execute the above function in clojurescript repl as - (html) - 
 I get 
 > - #<[object HTMLDivElement]>. 
 > 
 > However when I execute it as (.log js/console (html)), the proper 
 generated 
 > html is logged into the browser's console. 
 > 
 > How do I get it to return a HTML string instead of an object? 
 > 
 > Thanks, 
 > Murtaza 
 > 
 > -- 
 > 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.java.jdbc 0.2.3 available on Maven Central

2012-06-22 Thread Sean Corfield
On Fri, Jun 22, 2012 at 1:50 AM, Vinzent  wrote:
> Ok, I see. I've misunderstood the goals. Though, it still duplicates
> significant part of clojureql\korma, right?

Hmm, I wouldn't say a "significant" part. I think jsql covers a very
small space. To satisfy the basic goal for the new c.j.jdbc API, it
only really needs the insert/update/delete functions and folks could
use SQL for all other queries - but basic select/where is useful
enough that I think it's worth adding (to be able to use a map for a
simple query).

> What do you think about AST\compiler thing?

I'd love to see some examples of what Kevin / you have in mind here.
Feel free to edit http://dev.clojure.org/display/design/java.jdbc to
add some examples / thinking around AST.
-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-22 Thread fenton
Hi Brad, I've updated my doc with your questions.  Here is how I responded 
to your particular queries.  Note the answer may not be correct as I'm a 
clojure newbie myself.

-

Leiningen is a build tool like maven for java, or rake (i think) for
ruby.  You can use it to publish your jar into maven repositories for 
example.

Slime is a protocol that lets you communicate from emacs to a
listening server.  In clojure, we start a swank server, which is the
clojure REPL process, and connect to it from emacs, speaking 'slime'.
The net effect is that we can have a REPL inside our emacs editor.

-

On Thursday, June 21, 2012 5:58:23 PM UTC-7, brad bowman wrote:
>
> On Thursday, June 21, 2012 12:58:19 PM UTC+10, John Gabriele wrote:
>>
>> On Jun 18, 10:23 pm, Chris Zheng  wrote: 
>> > {snip} 
>> > So basically, if a 'lead clojure evangelist' can either 'officially' or 
>> > 'unofficially' recommend ONE emacs setup, along with a bunch of 
>> > videos/tutorials that demonstrate how to code and how fast it is to 
>> design 
>> > and code using the repl. Then that be enough to get people at least 
>> > interested. 
>>
>> People are very opinionated about their editor/IDE. I think the Getting 
>> +Started docs are good --- they separate: 
>>
>>   * if you want just Emacs plus the repl, here you go (clojure-mode 
>> readme) 
>>   * if you want Emacs + inferior-lisp, do this (this doc needs work) 
>>   * if you want Emacs + swank/slime, do this (swank-clojure readme) 
>>
>> and of course also info on Eclipse, Clooj, and other editors/ide's as 
>> well. 
>>
>
> I'm right at the start of this process, completely unfamiliar with Clojure,
> Leiningen, Emacs, Java and all of the projects with cute names.
> I don't even know what I want.
>
> I've cut and pasted various git-clone and lein commands, but have no idea
> about the bigger picture.  I'm happy to dawdle along on my own, but if my
> current (and hopefully temporary) ignorance can provide feedback on a
> start-up guide then let me know.
>
> At present I'm often wondering "what is this thing? why do I want it?".
> Slime for example.  I don't especially want answers here, but something 
> like
> a glossary for the clojure ecosystem would be handy (not that I've looked 
> hard).
>
> Another document that might useful is a platform Rosetta stone
> matching clojure tools and libraries to those that fill a similar role in 
> other
> languages (Java and Ruby for starters).  This is more of a "nice to have".
>
> Thanks,
>
> Brad
>

-- 
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.4.0 is out!

2012-06-22 Thread Denis Labaye
Hi,

This is interesting, but the github page you gave is missing an essential
information: What does it bring compared to already existing mature Clojure
solutions like Pallet ?

Cheers,

Denis

On Thu, Jun 21, 2012 at 2:34 PM, dennis zhuang  wrote:

> Clojure-control:  a clojure DSL for system admin and deployment with many
> remote machines via ssh,just like fabric in python and node-control in
> node.js.
>
> Usage: https://github.com/killme2008/clojure-control
>
> *Release 0.4.0*
>
> - There is a independent shell script for clojure-control right now,and it
> is not a leiningen plugin since 0.4.0,install clojure-control is easy:
>
>- Download the 
> script.
>(https://raw.github.com/killme2008/clojure-control/master/bin/control)
>- Place it on your $PATH. (I like to use ~/bin)
>- Set it to be executable. (chmod 755 ~/bin/control)
>- Upgade clojure-control is easy: control upgrade,just like leiningen.
>
> - Added a new global option :error-mode to set the behavior when error
> happens.
>   Default value is :exit,it will exit the process when
> error happens,another choice is :exception to throw a runtime
> exception.Change this value by:
>(set-options! :error-mode :exception)
>
>
>
> --
> 庄晓丹
> 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

-- 
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 to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread Joseph Guhlin
Awesome, thank you so much.

Is there any way to make it lazy to avoid the dreaded outOfMemoryError ? Or 
is it already lazy and I'm not seeing it / working with it properly?

Best,
--Joseph

On Friday, June 22, 2012 7:30:28 AM UTC-5, Walter Tetzner wrote:
>
>
>
> On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>>
>>
>> (defn read-records
>>   "Read the data from the given reader as a list of strings, where
>> each string is made up of multiple lines, separated by // on it's own
>> line."
>>   [reader]
>>   (->> (line-seq reader)
>>(partition-by #{["//"]})
>>(filter (comp not #{["//"]}))
>>(map (partial apply str
>>
>  
> Actually, you want the new lines:
>
> (defn read-records
>   "Read the data from the given reader as a list of strings, where
> each string is made up of multiple lines, separated by // on it's own
> line."
>   [reader]
>   (->> (line-seq reader)
>(partition-by #{["//"]})
>(filter (comp not #{["//"]}))
>(map (partial clojure.string/join "\n"
>
>

-- 
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.java.jdbc 0.2.3 available on Maven Central

2012-06-22 Thread Niels van Klaveren
I also can't help but think this is overlapping with ClojureQL/Korma. Korma 
also isn't that far from the 'metal' this library is shooting for. The 
biggest problem with SQL is that it isn't functionally composeable. 
Otherwise why use a DSL instead of SQL itself ? It seems a pretty 
well-designed DSL for working with relational databases :) Judging from the 
design of the clojure.java.jdbc query support one would need solid SQL 
knowledge to begin with.

On the one hand, another library of very limited scope wouldn't hurt. But 
on the other hand, both Korma and ClojureQL could use a bit of a boost. 
Korma could really use a function like SQL Alchemy's autoload to work with 
existing databases. That should be doable with better JDBC metadata based 
functions, which I think would be an appropriate match for 
clojure.java.jdbc. Such a library could be used in a Korma spin-off library 
to auto-generate Korma 'entities'. 'Insta-korma' anyone ?

ClojureQL had the nice idea to elevate itself above SQL. That makes it seem 
a bit more 'alien' than Korma or your initiative. The queries generated 
don't seem very efficient compared to the scope (advanced database use) one 
would use it to generate queries for. Also, development on it seems to be 
dwindling.
 
I was thinking if an SQL generation DSL / library could be based on 
core.logic ? Defining 'facts' a bit like Korma's entities (which could also 
be derived from JDBC metadata), a set of SQL dialect 'facts', and a set of 
base SQL facts and goals, with the programmer adding goals through a DSL to 
generate the desired SQL queries ? I found something like that has been 
done in 
Prolog,
 but as far as I found that's the only one.

Clojure could really use a great 'conventional' relational database stack 
like Python has in SQL Alchemy. A lot of the bases have been covered by 
Java and clojure.java.jdbc. Our web stack is built on small libraries 
building on eachother's strengths, could we do the same here ?

On Friday, June 22, 2012 9:09:22 PM UTC+2, Sean Corfield wrote:
>
> On Fri, Jun 22, 2012 at 1:50 AM, Vinzent  wrote: 
> > Ok, I see. I've misunderstood the goals. Though, it still duplicates 
> > significant part of clojureql\korma, right? 
>
> Hmm, I wouldn't say a "significant" part. I think jsql covers a very 
> small space. To satisfy the basic goal for the new c.j.jdbc API, it 
> only really needs the insert/update/delete functions and folks could 
> use SQL for all other queries - but basic select/where is useful 
> enough that I think it's worth adding (to be able to use a map for a 
> simple query). 
>
> > What do you think about AST\compiler thing? 
>
> I'd love to see some examples of what Kevin / you have in mind here. 
> Feel free to edit http://dev.clojure.org/display/design/java.jdbc to 
> add some examples / thinking around AST. 
> -- 
> 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: How to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread Walter Tetzner

>
> Is there any way to make it lazy to avoid the dreaded outOfMemoryError ? 
> Or is it already lazy and I'm not seeing it / working with it properly?
>

It's already lazy. If you are experiencing an outOfMemoryError, make sure 
you're not holding on to the head of the list.

line-seq, partition-by, filter, and map all return lazy sequences.

-Walter

On Friday, June 22, 2012 6:33:58 PM UTC-4, Joseph Guhlin wrote:
>
> Awesome, thank you so much.
>
> Is there any way to make it lazy to avoid the dreaded outOfMemoryError ? 
> Or is it already lazy and I'm not seeing it / working with it properly?
>
> Best,
> --Joseph
>
> On Friday, June 22, 2012 7:30:28 AM UTC-5, Walter Tetzner wrote:
>>
>>
>>
>> On Friday, June 22, 2012 8:28:02 AM UTC-4, Walter Tetzner wrote:
>>>
>>>
>>> (defn read-records
>>>   "Read the data from the given reader as a list of strings, where
>>> each string is made up of multiple lines, separated by // on it's own
>>> line."
>>>   [reader]
>>>   (->> (line-seq reader)
>>>(partition-by #{["//"]})
>>>(filter (comp not #{["//"]}))
>>>(map (partial apply str
>>>
>>  
>> Actually, you want the new lines:
>>
>> (defn read-records
>>   "Read the data from the given reader as a list of strings, where
>> each string is made up of multiple lines, separated by // on it's own
>> line."
>>   [reader]
>>   (->> (line-seq reader)
>>(partition-by #{["//"]})
>>(filter (comp not #{["//"]}))
>>(map (partial clojure.string/join "\n"
>>
>>

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

error in clojurescript compilation

2012-06-22 Thread Murtaza Husain
Hi,

I was hacking away happily with my clojurescript, when suddenly this error 
seems to crop up - 

java.lang.IllegalArgumentException: Parameter declaration clojure.core/let 
should be a vector
core.clj:6567 clojure.core/assert-valid-fdecl
 core.clj:220 clojure.core/sigs

I have tried commenting all bits of code, restarted the server etc . I 
am using cljsbuild 0.2.1 for comiplation.

Thanks,
Murtaza

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-22 Thread Qiu Xiafei
p.s. I think idea + la enclosure works quite wellwhy beginners are
always introduced to emacs solution?

On Sat, Jun 23, 2012 at 4:45 AM, fenton  wrote:

> Hi Brad, I've updated my doc with your questions.  Here is how I responded
> to your particular queries.  Note the answer may not be correct as I'm a
> clojure newbie myself.
>
> -
>
> Leiningen is a build tool like maven for java, or rake (i think) for
> ruby.  You can use it to publish your jar into maven repositories for
> example.
>
> Slime is a protocol that lets you communicate from emacs to a
> listening server.  In clojure, we start a swank server, which is the
> clojure REPL process, and connect to it from emacs, speaking 'slime'.
> The net effect is that we can have a REPL inside our emacs editor.
>
> -
>
>
> On Thursday, June 21, 2012 5:58:23 PM UTC-7, brad bowman wrote:
>>
>> On Thursday, June 21, 2012 12:58:19 PM UTC+10, John Gabriele wrote:
>>>
>>> On Jun 18, 10:23 pm, Chris Zheng  wrote:
>>> > {snip}
>>> > So basically, if a 'lead clojure evangelist' can either 'officially'
>>> or
>>> > 'unofficially' recommend ONE emacs setup, along with a bunch of
>>> > videos/tutorials that demonstrate how to code and how fast it is to
>>> design
>>> > and code using the repl. Then that be enough to get people at least
>>> > interested.
>>>
>>> People are very opinionated about their editor/IDE. I think the Getting
>>> +Started docs are good --- they separate:
>>>
>>>   * if you want just Emacs plus the repl, here you go (clojure-mode
>>> readme)
>>>   * if you want Emacs + inferior-lisp, do this (this doc needs work)
>>>   * if you want Emacs + swank/slime, do this (swank-clojure readme)
>>>
>>> and of course also info on Eclipse, Clooj, and other editors/ide's as
>>> well.
>>>
>>
>> I'm right at the start of this process, completely unfamiliar with
>> Clojure,
>> Leiningen, Emacs, Java and all of the projects with cute names.
>> I don't even know what I want.
>>
>> I've cut and pasted various git-clone and lein commands, but have no idea
>> about the bigger picture.  I'm happy to dawdle along on my own, but if my
>> current (and hopefully temporary) ignorance can provide feedback on a
>> start-up guide then let me know.
>>
>> At present I'm often wondering "what is this thing? why do I want it?".
>> Slime for example.  I don't especially want answers here, but something
>> like
>> a glossary for the clojure ecosystem would be handy (not that I've looked
>> hard).
>>
>> Another document that might useful is a platform Rosetta stone
>> matching clojure tools and libraries to those that fill a similar role in
>> other
>> languages (Java and Ruby for starters).  This is more of a "nice to have".
>>
>> Thanks,
>>
>> Brad
>>
>  --
> 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