Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-15 Thread Max Penet

Yes, your example looks ok. 

About performance of reify vs proxy, http://clojure.org/datatypes explains 
this better than I could: 


The method bodies of reify are lexical closures, and can refer to the 
 surrounding local scope. *reify* differs from *proxy* in that:


- Only protocols or interfaces are supported, no concrete superclass.
- The method bodies are true methods of the resulting class, not 
external fns.
- Invocation of methods on the instance is direct, not using map 
lookup.
- No support for dynamic swapping of methods in the method map.


 The result is better performance than proxy, both in construction and 
 invocation. *reify* is preferable to proxy in all cases where its 
 constraints are not prohibitive.



 - Max

On Thursday, February 14, 2013 8:08:37 PM UTC+1, Joachim De Beule wrote:


 Thanks for the tip Max, so you mean like this?

 (defn cases-event-stream [cases features-extractor labeler]
   (let [remaining (atom cases)]
 (reify opennlp.model.EventStream
   (next [this] (let [current (first @remaining)]
  (swap! remaining rest)
  (case-event current features-extractor labeler)))
   (hasNext [this] (not (empty? @remaining))

 May I ask why that would be faster? And when proxy is preferred over reify?

 Joachim.

 2013/2/14 Max Penet m...@qbits.cc javascript:


 Also It looks like you could use reify instead of proxy here, it would 
 improve performance. 

 http://clojuredocs.org/clojure_core/clojure.core/reify

 - Max


 On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote:

 Without testing or anything that looks reasonable enough. I'm sure that 
 there are plenty caveats around infinite seqs, etc. though.


 On 14 February 2013 14:22, Joachim De Beule joachim@gmail.comwrote:

 Thanks! So you mean like this (assuming some function elt-event):

 (defn seq-event-stream [input-seq]
   (let [remaining (atom input-seq)]
 (proxy [EventStream] []
   (next [] (let [current (first @remaining)]
 (swap! remaining rest)
 (elt-event current)))
   (hasNext [] (not (empty? @remaining))



 2013/2/14 Ulises ulises@gmail.com

 How about having your methods access an atom provided in a closure 
 like it's done here: http://kotka.de/blog/**2010/03/proxy_gen-class_**
 little_brother.htmlhttp://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html

 U


 On 14 February 2013 13:58, Joachim De Beule joachim@gmail.comwrote:

 Hi All,

 I want to turn a clojure sequence into an 'EventStream' java 
 interface in clojure (see http://opennlp.apache.**
 org/documentation/1.5.2-**incubating/apidocs/opennlp-**
 maxent/index.htmlhttp://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html).
  
 Basically this is an object that implements next() and hasNext() methods.

 I know this can be done with proxy:

 (proxy [EventStream] []
(hasNext [] ...)
(next [] (Event. ...) ...))

 What I am not sure about is how to deal with state. More precisely, 
 the object returned by the above call to proxy obviously must somehow 
 keep 
 a pointer to the current position in the input sequence and increment 
 the 
 index after a call to next() etc.

 Any ideas on how to best do something like this?

 Thanks a lot!
 Joachim. 


 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@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+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, 
 send an email to clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .
  
  


  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@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+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .
  
  


  -- 
 -- 
 

Re: Why is this so difficult?

2013-02-15 Thread ybaumes
Do you know LispBox http://www.gigamonkeys.com/lispbox/? We need a 
ClojureBox.

Le vendredi 15 février 2013 03:56:59 UTC+1, Jules a écrit :

 vemv, here is a file describing my Clojure install experience: 
 https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp

 How should I continue? And where would a beginner find that information?

 Hopefully this is taken in good humor, this is meant as an illustration 
 from a beginners' point of view, because undoubtedly the stupidity of a 
 beginner (i.e. me) is greater than any expert can imagine. Keep in mind 
 that once you know how to do something, doing it is easy. Driving to work 
 is easy, but if you are in a new city then driving from point A to point B 
 is hard if you don't know the way. The problem is the multitude of ways you 
 can go wrong. The ideal experience would be a big download Clojure starter 
 kit right on the clojure.org homepage, that would install leiningen, and 
 an IDE with leiningen integration, and display a quick guide how to set up 
 a project and run it.

 Jules

 On Friday, February 15, 2013 12:34:26 AM UTC+1, vemv wrote:

 If this does not work for you, you can help everyone by opening an issue 
 at the Leiningen bug tracker:

 Make sure java and curl are correctly installed
 Run the corresponding (unix or Windows) lein install script
 Now you should be able to run lein repl, lein new, etc

 On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote:

 Sure, but you have assumed that you have a perfectly working clojure 
 environment set up. *That* is the hard part.

 On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote:

 I never tried out core.logic. This is how I just got it installed in 
 less than a minute. Really no magic here:

 lein new foo; cd foo
 # google core.logic, grab the dependencies vector 
 ([org.clojure/core.logic 
 0.7.5]), attach it to your project.clj
 lein repl

 (use 'clojure.core.logic)(run* [q]
   (== q true))  


 Same principle for practically every single Clojure lib.

 On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote:

 You are certainly not alone. Learning the language and concepts is 
 very easy for me, but the sysadmin stuff to get set up is so much harder. 
 Believe it or not, I had much more trouble with installing core.logic 
 than 
 understanding it. It doesn't end either, you bump into more problems once 
 you try to do something interesting. Just try e.g. to call the LLVM C api 
 from Clojure, I have not succeeded to this day (was trying to implement a 
 LLVM backend for Clojurescript). You have the same problem with many open 
 source projects, they are simply not focused on user friendliness, it's 
 certainly not a Clojure specific problem. If you are on Windows the 
 problems are 10x worse. Compare this with e.g. Visual Studio. You install 
 it, and everything just works. Package manager, calling C functions, 
 powerful GUI libraries, IDE with debugger, syntax highlighting, 
 autocomplete, etc. From the first minute on you are programming rather 
 than 
 sysadmining. I wish we had the same experience for Clojure.

 On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote:

 Having studied Lisp decades ago I like the look of Clojure a lot. But 
 as a complete newbie when it comes to modern software development, I'm 
 exasperated by what strikes me as a very difficult and primitive set of 
 tools to get started. I keep seeing Leinigen, Leinigen, and the 
 Leinigen 
 homepage boasts that Leinigen offers the easiest way to get started 
 with 
 Clojure, but this simply isn't true. The easiest way to get started 
 with 
 Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found 
 that I'd probably have given up by now. 

 What got me back into programming recently was a Lua-based 
 development environment for Android called Gideros. Lua seems popular 
 for 
 developing apps for some reason. (Cf Corona, Moia, Unity). It seems like 
 quite a neat language, though I'd like to use something more Lisp-like. 
 Maybe the tools are just too difficult for me at the moment, though I'll 
 persevere for a bit. I'd like to achieve some simple graphics on an 
 Android 
 device at least. I've come across some tutorials for CLojure and jMonkey 
 and I'm wondering to dive into that, though I'm still unsure whether 
 OpenGL 
 is the way to go for simple 2D stuff...



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: Pretty-printing `lein test`s output?

2013-02-15 Thread Víctor M . V .
I just tried out both lein-difftest and gui-diff and they work just great.
I'd love a `lein test` command that defaulted to the former and could
resort to the latter when things got hairy. But that's just wishful
thinking at the moment :)

Thanks you Sean for the advice as well - the workflow you describe sounds
damn good. Now I'm not sure if I want lein or emacs to drive my tests.
Perhaps a best-of-both-worlds approach is possible.

On Fri, Feb 15, 2013 at 7:11 AM, Sean Corfield seancorfi...@gmail.comwrote:

 You'll find your workflow greatly improved by using nrepl (or
 slime/swank) and running tests directly from Emacs - and that applies
 whether you're using bare clojure.test, midje or expectations.

 I use expectations for testing and expectations-mode in Emacs. I can
 run an individual namespace's tests with C-c , and it shows the pass /
 fail summary in the minibuffer and highlights any failing tests in
 orange or red (depending on how they failed). It also shows the
 pass/fail summary in the repl buffer. Pretty sure there are equivalent
 modes for both clojure.test and midje.

 On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote:
  First of all, I must say I'm new to testing in Clojure. My current
 workflow
  is pretty simple:
 
  * Edit + save the tests (which use clojure.test - I hear Midje is better
  though) in emacs
  * Run `lein test` in the terminal
  * recur
 
  But then the printed values (triggered when e.g. an `are` case fails) are
  fairly illegible, especially when big.
 
  Can I get the test runner to pprint its output? Is my workflow improvable
  anyway?
 
  Thanks - Victor
 
  --
  --
  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 unsubscribe from this group and stop receiving emails from it, send an
  email to clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 



 --
 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
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Sven Johansson
On Fri, Feb 15, 2013 at 9:12 AM, ybau...@gmail.com wrote:

 Do you know LispBox http://www.gigamonkeys.com/lispbox/? We need a
 ClojureBox.


There is, or perhaps was, a ClojureBox. Although it seems to have been
aimed
specifically at Windows. Last update seems to have been about a year ago.

https://github.com/devinus/clojure-box

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




how to understand differences in results for nrepl.el interrupt evaluation (C-c C-b)?

2013-02-15 Thread George Oliver
hi, I am experimenting at the repl with a while form. For now I just write 
it as (while true ...) and interrupt it with C-c C-b. This is for a basic 
socket server. 

Recently I noticed a difference in how C-c C-b behaves that I don't 
understand. Normally when I interrupt, the repl returns immediately to the 
prompt, regardless of the client state. However if I swap one function for 
another, when I interrupt the repl doesn't return to the prompt until I 
initiate some action on the client end -- say, close the connection on the 
client end, or if all connections are closed, try to open a new connection. 

Is there a rule of thumb for under what conditions the repl will return to 
the prompt on an interrupt?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread BJG145
(Loads of great advice and information, here, thanks. I don't know anything 
about build managers so I think my next step will be to pick up a book on 
Maven to get the background...)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread BJG145


(Loads of great advice and information here, thanks! I don't know anything 
about build managers so I think my next step will be to pick up a book on 
Maven to get the background...)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
While it's perfectly useful and valuable to learn Maven, you need not to
dive into it for most purposes in the Clojure world - Leiningen effectively
abstracts its complexities and rigidities (which, I hear, are many).

On Fri, Feb 15, 2013 at 10:17 AM, BJG145 benmagicf...@gmail.com wrote:

 (Loads of great advice and information here, thanks! I don't know anything
 about build managers so I think my next step will be to pick up a book on
 Maven to get the background...)

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Angel Java Lopez
Hi people!

Sean, thanks for your landscape description of Clojure world. I'm a lurker
in this list, since +-2009. In the past year, I was showing Clojure in
programmer talks, using my Windows machine, and I have no major problem,
using plain command line with clojure jar, and then, lein. I don't use
Clojure for serious work, yet.

But I want to add something:

- The machine distribution you describe, is approximately equal to I found
when I talk about Node.js (again, using my Windows machine).
- But the node.js world, has a simple install for Linux, Mac/OS, and
Windows.
- There is few friction in Windows world for Node.js (at least, for
development). Even native modules can be downloaded and compiled
automatically at local environment.
- NPM (node package manager) is a beautiful tool. Maybe, the best package
manager I met.

After my Node.js experience, I expect the same out-of-the-box development
experience. I'm a bit oldie: I want to program, not struggle with config
mess.

Again, I had no problem with clojure experience. But I only play with it. I
put my Node.js experience as an example of multiplaform dev experience.
Maybe, current Clojure status is the same.

Angel Java Lopez
@ajlopez
gh:ajlopez

On Fri, Feb 15, 2013 at 1:01 AM, Sean Corfield seancorfi...@gmail.comwrote:

 On Thu, Feb 14, 2013 at 6:56 PM, Jules julesjac...@gmail.com wrote:
  vemv, here is a file describing my Clojure install experience:
  https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp
 
  How should I continue? And where would a beginner find that information?

 The problem is the Clojure world, for the most part, is all Mac and
 Linux - Windows is very much a second class citizen that very few
 Clojurians use at all. I surveyed the Bay Area Clojure Meetup members.
 53 responded. Just 3 of them said they used Windows. Go to a Clojure
 conference and it'll be mostly Macs and almost all of the rest will be
 running Linux.

 That means all the tools, all the instructions, all the thinking, is
 focused on the command line and comes from a world where developers
 know that installed software has to go on your path, which usually
 means editing a dot file in your home directory, updating the PATH
 variable and sourcing the dot file to pick up the changes. It also
 means that the primary Clojure website is aimed at those kind of
 developers and, more specifically, aimed at experienced developers on
 those platforms who can pick thru the minimalist information and
 variety of links scattered everywhere. The fact is: clojure.org is NOT
 beginner friendly :(

 Leiningen - the primary build tool - is a shell script. Clojure is a
 library - a JAR file - and using Clojure relies (under the hood) on a
 local Maven repository and then declaring and fetching dependencies
 from various known repositories. Leiningen makes all that much simpler
 than the raw tools. But it doesn't make it as simple as most Windows
 users expect.

 Having set up a dozen or so Clojure development environments on a
 variety of Mac, Linux and Windows, here's what I recommend for
 Windows:

 * Start with GOW - Gnu on Windows - so that you have the basic Linux
 toolset that is so familiar to most Clojurians:
 https://github.com/bmatzelle/gow/downloads
 * It installs curl and wget (and a bunch of other very useful stuff)
 and adds it to your path directly! Read more here:
 https://github.com/bmatzelle/gow/wiki
 * Download the Leiningen Windows batch file. I put mine in C:\LEIN and
 then added C:\LEIN to my Path environment variable (in the system
 environment variables)
 * Start a new cmd shell window (or Powershell if you're that way
 inclined) and type: lein self-install

 At least at this point you can create new Clojure projects, edit
 project.clj with your favorite editor to add dependencies, and use
 lein repl in a cmd shell to experiment with those libraries.

 As others have said, try Clooj if you really have no idea about the
 command line or the Java ecosystem. Try LightTable once you've
 installed Leiningen and created a project to play with.

 If you're a Java developer on Windows, you're probably using Eclipse
 or IntelliJ so install the Clojure plugin and use that.

 If you're brave, try Emacs - that's what most Clojurians use and it
 really does have the most integrated overall workflow, especially with
 a built-in shell, IRC client and various other goodies.
 --
 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 

Help on drafting a protocol for realtime communication between client and ring server

2013-02-15 Thread Feng Shen
Hi,  I am trying to draft a protocol for realtime communication between 
client and ring server. 

http-kit http://http-kit.org/ try to implement the protocol,  provide a 
fast  scalable ring adapter with websocket  async extension for Clojure 
web developers.

Here is an initial version, any thought/comment/suggestion welcome. 

(defprotocol Channel
  Asynchronous channel for HTTP streaming/long polling  websocekt
  (open? [] Tells whether or not this channel is still open)
  (close []
Closes this channel. If this channel is already closed then invoking 
this method has no effect. Any further attempt to invoke I/O operations is 
welcomed by IllegalStateException)
  (send! [data  [close-after-send]]
Send data to client. Weclomed by IllegalStateException if already closed   
  If `close-after-send` is true, `close` get called after sent. For 
Webocket, a text frame is sent to client. For streaming: 1. First call 
of send!, data expect to be {:headers _ :status _ :body _} or just body.
if `close-after-send` is true, a normal HTTP response is assembled and sent to 
client,useful for HTTP client that does not support chunked 
encoding(like ab). Otherwise, achunked encoding response is assembled, 
`close` signals end this response. 2. Any further call, only body(String, 
File, InputStream, ISeq) is expected.The data is encoded as chunk, sent 
to client)
  (on-send [callback]
Callback: (fn [data]) Do something with the data (like JSON encoding) 
before sending it off)
  (on-mesg [callback]
Callback: (fn [message-string]) Set the handler to get notified when 
there is message from client. Only valid for websocket. For streaming, 
another HTTP connection can be used to emulate the behaviour)
  (on-close [callback]
Callback: (fn [status]) Set the handler to get notified when channel 
get closed, by client `close` called. Callback is called once if server and 
client both close the channel Useful for clean up. Status code: 0 if 
closed by sever, closed by client: -1 if streaming, websocket: 
http://tools.ietf.org/html/rfc6455#section-7.4.1;))

Thanks.
Feng

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Sven Johansson
On Fri, Feb 15, 2013 at 10:32 AM, Víctor M. V. v...@vemv.net wrote:

 While it's perfectly useful and valuable to learn Maven, you need not to
 dive into it for most purposes in the Clojure world - Leiningen effectively
 abstracts its complexities and rigidities (which, I hear, are many).


+1. Maven is a big, hairy and scary beast. Picking up a book on it for the
purposes of learning enough of the build framework/manager framework basics
to work with Leiningen might turn you away rather than enlighten you.

Tools like these are so common across all development stacks/languages
these days, that surely there must be a guide somewhere out there that
teaches the basics without assuming that the reader is already familiar
with Maven, Ivy, sbt, npm and/or whatnot.

If not, I guess it shouldn't be that much work to improve existing docs and
spend a couple of paragraphs to explain what's obvious to the already
experienced.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help on drafting a protocol for realtime communication between client and ring server

2013-02-15 Thread Feng Shen
Opps, this post is intended to be posted on the Ring group, sorry for 
the noise. 


On Friday, February 15, 2013 5:50:15 PM UTC+8, Feng Shen wrote:

 Hi,  I am trying to draft a protocol for realtime communication between 
 client and ring server. 

 http-kit http://http-kit.org/ try to implement the protocol,  provide a 
 fast  scalable ring adapter with websocket  async extension for Clojure 
 web developers.

 Here is an initial version, any thought/comment/suggestion welcome. 

 (defprotocol Channel
   Asynchronous channel for HTTP streaming/long polling  websocekt
   (open? [] Tells whether or not this channel is still open)
   (close []
 Closes this channel. If this channel is already closed then invoking 
 this method has no effect. Any further attempt to invoke I/O operations 
 is welcomed by IllegalStateException)
   (send! [data  [close-after-send]]
 Send data to client. Weclomed by IllegalStateException if already closed 
 If `close-after-send` is true, `close` get called after sent. For 
 Webocket, a text frame is sent to client. For streaming: 1. First 
 call of send!, data expect to be {:headers _ :status _ :body _} or just body. 
if `close-after-send` is true, a normal HTTP response is assembled and 
 sent to client,useful for HTTP client that does not support chunked 
 encoding(like ab). Otherwise, achunked encoding response is 
 assembled, `close` signals end this response. 2. Any further call, only 
 body(String, File, InputStream, ISeq) is expected.The data is encoded 
 as chunk, sent to client)
   (on-send [callback]
 Callback: (fn [data]) Do something with the data (like JSON 
 encoding) before sending it off)
   (on-mesg [callback]
 Callback: (fn [message-string]) Set the handler to get notified when 
 there is message from client. Only valid for websocket. For streaming,
  another HTTP connection can be used to emulate the behaviour)
   (on-close [callback]
 Callback: (fn [status]) Set the handler to get notified when channel 
 get closed, by client `close` called. Callback is called once if server 
 and client both close the channel Useful for clean up. Status code: 0 
 if closed by sever, closed by client: -1 if streaming, websocket: 
 http://tools.ietf.org/html/rfc6455#section-7.4.1;))

 Thanks.
 Feng


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to bind an Aleph TCP server to a TCP v4 port?

2013-02-15 Thread peter.courc...@googlemail.com


Hi Jorge,

I'm not sure if this is what you need but, you could try starting the jvm with

|-Djava.net.preferIPv4Stack=true

Regards,

Peter


On Thursday, 14 February 2013 23:06:24 UTC, Jorge Luis Pérez wrote:

 I started to learn Clojure a couple of days ago. I was trying with some 
 Aleph TCP echo server examples but I can not get the server to bind to a 
 tcp v4 port. The server only binds to a tcp v6 port by default. 

 Here my project file: 

 (defproject clj-echo-server 0.1.0-SNAPSHOT
   :description Echo server with Aleph
   :url http://example.com/FIXME;
   :license {:name Eclipse Public License
   :url http://www.eclipse.org/legal/epl-v10.html}
   :dependencies [[org.clojure/clojure 1.4.0]
  [aleph 0.3.0-beta12]]
   :main clj-echo-server.core)

 And the server code:

 (ns clj-echo-server.core)
 (use 'lamina.core 'aleph.tcp 'gloss.core)
 (defn handler [ch client-info]
   (receive-all ch
 #(enqueue ch (str You said  %
 (start-tcp-server
   handler
   {:port 9000, :frame (string :utf-8 :delimiters [\r\n])})


 I can't figure out if I'm doing something wrong or how to configure the 
 binding port, the documentation wasn't very helpful about tcp ports.

 My OS is an Ubuntu 12.04.2 LTS, the Leiningen version is 2.0.0-preview10 
 and all runs on Java 1.6.0_24 OpenJDK 64-Bit Server VM.

 Can anyone advise me on how to configure the port binding for the tcp 
 server?

 Thanks for your time.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ClojureScript atom behavior

2013-02-15 Thread Alexander Solovyov
Hi,

I use atoms as a data storage in my application right now and add-watch to
propagate data changes to DOM.

And right now I noticed strange behavior - sometimes new-state is different
from dereferenced atom (coming as a parameter to a function right now). And
it's not just different, it is different in an unexpected way (such that it
shouldn't have happened at all). This causes a breakage in my code.

I'm not sure if it's intended to be like that or is it a bug right now.

I'll try to extract a case from my code, but meanwhile if anybody thinks it
shouldn't be so, can check my code/project here:

http://github.com/piranha/pairword

Simple make runs lein autocompiler and then you can open
'build/index.html', enter anything in input field and click 'Add player'.
This should work but then console shows various output and at some point it
says 'update NOT expected'.

You can edit there to make it fail:

https://github.com/piranha/pairword/blob/master/src/pairwords/templates.cljs#L59

I'm sorry for such a description, I'll still try to extract the thing in
smaller amount of code, but I'm failing right now.

If somebody can explain what's wrong here I'll be really grateful.

-- 
Alexander

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Bob Hutchison

On 2013-02-15, at 4:16 AM, BJG145 benmagicf...@gmail.com wrote:

 I don't know anything about build managers so I think my next step will be to 
 pick up a book on Maven to get the background…)

Don't. Just don't. All you really need to know about maven, and it's role, is 
what you can get from wikipedia. Seriously. Then click around on related 
articles. If you need more than that then lein will have failed (miserably) -- 
but my experience with lein is pretty good. When you know that lein cannot do 
what you need (which may well be never) then it'll be time to look into maven.

http://en.wikipedia.org/wiki/Build_automation
http://en.wikipedia.org/wiki/Apache_Maven

The trick is to get lein installed the first time. This might take a bit of 
work if you haven't already got a machine setup for command line based 
development. (That's important by the way: *command line* -- even if you intend 
to always use IntelliJ or some other IDE)

I completely sympathize with your situation. I've seen this a lot, and 
experienced it myself when starting from a fresh machine. It's very difficult 
to give instructions because of the wildly differing starting points.

Good luck, but you'll get there :-)

Cheers,
Bob

 
 -- 
 -- 
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Looping and accumulation

2013-02-15 Thread Jonathon McKitrick
On Thursday, February 14, 2013 7:44:18 PM UTC-5, Stephen Compall wrote:

 On Feb 14, 2013 6:11 PM, Jonathon McKitrick 
 jmcki...@gmail.comjavascript: 
 wrote:
  I have a loop over a function that is accumulating a list of database 
 keys for later use.  But it is primarily doing other processing and 
 returning a collection of processed/filtered records.

 As you come from Common Lisp, where all standard library sequences are 
 strict, I think it will be more interesting for you to write a version of 
 your function that can work on infinite lists of records.

 The point is laziness, not that the function will ever receive an infinite 
 seq, but this is a good way to think about it.  Consider that several 
 library functions, like map, filter, iterate, and take-while are all 
 lazy-friendly.


I think that's my biggest challenge so far: thinking in terms of lazy 
sequences, and especially generating my own.  I'm so used to just building 
a list and traversing it 

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
Sean, Thanks a lot, I'll try that method later. I have succeeded in 
installing leiningen, and indeed just running it from the command line and 
using emacs as an editor is the most user friendly way I've seen (other 
things like lighttable and ccw didn't work for me -- most likely i did 
something stupid). But most windows users aren't familiar with emacs.

vevm, it's true that you don't want to explain what the PATH is for every 
open source project, but you don't have to. The Ruby and Python installers 
put everything on the path for you. Windows users expect this, they don't 
want to play shell script and do everything manually what is in essence 
following a bunch of steps which you have to hunt down over various places 
on the internet and could have been an automated script, even if they do 
know what the path is (and most programmers on windows will know that).

Note also that the hypothetical beginner has not figured out yet that 
lein.bat is in fact leiningen. He thinks that that is just the install 
script (since this is not made clear on the leiningen site), and he thinks 
the installation has failed. It is not made clear that lein.bat *is* the 
program you want to run, and that you want to put it on your path as well. 
I have still personally not succeeded in setting up an IDE with leiningen 
integration on Windows...which resulted in me dropping Clojure for serious 
work in favor of F# (I still play with it occasionally on linux). I am very 
sure that I'm far from the only one. It's a pity that people miss out on 
such beautiful software for such a trivial reason.

Another problem, also seen in this thread, is that there are too many 
options and no consensus on what's the best way to get started. At least no 
consensus that a beginner can easily figure out. Maven? Leiningen? Just the 
clojure jar? CCW? IntelliJ? Clooj? Emacs? Lighttable? You really don't want 
a beginner to get the impression that he has to spend a couple of months 
learning maven with a book, before he can do serious clojure, like almost 
happened here.

Blaming the newbies by saying you better practice the skill of figuring 
out things is a bit unfair I think. Plenty of other projects do manage to 
be user friendly. Python: you download the installer, install it, and voila 
you have everything you need, including an editor. Packages generally come 
with their own installer. With Ruby you also get the language, an editor 
and a package manager. With F# you even get an extremely good IDE. All of 
these I was able to install in less than 5 minutes of my time. With Clojure 
I have spend at least 20 hours with installation woes. The way I view it, 
learning the magic incantations to get a specific tool working is not 
useful knowledge. People would rather fill their brain with the cool stuff: 
how reducers, lambda, macros, core.logic work, etc.

Jules

On Friday, February 15, 2013 8:29:25 AM UTC+1, vemv wrote:

 Well the first thing you assume is that project pages should be giant 
 download buttons, and therefore the exposed content in those pages is not 
 worth reading/understanding. For instance you can find the answer to the 
 question posed in the slide 19 in slide 7.

 Just imagine if every single open source project had to explain what the 
 PATH is, how to install curl, and so on.

 You (and me) will be constantly a newbie at something, and the getting 
 started guide (if any) will be almost invariably incomplete. So you better 
 practice the skill of figuring out things.

 That said, the wording in lein's installation instructions for Windows is 
 improvable - it should acknowledge the fact that working with the Windows 
 mindset can pretty much equal clicking till it works. In particular it 
 should leave clear that you *want* curl installed even if it isn't:

 On Windows most users can get the batch file. If you have wget.exe or 
 curl.exe already installed and in PATH, you can just run lein self-install, 
 *otherwise* get the standalone jar from the downloads page. If you have 
 Cygwin you should be able to use the shell script above rather than the 
 batch file.


 Emphasis mine. 

 On Fri, Feb 15, 2013 at 3:56 AM, Jules jules...@gmail.com 
 javascript:wrote:

 vemv, here is a file describing my Clojure install experience: 
 https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp

 How should I continue? And where would a beginner find that information?

 Hopefully this is taken in good humor, this is meant as an illustration 
 from a beginners' point of view, because undoubtedly the stupidity of a 
 beginner (i.e. me) is greater than any expert can imagine. Keep in mind 
 that once you know how to do something, doing it is easy. Driving to work 
 is easy, but if you are in a new city then driving from point A to point B 
 is hard if you don't know the way. The problem is the multitude of ways you 
 can go wrong. The ideal experience would be a big download Clojure starter 
 kit right on the clojure.org 

Forcing evaluation of args to a macro?

2013-02-15 Thread Jason Lewis
Hey, Clojure n00b here... I'm working with a macro that expects a vector
and iterates over the contents with a `for` form. I had naively assumed
that it would work equally well to pass it a var containing the vector, but
instead it tries to iterate over the individual symbol and the output is
munged.

I also tried passing the fn call that I was using to build the vector, with
no better results. Is there any way to force evaluation so the macro 'sees'
the vector it expects instead of trying to work on the symbol or form that
I pass it?

Thanks,

Jason Lewis

Email  jasonlewi...@gmail.com

Twitter@canweriotnow http://twitter.com/canweriotnow

Blog   http://decomplecting.org

About http://about.me/jason.lewis

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Forcing evaluation of args to a macro?

2013-02-15 Thread AtKaaZ
Hi.
It would maybe help if you'd post some test code (deftest for the macro?),
if not also that macro that you have so far.

But, if you want to force evaluation you could maybe use *eval* but this
may not need apply in your case,
ie. maybe you want this:
= (def a '(1 3 9))
#'runtime.q/a
= a
(1 3 9)
= *(var-get #'a)*
(1 3 9)
= (var? #'a)
true
= (= a (var-get #'a))
true




On Fri, Feb 15, 2013 at 1:44 PM, Jason Lewis jasonlewi...@gmail.com wrote:

 Hey, Clojure n00b here... I'm working with a macro that expects a vector
 and iterates over the contents with a `for` form. I had naively assumed
 that it would work equally well to pass it a var containing the vector, but
 instead it tries to iterate over the individual symbol and the output is
 munged.

 I also tried passing the fn call that I was using to build the vector,
 with no better results. Is there any way to force evaluation so the macro
 'sees' the vector it expects instead of trying to work on the symbol or
 form that I pass it?

 Thanks,

 Jason Lewis

 Email  jasonlewi...@gmail.com

 Twitter@canweriotnow http://twitter.com/canweriotnow

 Blog   http://decomplecting.org

 About http://about.me/jason.lewis

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Please correct me if I'm wrong or incomplete,
even if you think I'll subconsciously hate it.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to set the value of a static variable in a java factory class from clojure?

2013-02-15 Thread Joachim De Beule
yes, that works. thanks!

Op donderdag 14 februari 2013 17:07:31 UTC+1 schreef Baishampayan Ghose het 
volgende:

 Haven't looked at the code, but `set!` should work. ~BG

 Sent from phone. Please excuse brevity.
 On 14 Feb 2013 21:30, Joachim De Beule joachim@gmail.comjavascript: 
 wrote:

 Hi All,


 I know how to call static java methods such as the ones defined here: 
 http://grepcode.com/file/repo1.maven.org/maven2/org.apache.opennlp/opennlp-maxent/3.0.2-incubating/opennlp/maxent/GIS.java,
  
 e.g. trainModel(...). 

 However, before I call this method I want to change the value of the 
 variable SMOOTHING_OBSERVATION (see above link section 
 #SMOOTHING_OBSERVATION).

 My problem is that I don't know how to do that from clojure?

 Thanks a lot!
 Joachim

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com javascript:
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Pretty-printing `lein test`s output?

2013-02-15 Thread Hugo Duncan
Sean Corfield seancorfi...@gmail.com writes:

 You'll find your workflow greatly improved by using nrepl (or
 slime/swank) and running tests directly from Emacs - and that applies
 whether you're using bare clojure.test, midje or expectations.

For nrepl.el, via clojure-test-mode, There is an pull request [1] to add
inspection of test failures using pretty printing.  The pull request
also adds inspection of test failures using ediff to compare actual and
expected.

[1] https://github.com/technomancy/clojure-mode/pull/139

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: protocol implementation delegating to protocol extension doesn't compile

2013-02-15 Thread Jim - FooBar();

Hi Juan,

I have to admit you're a life saver! You didn't say anything that I did 
not know but you did make a couple of observations that made me have a 
closer look on my code...For example you noticed that the protocol 
extension to String was never registered...That is the *real* problem 
hereI was trying to register two 'getDistance' with 2 and 3 args 
respectively while the protocol only defines arities 3 and 4...I don't 
really need to add an arity of 2 on the protocol - what I need to do is 
properly extend the protocol to String so that both arities are 
registered...then, it's pretty obvious that the record should be like 
this (see below - notice the ignored 2nd arg when delegating) and 
everything works as expected! :)


(defrecord LevenshteinDistance []
IDistance
(getDistance [_ s1 s2]
  (getDistance s1 _ s2))   ;;delegate to string for this
(getDistance [_ s1 s2 weight]
  (getDistance s1 _ s2 weight))) ;;delegate to string for this


The fact of the matter is that Clojure code can get so incredibly terse 
that after a while my eyes hurt! That said, i certainly prefer my eyes 
hurting than my brain hurting... ;)


thanks again for taking the time to poke around...as I said, your 
observations were spot on!


cheers,
Jim


On 15/02/13 06:38, juan.facorro wrote:

Hi Jim:

I think the problem is that you are actually calling the *getDistance 
*protocol function with only 2 arguments in the line in bold below:


(defrecord LevenshteinDistance []
  IDistance
  (getDistance [_ s1 s2]
*(getDistance s1 s2))  ;; - Calling a getDistance function with 2 args*
  (getDistance [_ s1 s2 weight]
 (getDistance s1 s2 weight)))

While in the protocol definition there's only a 3 and 4 arguments 
declarations for getDistance.


(defprotocol IDistance
  (getDistance
[this s1 s2]; 3 args
[this s1 s2 m-weight])) ; 4 args

You could add a 2 arguments override for the *getDistance* protocol 
function and it would work by calling the 2 args implementation added 
to String, which is actually never registered in the protocol and goes 
unnoticed for the reason that follows, which I myself found out while 
experimenting with your code, you can skip it if you like, I just had 
a little fun investigating some Clojure code :).


When using *extend-type*, any implementation for a protocol function 
with a number of args not present in the protocol's declaration 
doesn't seem to produce any errors or warnings (*extend* presents the 
same behavior, which makes sense since *extend-type* uses it).


(defprotocol SomeProtocol
  (some-function [this x] [this x y]))
(defrecord SomeRecord [])

(extend-type SomeRecord
  SomeProtocol
  (some-function
([_] (println 1-arg)) ; this is not declared
([_ _ _ _ _] (println 5-arg)) ; this is not declared
([_ x y]
  (some-function x y)))

However, a*CompilerException* is thrown when implementing a protocol 
using the *defrecord*macro, and declaring a non-existing override for 
the function. I looked a little bit into the code of *defrecord *and 
the reason for this seems to be that it ultimately uses *deftype* 
which actually creates a class that implements the methods for the 
Java interface that the protocol defines, the compiler checks in this 
case if there's any method with the name and arity with the supplied 
implementation, and throws an exception if it doesn't.


(defprotocol SomeProtocol
  (some-function [this x] [this x y]))

(defrecord SomeRecord []
  SomeProtocol
  (some-function [_] (println 1-arg)) ; this is not declared
  (some-function [_ x y]
(some-function x y)))

#CompilerException java.lang.IllegalArgumentException: Can't define 
method not in interfaces: some_function, compiling: (file.clj)


This seems to indicate that using extend (or extend-type) vs. deftpye 
(or defrecord) for implementing a protocol yields two different 
results, the former registers the function implementations in the 
protocol using the map supplied and the latter actually creates a 
class method for the record or type class generated.


This was not obvious at all to me and I think I even recall reading 
somewhere (can't remember exactly where and can't find it right now) 
that the defrecord inline implementation was just a convenience form 
for extend/extend-type, but is it possible that it's actually more 
performant to use the defrecord/deftpye?


Hope it helps,

Juan

On Thursday, February 14, 2013 5:16:53 PM UTC-3, Jim foo.bar wrote:

let me explain with an example:


;;in some namespace x

(defprotocol IStemmable
(stem [this token] [this token lang])
(getRoot [this token dictionary]))

(defprotocol IDistance
(getDistance [this s1 s2] [this s1 s2 m-weight]))

;;in some namespace y that refers all vars from x

(extend-type String
  IStemmable
  (stem
   ([this] (stem this english))
   ([this lang]
  (let [stemmer (help/porter-stemmer lang)]
 (doto stemmer
 

Re: Forcing evaluation of args to a macro?

2013-02-15 Thread vxm
Reader: Source code (text) - Clojure reader - Data structures (code)
Compiler: [function or special form] - bytecode, [macro] - Data 
structures (code)
Runtime: Data structures are evaluated:
  Literals - to themselves (1-1, some string - some 
string, :some-key - :some-key)
  Symbols - to a value (from a var in some namespace)
  Lists - call to a function or special form.

A call to a macro take place at compile time before the data structures 
(code) are evaluated. It is a transformation tool of data structures (code) 
to data stuctures (code) before the evaluation take place.


You are using the wrong tool for the job, 
if you want to iterate over the contents of a variable (runtime), use a 
function.

On Friday, February 15, 2013 2:44:53 PM UTC+2, Jason Lewis wrote:

 Hey, Clojure n00b here... I'm working with a macro that expects a vector 
 and iterates over the contents with a `for` form. I had naively assumed 
 that it would work equally well to pass it a var containing the vector, but 
 instead it tries to iterate over the individual symbol and the output is 
 munged.

 I also tried passing the fn call that I was using to build the vector, 
 with no better results. Is there any way to force evaluation so the macro 
 'sees' the vector it expects instead of trying to work on the symbol or 
 form that I pass it?

 Thanks,

 Jason Lewis

 Email  jasonl...@gmail.com javascript: 

 Twitter@canweriotnow http://twitter.com/canweriotnow

 Blog   http://decomplecting.org

 About http://about.me/jason.lewis
  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread BJG145
Jules sums up pretty exactly where I was at...tried CCW, nope, tried light 
Table, nope, looked at Leiningen, thought: Edit PATH? What, I haven't done 
that since I was on Windows 3.1, and what does this thing do anyway...I 
appreciate the time people have put into all the advice given above because 
I can see the subject has probably been done to death already. I'm sure 
it's not really that hard, it's just that I've been spoiled by simple 
friendly IDEs like Code::Blocks, Visual Studio, Gideros Studio, and I 
resented mucking about with Linux-on-Windows and command prompts. But, it's 
cool, I'm sure it'll be worth it...;-)

I do think the Leiningen homepage could do with a revamp...I reckon it's 
likely one of the main entry points for beginners and it needs to be 
simplified for cosseted Windows users like me.  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Laurent PETIT
Hello,

2013/2/15 BJG145 benmagicf...@gmail.com:
 Jules sums up pretty exactly where I was at...tried CCW, nope, tried light

Sorry to be a little bit off topic (or am I ?), but as one of the main
developers of CCW, I'd like to learn from this nope.

Indeed, one of the main goals of CCW is to be beginner friendly so ...
what was (were) the problem(s) ?

 Table, nope, looked at Leiningen, thought: Edit PATH? What, I haven't done
 that since I was on Windows 3.1, and what does this thing do anyway...I
 appreciate the time people have put into all the advice given above because
 I can see the subject has probably been done to death already. I'm sure it's
 not really that hard, it's just that I've been spoiled by simple friendly
 IDEs like Code::Blocks, Visual Studio, Gideros Studio, and I resented
 mucking about with Linux-on-Windows and command prompts. But, it's cool, I'm
 sure it'll be worth it...;-)

 I do think the Leiningen homepage could do with a revamp...I reckon it's
 likely one of the main entry points for beginners and it needs to be
 simplified for cosseted Windows users like me.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
Well, given that you've mentioned Ruby, I can tell you that getting real
work done (no just a installing some welcome pack) in Ruby is orders of
magnitude harder than with Clojure - and borderline impossible if using
Windows. What Lein does is divided into a dozen tools, each with its own
idiosyncrasies.

Even OSX devs (and recall that both OSX and Linux share common roots),
which tend to use the terminal a lot more than Windows devs, have a hard
time setting up Rails (and later keeping that setup in sync with the Linux
boxes where they deploy their apps).

What the story shares in common for all OSes is that you have to figure
things out. Fact of life.

You can sort of avoid that problem by using always languages and components
backed by corporations. But if you want to leverage software from the open
source community, that *implies* becoming good at troubleshooting.

Wrapping up, your current approach pretty much limits you to F# (good luck
with cathegory theory) + Visual Studio. If you acknowledge hardness (see
Rich Hickey's talk, Simple made easy), you'll be able to use those (and
at a deeper level) but also *other* technologies.

On Fri, Feb 15, 2013 at 1:02 PM, Jules julesjac...@gmail.com wrote:

 Sean, Thanks a lot, I'll try that method later. I have succeeded in
 installing leiningen, and indeed just running it from the command line and
 using emacs as an editor is the most user friendly way I've seen (other
 things like lighttable and ccw didn't work for me -- most likely i did
 something stupid). But most windows users aren't familiar with emacs.

 vevm, it's true that you don't want to explain what the PATH is for every
 open source project, but you don't have to. The Ruby and Python installers
 put everything on the path for you. Windows users expect this, they don't
 want to play shell script and do everything manually what is in essence
 following a bunch of steps which you have to hunt down over various places
 on the internet and could have been an automated script, even if they do
 know what the path is (and most programmers on windows will know that).

 Note also that the hypothetical beginner has not figured out yet that
 lein.bat is in fact leiningen. He thinks that that is just the install
 script (since this is not made clear on the leiningen site), and he thinks
 the installation has failed. It is not made clear that lein.bat *is* the
 program you want to run, and that you want to put it on your path as well.
 I have still personally not succeeded in setting up an IDE with leiningen
 integration on Windows...which resulted in me dropping Clojure for serious
 work in favor of F# (I still play with it occasionally on linux). I am very
 sure that I'm far from the only one. It's a pity that people miss out on
 such beautiful software for such a trivial reason.

 Another problem, also seen in this thread, is that there are too many
 options and no consensus on what's the best way to get started. At least no
 consensus that a beginner can easily figure out. Maven? Leiningen? Just the
 clojure jar? CCW? IntelliJ? Clooj? Emacs? Lighttable? You really don't want
 a beginner to get the impression that he has to spend a couple of months
 learning maven with a book, before he can do serious clojure, like almost
 happened here.

 Blaming the newbies by saying you better practice the skill of figuring
 out things is a bit unfair I think. Plenty of other projects do manage to
 be user friendly. Python: you download the installer, install it, and voila
 you have everything you need, including an editor. Packages generally come
 with their own installer. With Ruby you also get the language, an editor
 and a package manager. With F# you even get an extremely good IDE. All of
 these I was able to install in less than 5 minutes of my time. With Clojure
 I have spend at least 20 hours with installation woes. The way I view it,
 learning the magic incantations to get a specific tool working is not
 useful knowledge. People would rather fill their brain with the cool stuff:
 how reducers, lambda, macros, core.logic work, etc.

 Jules


 On Friday, February 15, 2013 8:29:25 AM UTC+1, vemv wrote:

 Well the first thing you assume is that project pages should be giant
 download buttons, and therefore the exposed content in those pages is not
 worth reading/understanding. For instance you can find the answer to the
 question posed in the slide 19 in slide 7.

 Just imagine if every single open source project had to explain what the
 PATH is, how to install curl, and so on.

 You (and me) will be constantly a newbie at something, and the getting
 started guide (if any) will be almost invariably incomplete. So you better
 practice the skill of figuring out things.

 That said, the wording in lein's installation instructions for Windows is
 improvable - it should acknowledge the fact that working with the Windows
 mindset can pretty much equal clicking till it works. In particular it
 should leave clear that you 

STM in Clojure vs Haskell, why no retry or orElse?

2013-02-15 Thread Tom Hall
A few months ago I reread Simon Peyton Joneses article on STM in the
Beautiful Code book and decided to try and translate it into clojures
STM

See the paper here http://research.microsoft.com/pubs/74063/beautiful.pdf

He says 'Atomic blocks as we have introduced them so far are utterly
inadequate to coordinate concurrent programs. They lack two key
facilities: blocking and choice' so I guess the implication is
Clojures STM is inferior, any thoughts?

I had to use a constraint on a ref and try/catch to get the same
effect (though I hate using exceptions for control flow it does seem
to work)

https://github.com/thattommyhall/santa-claus/blob/master/src/santa/core.clj

I think a better solution might be had using watchers, how would you do it?
Any good links explaining differences in the STMs?

Cheers,
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread BJG145
Figuring stuff out is all very well if you've got a clear, consistent, 
reliable source of information. Learning Clojure the language - get a book, 
no problem. Learning Clojure the IDE...it's a mess, loads of blogs, some 
good, some bad, a lot of outdated or abandoned stuff. 

Google Clojure and you get Clojure.org. Click Getting Started and you get 
pointed at Leningen. For a beginner, the Leiningen homepage is enough to 
send you crawling back to F#.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread MarkH
I too suggest taking a second look at CCW.  I'll never be an Emacs guy and 
current CCW should be an almost seamless setup with Lein.

On Friday, February 15, 2013 8:53:47 AM UTC-6, lpetit wrote:

 Hello, 

 2013/2/15 BJG145 benmag...@gmail.com javascript:: 
  Jules sums up pretty exactly where I was at...tried CCW, nope, tried 
 light 

 Sorry to be a little bit off topic (or am I ?), but as one of the main 
 developers of CCW, I'd like to learn from this nope. 

 Indeed, one of the main goals of CCW is to be beginner friendly so ... 
 what was (were) the problem(s) ? 

  Table, nope, looked at Leiningen, thought: Edit PATH? What, I haven't 
 done 
  that since I was on Windows 3.1, and what does this thing do anyway...I 
  appreciate the time people have put into all the advice given above 
 because 
  I can see the subject has probably been done to death already. I'm sure 
 it's 
  not really that hard, it's just that I've been spoiled by simple 
 friendly 
  IDEs like Code::Blocks, Visual Studio, Gideros Studio, and I resented 
  mucking about with Linux-on-Windows and command prompts. But, it's cool, 
 I'm 
  sure it'll be worth it...;-) 
  
  I do think the Leiningen homepage could do with a revamp...I reckon it's 
  likely one of the main entry points for beginners and it needs to be 
  simplified for cosseted Windows users like me. 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  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 unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread BJG145
Sure...(lpetit, I can't remember what threw me, I probably don't have 
Eclipse set up correctly, but I'll add a note when I've checked it out.)

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Phillip Lord

I'd agree with this. The situation is even not ideal with linux; when I
first used Clojure I was reticient to install lein by hand and only lein
1 was available for my repo. Lazy? Well, I use 4 or 5 machines
routinely, and I set them up as I go, so an quick and easy install is
important. Eventually, I relented. 

I'm a full time linux user and an Emacs junkie. But not a full-time
Clojure user; it's only one of the languages that I use regularly, so
rapid set up is important. On windows, setting up PATH and probably HOME
if you are going the Emacs route makes it worse. 

It's a concern for me. I am using Clojure to provide a DSL. To use the
DSL you do not have to use Clojure per se (or rather not be aware that
you are). But you do need a working Clojure environment. This might be
an uphill struggle. 

Phil



Jules julesjac...@gmail.com writes:
 vevm, it's true that you don't want to explain what the PATH is for every 
 open source project, but you don't have to. The Ruby and Python installers 
 put everything on the path for you. Windows users expect this, they don't 
 want to play shell script and do everything manually what is in essence 
 following a bunch of steps which you have to hunt down over various places 
 on the internet and could have been an automated script, even if they do 
 know what the path is (and most programmers on windows will know that).

 Note also that the hypothetical beginner has not figured out yet that 
 lein.bat is in fact leiningen. He thinks that that is just the install 
 script (since this is not made clear on the leiningen site), and he thinks 
 the installation has failed. It is not made clear that lein.bat *is* the 
 program you want to run, and that you want to put it on your path as well. 
 I have still personally not succeeded in setting up an IDE with leiningen 
 integration on Windows...which resulted in me dropping Clojure for serious 
 work in favor of F# (I still play with it occasionally on linux). I am very 
 sure that I'm far from the only one. It's a pity that people miss out on 
 such beautiful software for such a trivial reason.

 Another problem, also seen in this thread, is that there are too many 
 options and no consensus on what's the best way to get started. At least no 
 consensus that a beginner can easily figure out. Maven? Leiningen? Just the 
 clojure jar? CCW? IntelliJ? Clooj? Emacs? Lighttable? You really don't want 
 a beginner to get the impression that he has to spend a couple of months 
 learning maven with a book, before he can do serious clojure, like almost 
 happened here.

 Blaming the newbies by saying you better practice the skill of figuring 
 out things is a bit unfair I think. Plenty of other projects do manage to 
 be user friendly. Python: you download the installer, install it, and voila 
 you have everything you need, including an editor. Packages generally come 
 with their own installer. With Ruby you also get the language, an editor 
 and a package manager. With F# you even get an extremely good IDE. All of 
 these I was able to install in less than 5 minutes of my time. With Clojure 
 I have spend at least 20 hours with installation woes. The way I view it, 
 learning the magic incantations to get a specific tool working is not 
 useful knowledge. People would rather fill their brain with the cool stuff: 
 how reducers, lambda, macros, core.logic work, etc.

 Jules

 On Friday, February 15, 2013 8:29:25 AM UTC+1, vemv wrote:

 Well the first thing you assume is that project pages should be giant 
 download buttons, and therefore the exposed content in those pages is not 
 worth reading/understanding. For instance you can find the answer to the 
 question posed in the slide 19 in slide 7.

 Just imagine if every single open source project had to explain what the 
 PATH is, how to install curl, and so on.

 You (and me) will be constantly a newbie at something, and the getting 
 started guide (if any) will be almost invariably incomplete. So you better 
 practice the skill of figuring out things.

 That said, the wording in lein's installation instructions for Windows is 
 improvable - it should acknowledge the fact that working with the Windows 
 mindset can pretty much equal clicking till it works. In particular it 
 should leave clear that you *want* curl installed even if it isn't:

 On Windows most users can get the batch file. If you have wget.exe or 
 curl.exe already installed and in PATH, you can just run lein self-install, 
 *otherwise* get the standalone jar from the downloads page. If you have 
 Cygwin you should be able to use the shell script above rather than the 
 batch file.


 Emphasis mine. 

 On Fri, Feb 15, 2013 at 3:56 AM, Jules jules...@gmail.com 
 javascript:wrote:

 vemv, here is a file describing my Clojure install experience: 
 https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp

 How should I continue? And where would a beginner find that information?

 Hopefully this is taken in good 

Re: Forcing evaluation of args to a macro?

2013-02-15 Thread Phillip Lord


The obvious answer is use a function and not a macro. So, for instance

user (defn f[x] (println x))
#'user/f
user (f [1 2 3])
[1 2 3]
nil
user (def x [1 2 3])
#'user/x
user (f x)
[1 2 3]
nil

In this case, the arguments are evaluated before being passed. x evals
to [1 2 3] while [1 2 3] evals to itself. 

What circumstances do you want the argument to *not* be evaled? Unless
there is one, why use a macro? 

Phil


Jason Lewis jasonlewi...@gmail.com writes:

 Hey, Clojure n00b here... I'm working with a macro that expects a vector
 and iterates over the contents with a `for` form. I had naively assumed
 that it would work equally well to pass it a var containing the vector, but
 instead it tries to iterate over the individual symbol and the output is
 munged.

 I also tried passing the fn call that I was using to build the vector, with
 no better results. Is there any way to force evaluation so the macro 'sees'
 the vector it expects instead of trying to work on the symbol or form that
 I pass it?


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
lpetit, I'll describe my experience with CCW on windows. Installing CCW is 
fairly easy, though not as easy as just downloading and running. If you go 
to the counterclockwise site (https://code.google.com/p/counterclockwise/) 
it is reasonably clear what you should do, but not as clear as it could be 
by a long shot. New users would be inclined to click the download button on 
the top, which takes you to a page with two jars, which is not the correct 
way to install CCW. On the main page there are links, and one of them in 
the middle is Installation / Feature description / 
Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
 
That should really be very prominent. On that page you find these 
instructions, among a page with a lot of other stuff:



Pre-requisites:

   - Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your 
   projects can still use Java 5)
   - Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse for 
   Java Developers package, Eclipse for Java EE Developers package, etc. 
   (really, any packaging including JDT -Java Development Tools- features will 
   work)

Update site : http://ccw.cgrand.net/updatesite/

---

So you download java 6+. Then you download eclipse, which uses a 
non-standard way to install (on windows). But then what? Turns out you have 
to go to Help - Install new software, paste that url, select 
counterclockwise, press next a couple of times and then you're good to go.

But now you still don't have leiningen, which is essential if you want to 
do anything non toy. The installation page of CCW does describe how to 
create a leiningen project, but doesn't say that you first have to manually 
install leiningen. Even if you manage to install it, which is quite a feat 
for a newbie (as described previously), how do you then use it from CCW? 
For me, if I create a new leiningen project, the a new project gets created 
but then the IDE hangs and the project doesn't have anything in it...

A quick way to improve the situation is to make it prominently clear on the 
homepage of CCW what the steps are for installing a full featured CCW + 
leiningen. Even better would be to create a package to automate those steps 
of course.
vemv, I don't know how the situation is now with Ruby, but when I used it 
it was really easy (and I did use it for non-toy purposes -- I got paid to 
use it). You downloaded the ruby installer, ran it, opened a command line 
and typed gem install rails and you have everything you need. The it's 
hard no matter what you do if you use open source really doesn't match 
with my experience. There *are* easy to use open source projects. Python is 
another example. You're right that there are a lot of open source projects 
that aren't as easy, like OCaml for example, and look how successful that 
is. But this isn't a pissing match between different projects. Don't we 
want people to use Clojure?

Jules

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
Phil, while I don't know the specific application you're working on,
distributing Clojure apps to end users should't be any more difficult than
distributing Java apps. Are you familiar with `lein uberjar`?

As for Linux installation, curling and executing a single script can't be
that much work...? Anyway what I do is to include those few lines of code
in a script I use every time I install Linux on a new box - it sets up
Ruby, Java, performs a bunch of apt-get-installs, makes some aliases, etc.

Hope it helps - Victor

On Fri, Feb 15, 2013 at 5:04 PM, Phillip Lord
phillip.l...@newcastle.ac.ukwrote:


 I'd agree with this. The situation is even not ideal with linux; when I
 first used Clojure I was reticient to install lein by hand and only lein
 1 was available for my repo. Lazy? Well, I use 4 or 5 machines
 routinely, and I set them up as I go, so an quick and easy install is
 important. Eventually, I relented.

 I'm a full time linux user and an Emacs junkie. But not a full-time
 Clojure user; it's only one of the languages that I use regularly, so
 rapid set up is important. On windows, setting up PATH and probably HOME
 if you are going the Emacs route makes it worse.

 It's a concern for me. I am using Clojure to provide a DSL. To use the
 DSL you do not have to use Clojure per se (or rather not be aware that
 you are). But you do need a working Clojure environment. This might be
 an uphill struggle.

 Phil



 Jules julesjac...@gmail.com writes:
  vevm, it's true that you don't want to explain what the PATH is for every
  open source project, but you don't have to. The Ruby and Python
 installers
  put everything on the path for you. Windows users expect this, they don't
  want to play shell script and do everything manually what is in essence
  following a bunch of steps which you have to hunt down over various
 places
  on the internet and could have been an automated script, even if they do
  know what the path is (and most programmers on windows will know that).
 
  Note also that the hypothetical beginner has not figured out yet that
  lein.bat is in fact leiningen. He thinks that that is just the install
  script (since this is not made clear on the leiningen site), and he
 thinks
  the installation has failed. It is not made clear that lein.bat *is* the
  program you want to run, and that you want to put it on your path as
 well.
  I have still personally not succeeded in setting up an IDE with leiningen
  integration on Windows...which resulted in me dropping Clojure for
 serious
  work in favor of F# (I still play with it occasionally on linux). I am
 very
  sure that I'm far from the only one. It's a pity that people miss out on
  such beautiful software for such a trivial reason.
 
  Another problem, also seen in this thread, is that there are too many
  options and no consensus on what's the best way to get started. At least
 no
  consensus that a beginner can easily figure out. Maven? Leiningen? Just
 the
  clojure jar? CCW? IntelliJ? Clooj? Emacs? Lighttable? You really don't
 want
  a beginner to get the impression that he has to spend a couple of months
  learning maven with a book, before he can do serious clojure, like almost
  happened here.
 
  Blaming the newbies by saying you better practice the skill of figuring
  out things is a bit unfair I think. Plenty of other projects do manage
 to
  be user friendly. Python: you download the installer, install it, and
 voila
  you have everything you need, including an editor. Packages generally
 come
  with their own installer. With Ruby you also get the language, an editor
  and a package manager. With F# you even get an extremely good IDE. All of
  these I was able to install in less than 5 minutes of my time. With
 Clojure
  I have spend at least 20 hours with installation woes. The way I view it,
  learning the magic incantations to get a specific tool working is not
  useful knowledge. People would rather fill their brain with the cool
 stuff:
  how reducers, lambda, macros, core.logic work, etc.
 
  Jules
 
  On Friday, February 15, 2013 8:29:25 AM UTC+1, vemv wrote:
 
  Well the first thing you assume is that project pages should be giant
  download buttons, and therefore the exposed content in those pages is
 not
  worth reading/understanding. For instance you can find the answer to the
  question posed in the slide 19 in slide 7.
 
  Just imagine if every single open source project had to explain what the
  PATH is, how to install curl, and so on.
 
  You (and me) will be constantly a newbie at something, and the getting
  started guide (if any) will be almost invariably incomplete. So you
 better
  practice the skill of figuring out things.
 
  That said, the wording in lein's installation instructions for Windows
 is
  improvable - it should acknowledge the fact that working with the
 Windows
  mindset can pretty much equal clicking till it works. In particular it
  should leave clear that you *want* curl installed even if 

Re: Why is this so difficult?

2013-02-15 Thread Phil Hagelberg

So for the record, the reason Leiningen doesn't work on Windows is
primarily that Windows users spend a lot more time talking about how it
doesn't work on Windows, and very little time actually making it work on
Windows. It's like some kind of reverse Heisenberg Uncertainty Principle.

Just because I am not personally interested in making it work on Windows
doesn't mean I'm not open to accepting patches to do so; in fact I *am*
interested in making sure motivated parties can contribute to the project.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
By the way, I've been trying to write an install script for windows that 
installs leiningen + CCW. Creating a folder for all Clojure stuff, putting 
that folder on the PATH, downloading lein.bat, running lein self-install, 
downloading eclipse works OK. So far there are two problems I ran into that 
prevented full installation:

1. How to install CCW into eclipse from the command line? There should be a 
way to do it according to this 
page: 
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html
 
but I haven't been able to come up with an actual command that succesfully 
installs CCW. I suppose the -repository should have the ccw update site, 
but what should be the -installIU argument?

2. How to prevent CCW from hanging when creating a leiningen project.

On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing CCW is 
 fairly easy, though not as easy as just downloading and running. If you go 
 to the counterclockwise site (https://code.google.com/p/counterclockwise/) 
 it is reasonably clear what you should do, but not as clear as it could be 
 by a long shot. New users would be inclined to click the download button on 
 the top, which takes you to a page with two jars, which is not the correct 
 way to install CCW. On the main page there are links, and one of them in 
 the middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
  
 That should really be very prominent. On that page you find these 
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your 
projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse 
for Java Developers package, Eclipse for Java EE Developers package, 
etc. (really, any packaging including JDT -Java Development Tools- 
 features 
will work)

 Update site : http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a 
 non-standard way to install (on windows). But then what? Turns out you 
 have to go to Help - Install new software, paste that url, select 
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want to 
 do anything non toy. The installation page of CCW does describe how to 
 create a leiningen project, but doesn't say that you first have to manually 
 install leiningen. Even if you manage to install it, which is quite a feat 
 for a newbie (as described previously), how do you then use it from CCW? 
 For me, if I create a new leiningen project, the a new project gets created 
 but then the IDE hangs and the project doesn't have anything in it...

 A quick way to improve the situation is to make it prominently clear on 
 the homepage of CCW what the steps are for installing a full featured CCW + 
 leiningen. Even better would be to create a package to automate those steps 
 of course.
 vemv, I don't know how the situation is now with Ruby, but when I used it 
 it was really easy (and I did use it for non-toy purposes -- I got paid to 
 use it). You downloaded the ruby installer, ran it, opened a command line 
 and typed gem install rails and you have everything you need. The it's 
 hard no matter what you do if you use open source really doesn't match 
 with my experience. There *are* easy to use open source projects. Python is 
 another example. You're right that there are a lot of open source projects 
 that aren't as easy, like OCaml for example, and look how successful that 
 is. But this isn't a pissing match between different projects. Don't we 
 want people to use Clojure?

 Jules


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Giacomo Cosenza
On Feb 15, 2013, at 5:30 PM, Phil Hagelberg wrote:

  It's like some kind of reverse Heisenberg Uncertainty Principle.

I never use +1, but this is the case

mimmo

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
on the CCW hang you mention - I saw an issue that was marked as critical
on the bug tracker, two weeks ago. As I can't find it anymore I assume it's
been fixed. Are you sure you're using the absolute latest version?

If you are, you should open an issue.

I like your idea. Assuming curl is installed, when running `lein.bat
self-install` the user could be asked whether he wants to download a fully
functioning Clojure development environment or something like that.

On Fri, Feb 15, 2013 at 5:36 PM, Jules julesjac...@gmail.com wrote:

 By the way, I've been trying to write an install script for windows that
 installs leiningen + CCW. Creating a folder for all Clojure stuff, putting
 that folder on the PATH, downloading lein.bat, running lein self-install,
 downloading eclipse works OK. So far there are two problems I ran into that
 prevented full installation:

 1. How to install CCW into eclipse from the command line? There should be
 a way to do it according to this page:
 http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully
 installs CCW. I suppose the -repository should have the ccw update site,
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing CCW
 is fairly easy, though not as easy as just downloading and running. If you
 go to the counterclockwise site (https://code.google.com/p/**
 counterclockwise/ https://code.google.com/p/counterclockwise/) it is
 reasonably clear what you should do, but not as clear as it could be by a
 long shot. New users would be inclined to click the download button on the
 top, which takes you to a page with two jars, which is not the correct way
 to install CCW. On the main page there are links, and one of them in the
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
 That should really be very prominent. On that page you find these
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your
projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse
for Java Developers package, Eclipse for Java EE Developers package,
etc. (really, any packaging including JDT -Java Development Tools- 
 features
will work)

 Update site : 
 http://ccw.cgrand.net/**updatesite/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a
 non-standard way to install (on windows). But then what? Turns out you
 have to go to Help - Install new software, paste that url, select
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want to
 do anything non toy. The installation page of CCW does describe how to
 create a leiningen project, but doesn't say that you first have to manually
 install leiningen. Even if you manage to install it, which is quite a feat
 for a newbie (as described previously), how do you then use it from CCW?
 For me, if I create a new leiningen project, the a new project gets created
 but then the IDE hangs and the project doesn't have anything in it...

 A quick way to improve the situation is to make it prominently clear on
 the homepage of CCW what the steps are for installing a full featured CCW +
 leiningen. Even better would be to create a package to automate those steps
 of course.
 vemv, I don't know how the situation is now with Ruby, but when I used it
 it was really easy (and I did use it for non-toy purposes -- I got paid to
 use it). You downloaded the ruby installer, ran it, opened a command line
 and typed gem install rails and you have everything you need. The it's
 hard no matter what you do if you use open source really doesn't match
 with my experience. There *are* easy to use open source projects. Python is
 another example. You're right that there are a lot of open source projects
 that aren't as easy, like OCaml for example, and look how successful that
 is. But this isn't a pissing match between different projects. Don't we
 want people to use Clojure?

 Jules

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

Re: Why is this so difficult?

2013-02-15 Thread Jason Lewis
I don't want to sound like a curmudgeon, but all I can say is people who
complain about lein have never written a Makefile.

Jason Lewis

Email  jasonlewi...@gmail.com

Twitter@canweriotnow http://twitter.com/canweriotnow

Blog   http://decomplecting.org

About http://about.me/jason.lewis


On Fri, Feb 15, 2013 at 11:54 AM, Giacomo Cosenza
mimmo.cose...@gmail.comwrote:

 On Feb 15, 2013, at 5:30 PM, Phil Hagelberg wrote:

   It's like some kind of reverse Heisenberg Uncertainty Principle.

 I never use +1, but this is the case

 mimmo

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
Now I think it, if automating the CCW plugin install is too difficult
(Eclipse is very script-unfriendly) we could just mantain an
already-configured setup ready to download. In other words, zipping and
uploading a clean `eclipse` folder.

On Fri, Feb 15, 2013 at 6:03 PM, Víctor M. V. v...@vemv.net wrote:

 on the CCW hang you mention - I saw an issue that was marked as critical
 on the bug tracker, two weeks ago. As I can't find it anymore I assume it's
 been fixed. Are you sure you're using the absolute latest version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat
 self-install` the user could be asked whether he wants to download a fully
 functioning Clojure development environment or something like that.


 On Fri, Feb 15, 2013 at 5:36 PM, Jules julesjac...@gmail.com wrote:

 By the way, I've been trying to write an install script for windows that
 installs leiningen + CCW. Creating a folder for all Clojure stuff, putting
 that folder on the PATH, downloading lein.bat, running lein self-install,
 downloading eclipse works OK. So far there are two problems I ran into that
 prevented full installation:

 1. How to install CCW into eclipse from the command line? There should be
 a way to do it according to this page:
 http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully
 installs CCW. I suppose the -repository should have the ccw update site,
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing CCW
 is fairly easy, though not as easy as just downloading and running. If you
 go to the counterclockwise site (https://code.google.com/p/**
 counterclockwise/ https://code.google.com/p/counterclockwise/) it is
 reasonably clear what you should do, but not as clear as it could be by a
 long shot. New users would be inclined to click the download button on the
 top, which takes you to a page with two jars, which is not the correct way
 to install CCW. On the main page there are links, and one of them in the
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
 That should really be very prominent. On that page you find these
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your
projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse
for Java Developers package, Eclipse for Java EE Developers package,
etc. (really, any packaging including JDT -Java Development Tools- 
 features
will work)

 Update site : 
 http://ccw.cgrand.net/**updatesite/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a
 non-standard way to install (on windows). But then what? Turns out you
 have to go to Help - Install new software, paste that url, select
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want
 to do anything non toy. The installation page of CCW does describe how to
 create a leiningen project, but doesn't say that you first have to manually
 install leiningen. Even if you manage to install it, which is quite a feat
 for a newbie (as described previously), how do you then use it from CCW?
 For me, if I create a new leiningen project, the a new project gets created
 but then the IDE hangs and the project doesn't have anything in it...

 A quick way to improve the situation is to make it prominently clear on
 the homepage of CCW what the steps are for installing a full featured CCW +
 leiningen. Even better would be to create a package to automate those steps
 of course.
 vemv, I don't know how the situation is now with Ruby, but when I used
 it it was really easy (and I did use it for non-toy purposes -- I got paid
 to use it). You downloaded the ruby installer, ran it, opened a command
 line and typed gem install rails and you have everything you need. The
 it's hard no matter what you do if you use open source really doesn't
 match with my experience. There *are* easy to use open source projects.
 Python is another example. You're right that there are a lot of open source
 projects that aren't as easy, like OCaml for example, and look
 how successful that is. But this isn't a pissing match between different
 projects. Don't we want people to use Clojure?

 Jules

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

Re: Why is this so difficult?

2013-02-15 Thread Jules
Actually I think CCW is not the issue but leiningen. If I do this:

lein new foo
cd foo
lein repl

Now leiningen hangs. If I run lein repl outside of a project folder, it 
works. I'm not sure if this is really a problem with leiningen, or I just 
did something wrong at some point, so I'm a bit hesitant to submit a bug 
report.

On Friday, February 15, 2013 6:03:19 PM UTC+1, vemv wrote:

 on the CCW hang you mention - I saw an issue that was marked as critical 
 on the bug tracker, two weeks ago. As I can't find it anymore I assume it's 
 been fixed. Are you sure you're using the absolute latest version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat 
 self-install` the user could be asked whether he wants to download a fully 
 functioning Clojure development environment or something like that.

 On Fri, Feb 15, 2013 at 5:36 PM, Jules jules...@gmail.com 
 javascript:wrote:

 By the way, I've been trying to write an install script for windows that 
 installs leiningen + CCW. Creating a folder for all Clojure stuff, putting 
 that folder on the PATH, downloading lein.bat, running lein self-install, 
 downloading eclipse works OK. So far there are two problems I ran into that 
 prevented full installation:

 1. How to install CCW into eclipse from the command line? There should be 
 a way to do it according to this page: 
 http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully 
 installs CCW. I suppose the -repository should have the ccw update site, 
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing CCW 
 is fairly easy, though not as easy as just downloading and running. If you 
 go to the counterclockwise site (https://code.google.com/p/**
 counterclockwise/ https://code.google.com/p/counterclockwise/) it is 
 reasonably clear what you should do, but not as clear as it could be by a 
 long shot. New users would be inclined to click the download button on the 
 top, which takes you to a page with two jars, which is not the correct way 
 to install CCW. On the main page there are links, and one of them in the 
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
  
 That should really be very prominent. On that page you find these 
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your 
projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse 
for Java Developers package, Eclipse for Java EE Developers package, 
etc. (really, any packaging including JDT -Java Development Tools- 
 features 
will work) 

 Update site : 
 http://ccw.cgrand.net/**updatesite/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a 
 non-standard way to install (on windows). But then what? Turns out you 
 have to go to Help - Install new software, paste that url, select 
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want 
 to do anything non toy. The installation page of CCW does describe how to 
 create a leiningen project, but doesn't say that you first have to manually 
 install leiningen. Even if you manage to install it, which is quite a feat 
 for a newbie (as described previously), how do you then use it from CCW? 
 For me, if I create a new leiningen project, the a new project gets created 
 but then the IDE hangs and the project doesn't have anything in it...

 A quick way to improve the situation is to make it prominently clear on 
 the homepage of CCW what the steps are for installing a full featured CCW + 
 leiningen. Even better would be to create a package to automate those steps 
 of course.
 vemv, I don't know how the situation is now with Ruby, but when I used 
 it it was really easy (and I did use it for non-toy purposes -- I got paid 
 to use it). You downloaded the ruby installer, ran it, opened a command 
 line and typed gem install rails and you have everything you need. The 
 it's hard no matter what you do if you use open source really doesn't 
 match with my experience. There *are* easy to use open source projects. 
 Python is another example. You're right that there are a lot of open source 
 projects that aren't as easy, like OCaml for example, and look 
 how successful that is. But this isn't a pissing match between different 
 projects. Don't we want people to use Clojure?

 Jules

  -- 
 -- 
 You received this message 

Re: Why is this so difficult?

2013-02-15 Thread Jules
Yes, just zipping up a clean eclipse+ccw was my first thought too, but the 
resulting file is rather large 200MB or so, so we'd need to find hosting 
for that.

On Friday, February 15, 2013 6:09:14 PM UTC+1, vemv wrote:

 Now I think it, if automating the CCW plugin install is too difficult 
 (Eclipse is very script-unfriendly) we could just mantain an 
 already-configured setup ready to download. In other words, zipping and 
 uploading a clean `eclipse` folder.

 On Fri, Feb 15, 2013 at 6:03 PM, Víctor M. V. ve...@vemv.netjavascript:
  wrote:

 on the CCW hang you mention - I saw an issue that was marked as 
 critical on the bug tracker, two weeks ago. As I can't find it anymore I 
 assume it's been fixed. Are you sure you're using the absolute latest 
 version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat 
 self-install` the user could be asked whether he wants to download a fully 
 functioning Clojure development environment or something like that.


 On Fri, Feb 15, 2013 at 5:36 PM, Jules jules...@gmail.com 
 javascript:wrote:

 By the way, I've been trying to write an install script for windows that 
 installs leiningen + CCW. Creating a folder for all Clojure stuff, putting 
 that folder on the PATH, downloading lein.bat, running lein self-install, 
 downloading eclipse works OK. So far there are two problems I ran into that 
 prevented full installation:

 1. How to install CCW into eclipse from the command line? There should 
 be a way to do it according to this page: 
 http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully 
 installs CCW. I suppose the -repository should have the ccw update site, 
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing CCW 
 is fairly easy, though not as easy as just downloading and running. If you 
 go to the counterclockwise site (https://code.google.com/p/**
 counterclockwise/ https://code.google.com/p/counterclockwise/) it is 
 reasonably clear what you should do, but not as clear as it could be by a 
 long shot. New users would be inclined to click the download button on the 
 top, which takes you to a page with two jars, which is not the correct way 
 to install CCW. On the main page there are links, and one of them in the 
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
  
 That should really be very prominent. On that page you find these 
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. Your 
projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, Eclipse 
for Java Developers package, Eclipse for Java EE Developers package, 
etc. (really, any packaging including JDT -Java Development Tools- 
 features 
will work) 

 Update site : 
 http://ccw.cgrand.net/**updatesite/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a 
 non-standard way to install (on windows). But then what? Turns out you 
 have to go to Help - Install new software, paste that url, select 
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want 
 to do anything non toy. The installation page of CCW does describe how to 
 create a leiningen project, but doesn't say that you first have to 
 manually 
 install leiningen. Even if you manage to install it, which is quite a feat 
 for a newbie (as described previously), how do you then use it from CCW? 
 For me, if I create a new leiningen project, the a new project gets 
 created 
 but then the IDE hangs and the project doesn't have anything in it...

 A quick way to improve the situation is to make it prominently clear on 
 the homepage of CCW what the steps are for installing a full featured CCW 
 + 
 leiningen. Even better would be to create a package to automate those 
 steps 
 of course.
 vemv, I don't know how the situation is now with Ruby, but when I used 
 it it was really easy (and I did use it for non-toy purposes -- I got paid 
 to use it). You downloaded the ruby installer, ran it, opened a command 
 line and typed gem install rails and you have everything you need. The 
 it's hard no matter what you do if you use open source really doesn't 
 match with my experience. There *are* easy to use open source projects. 
 Python is another example. You're right that there are a lot of open 
 source 
 projects that aren't as easy, like OCaml for example, and look 

Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
On `lein repl` hanging - it could be anything, from the repl is used (
https://github.com/trptcolin/reply/) to who knows. If your issue is
reproducible with a clean lein install, there should be no reason why a bug
report wouldn't be welcome.

File hosting wouldn't be as much as problem a setting up a mini build
system that continuously fetched the latest stable release of CCW and
applied it to Eclipse, making sure it works for users from every OS... it's
much more maintainable to let the user figure out what IDE/editor to use
and how to get it working.

It'd be ideal if `lein self-install` saved a lot of work / decisions to the
newcomers, but making that happen requires a lot of effort - which might or
might not be worth it, especially considering lein devs' contributions come
from their free time (afaict). Same thing for Clojure the language, the
library ecosystem, etc.

On Fri, Feb 15, 2013 at 6:11 PM, Jules julesjac...@gmail.com wrote:

 Yes, just zipping up a clean eclipse+ccw was my first thought too, but the
 resulting file is rather large 200MB or so, so we'd need to find hosting
 for that.


 On Friday, February 15, 2013 6:09:14 PM UTC+1, vemv wrote:

 Now I think it, if automating the CCW plugin install is too difficult
 (Eclipse is very script-unfriendly) we could just mantain an
 already-configured setup ready to download. In other words, zipping and
 uploading a clean `eclipse` folder.

 On Fri, Feb 15, 2013 at 6:03 PM, Víctor M. V. ve...@vemv.net wrote:

 on the CCW hang you mention - I saw an issue that was marked as
 critical on the bug tracker, two weeks ago. As I can't find it anymore I
 assume it's been fixed. Are you sure you're using the absolute latest
 version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat
 self-install` the user could be asked whether he wants to download a fully
 functioning Clojure development environment or something like that.


 On Fri, Feb 15, 2013 at 5:36 PM, Jules jules...@gmail.com wrote:

 By the way, I've been trying to write an install script for windows
 that installs leiningen + CCW. Creating a folder for all Clojure stuff,
 putting that folder on the PATH, downloading lein.bat, running lein
 self-install, downloading eclipse works OK. So far there are two problems I
 ran into that prevented full installation:

 1. How to install CCW into eclipse from the command line? There should
 be a way to do it according to this page: http://help.eclipse.org/**
 galileo/index.jsp?topic=/org.**eclipse.platform.doc.isv/**
 guide/p2_director.htmlhttp://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully
 installs CCW. I suppose the -repository should have the ccw update site,
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing
 CCW is fairly easy, though not as easy as just downloading and running. If
 you go to the counterclockwise site (https://code.google.com/p/**cou**
 nterclockwise/ https://code.google.com/p/counterclockwise/) it is
 reasonably clear what you should do, but not as clear as it could be by a
 long shot. New users would be inclined to click the download button on the
 top, which takes you to a page with two jars, which is not the correct way
 to install CCW. On the main page there are links, and one of them in the
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
 That should really be very prominent. On that page you find these
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse.
Your projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package,
Eclipse for Java Developers package, Eclipse for Java EE Developers
package, etc. (really, any packaging including JDT -Java Development 
 Tools-
features will work)

 Update site : 
 http://ccw.cgrand.net/**update**site/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a
 non-standard way to install (on windows). But then what? Turns out
 you have to go to Help - Install new software, paste that url, select
 counterclockwise, press next a couple of times and then you're good to go.

 But now you still don't have leiningen, which is essential if you want
 to do anything non toy. The installation page of CCW does describe how to
 create a leiningen project, but doesn't say that you first have to 
 manually
 install leiningen. Even if you manage to install it, which is quite a feat
 for a newbie (as described previously), how do you 

Re: Why is this so difficult?

2013-02-15 Thread David Powell
Just for the record, I've had problems with lein trampoline on the past,
but the latest version of lein is fine.  I do all my clojure on Windows 7.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
It is reproducible from a clean install, as far as I can tell (but it is 
possible that I had not deleted previous leiningen fully). I have posted it 
on the issue tracker.

What I was thinking is not to integrate CCW installation to leiningen, but 
instead a Clojure Starter Kit just for windows that installs 
leiningen+CCW. This is a bit easier since you just need to worry about 
windows.

On Friday, February 15, 2013 6:33:51 PM UTC+1, vemv wrote:

 On `lein repl` hanging - it could be anything, from the repl is used (
 https://github.com/trptcolin/reply/) to who knows. If your issue is 
 reproducible with a clean lein install, there should be no reason why a bug 
 report wouldn't be welcome.

 File hosting wouldn't be as much as problem a setting up a mini build 
 system that continuously fetched the latest stable release of CCW and 
 applied it to Eclipse, making sure it works for users from every OS... it's 
 much more maintainable to let the user figure out what IDE/editor to use 
 and how to get it working.

 It'd be ideal if `lein self-install` saved a lot of work / decisions to 
 the newcomers, but making that happen requires a lot of effort - which 
 might or might not be worth it, especially considering lein devs' 
 contributions come from their free time (afaict). Same thing for Clojure 
 the language, the library ecosystem, etc.

 On Fri, Feb 15, 2013 at 6:11 PM, Jules jules...@gmail.com 
 javascript:wrote:

 Yes, just zipping up a clean eclipse+ccw was my first thought too, but 
 the resulting file is rather large 200MB or so, so we'd need to find 
 hosting for that.


 On Friday, February 15, 2013 6:09:14 PM UTC+1, vemv wrote:

 Now I think it, if automating the CCW plugin install is too difficult 
 (Eclipse is very script-unfriendly) we could just mantain an 
 already-configured setup ready to download. In other words, zipping and 
 uploading a clean `eclipse` folder.

 On Fri, Feb 15, 2013 at 6:03 PM, Víctor M. V. ve...@vemv.net wrote:

  on the CCW hang you mention - I saw an issue that was marked as 
 critical on the bug tracker, two weeks ago. As I can't find it anymore I 
 assume it's been fixed. Are you sure you're using the absolute latest 
 version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat 
 self-install` the user could be asked whether he wants to download a 
 fully 
 functioning Clojure development environment or something like that.
  

 On Fri, Feb 15, 2013 at 5:36 PM, Jules jules...@gmail.com wrote:

  By the way, I've been trying to write an install script for windows 
 that installs leiningen + CCW. Creating a folder for all Clojure stuff, 
 putting that folder on the PATH, downloading lein.bat, running lein 
 self-install, downloading eclipse works OK. So far there are two problems 
 I 
 ran into that prevented full installation:

 1. How to install CCW into eclipse from the command line? There should 
 be a way to do it according to this page: http://help.eclipse.org/**
 galileo/index.jsp?topic=/org.**eclipse.platform.doc.isv/**
 guide/p2_director.htmlhttp://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully 
 installs CCW. I suppose the -repository should have the ccw update site, 
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing 
 CCW is fairly easy, though not as easy as just downloading and running. 
 If 
 you go to the counterclockwise site (https://code.google.com/p/**cou*
 *nterclockwise/ https://code.google.com/p/counterclockwise/) it is 
 reasonably clear what you should do, but not as clear as it could be by 
 a 
 long shot. New users would be inclined to click the download button on 
 the 
 top, which takes you to a page with two jars, which is not the correct 
 way 
 to install CCW. On the main page there are links, and one of them in the 
 middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
  
 That should really be very prominent. On that page you find these 
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse. 
Your projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package, 
Eclipse for Java Developers package, Eclipse for Java EE 
 Developers 
package, etc. (really, any packaging including JDT -Java Development 
 Tools- 
features will work) 

 Update site : 
 http://ccw.cgrand.net/**update**site/http://ccw.cgrand.net/updatesite/

 ---

 So you download java 6+. Then you download eclipse, which uses a 
 non-standard way to install 

Re: Why is this so difficult?

2013-02-15 Thread Alan Shaw
Leiningen works on Windows.
On Feb 15, 2013 8:32 AM, Phil Hagelberg p...@hagelb.org wrote:


 So for the record, the reason Leiningen doesn't work on Windows is
 primarily that Windows users spend a lot more time talking about how it
 doesn't work on Windows, and very little time actually making it work on
 Windows. It's like some kind of reverse Heisenberg Uncertainty Principle.

 Just because I am not personally interested in making it work on Windows
 doesn't mean I'm not open to accepting patches to do so; in fact I *am*
 interested in making sure motivated parties can contribute to the project.

 -Phil

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Víctor M . V .
Jules:

between the current doc improvement for lein we're both participating in (
https://github.com/technomancy/leiningen/issues/1007) and the available doc
for CCW (installation is one step really), are there any pain points that
such a starter kit would address?


On Fri, Feb 15, 2013 at 6:42 PM, Jules julesjac...@gmail.com wrote:

 It is reproducible from a clean install, as far as I can tell (but it is
 possible that I had not deleted previous leiningen fully). I have posted it
 on the issue tracker.

 What I was thinking is not to integrate CCW installation to leiningen, but
 instead a Clojure Starter Kit just for windows that installs
 leiningen+CCW. This is a bit easier since you just need to worry about
 windows.


 On Friday, February 15, 2013 6:33:51 PM UTC+1, vemv wrote:

 On `lein repl` hanging - it could be anything, from the repl is used (
 https://github.com/trptcolin/**reply/https://github.com/trptcolin/reply/)
 to who knows. If your issue is reproducible with a clean lein install,
 there should be no reason why a bug report wouldn't be welcome.

 File hosting wouldn't be as much as problem a setting up a mini build
 system that continuously fetched the latest stable release of CCW and
 applied it to Eclipse, making sure it works for users from every OS... it's
 much more maintainable to let the user figure out what IDE/editor to use
 and how to get it working.

 It'd be ideal if `lein self-install` saved a lot of work / decisions to
 the newcomers, but making that happen requires a lot of effort - which
 might or might not be worth it, especially considering lein devs'
 contributions come from their free time (afaict). Same thing for Clojure
 the language, the library ecosystem, etc.

 On Fri, Feb 15, 2013 at 6:11 PM, Jules jules...@gmail.com wrote:

 Yes, just zipping up a clean eclipse+ccw was my first thought too, but
 the resulting file is rather large 200MB or so, so we'd need to find
 hosting for that.


 On Friday, February 15, 2013 6:09:14 PM UTC+1, vemv wrote:

 Now I think it, if automating the CCW plugin install is too difficult
 (Eclipse is very script-unfriendly) we could just mantain an
 already-configured setup ready to download. In other words, zipping and
 uploading a clean `eclipse` folder.

 On Fri, Feb 15, 2013 at 6:03 PM, Víctor M. V. ve...@vemv.net wrote:

  on the CCW hang you mention - I saw an issue that was marked as
 critical on the bug tracker, two weeks ago. As I can't find it anymore I
 assume it's been fixed. Are you sure you're using the absolute latest
 version?

 If you are, you should open an issue.

 I like your idea. Assuming curl is installed, when running `lein.bat
 self-install` the user could be asked whether he wants to download a 
 fully
 functioning Clojure development environment or something like that.


 On Fri, Feb 15, 2013 at 5:36 PM, Jules jules...@gmail.com wrote:

  By the way, I've been trying to write an install script for windows
 that installs leiningen + CCW. Creating a folder for all Clojure stuff,
 putting that folder on the PATH, downloading lein.bat, running lein
 self-install, downloading eclipse works OK. So far there are two 
 problems I
 ran into that prevented full installation:

 1. How to install CCW into eclipse from the command line? There
 should be a way to do it according to this page:
 http://help.eclipse.org/galileo/index.jsp?topic=/org.**e**
 clipse.platform.doc.isv/**guide/**p2_director.htmlhttp://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.htmlbut
  I haven't been able to come up with an actual command that succesfully
 installs CCW. I suppose the -repository should have the ccw update site,
 but what should be the -installIU argument?

 2. How to prevent CCW from hanging when creating a leiningen project.


 On Friday, February 15, 2013 5:19:01 PM UTC+1, Jules wrote:

 lpetit, I'll describe my experience with CCW on windows. Installing
 CCW is fairly easy, though not as easy as just downloading and running. 
 If
 you go to the counterclockwise site (https://code.google.com/p/**cou
 nterclockwise/ https://code.google.com/p/counterclockwise/)
 it is reasonably clear what you should do, but not as clear as it could 
 be
 by a long shot. New users would be inclined to click the download 
 button on
 the top, which takes you to a page with two jars, which is not the 
 correct
 way to install CCW. On the main page there are links, and one of them in
 the middle is Installation / Feature description / 
 Documentationhttps://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin.
 That should really be very prominent. On that page you find these
 instructions, among a page with a lot of other stuff:

 

 Pre-requisites:

- Java Virtual Machine (JVM) 6 or higher (for running Eclipse.
Your projects can still use Java 5)
- Eclipse 3.5 or higher installed : Eclipse SDK package,
Eclipse for Java Developers package, 

Re: Why is this so difficult?

2013-02-15 Thread Mark Engelberg
On Fri, Feb 15, 2013 at 8:19 AM, Jules julesjac...@gmail.com wrote:

 But now you still don't have leiningen, which is essential if you want to
 do anything non toy. The installation page of CCW does describe how to
 create a leiningen project, but doesn't say that you first have to manually
 install leiningen.


AFAIK, this is not true.   Eclipse Counterclockwise comes bundled with its
own internal copy of leiningen, and completely manages it for you.  You do
not need to manually install leiningen or understand anything about it
other than how to add dependencies to your project.clj file.

I personally think that Eclipse's ultra-simple install (just unzip it) is
refreshing relative to the complexity of other Windows install programs
which create a lot of junk on my desktop, start menu, and registry.  Once
Eclipse is unzipped, the installation of counterclockwise plugin is one
step and pretty clearly documented, in my opinion.  I definitely think this
is the easiest way to get up and running with Clojure on windows.

I can see how the counterclockwise site would benefit from a more
unambiguous endorsement of a specific version of Eclipse, for users who
aren't already using it and are downloading it for the first time.  There
are a lot of choices at the Eclipse site.  Also, I understand there a few
confusing aspects of getting started once everything is installed: starting
a project (leiningen project vs clojure project), creating a file to code
in (doesn't automatically do user-friendly things like add the .clj
extension to new files created in the project nor add a default namespace
declaration at the top of the file), and starting the REPL (there are a few
different ways to start a REPL and it is not obvious what, if any, the
differences are).

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Mark Engelberg
P.S.  I've been very happy with the latest version of leiningen on Windows.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Forcing evaluation of args to a macro?

2013-02-15 Thread Jason Lewis
Thanks for the info -

The macro in question was in a library I was using... I just ended up
writing a function to build a data structure that did exactly what I needed.

First hand lesson that data structures  functions  macros

Thanks,

Jason Lewis

Email  jasonlewi...@gmail.com

Twitter@canweriotnow http://twitter.com/canweriotnow

Blog   http://decomplecting.org

About http://about.me/jason.lewis


On Fri, Feb 15, 2013 at 11:15 AM, Phillip Lord phillip.l...@newcastle.ac.uk
 wrote:



 The obvious answer is use a function and not a macro. So, for instance

 user (defn f[x] (println x))
 #'user/f
 user (f [1 2 3])
 [1 2 3]
 nil
 user (def x [1 2 3])
 #'user/x
 user (f x)
 [1 2 3]
 nil

 In this case, the arguments are evaluated before being passed. x evals
 to [1 2 3] while [1 2 3] evals to itself.

 What circumstances do you want the argument to *not* be evaled? Unless
 there is one, why use a macro?

 Phil


 Jason Lewis jasonlewi...@gmail.com writes:

  Hey, Clojure n00b here... I'm working with a macro that expects a vector
  and iterates over the contents with a `for` form. I had naively assumed
  that it would work equally well to pass it a var containing the vector,
 but
  instead it tries to iterate over the individual symbol and the output is
  munged.
 
  I also tried passing the fn call that I was using to build the vector,
 with
  no better results. Is there any way to force evaluation so the macro
 'sees'
  the vector it expects instead of trying to work on the symbol or form
 that
  I pass it?
 

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




edn test data generator for vetting edn across platforms and a .Net edn reader/writer

2013-02-15 Thread Eric Thorsen
We use Clojure, .Net, javascript, iOS and are/planning on using edn as a 
data format across platforms. 
We wanted a test data generator that we could use to vet out the edn 
implementations.
The repo is data.edn:
https://github.com/edn-format/data.edn

The first implementation we vetted was our own .net edn reader/writer which 
can be found here:
https://github.com/edn-format/edn-dot-net

Feedback welcome!
Thanks,
Eric

*Eric Thorsen* 

*ThorTech Solutions
**www.thortech-solutions.com
**(914) 358-9338  [work] 
**(914) 358-9343  [fax]* 
*(914) 804-4954  [cell]*

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Phil Hagelberg

Phillip Lord writes:

 I'd agree with this. The situation is even not ideal with linux; when I
 first used Clojure I was reticient to install lein by hand and only lein
 1 was available for my repo. Lazy? Well, I use 4 or 5 machines
 routinely, and I set them up as I go, so an quick and easy install is
 important. Eventually, I relented. 

I know this is a drag, but package managers nearly always lag behind
upstream releases; it's an unfortunate fact of life. We are working on
packaging Leiningen 2.0.0 for Debian, so if you're familiar with
the packaging process it would be great to get some help there. Most of
the work right now involves ensuring Leiningen's own dependencies are in
Debian, since many new ones have been added in the jump to 2.x.

I think for Fedora they've recently packaged 1.7.0 but I'm not aware of
an effort to upgrade it 2.0.0 yet unfortunately.

If you're interested in helping on this, please drop a line on the
Leiningen mailing list and we can pick it up there.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




.net port of fressian : fressian-clr

2013-02-15 Thread Eric Thorsen
We've created a .net port for fressian and tested this back and forth with 
the java library.
Repo is here:
https://github.com/fressian/fressian-clr

Feedback welcome!
Eric


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Lee Spector

On Feb 15, 2013, at 1:29 PM, Víctor M. V. wrote:

 Jules:
 
 between the current doc improvement for lein we're both participating in 
 (https://github.com/technomancy/leiningen/issues/1007) and the available doc 
 for CCW (installation is one step really), are there any pain points that 
 such a starter kit would address?

While you've addressed this to Jules I'll say that one of the things a starter 
kit should provide is a way to edit code with bracket matching and 
auto-indentation, which I think are essential for any work in Clojure beyond 
one-liners. Of course leiningen doesn't aim to provide this, and that's fine. 
But that's why I think that leiningen by itself doesn't provide what I ( maybe 
others on this thread) mean by a starter kit. 

CCW *does* provide this, and very nicely, but on pain points of CCW for 
beginners:

On Feb 15, 2013, at 1:31 PM, Mark Engelberg wrote:
 I can see how the counterclockwise site would benefit from a more unambiguous 
 endorsement of a specific version of Eclipse, for users who aren't already 
 using it and are downloading it for the first time.  There are a lot of 
 choices at the Eclipse site.  Also, I understand there a few confusing 
 aspects of getting started once everything is installed: starting a project 
 (leiningen project vs clojure project), creating a file to code in (doesn't 
 automatically do user-friendly things like add the .clj extension to new 
 files created in the project nor add a default namespace declaration at the 
 top of the file), and starting the REPL (there are a few different ways to 
 start a REPL and it is not obvious what, if any, the differences are).

All of that. And these are more baffling to newcomers than some of you may 
appreciate -- things just don't work if you don't make the correct choices 
among many ambiguous choices, and you have no idea why. Plus, although this is 
certainly not the fault of the CCW developers who are doing awesome work (it 
has improved a LOT over time!!), Eclipse is really complicated and full of all 
sorts of buttons and widgets and gizmos and hidden preference settings etc etc 
much of which will make no sense to people who are new to it and/or the JVM. 
And someone who just wants to write and some pure Clojure code shouldn't need 
to understand any of that.

Which (yes, I'm a broken record), all again speaks in favor of Clooj as a 
starter kit: Download one thing and double click to run. You get obvious menus 
for creating projects etc with no unnecessary complexity. Write and edit (with 
bracket matching, auto-indentation, and a few other nice features) and run code 
without understanding anything but the code. I appreciate that a pointer to 
Clooj has been added to http://dev.clojure.org/display/doc/Getting+Started, and 
I think that's great. But I wish that it would get some more love from other 
tool developers because its author doesn't have the time to maintain it 
actively. There are several minor things that need fixing -- enough that I've 
had to stop teaching with it and switch back to CCW, but I'd love to go back to 
Clooj if it becomes more widely adopted and maintained. And if it does then it 
think it will be an excellent answer to many requests for a starter pack.

It's true that many people will want/need leiningen at some point, but Clooj 
will suffice for a long time for some kinds of work and one can use lein and 
Clooj together to do quite a lot more. (Actually, I think this is an area where 
some maintenance is required -- if I recall correctly Clooj may not yet find 
dependencies where they're pulled in by lein2.) And of course people may want 
to switch to Eclipse/CCW or emacs or whatever else at some point, for various 
reasons, once they have a better idea of what's what and why they should bother 
with the added complexity of those environments.

 -Lee

PS I'm sure someone will think you're asking other people to help maintain 
Clooj, why don't you do it yourself? The answer is that I'm not really well 
steeped in the Java ecosystem or other things needed to do this well, but I am 
indeed willing and able to play a role by testing and providing constructive 
feedback.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Sean Corfield
On Fri, Feb 15, 2013 at 4:02 AM, Jules julesjac...@gmail.com wrote:
 But most windows users aren't familiar with emacs.

Probably fair to say that most insert anything except lisp users
aren't familiar with emacs :)

 Note also that the hypothetical beginner has not figured out yet that
 lein.bat is in fact leiningen. He thinks that that is just the install
 script (since this is not made clear on the leiningen site), and he thinks
 the installation has failed. It is not made clear that lein.bat *is* the
 program you want to run, and that you want to put it on your path as well.

I'm sure Phil would appreciate tickets on the Leiningen issue tracker
that provided specific suggested changes to the wording /
documentation, that would help make the project more approachable to
Windows users.

Changing clojure.org is another matter, unfortunately, and that comes
up repeatedly. It would certainly be an improvement if the Getting
Started page linked to leiningen.org instead of the Github repo.

 Another problem, also seen in this thread, is that there are too many
 options and no consensus on what's the best way to get started.

I think there's a feeling that Clojure should not be too opinionated
or too proscriptive. Basically, if you're already developing JVM-based
software, you should just be able to add Clojure to whatever you're
already doing. I think also many Clojurians have strong opinions on
how they prefer to develop - because of the sort of people that
Clojure has historically attracted - and so there's not yet been any
real coalescing into a single endorsed way of doing things.

 Blaming the newbies by saying you better practice the skill of figuring out
 things is a bit unfair I think.

There certainly has been an attitude in the Clojure world that you
need to think more and be a better than average developer. I think
what we're seeing now is an influx of people that are different to the
early adopters and the ecosystem hasn't yet adjusted to address that.

 The way I view it, learning
 the magic incantations to get a specific tool working is not useful
 knowledge. People would rather fill their brain with the cool stuff: how
 reducers, lambda, macros, core.logic work, etc.

Yes, but... Installation is a one-off. Once you're done, you don't
have to revisit it until you move to a new machine, by which time you
already know how to set things up to your liking, because you
succeeded before (even if took you a while the first time).

When I first installed Leiningen + Emacs on a number of machines, I
ran into a number of problems (Emacs 24 previews on Ubuntu were an
adventure, for example) but it's gotten easier each time I've done it.
Leiningen on Windows is trivial now but was frustrating /
bewildering at my first attempt (especially not being particularly
familiar with Windows in the first place!).
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




interleave with one argument

2013-02-15 Thread Denis Washington
Hi,

I just solved the Replicate a Sequence problem on 4clojure [1] using
interleave. However, I noticed that interleave cannot be called with
a single argument. My first attempt at solving the problem was like
this:

  (defn replicate-n-times [xs n]
(apply interleave (replicate n xs)))

This works fine for n  1:

  clojure= (replicate-n-times [1 2 3] 3)
  (1 1 1 2 2 2 3 3 3)

However, for n = 1 the function fails with an exception:

  clojure= (replicate-n-times [1 2 3] 1)
  ArityException Wrong number of args (1) passed to: core$interleave
  clojure.lang.AFn.throwArity (AFn.java:437)

I had to add a special case to make this work:

  (fn replicate-n-times [xs n]
(if (= n 1) xs (apply interleave (replicate n xs

I think it would be nice if interleave called with a single argument
would just return the argument itself, just like single-argument + and
* do.

Regards,
Denis Washington

[1] http://www.4clojure.com/problem/33

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: interleave with one argument

2013-02-15 Thread Andy Fingerhut
There's a ticket requesting that enhancement:

http://dev.clojure.org/jira/browse/CLJ-863

Andy

On Feb 15, 2013, at 1:15 PM, Denis Washington wrote:

 Hi,
 
 I just solved the Replicate a Sequence problem on 4clojure [1] using
 interleave. However, I noticed that interleave cannot be called with
 a single argument. My first attempt at solving the problem was like
 this:
 
  (defn replicate-n-times [xs n]
(apply interleave (replicate n xs)))
 
 This works fine for n  1:
 
  clojure= (replicate-n-times [1 2 3] 3)
  (1 1 1 2 2 2 3 3 3)
 
 However, for n = 1 the function fails with an exception:
 
  clojure= (replicate-n-times [1 2 3] 1)
  ArityException Wrong number of args (1) passed to: core$interleave
  clojure.lang.AFn.throwArity (AFn.java:437)
 
 I had to add a special case to make this work:
 
  (fn replicate-n-times [xs n]
(if (= n 1) xs (apply interleave (replicate n xs
 
 I think it would be nice if interleave called with a single argument
 would just return the argument itself, just like single-argument + and
 * do.
 
 Regards,
 Denis Washington
 
 [1] http://www.4clojure.com/problem/33

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
 between the current doc improvement for lein we're both participating in (
https://github.com/technomancy/leiningen/issues/1007) and the available doc 
for CCW (installation is one step really), are there any pain points that 
such a starter kit would address?

A starter kit would address several things:

- To a beginner it is not clear that he should pick leiningen
- A starter kit includes an IDE that the user doesn't need to find and 
choose among the many options himself
- The current installation, even if everything is documented perfectly, is 
still many steps. for somebody who is determined to install clojure this is 
not a problem, but somebody who is not so determined may give up, 
especially since the steps are not documented in one place.

 AFAIK, this is not true.   Eclipse Counterclockwise comes bundled with 
its own internal copy of leiningen, and completely manages it for you.  You 
do not need to manually install leiningen or understand anything about it 
other than how to add dependencies to your project.clj file.

Ah, I had not realized this. If this is the case then this would solve many 
problems. It has certainly never worked for me. I will have access to a 
windows 8 machine soon, I'll try it there. And if it doesn't work there 
either I will also try installing leiningen by hand there, to see if that 
does work. And if so, I'll write a guide on how to install everything 
that's easy to follow by a newbie like me ;-) Or if somebody does figure 
out how to install CCW from the command line, I'll write a script that 
downloads and installs everything automatically.

 Which (yes, I'm a broken record), all again speaks in favor of Clooj as a 
starter kit: Download one thing and double click to run.

Yes, this would be the ideal experience. But I do think that you very 
quickly want leiningen integration. For so many things you have an external 
dependency, e.g. people wanting to play with core.logic or with web 
programming. Maybe lighttable will eventually fill this role. Generally 
commercially backed projects do better in this regard, because if they 
aren't user friendly they go bankrupt ;-)

 I think there's a feeling that Clojure should not be too opinionated or 
too proscriptive.

Yes, this diversity is good for experienced clojure developers, but for a 
beginner it is great if the community has paved a default route for people 
just getting started, because beginners can't make an informed choice yet. 
Later when they are more knowledgeable, they can always switch to something 
else easily.

 There certainly has been an attitude in the Clojure world that you need 
to think more and be a better than average developer. I think what we're 
seeing now is an influx of people that are different to the early adopters 
and the ecosystem hasn't yet adjusted to address that. 

Yes this is part of the reason, but I think there's no denying that it's 
just hard on windows. On linux I was able to set up clojure pretty easily. 
Even though it's not a one step process on linux, it's reasonably obvious 
which steps to take and once you take them it actually works immediately.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Phil Hagelberg

 It's true that many people will want/need leiningen at some point, but
 Clooj will suffice for a long time for some kinds of work and one can
 use lein and Clooj together to do quite a lot more.

There's really no reason (apart from a lack of motivated devs working on
it) that you'd have to choose between the two. As of Leiningen 2.x it's
possible to use Leiningen as a library, which is how CCW uses it. It
would be easy in theory for Clooj to detect that it's working within a
Leiningen project, use Leiningen to handle its REPL, and offer to launch
various Leiningen tasks in the context of the project. Then it could all
be handled by a single uberjar; no messy install.

I'd be happy to offer pointers for Leiningen integration in the
#leiningen channel on Freenode if anyone wants to make this happen.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Lee Spector

On Feb 15, 2013, at 6:37 PM, Phil Hagelberg wrote:
 
 There's really no reason (apart from a lack of motivated devs working on
 it) that you'd have to choose between the two. As of Leiningen 2.x it's
 possible to use Leiningen as a library, which is how CCW uses it. It
 would be easy in theory for Clooj to detect that it's working within a
 Leiningen project, use Leiningen to handle its REPL, and offer to launch
 various Leiningen tasks in the context of the project. Then it could all
 be handled by a single uberjar; no messy install.
 
 I'd be happy to offer pointers for Leiningen integration in the
 #leiningen channel on Freenode if anyone wants to make this happen.

I don't know if this will motivate people with the requisite chops/time but I 
for one would love to see this happen. Even just a lein deps menu item would 
extend the utility of this simplest-to-install-and-use Clojure IDE 
tremendously. I can't volunteer to do it but I'll gladly test it and use it 
with students, and discuss options etc.

FWIW until recently you could at least use command-line Leiningen and Clooj 
side by side on the same project when you got to the point of needing 
dependencies, so you could keep writing and running code in Clooj with 
occasional trips to a command line (and yes, a separate installation) to pull 
in new dependencies. I don't think that Clooj has been updated to deal with 
where lein2 puts things, but building the functionality into Clooj itself would 
be much better than just fixing this.

 -Lee

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread Jules
Okay, here is what happened when I tried to install on a fresh win 8 
machine:

- first downloaded eclipse
- tried to run it = no java installed
- installed java from the oracle site (making sure to opt out of their 
bundeled crapware :P)
- tried to run eclipse again, says still no java installed
- turns out i needed to put the java binary on the path manually, so i do 
this
- run eclipse again, error: Failed to load the JNI shared library 
C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll
- google for this problem, suspect that i have 32 bit java and 64 bit 
eclipse
- go to oracle site again, and hunt around for 64 bit java, which is hidden 
on a different page
- eclipse runs, I select a worskspace directory
- go to Help  Install new software
- paste update site url in field called Work with
- select counterclockwise, next, next, next, OK, next, restart eclipse
- file  new  project  leiningen  leiningen project, next, type project 
name, finish
- eclipse appears to be hanging: the window grays out and title bar says 
not responding, but eventually does work, I get a couple of dialog boxes 
about git which I close
- now I'm back to the home screen of eclipse, nothing indicates that the 
project was created
- looking around on the file system indicates that the project was however 
created
- after some fighting with the eclipse UI I get to see that the project was 
indeed created
- i select the project, click run, select run as clojure application, get 
some more dialog boxes, select OK
- at the bottom, an empty tab opens with title REPL @ 
nrepl:///localhost...
- that repl works
- i add core.logic to the dependencies in project.clj
- i restart the repl
- try (use 'clojure.core.logic) = file not found error
- i right click on the project  leiningen  update dependencies
- i restart the repl, and type (use 'clojure.core.logic)
- IT WORKS!!!

So indeed CCW does contain its own leiningen, which is awesome. Somehow 
that didn't work on the other computer though...

Although not optimal, the process described above is doable. Some of the 
steps will be really non obvious to beginners, and at each step you have 10 
ways to do the wrong thing. But indeed this installation is MUCH better 
than I previously experienced. Now I just need to figure out how to do the 
rest of the things one needs to do in CCW, like unit testing, having java 
files and clojure in the same project, integrating with version control, 
running the whole application, and creating a packaged application/library.

If this process was described in a canonical how to get started guide for 
clojure on windows, then that would be very good.

Jules

 

On Friday, February 15, 2013 11:55:06 PM UTC+1, Jules wrote:

  between the current doc improvement for lein we're both participating in 
 (https://github.com/technomancy/leiningen/issues/1007) and the available 
 doc for CCW (installation is one step really), are there any pain points 
 that such a starter kit would address?

 A starter kit would address several things:

 - To a beginner it is not clear that he should pick leiningen
 - A starter kit includes an IDE that the user doesn't need to find and 
 choose among the many options himself
 - The current installation, even if everything is documented perfectly, is 
 still many steps. for somebody who is determined to install clojure this is 
 not a problem, but somebody who is not so determined may give up, 
 especially since the steps are not documented in one place.

  AFAIK, this is not true.   Eclipse Counterclockwise comes bundled with 
 its own internal copy of leiningen, and completely manages it for you.  You 
 do not need to manually install leiningen or understand anything about it 
 other than how to add dependencies to your project.clj file.

 Ah, I had not realized this. If this is the case then this would solve 
 many problems. It has certainly never worked for me. I will have access to 
 a windows 8 machine soon, I'll try it there. And if it doesn't work there 
 either I will also try installing leiningen by hand there, to see if that 
 does work. And if so, I'll write a guide on how to install everything 
 that's easy to follow by a newbie like me ;-) Or if somebody does figure 
 out how to install CCW from the command line, I'll write a script that 
 downloads and installs everything automatically.

  Which (yes, I'm a broken record), all again speaks in favor of Clooj as 
 a starter kit: Download one thing and double click to run.

 Yes, this would be the ideal experience. But I do think that you very 
 quickly want leiningen integration. For so many things you have an external 
 dependency, e.g. people wanting to play with core.logic or with web 
 programming. Maybe lighttable will eventually fill this role. Generally 
 commercially backed projects do better in this regard, because if they 
 aren't user friendly they go bankrupt ;-)

  I think there's a feeling that Clojure should not be too opinionated or 
 too proscriptive.


Re: Why is this so difficult?

2013-02-15 Thread Andy Fingerhut
Jules:

Did you see this page on clojure-doc.org before?

http://clojure-doc.org/articles/tutorials/eclipse.html

I don't know if it covers any of the difficulties you found, or documents 
anything that you'd like to see documented, but Michael Klishin and others that 
maintain clojure-doc.org content would likely be quite willing to accept any 
enhancements to that documentation that you would suggest.

Andy

On Feb 15, 2013, at 3:57 PM, Jules wrote:

 Okay, here is what happened when I tried to install on a fresh win 8 machine:
 
 - first downloaded eclipse
 - tried to run it = no java installed
 - installed java from the oracle site (making sure to opt out of their 
 bundeled crapware :P)
 - tried to run eclipse again, says still no java installed
 - turns out i needed to put the java binary on the path manually, so i do this
 - run eclipse again, error: Failed to load the JNI shared library 
 C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll
 - google for this problem, suspect that i have 32 bit java and 64 bit eclipse
 - go to oracle site again, and hunt around for 64 bit java, which is hidden 
 on a different page
 - eclipse runs, I select a worskspace directory
 - go to Help  Install new software
 - paste update site url in field called Work with
 - select counterclockwise, next, next, next, OK, next, restart eclipse
 - file  new  project  leiningen  leiningen project, next, type project 
 name, finish
 - eclipse appears to be hanging: the window grays out and title bar says not 
 responding, but eventually does work, I get a couple of dialog boxes about 
 git which I close
 - now I'm back to the home screen of eclipse, nothing indicates that the 
 project was created
 - looking around on the file system indicates that the project was however 
 created
 - after some fighting with the eclipse UI I get to see that the project was 
 indeed created
 - i select the project, click run, select run as clojure application, get 
 some more dialog boxes, select OK
 - at the bottom, an empty tab opens with title REPL @ nrepl:///localhost...
 - that repl works
 - i add core.logic to the dependencies in project.clj
 - i restart the repl
 - try (use 'clojure.core.logic) = file not found error
 - i right click on the project  leiningen  update dependencies
 - i restart the repl, and type (use 'clojure.core.logic)
 - IT WORKS!!!
 
 So indeed CCW does contain its own leiningen, which is awesome. Somehow that 
 didn't work on the other computer though...
 
 Although not optimal, the process described above is doable. Some of the 
 steps will be really non obvious to beginners, and at each step you have 10 
 ways to do the wrong thing. But indeed this installation is MUCH better than 
 I previously experienced. Now I just need to figure out how to do the rest of 
 the things one needs to do in CCW, like unit testing, having java files and 
 clojure in the same project, integrating with version control, running the 
 whole application, and creating a packaged application/library.
 
 If this process was described in a canonical how to get started guide for 
 clojure on windows, then that would be very good.
 
 Jules

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Google Summer of Code 2013

2013-02-15 Thread Andy Fingerhut
I don't know if it would be within the scope of what GSoC would be interested 
in funding, or if anyone would be interested in doing it, but from some of the 
messages in the Why is it so hard? thread, there are people interested in 
seeing Clooj stay up to date and maintained.

Andy

On Feb 14, 2013, at 10:03 AM, Daniel Solano Gómez wrote:

 Hello, all,
 
 It's official:  Google Summer of Code 2013 is on.
 
 Last year, Clojure was able to get four students who worked on projects like 
 Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and I'd 
 love to see Clojure be a mentoring organisation again this year.
 
 I have created a GSoC 2013 page on the Clojure community wiki 
 http://dev.clojure.org/display/community/Google+Summer+of+Code+2013.  Here 
 you will be able to find the latest information about what's going on with 
 Clojure's GSoC 2013 effort and how to get involved.
 
 Here's some ways you can help:
 
 * Let people in your local user groups or university know about Clojure and 
 GSoC.
 * If you're going to Clojure/West, attend the GSoC unsession.
 
 For students
 
 * Start researching project ideas and get involved with the relevant 
 communities to find mentors.
 
 For developers:
 
 Does your open source project have a backlog of features to implement?  GSoC 
 is a great way to draw new contributors to your project.
 
 * Post it to the project idea page and become a mentor.
 * Let people know about GSoC on your project mailing list.
 
 I'd like to thank everyone in advance for helping with our GSoC 2013 project.
 
 Sincerely,
 
 Daniel

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




regarding Ring, am I reinventing the wheel?

2013-02-15 Thread larry google groups

I have been working with Clojure for a few months now. I am now more
familiar with it then I was even 3 months ago. I am now going back
through some of the early code I wrote, and I see a lot of redundancy
and mistakes. In particular, I notice this function that I wrote to
handle the request map (in a web app that is using Ring and
Compojure):

  (defn process-event [request]
(let [request1 (process-pre-event-hooks request)
  request2 (process-page-specific-pre-page-hooks request1)
  request3 (process-mid-event-hooks request2)
  request4 (process-page-specific-post-page-hooks request3)
  request5 (process-post-event-hooks request4)]
  request5))

I could probably re-write all of this as Ring middleware, yes?
Functions that take the request map, do something with it, and then
return the new, modified request map -- that is what middleware is,
yes? Or does middleware return a function that is then called on the
request map?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: regarding Ring, am I reinventing the wheel?

2013-02-15 Thread James Reeves
A Ring middleware function takes a handler as its argument, and returns a
new handler, so you could write:

(defn wrap-pre-event-hooks [handler]
  (fn [request]
(handler (process-pre-event-hooks request

However, I'm curious as to what all your process-* functions are actually
doing. It seems strange to modify the request map so much.

- James


On 16 February 2013 00:14, larry google groups lawrencecloj...@gmail.comwrote:


 I have been working with Clojure for a few months now. I am now more
 familiar with it then I was even 3 months ago. I am now going back
 through some of the early code I wrote, and I see a lot of redundancy
 and mistakes. In particular, I notice this function that I wrote to
 handle the request map (in a web app that is using Ring and
 Compojure):

   (defn process-event [request]
 (let [request1 (process-pre-event-hooks request)
   request2 (process-page-specific-pre-page-hooks request1)
   request3 (process-mid-event-hooks request2)
   request4 (process-page-specific-post-page-hooks request3)
   request5 (process-post-event-hooks request4)]
   request5))

 I could probably re-write all of this as Ring middleware, yes?
 Functions that take the request map, do something with it, and then
 return the new, modified request map -- that is what middleware is,
 yes? Or does middleware return a function that is then called on the
 request map?

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Can I embed sqlite inside of an uberjar file?

2013-02-15 Thread larry google groups
I am thinking about what they did at Hotelicopter (now renamed
RoomKey) -- where they embed a whole snapshot of Solr, and all the
data, inside their uberwar files, so that the uberwar file has no
outside dependencies, not even a database. The CTO of RoomKey has
talked about how you could wait 10 years and then take one of their
uberwars from 2013 and run it, and it would still run, because it
relies on nothing outside of itself.

I am wondering how close I could get to that with an active database
that still allows INSERT and DELETE operations. I am thinking that if
I use Sqlite I could possible get outside dependencies down to a
single file that Sqlite would read and write to?

I might devote a few days to exploring this. Does anyone know of
whether this can work?



-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: regarding Ring, am I reinventing the wheel?

2013-02-15 Thread Sean Corfield
On Fri, Feb 15, 2013 at 4:14 PM, larry google groups
lawrencecloj...@gmail.com wrote:
   (defn process-event [request]
 (let [request1 (process-pre-event-hooks request)
   request2 (process-page-specific-pre-page-hooks request1)
   request3 (process-mid-event-hooks request2)
   request4 (process-page-specific-post-page-hooks request3)
   request5 (process-post-event-hooks request4)]
   request5))

If you wanted to keep the same basic processing, you could use this
much simpler code:

(defn process-event [request]
  (- request
  process-pre-event-hooks
  process-page-specific-pre-page-hooks
  process-mid-event-hooks
  process-page-specific-post-page-hooks
  process-post-event-hooks))
--
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Can I embed sqlite inside of an uberjar file?

2013-02-15 Thread Phil Hagelberg

larry google groups writes:

 I am wondering how close I could get to that with an active database
 that still allows INSERT and DELETE operations. I am thinking that if
 I use Sqlite I could possible get outside dependencies down to a
 single file that Sqlite would read and write to?

SQLite is really not a good choice on the JVM. Unless you have to
read from existing SQLite databases you would certainly be better off
with Derby or H2.

-Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Reusing parameters in a MAP function

2013-02-15 Thread Jonathon McKitrick
I'd like turn an array of maps into a map of maps, extracting a unique id 
from each map as the key.

(into {} (map #([(:id %) %]) map-array)

was my first attempt, but I'm not sure the syntax would work anyway. 
 However, the first question (and obvious error cause) is how to repeat 
MAP-ARRAY twice inside the lambda expression without writing a new FN.  Or 
am I going down the wrong path here?

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reusing parameters in a MAP function

2013-02-15 Thread Sean Corfield
(into {} (map (juxt :id identity) map-array)) ;; the first thing that
comes to mind

On Fri, Feb 15, 2013 at 4:55 PM, Jonathon McKitrick
jmckitr...@gmail.com wrote:
 I'd like turn an array of maps into a map of maps, extracting a unique id
 from each map as the key.

 (into {} (map #([(:id %) %]) map-array)

 was my first attempt, but I'm not sure the syntax would work anyway.
 However, the first question (and obvious error cause) is how to repeat
 MAP-ARRAY twice inside the lambda expression without writing a new FN.  Or
 am I going down the wrong path here?

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





--
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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Questions regarding lazy sequence processing

2013-02-15 Thread Steven Yi
Hi All,

I'm fairly new to Clojure (enjoying it very much!) and had a couple 
questions regarding lazy sequences.  

1. With a sequence of sequences, I want to reduce the sequences down into a 
single sequence.  So, the heads of all the sequences gets reduced, then the 
next items, etc.  The end result would also be a lazy sequence.  Right now 
I have this code that is working, but I wasn't sure if there's some other 
way that might be clearer:

(defn amix
  ([] [])
  ([ a]
 (let [len (count a)]
   (if (= len 1)
 (first a)
 (map #(reduce + %) (partition len (apply interleave a)))


2. I'm planning to have a number of sequence transforming functions.  Most 
will probably have this shape:

(defn some-func [arg1 arg2 xs]
  (map #(some code...) xs))

This would be so I could consume a lazy sequence xs, operate on it, then 
output a lazy sequence.  I thought I might write a macro to simplify this 
and have the function do its own lazy-seq and recursive call to itself, 
rather than go through map (figured it might save some call overhead, and 
simplify the macro writing, but am still a bit new with this).  I imagine 
this should work fine, but is this kind of thing already encapsulated 
somewhere?

Thanks!
steven

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reusing parameters in a MAP function

2013-02-15 Thread Jonathon McKitrick
Beautiful.  I haven't gotten to juxt and identity yet, and this works 
brilliantly

On Friday, February 15, 2013 7:58:09 PM UTC-5, Sean Corfield wrote:

 (into {} (map (juxt :id identity) map-array)) ;; the first thing that 
 comes to mind 

 On Fri, Feb 15, 2013 at 4:55 PM, Jonathon McKitrick 
 jmcki...@gmail.com javascript: wrote: 
  I'd like turn an array of maps into a map of maps, extracting a unique 
 id 
  from each map as the key. 
  
  (into {} (map #([(:id %) %]) map-array) 
  
  was my first attempt, but I'm not sure the syntax would work anyway. 
  However, the first question (and obvious error cause) is how to repeat 
  MAP-ARRAY twice inside the lambda expression without writing a new FN. 
  Or 
  am I going down the wrong path here? 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  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 unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  



 -- 
 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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reusing parameters in a MAP function

2013-02-15 Thread Jonathon McKitrick
Sorry, I should add I haven't gotten to them in my migration studies yet... 
common lisp to clojure is a longer road than appears.  ;-)


On Friday, February 15, 2013 8:28:26 PM UTC-5, Jonathon McKitrick wrote:

 Beautiful.  I haven't gotten to juxt and identity yet, and this works 
 brilliantly

 On Friday, February 15, 2013 7:58:09 PM UTC-5, Sean Corfield wrote:

 (into {} (map (juxt :id identity) map-array)) ;; the first thing that 
 comes to mind 

 On Fri, Feb 15, 2013 at 4:55 PM, Jonathon McKitrick 
 jmcki...@gmail.com wrote: 
  I'd like turn an array of maps into a map of maps, extracting a unique 
 id 
  from each map as the key. 
  
  (into {} (map #([(:id %) %]) map-array) 
  
  was my first attempt, but I'm not sure the syntax would work anyway. 
  However, the first question (and obvious error cause) is how to repeat 
  MAP-ARRAY twice inside the lambda expression without writing a new FN. 
  Or 
  am I going down the wrong path here? 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@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+u...@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 unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to clojure+u...@googlegroups.com. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  



 -- 
 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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Looping and accumulation

2013-02-15 Thread Jonathon McKitrick
So it looks like this might be perfect for what I need.  I need to track a 
hash of the key fields of inserted db records so I can skip duplicates 
without db access.

On Thursday, February 14, 2013 7:35:20 PM UTC-5, Luc wrote:

 Look at the first example here: 

 http://clojuredocs.org/clojure_core/clojure.core/transient 

 It should inspire you. 

 Transient structures make this kind of loop run faster but as you lay out 
 your first iteration just toss this aside (and the xxx! version of conj 
 and cie). 

 Luc P. 


  I have a loop over a function that is accumulating a list of database 
 keys 
  for later use.  But it is primarily doing other processing and returning 
 a 
  collection of processed/filtered records.  I'd normally just PUSH the 
 ids 
  and records onto a list in Common Lisp, or even LOOP... COLLECT into 2 
  lists.  In the Clojure way, how would I build this auxiliary list 
 without 
  using a mutable collection?  Would it make sense to return a map or some 
  other structure from the processing function that would contain both the 
  processed record as well as any id of interest?  I could accumulate this 
  result, then filter the map into 2 collections - one of processed 
 records 
  and the other a subset of id's of interest.  But that seems kludgy 
  commingling the results like that. 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  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 unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  
  
 -- 
 Softaddictslprefo...@softaddicts.ca javascript: 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
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Building/inserting multiple records

2013-02-15 Thread Jonathon McKitrick
I'm iterating a large dataset and inserting a record for each row.  After 
working in a Salesforce environment, I'm thinking it would be better to 
build a collection of records and insert them in one fell swoop.

1.  Is it easy (and immutable) to build a collection of records to insert? 
 I've been told CONJ is a good start.
2.  Does the clojure jdbc interface support insertion of multiple records? 
 I haven't seen such a function yet.

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] analyze 0.3.0 - Hygienic transformation

2013-02-15 Thread ronen
Great! 

The Clojure eco system is really fast paced

Ronen

On Friday, February 15, 2013 9:30:19 AM UTC+2, Ambrose Bonnaire-Sergeant 
wrote:

 Jonas already has another project which uses analyze 
 https://github.com/jonase/eastwood

 On Fri, Feb 15, 2013 at 12:19 PM, ronen nar...@gmail.com javascript:wrote:


 It looks as if https://github.com/jonase/kibit/ is a lint/check style 
 tool that only reads the source code, this limits its utilization:

 Kibit 
 readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read
  source 
 code without any macro expansion or evaluation. A macro can therefor easily 
 invalidate a rule. Also, kibit will not know if the symbol + in the form (+ 
 x 1) actually refers to a local or to a function in a namespace other 
 than clojure.core. Expect some false positives.

 So there is a place for an AST based one (more similar to findbugs I 
 guess)

 On Wednesday, February 13, 2013 9:21:52 AM UTC+2, Ambrose 
 Bonnaire-Sergeant wrote:

 IMO that's the job of a linter-style tool, which can be written easily 
 with `analyze`.

 On Tue, Feb 12, 2013 at 11:58 PM, Michael Wood esio...@gmail.comwrote:

 It might be useful, though, to be able to enable warnings for shadowed
 variables.

 On 12 February 2013 17:38, Timothy Baldridge tbald...@gmail.com 
 wrote:
  This sort of pattern is used quite a lot in clojure (even in core):
 
  (let [data (if (string? data) (read-string data) data)
data (if (string? (first data)) (first data) (next data))
data (if (string? (first data)) (first data) (next data))]
   data)
 
  Throwing exceptions on overridden variable names would not only break
  Clojure code, but also is very non-lispy.
 
  Timothy
 
 
 
  On Tue, Feb 12, 2013 at 6:31 AM, AtKaaZ atk...@gmail.com wrote:
 
  it makes sense to not throw now that I think about it, when using _
  instead of a
  I'm also thinking of cases like:
  = (let [a 1]
   (let [b 2 a 3]
 (println a b)))
  3 2
  nil
 
  is there something that would let me know I'm overwriting a ? I 
 figure
  if something like this would slip by would be tough to track down
 
 
  On Tue, Feb 12, 2013 at 1:46 PM, Michael Wood esio...@gmail.com 
 wrote:

 
  On 12 February 2013 12:28, AtKaaZ atk...@gmail.com wrote:
   what would this do:
  
   (let [a 1, a 2] a)
   becomes:
   (let [a 1, a123 2] a)
   or
   (let [a 1, a123 2] a123)
   or
   exception[I prefer]
 
  It would be the second option, i.e.:
 
  (let [a 1, a123 2] a123)
 
  The original code is valid, so it would not throw an exception.
 
   On Tue, Feb 12, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant
   abonnair...@gmail.com wrote:
  
   Processing a hygienic AST relieves the burden of worrying about
   shadowing
   of locals.
  
   Wherever a binding would normally be shadowed, it is instead 
 renamed
   to a
   local binding currently not in scope.
  
   eg. (let [a 1, a a] a)
  
   becomes
  
   (let [a 1, a123 a] a123)
  
   It can be useful for those processing Clojure's analysis results.
  
   Thanks,
   Ambrose
  
  
   On Tue, Feb 12, 2013 at 1:54 AM, kovas boguta 
 kovas@gmail.com

   wrote:
  
   What is a hygienic AST?
  
   Thanks
   k
  
  
   On Sun, Feb 10, 2013 at 10:45 PM, Ambrose Bonnaire-Sergeant
   abonnair...@gmail.com wrote:
Hi everyone,
   
Happy to release analyze 0.3.0 with new hygienic code
transformation
capabilities.
   
[analyze 0.3.0]
   
In a line:
   
analyze.hygienic= (- (ast (let [a 1 a a b a a a] a)) ast-hy
emit-hy)
((fn* ([] (let* [a 1 a2921 a b a2921 a2922 a2921] a2922
   
Hygienic AST's have enabled large performance boosts in 
 core.typed.
I'm
excited to see how it could
be as useful to others.
   
Note: hygienic AST's (those transformed with
`analyze.hygienic/ast-hy` can
be printed normally with `analyze.emit-form/emit-form`, and
hygienically
with `analyze.hygienic/emit-hy`.
   
https://github.com/frenchy64/**analyzehttps://github.com/frenchy64/analyze
   
Thanks,
Ambrose
   
--
--
You received this message because you are subscribed to the 
 Google
Groups Clojure group.
To post to this group, send email to clo...@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+u...@**googlegroups.com

For more options, visit this group at
http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the 
 Google
Groups
Clojure group.
To unsubscribe from this group and stop receiving emails from 
 it,
send
an
email to clojure+u...@**googlegroups.com.

For more options, visit https://groups.google.com/**
 groups/opt_out https://groups.google.com/groups/opt_out.
   
   
  
   --
   --
   You received this message because you 

Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-15 Thread Eric Arthen
Stu,

I changed my code from 1.4.0 to 1.5.0 RC 16 (about 70 source files) and ran 
into two small things.They are probably not bugs but they confused me.

I have not been following 1.5 development in detail, so these are probably 
not at all new. So far everything else seems ok, which is great.

1. array-map used to throw an illegal argument exception on duplicate keys, 
but now it succeeds and uses the last value in the array. This change seems 
okay, I just had a case that used the old behavior and it took a bit to 
realize what happened.
  
(array-map :a 1 :a 2 :b 0 :a 3 :b 1)
{:a 3, :b 1}


2. The defn macro used to be permissive when it had nothing but the 
function name, but now it complains. That seems like an improvement, but 
the problem is that it gives no information of what source file or line the 
problem is at so it took me a while to find it.

I was defining a mocked out function, so I just had this: (defn x)

That was okay in 1.4.0, but now it returns the error below. I just replaced 
it by (def x), so it was easy to fix once I saw it.

It seems to me macro errors never tell about where in the source they 
happen, so I assume that must be very hard to fix and that we're still 
stuck with this in 1.5.0. I must admit that trying to debug macro issues 
(esp. in the 'ns' macro) are almost the only time I've found myself cursing 
at clojure itself. Most of the time it is a joy.


Exception in thread main java.lang.IllegalArgumentException: Parameter 
declaration missing
at clojure.core$assert_valid_fdecl.invoke(core.clj:6716)
at clojure.core$sigs.invoke(core.clj:223)
at clojure.core$defn.doInvoke(core.clj:301)
at clojure.lang.RestFn.invoke(RestFn.java:445)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6468)
at clojure.lang.Compiler.macroexpand(Compiler.java:6529)
at clojure.lang.Compiler.eval(Compiler.java:6603)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.loadResourceScript(RT.java:361)
at clojure.lang.RT.load(RT.java:440)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5028.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5336)
at clojure.core$load_lib$fn__4977.invoke(core.clj:5375)
at clojure.core$load_lib.doInvoke(core.clj:5374)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$load_libs.doInvoke(core.clj:5413)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at clojure.core$require.doInvoke(core.clj:5496)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at midje.repl$load_facts$fn__5948.invoke(repl.clj:205) -- yes this was in 
a midje test case, but it does not tell where in my code it is
at midje.repl$load_facts.doInvoke(repl.clj:191)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at user$eval6011.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.eval(Compiler.java:6582)
at clojure.core$eval.invoke(core.clj:2852)
at clojure.main$eval_opt.invoke(main.clj:302)
at clojure.main$initialize.invoke(main.clj:321)
at clojure.main$null_opt.invoke(main.clj:356)
at clojure.main$main$fn__6656.invoke(main.clj:434)
at clojure.main$main.doInvoke(main.clj:431)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
Subprocess failed

-Eric


On Wednesday, February 13, 2013 10:33:42 PM UTC-5, stuart@gmail.com 
wrote:

 If you care about Clojure 1.5 compatibility for your codebase, please test 
 it against RC 16 as soon as possible.

 You can get the source and build it yourself from [1], or wait for Maven 
 Central [2] to pick up the CI build, which usually takes a few hours.

 Thanks!
 Stu

 [1] https://github.com/clojure/clojure
 [2] http://bit.ly/WEnjAi
  

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: RC 16: Last chance to test against Clojure 1.5 before it ships

2013-02-15 Thread Andy Fingerhut
Eric:

1 was a result of a change made by choice:


https://github.com/clojure/clojure/blob/master/changes.md#210-set-and-map-constructor-functions-allow-duplicates

The ticket linked there has a link to a design page on it, which in turn has a 
link to an earlier discussion thread on the Clojure group about it.

2. I'm not sure about this, but I think this was a change for ticket CLJ-157:

http://dev.clojure.org/jira/browse/CLJ-157

Given your description of it, I found it a bit funny that I categorized that 
one under Improved error messages in the changes file.  Probably time to file 
a new ticket related to improving the issues you point out.

Andy

On Feb 15, 2013, at 8:12 PM, Eric Arthen wrote:

 Stu,
 
 I changed my code from 1.4.0 to 1.5.0 RC 16 (about 70 source files) and ran 
 into two small things.They are probably not bugs but they confused me.
 
 I have not been following 1.5 development in detail, so these are probably 
 not at all new. So far everything else seems ok, which is great.
 
 1. array-map used to throw an illegal argument exception on duplicate keys, 
 but now it succeeds and uses the last value in the array. This change seems 
 okay, I just had a case that used the old behavior and it took a bit to 
 realize what happened.
   
 (array-map :a 1 :a 2 :b 0 :a 3 :b 1)
 {:a 3, :b 1}
 
 
 2. The defn macro used to be permissive when it had nothing but the function 
 name, but now it complains. That seems like an improvement, but the problem 
 is that it gives no information of what source file or line the problem is at 
 so it took me a while to find it.
 
 I was defining a mocked out function, so I just had this: (defn x)
 
 That was okay in 1.4.0, but now it returns the error below. I just replaced 
 it by (def x), so it was easy to fix once I saw it.
 
 It seems to me macro errors never tell about where in the source they happen, 
 so I assume that must be very hard to fix and that we're still stuck with 
 this in 1.5.0. I must admit that trying to debug macro issues (esp. in the 
 'ns' macro) are almost the only time I've found myself cursing at clojure 
 itself. Most of the time it is a joy.
 
 
 Exception in thread main java.lang.IllegalArgumentException: Parameter 
 declaration missing
   at clojure.core$assert_valid_fdecl.invoke(core.clj:6716)
   at clojure.core$sigs.invoke(core.clj:223)
   at clojure.core$defn.doInvoke(core.clj:301)
   at clojure.lang.RestFn.invoke(RestFn.java:445)
   at clojure.lang.Var.invoke(Var.java:423)
   at clojure.lang.AFn.applyToHelper(AFn.java:167)
   at clojure.lang.Var.applyTo(Var.java:532)
   at clojure.lang.Compiler.macroexpand1(Compiler.java:6468)
   at clojure.lang.Compiler.macroexpand(Compiler.java:6529)
   at clojure.lang.Compiler.eval(Compiler.java:6603)
   at clojure.lang.Compiler.load(Compiler.java:7064)
   at clojure.lang.RT.loadResourceScript(RT.java:370)
   at clojure.lang.RT.loadResourceScript(RT.java:361)
   at clojure.lang.RT.load(RT.java:440)
   at clojure.lang.RT.load(RT.java:411)
   at clojure.core$load$fn__5028.invoke(core.clj:5530)
   at clojure.core$load.doInvoke(core.clj:5529)
   at clojure.lang.RestFn.invoke(RestFn.java:408)
   at clojure.core$load_one.invoke(core.clj:5336)
   at clojure.core$load_lib$fn__4977.invoke(core.clj:5375)
   at clojure.core$load_lib.doInvoke(core.clj:5374)
   at clojure.lang.RestFn.applyTo(RestFn.java:142)
   at clojure.core$apply.invoke(core.clj:619)
   at clojure.core$load_libs.doInvoke(core.clj:5413)
   at clojure.lang.RestFn.applyTo(RestFn.java:137)
   at clojure.core$apply.invoke(core.clj:619)
   at clojure.core$require.doInvoke(core.clj:5496)
   at clojure.lang.RestFn.invoke(RestFn.java:421)
   at midje.repl$load_facts$fn__5948.invoke(repl.clj:205) -- yes this was 
 in a midje test case, but it does not tell where in my code it is
   at midje.repl$load_facts.doInvoke(repl.clj:191)
   at clojure.lang.RestFn.invoke(RestFn.java:397)
   at user$eval6011.invoke(NO_SOURCE_FILE:1)
   at clojure.lang.Compiler.eval(Compiler.java:6619)
   at clojure.lang.Compiler.eval(Compiler.java:6609)
   at clojure.lang.Compiler.eval(Compiler.java:6582)
   at clojure.core$eval.invoke(core.clj:2852)
   at clojure.main$eval_opt.invoke(main.clj:302)
   at clojure.main$initialize.invoke(main.clj:321)
   at clojure.main$null_opt.invoke(main.clj:356)
   at clojure.main$main$fn__6656.invoke(main.clj:434)
   at clojure.main$main.doInvoke(main.clj:431)
   at clojure.lang.RestFn.invoke(RestFn.java:421)
   at clojure.lang.Var.invoke(Var.java:419)
   at clojure.lang.AFn.applyToHelper(AFn.java:163)
   at clojure.lang.Var.applyTo(Var.java:532)
   at clojure.main.main(main.java:37)
 Subprocess failed
 
 -Eric
 
 
 On Wednesday, February 13, 2013 10:33:42 PM UTC-5, stuart@gmail.com wrote:
 If you care about Clojure 1.5 compatibility for 

Re: Building/inserting multiple records

2013-02-15 Thread Feng Shen
 Is it easy (and immutable) to build a collection of records to insert? 
 I've been told CONJ is a good start.

map maybe be helpful:  (map (fn [d] return-map-of-records) datasets)

 Does the clojure jdbc interface support insertion of multiple records?  I 
haven't seen such a function yet.

clojure.java.jdbc/insert-records



On Saturday, February 16, 2013 11:30:08 AM UTC+8, Jonathon McKitrick wrote:

 I'm iterating a large dataset and inserting a record for each row.  After 
 working in a Salesforce environment, I'm thinking it would be better to 
 build a collection of records and insert them in one fell swoop.

 1.  Is it easy (and immutable) to build a collection of records to insert? 
  I've been told CONJ is a good start.
 2.  Does the clojure jdbc interface support insertion of multiple records? 
  I haven't seen such a function yet.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Google Summer of Code 2013

2013-02-15 Thread Håkan Råberg
I'm pretty interested in setting up and mentor a project around Deuce[1] - 
exact scope to be decided.
But I'm not sure this would fall under the scope of this?

cheers, Hakan

[1] https://github.com/hraberg/deuce/

On Thursday, 14 February 2013 23:33:58 UTC+5:30, Daniel Solano Gómez wrote:

 Hello, all,

 It's official:  Google Summer of Code 2013 is on.

 Last year, Clojure was able to get four students who worked on projects 
 like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and 
 I'd love to see Clojure be a mentoring organisation again this year.

 I have created a GSoC 2013 page on the Clojure community wiki 
 http://dev.clojure.org/display/community/Google+Summer+of+Code+2013. 
  Here you will be able to find the latest information about what's going on 
 with Clojure's GSoC 2013 effort and how to get involved.

 Here's some ways you can help:

 * Let people in your local user groups or university know about Clojure 
 and GSoC.
 * If you're going to Clojure/West, attend the GSoC unsession.

 For students

 * Start researching project ideas and get involved with the relevant 
 communities to find mentors.

 For developers:

 Does your open source project have a backlog of features to implement? 
  GSoC is a great way to draw new contributors to your project.

 * Post it to the project idea page and become a mentor.
 * Let people know about GSoC on your project mailing list.

 I'd like to thank everyone in advance for helping with our GSoC 2013 
 project.

 Sincerely,

 Daniel


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.