Re: Leiningen 2.0.0-preview1

2012-03-08 Thread Pepijn de Vos
Yay, cool! I've run into a problem with "lein run" though. It didn't take any input, so I ran "lein trampoline run" instead, which did this: http://pastebin.com/GBkpC0BP Pepijn On Mar 7, 11:28 pm, Phil Hagelberg wrote: > Hello folks! > > I'm proud to announce the release of Leiningen 2.0.0-prev

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
Sean, I agree that breaking things into smaller functions can potentially help. Often, though, I find that a function begins by unpacking and computing a large number of values that are all important for subsequent computations. Dispatching these computations to helper functions would mean passing

[ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Konrad Hinsen
Timothy Baldridge writes: > The Clojure-Py team is happy to announce the release of Clojure-Py 0.1.0. > > https://github.com/halgari/clojure-py This looks really nice already. Keep up the good work! For me, this could be the solution to the main problem I have with Clojure: the JVM. Most of

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Nicolas
I’m not sure that just adding counter responses to almost all Mark points really help. Most counter arguments here resume to "you are doing it wrong" and "all clojure 'warts' are here to force you to better design". Indeed some kind of code is more readable when written in an imperative way than f

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
On Wed, Mar 7, 2012 at 11:37 PM, Sean Corfield wrote: > I actually find that to be a plus - there's no distracting variance > that artificially makes things "different" that don't need to be. > > I just thought of an amusing analogy. To me, reading Lisp takes more mental effort in the same way th

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
On Thu, Mar 8, 2012 at 2:45 AM, Nicolas wrote: > I’m not sure that just adding counter responses to almost all Mark > points really help. Most counter arguments here resume to "you are > doing it wrong" and "all clojure 'warts' are here to force you to > better design". > Looking back at my init

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Timothy Baldridge
>Congrat's on the release! I am getting the following error on my >Macbook (running 64-bit Lion, Python 2.7.1) when trying to run "sudo >easy_install clojure-py": I've seen this once before, in Linux, I'll open a bug for it and see if we can get it ironed out. Timothy -- You received this messa

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Daniel Janus
I'm seeing it on Arch Linux as well, using both pip2 and easy_install-2.7. Thanks, Daniel W dniu czwartek, 8 marca 2012, 12:00:24 UTC użytkownik tbc++ napisał: > > >Congrat's on the release! I am getting the following error on my > >Macbook (running 64-bit Lion, Python 2.7.1) when trying to run "

Re: Clojurescript: named/numbered releases?

2012-03-08 Thread Stuart Campbell
Hello, According to a past thread ( https://groups.google.com/forum/?fromgroups#!topic/clojure/L4e8DtzdThY): ClojureScript has no "release" versions yet. Instead we have a > revision number, calculated as the number of commits on the master > branch since the beginning of the project. ClojureScri

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Timothy Baldridge
It seems to be a packaging issue. As an aside note, if you do a github checkout then run python setup.py install it seems to work just fine. But I'll look into this issue as well. Timothy 2012/3/8 Daniel Janus : > I'm seeing it on Arch Linux as well, using both pip2 and easy_install-2.7. > > Th

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Laurent PETIT
Amazing! What startup time performance improvements do you see for eg using this platform for shell scripts-like stuff ? Le 8 mars 2012 à 04:42, Timothy Baldridge a écrit : > The Clojure-Py team is happy to announce the release of Clojure-Py 0.1.0. > > https://github.com/halgari/clojure-py > >

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Stuart Halloway
> Looking back at my initial email, I can see that it probably came across as a > bit of a rant, and probably not as constructive a response as I had intended > it to be. I understand where Sean is coming from with his point-by-point. I did not find it so, and enjoyed reading it, albeit while d

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Timothy Baldridge
Okay, the Python package should be fixed now. It took a few tries, but I was finally able to get it to include core.clj as part of the distro. > What startup time performance improvements do you see for eg using > this platform for shell scripts-like stuff ? Currently, it's about 3sec on my machi

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Michael Wood
On 8 March 2012 05:42, Timothy Baldridge wrote: > The Clojure-Py team is happy to announce the release of Clojure-Py 0.1.0. > > https://github.com/halgari/clojure-py > > Clojure-Py is an implementation of Clojure running atop the Python VM. Looks interesting :) What's the plan for ratios and cha

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Timothy Baldridge
> What's the plan for ratios and characters?  I assume they're still on > the TODO list?  (Maybe Issue 17 covers the ratios?) Yeah, I need to run a few more tests, but I'm thinking of somehow layering libgmp ontop of Python in order to implement ratios. The lispreader needs to be fixed to handle

Re: Why don't extends? and satisfies? require implementation of all protocol methods?

2012-03-08 Thread Armando Blancas
(Don't know why I can only respond to the first message.) I come across partial implementation all the time, and with proxy, too. In Eclipse this is so common that this is typical: "This adapter class provides default implementations for the methods described by the SelectionListener interface.

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Evan Gamble
Another way to flatten nested lets and conds is to use a macro that lets you insert conditionals in your lets (vs. your suggestion of inserting lets in conds). I wrote a let? macro that does that: https://github.com/egamble/let-else - Evan On Mar 7, 10:51 pm, Mark Engelberg wrote: > In the mea

Which emacs packages?

2012-03-08 Thread AndyK
Curious about which emacs packages folks use for increased Clojure productivity (beyond the obvious, like slime/swank-clojure)... -- 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

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Sean Corfield
On Thu, Mar 8, 2012 at 2:54 AM, Mark Engelberg wrote: > Looking back at my initial email, I can see that it probably came across as > a bit of a rant, and probably not as constructive a response as I had > intended it to be. No, I thought it was an interesting set of observations but, like Stu, I

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Laurent PETIT
You should probably both share gists of real code you're talking about, shouldn't you ? Your discussion made me think that editors may help further in this area, without having to change the syntax. Currently, the editors only try to give some "hints" by playing with colors, but there are some oth

Re: Leiningen 2.0.0-preview1

2012-03-08 Thread Phil Hagelberg
Pepijn de Vos writes: > I've run into a problem with "lein run" though. It didn't take any > input, so I ran "lein trampoline run" instead, which did this: > http://pastebin.com/GBkpC0BP I'm having trouble reproducing this; could you open an issue with a minimal test case? -Phil -- You receiv

Re: Which emacs packages?

2012-03-08 Thread Tassilo Horn
AndyK writes: > Curious about which emacs packages folks use for increased Clojure > productivity (beyond the obvious, like slime/swank-clojure)... For any lisp: - paredit http://www.emacswiki.org/emacs/ParEdit - highlight-parentheses http://www.emacswiki.org/emacs/HighlightParenthe

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Phil Hagelberg
Sean Corfield writes: > Most of my comments would be true of code in other languages (and > Scala came to mind, specifically, as I was suggesting breaking code > into smaller units to aid readability). I'm interested in hearing more > about the sort of functions that begin "by unpacking and compu

[Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
Right now, when I define a deftype function f the generated js code looks something like: f = function(self, arg) { if (self.func) { return self.func(self, arg); } else { // check if self implements protocol return f._(self, arg); } } This seems like an awful lot of indir

how to restart Clojurescript One repl the right way?

2012-03-08 Thread George Oliver
hi, I'm just starting with ClojureScript and ClojureScript One. Sometimes working with One I kill the cljs-repl for whatever reason (something hangs, I make some mistake and can't correct it, etcetera); when I go to restart (by running lein repl again), I then can't restart the cljs-repl. I get, B

Re: Clojurescript: named/numbered releases?

2012-03-08 Thread Evan Mezeske
I've been working off the releases under "tags": https://github.com/clojure/clojurescript/tags I think these are still pre-1.0 releases, but they seem to be released at more stable points than just tracking the master. On Wednesday, March 7, 2012 9:02:48 PM UTC-7, kovasb wrote: > > It's gre

Re: clojure on android over CLI

2012-03-08 Thread Jim - FooBar();
There is a clojure repl for android...it will make your life easier...the only problem is you cannot include external libs in your project... Jim On 08/03/12 01:43, Rostislav Svoboda wrote: Hi. I'm trying to run: java -cp clojure-${VERSION}.jar clojure.main on an Android phone from bash

Re: Which emacs packages?

2012-03-08 Thread Eduardo Bellani
IMHO, more or less in this order * Paredit * undo-tree * ido-ubiquitous-mode or icicles * winner-mode * highlight-parentheses-mode See you On Thu, Mar 8, 2012 at 2:10 PM, AndyK wrote: > Curious about which emacs packages folks use for increased Clojure > productivity (beyond the obvious, like sl

Re: How to use goog.dom.query

2012-03-08 Thread Evan Mezeske
Just a word of warning: I've had several reports of people encountering difficulties (e.g. weird stack traces) when trying to use a recent ClojureScript compiler with the various "goog" jars that are flying around. Presumably this is due to the fact that the compiler depends on the Google Clo

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Leon Talbot
What I met by readable, is the capacity of reading someone's code. On 7 mar, 18:12, Joachim De Beule wrote: > On Mar 7, 6:39 pm, Leon Talbot wrote: > > > If so, how ? > > > Thanks ! > > Please define "readable". > > Thanks! -- You received this message because you are subscribed to the Google

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread djh
I think it's all down to pattern recognition. Once you've been developing in Clojure for a while you start to recognise patterns very easily, meaning reading other peoples code isn't really an issue. The same applies to languages like Haskell, when you're just starting out it might seem a lit

Re: Clojurescript: named/numbered releases?

2012-03-08 Thread Stuart Sierra
We have ClojureScript jars in Maven Central, built periodically when we think master is in a stable state. http://search.maven.org/#search|gav|1|g%3A%22org.clojure%22%20AND%20a%3A%22clojurescript%22 These JARs correspond to the tags in Git. -S -- You received this message because you are subsc

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Moritz Ulrich
On Thu, Mar 8, 2012 at 08:37, Sean Corfield wrote: >> * The convention of using hyphens to separate words is hard to read > > I disagree. I find camelCase far harder to read than hyphenated-names. I'm pretty sure there is an Emacs mode for displaying foo-bar-baz as fooBarBaz and reversed. -- Mo

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread David Nolen
The overhead is not as great as you think. In the newer crop of JS engines it's surprisingly small and I imagine that it will get smaller. I don't see this getting changed anytime soon as it allows for polymorphism as well as handling the default case if provided. If you see a better way to get th

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Tassilo Horn
Moritz Ulrich writes: >>> * The convention of using hyphens to separate words is hard to read >> >> I disagree. I find camelCase far harder to read than >> hyphenated-names. > > I'm pretty sure there is an Emacs mode for displaying foo-bar-baz as > fooBarBaz and reversed. There's glasses-mode fo

Re: Pretty print defn

2012-03-08 Thread Jeff Weiss
I use serializable.fn pretty extensively, and it's been working great for me. I think at this point, the only fix I put in that Phil didn't is that my serialized fn's print with an unqualified "fn" symbol, instead of "serializable.fn/fn". I did that so it's more readable, the tradeoff is that

Re: clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Shantanu Kumar
On Mar 8, 7:22 pm, Timothy Baldridge wrote: > Okay, the Python package should be fixed now. It took a few tries, but > I was finally able to get it to include core.clj as part of the > distro. Thanks, the install works for me now. However, when I run "sudo clojurepy" pressing Ctrl+D exits the R

Re: clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Timothy Baldridge
It looks to be a bug with where the script is saving the history file. We have a bug report for it https://github.com/halgari/clojure-py/issues/41 and we'll look into it. Thanks! Timothy On Thu, Mar 8, 2012 at 1:11 PM, Shantanu Kumar wrote: > > > On Mar 8, 7:22 pm, Timothy Baldridge wrote: >> O

Re: How I can use InteractionEvent in clojure?

2012-03-08 Thread Antonio Recio
It works!!! Thanks Aaron Cohen and Mark Rathwell. The code final that works 100% of the example cone6 of vtk in clojure is this: (ns example (:import (javax.swing JFrame JPanel SwingUtilities))) (clojure.lang.RT/loadLibrary "vtkCommonJava") (clojure.lang.RT/loadLibrary "vtkWidgetsJava") (def

Re: clojure.test on ClojureScript?

2012-03-08 Thread Shantanu Kumar
Thanks Brenton and Stuart, that was very insightful. Shantanu On Feb 26, 11:58 pm, Brenton wrote: > Shantanu, > > I have been experimenting with this in ClojureScript One. The latest > version is in the M003 branch. > > The example that Stuart links to is a complex integration test. Here > is an

Re: Clojurescript: named/numbered releases?

2012-03-08 Thread kovas boguta
Thanks. I was just going on the information on the github wiki pages, and poking around the tags and branches. Part of the confusion is that the tags are large integers, with no "0." prefixes. I concluded that they corresponded to a jira ticket rather than to some kind of release number. On Thu

idiomatic list-ify

2012-03-08 Thread Brandon Harvey
Hi, I'm seeking a small & idiomatic function that will take input and ensure it's wrapped in a list. If nil, I'd like the list to be empty. If the input is already a list, I don't want to wrap it in another list layer. So: "hi" => ("hi") nil=> () ("hi") => ("hi") (list '("hi"))

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
I see the rationale now, thanks. One question though, isn't it possible to generate: if (self && self.func) { return self.func(self); } instead of if (truth(truth(self) ? self.func : self)) { return self.func(self); } -- You received this message because you are subscribed to the Google G

clojure.io

2012-03-08 Thread cej38
This is a NOOB question. Would it be possible to write a library that could do IO without resorting to the underlying VM? -- 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 fr

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread David Nolen
Nope, JavaScript has a terrible notion of truth. What if you want to add functionality to numbers? Or strings? 0 and blank strings are false-y. That said I have a branch where we inline the truth test which does a give a perf boost on many JS engines. This needs to benchmarked more thoroughly befo

Re: clojure.io

2012-03-08 Thread Jeremy Heiler
On Thu, Mar 8, 2012 at 4:12 PM, cej38 wrote: > Would it be possible to write a library that could do IO without > resorting to the underlying VM? What do you mean by that? Do you want to restrict yourself to a particular platform? I think a more prudent question would be: Should there be a stand

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread evandi
Why not avoid all the keywords and create let-cond? (let-cond [a x b (* a 4)] (> b x) 1 :else 2) On Thursday, March 8, 2012 9:01:33 AM UTC-8, Evan Gamble wrote: > > Another way to flatten nested lets and conds is to use a macro that > lets you insert conditionals in your lets (vs. your sugge

Re: clojure.io

2012-03-08 Thread cej38
>Should there be a standard Clojure IO API that each flavor of Clojure would >implement? You are correct. This is more of what my question should have been. I do NOT want to restrict myself to a particular platform. -- You received this message because you are subscribed to the Google Groups

Functions knowing whether they're thread-bound or not?

2012-03-08 Thread Mark
Over in the clojure dev group, there's a discussion going on the overhead of sending thread-bound functions (by which, I think means a function that takes input from a thread-local) to an agent. Functions that are thread-bound require the overhead of copying thread-local state to the agent's t

Re: idiomatic list-ify

2012-03-08 Thread Allen Johnson
> So I've ended up writing the function with a conditional, like so.  Is there > a tidier way? > > (defn ls [x] (cond (list? x) (apply list x) >                    (nil? x)  '() >                    :else (list x))) If `x` is a list then is the call to `(apply list x)` necessary? (defn ls [x] (

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
> > Nope, JavaScript has a terrible notion of truth. What if you want to add > functionality to numbers? Or strings? 0 and blank strings are false-y. > > That said I have a branch where we inline the truth test which does a give > a perf boost on many JS engines. This needs to benchmarked more t

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread David Nolen
In my branch the truth test is always inlined. Support for type-hints and inference in the compiler could simplify the test when possible. On Thursday, March 8, 2012, Philip K wrote: >> Nope, JavaScript has a terrible notion of truth. What if you want to add functionality to numbers? Or strings?

Re: clojure on android over CLI

2012-03-08 Thread Daniel Solano Gomez
Hello, On Thu Mar 8 02:43 2012, Rostislav Svoboda wrote: > Hi. I'm trying to run: > java -cp clojure-${VERSION}.jar clojure.main > > on an Android phone from bash (using the 'terminal-ide' app) but I > can't make it past the error bellow. I did the jar-to-dex conversion > using: > dx --v

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Evan Gamble
That would work for replacing a single cond surrounded by a single let, but I often find myself writing a series of nested lets, when- lets, if-lets, etc. to handle the exceptional cases in lets. A contrived example: (when-let [a foo] (let [b bar] (when (even? b) (let [c baz]

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
On Thu, Mar 8, 2012 at 6:04 PM, Evan Gamble wrote: > That would work for replacing a single cond surrounded by a single > let, but I often find myself writing a series of nested lets, when- > lets, if-lets, etc. to handle the exceptional cases in lets. A > contrived example: > > (when-let [a foo]

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
On Thu, Mar 8, 2012 at 9:44 AM, Laurent PETIT wrote: > You should probably both share gists of real code you're talking about, > shouldn't you ? > Most of the stuff I'm working on is closed-source. Offhand, I'm not sure what examples I can share, but I'll keep an eye out for that. In the meanti

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Mark Engelberg
On Thu, Mar 8, 2012 at 9:33 AM, Sean Corfield wrote: > I'm interested in hearing more > about the sort of functions that begin "by unpacking and computing a > large number of values that are all important for subsequent > computations". I'm not seeing this in my code so I assume we're > working on

Re: [ANN] Leiningen 2.0.0-preview1

2012-03-08 Thread Phil Hagelberg
Phil Hagelberg writes: > Just found a bug that only manifests when you don't have any profiles > and are running outside a project. I released a 2.0.0-preview2 version with this fix. If you are running the old preview, running "lein2 upgrade" should take care of it. thanks, Phil -- You receiv

Re: How to use goog.dom.query

2012-03-08 Thread Brent Millare
>From what I understand, the third-party libraries are only packaged as part of the github, but not as a part of the goog.jar. You can use the :libs option to add the third party google compatible javascript files separately. On Thursday, March 8, 2012 2:58:46 AM UTC-5, Evan Mezeske wrote: > > J

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Meikel Brandmeyer (kotarak)
Hi, Am Freitag, 9. März 2012 03:12:52 UTC+1 schrieb puzzler: > > > (cond > :when-let [a foo] > :let [b bar] > :when (even? b) > :let [c baz] > :when (> b z) > :let [d gux] > (f a b c d)) > > I wonder how long it will take until someone proposes monads. (domonad [a foo] [b bar]

Re: Why don't extends? and satisfies? require implementation of all protocol methods?

2012-03-08 Thread Garth Sheldon-Coulson
I think Tassilo's ideas about extenders deserve more discussion. But let me continue the discussion with Armando for now. Thank you for offering the Eclipse API example, which is very helpful. I agree that Java's OO paradigm creates the need for abstract classes. However, I would like to look f

Re: Can Clojure be as readable as Python or Ruby ?

2012-03-08 Thread Tassilo Horn
Mark Engelberg writes: Hi Mark, > In the meantime, just to get a feel for whether this is unique to my code > or universal, I decided that I was going to carefully scrutinize the > nesting level of the next public Clojure code I encountered. Completely > randomly, the next Clojure code I encoun