defs in Clojurescript REPL

2012-05-14 Thread Mark Engelberg
In Clojure, when you def a variable, the REPL prints the name of the variable rather than the value. In Clojurescript, when you def a variable, the REPL prints the value assigned to the variable. This is problematic when working with lazy values. Is there any particular reason the Clojurescript

Re: How to configure a Clojure library at runtime?

2012-05-14 Thread Roberto Mannai
Instead of using alter-var-root you could use the binding form. On this subject of factory methods you could find useful the following article, expecially the with-implementation macro: http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure IMHO that solution should not prevent the

Re: clojurescript error

2012-05-14 Thread Raju Bitter
I've compiled your code without problems in the CLJS REPL, and embedded in a CLJS app I'm working on. Do you get the same bug when you evaluate your code snippet using the script/repljs? Raju -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: tracing cljsbuild error

2012-05-14 Thread Herwig Hochleitner
From the stacktrace and some source reading, it seems clj-stacktrace passes null as class-name in clj-stacktrace.core/clojure-ns, which passes it to a regex function. That should not even be possible, because it passes the same value to clj-stacktrace.core/clojure-code?, which would already throw,

Re: tracing cljsbuild error

2012-05-14 Thread Herwig Hochleitner
Also, are you running the latest version of clj-stacktrace? -- 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

Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread James
When a new technology (a programming language) comes out, initially there are very few people who are really proficient in it. One can learn by one's own, but tremendous learning acceleration can be gained if one pairs with more experienced devs than oneself. So I'd like to ask: is there any

Re: defs in Clojurescript REPL

2012-05-14 Thread David Nolen
Do you have a more specific example of why this is a problem? On Monday, May 14, 2012, Mark Engelberg wrote: In Clojure, when you def a variable, the REPL prints the name of the variable rather than the value. In Clojurescript, when you def a variable, the REPL prints the value assigned to

Re: tracing cljsbuild error

2012-05-14 Thread Murtaza Husain
Herwig thanks for your comments. I was able to solve the problem by doing the following. I created a new source directory and changed the src path for lein-cljsbuild to the new src dir. Then I started saving one file after another to the dir. All this while I had lein cljsbuild running as

Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Timothy Baldridge
Over the weekend there was some talk in IRC about why clojure-py didn't use Clojurescript as the basis for its compiler. The reasons I had, basically boiled down to this: Clojurescript is written in Clojure-JVM and as such requires that the JVM be installed, and also requires that all macros be

Re: clojurescript error

2012-05-14 Thread Murtaza Husain
Raju thanks for your comments. I tried building using cljsbuild and the code is now compiling without any errors. I am curious to know, when you say script/repljs, are you referring to the browser based repl that cljsbuild provides access to or a cmd based repl? How do you access the latter?

deps.js in cljsbuild?

2012-05-14 Thread Murtaza Husain
Hi, I am using lein-cljsbuild to compile the cljs code. I see reference to a deps.js file that is added after the tag in which I have included the generated js file. The browser naturally fails to find the file as it does not exist. What is the deps.js file and how do I resolve its 404

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Jay Fields
James, For learning, I'd recommend 4clojure.com and compare your solutions with solutions submitted by other people. Also, if you have the cash, you could pay clojure/core to pair with you. Unfortunately, I've never heard of anyone doing that kind of thing as a mutually beneficial situation - (you

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread James
Hi Jay,- I agree, paying to sweep someone's dojo does sound a bit strong. / James On May 14, 3:24 pm, Jay Fields j...@jayfields.com wrote: James, For learning, I'd recommend 4clojure.com and compare your solutions with solutions submitted by other people. Also, if you have the cash, you

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread James
PS. My last post wasn't clearly formulated, so let me re-phrase that: I think that paying clojure/core to pair up is a perfectly legit solution if one wants to jump ahead of the curve. My point was that I wish the sweeping the dojo model was more widespread (one does whatever other work there is

Re: deps.js in cljsbuild?

2012-05-14 Thread Allen Johnson
I think the current fix is to add this JS declaration before you import your cljs generated js file. IIRC, this is only needed when building without advanced optimizations. script type=text/javascript var CLOSURE_NO_DEPS = true; /script script type=text/javascript src=js/myapp.js/script AJ

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread David Nolen
James, Another way - I would recommend contributing to one of the Clojure contrib libraries or an open source Clojure project. It's a great way to familiarize yourself with non-trivial Clojure code, get feedback and offer something up to the community. You'll definitely get feedback from me if

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread David Nolen
Sounds reasonable. Is there some specific direction you are suggesting? David On Mon, May 14, 2012 at 8:35 AM, Timothy Baldridge tbaldri...@gmail.comwrote: Over the weekend there was some talk in IRC about why clojure-py didn't use Clojurescript as the basis for its compiler. The reasons I

Re: Faster application startup for rapid development

2012-05-14 Thread Stuart Sierra
Also discovered I can prefix `java -cp ...` with `rlwrap` to get back a nice REPL experience. -S -- 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

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread James
Hi David,- thanks for the feedback. To jump in and start augmenting non-trivial Clojure code sounds like a serious task. I think the prerequisite for that would be to be able to read and write trivial Clojure code, which is where I'm at right now! But I'll definitely study the libraries you

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Sean Corfield
On Mon, May 14, 2012 at 10:41 AM, James abbott...@gmail.com wrote: thanks for the feedback. To jump in and start augmenting non-trivial Clojure code sounds like a serious task. I think the prerequisite for that would be to be able to read and write trivial Clojure code, which is where I'm at

ANN: Lemur - A tool/DSL for launching hadoop jobs on elastic-mapreduce

2012-05-14 Thread mlimotte
Lemur is a tool to launch hadoop jobs locally or on EMR, based on a configuration file referred to as a jobdef. The jobdef file describes your EMR cluster, local environment, pre- and post-actions (aka hooks) and zero or more steps (jobs). Lemur reads your jobdef, at the end of your jobdef

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Armando Blancas
Much of the more recent code in Clojure is very cross platform. Stuff like reducers can simply be copied over, fixed up a bit, and it runs. I wonder how is the fork/join part carrier over for reducers. -- You received this message because you are subscribed to the Google Groups Clojure

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread David Nolen
On Mon, May 14, 2012 at 2:32 PM, Armando Blancas abm221...@gmail.comwrote: Much of the more recent code in Clojure is very cross platform. Stuff like reducers can simply be copied over, fixed up a bit, and it runs. I wonder how is the fork/join part carrier over for reducers. Sounds

Re: how to get good at clojure?

2012-05-14 Thread Bill Allen
Sam, thanks for the pointer to quilt. Looks really cool. I'm starting to imagine a project with quilt and overtone together! Regards, Bill On May 11, 2012 3:34 PM, Sam Aaron samaa...@gmail.com wrote: In addition to following up on all the great suggestions above, I'd hack about with Quil; it's

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Jason Jackson
This might not sound glamorous, but reading books, and reading great code, and code reviews is a great way to get up to speed. The explanations found in the Joy of Clojure, and other books have been highly edited and refined; if I ever paired up with someone, I doubt my ad-hoc verbal

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Yan King Yin, 甄景贤
On Mon, May 14, 2012 at 7:45 PM, James abbott...@gmail.com wrote: When a new technology (a programming language) comes out, initially there are very few people who are really proficient in it. One can learn by one's own, but tremendous learning acceleration can be gained if one pairs with

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Chris Ford
Are there any Clojure dojos near where you live? We have a monthly one in London, which is a great way for people of different experience levels to come together. Cheers, Chris On 14 May 2012 12:45, James abbott...@gmail.com wrote: When a new technology (a programming language) comes out,

Troubles with truthiness

2012-05-14 Thread Jamie Brandon
I ran across this behaviour today: shackles.examples= (import '[clojure.lang Seqable]) clojure.lang.Seqable shackles.examples= (deftype Foo [] Seqable (seq [this] ())) shackles.examples.Foo shackles.examples= (empty? (Foo.)) false shackles.examples= (deftype Bar [] Seqable (seq [this] nil))

Re: Leiningen 2.0.0-preview4

2012-05-14 Thread Alan Shaw
Having another little problem, any help appreciated: alan@shotwell /cygdrive/c/Workspaces/Clojure-lein $ lein2 new startingclojure Generating a project called startingclojure based on the 'default' template. java.lang.IllegalArgumentException: No implementation of method: :make-reader of

Re: closure example doesn't need let?

2012-05-14 Thread n aipmoro
hi, Just a couple of paragraphs further on in the book (p. 137): In our definition of times-n, we created a local x using let and closed over that instead of closing over the argument n directly. But this was only to help focus the discussion on other parts of the function. In fact, closures

docstrings of if-let and when-let incorrect

2012-05-14 Thread Borkdude
The docstring of if-let is as follows: bindings = binding-form test If test is true, evaluates then with binding-form bound to the value of test, if not, yields else I think it should be mentioned in the docs that if-let and when-let support only *one binding*, not multiple bindings (like for

Re: Leiningen 2.0.0-preview4

2012-05-14 Thread Alan Shaw
Hi, In cygwin on win7 I get this: _ $ lein2 upgrade The script at /cygdrive/c/Users/alan/bin/lein2 will be upgraded to the latest preview version. Do you want to continue [Y/n]? Y Upgrading... % Total % Received % Xferd Average Speed Time Time Time Current Dload

defstruct defrecord metadata

2012-05-14 Thread JDuPreez
Hi, I'm new to Clojure. I've been unsuccessful in finding a clear answer or getting it to work (might just have done it incorrectly, since I'm still learning). I understand that you can add metadata to an object, with-meta, and to a variable or parameter, ^{:. However, I would like to apply

How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-14 Thread Mads Andreas Elvheim
I have a few issues which are all related. I'll do my best to explain them one by one. I'd like to use the latest version of the jOGL library with Clojure 1.3 / Leiningen 1.7.1 / OpenJDK 1.6. After getting the jars from joGL's website, how can I get the library exposed to leiningen and

Re: [ANN] C2: Clojure/ClojureScript data visualization

2012-05-14 Thread Kostas Pramatias
On Fri, May 11, 2012 at 9:04 PM, Kevin Lynagh ke...@keminglabs.com wrote: Announcing C2, a data visualization library inspired by D3.js C2 is not a charting library; there are no plotting functions like scatterplot or piechart . Instead, C2 is a collection of scales, map projections, and

Re: Bootstrapping Clojure-in-Clojure

2012-05-14 Thread Kevin Downey
http://www.lambdassociates.org/blog/klambda.htm suggests a possible bootstrapping mechanism, some kind of reduced set of clojure functionality ur-clojure that is designed to be easy to write and interpreter for, and a compiler backend that generates ur-clojure, after compiling the

Re: Clojure beginner in search of peer-induced enlightenment

2012-05-14 Thread Sean Corfield
On Mon, May 14, 2012 at 4:47 AM, Chris Ford christophertf...@gmail.com wrote: Are there any Clojure dojos near where you live? We have a monthly one in London, which is a great way for people of different experience levels to come together. FYI, the guy who used to run the London Clojure dojo

Re: How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-14 Thread Sean Corfield
Check out lein-localrepo - a way to install arbitrary JARs in your local Maven repo cache. On Sat, May 12, 2012 at 9:36 AM, Mads Andreas Elvheim mads.elvh...@gmail.com wrote: I have a few issues which are all related. I'll do my best to explain them one by one. I'd like to use the latest

Re: Leiningen 2.0.0-preview4

2012-05-14 Thread Phil Hagelberg
On Sat, May 12, 2012 at 3:22 PM, Alan Shaw noden...@gmail.com wrote: In cygwin on win7 I get this: Could you open an issue on Github for this? I don't know enough about Windows to say what's going on here, but if it's on the issue tracker there's a better chance of getting it figured out if

Re: How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-14 Thread Mark Rathwell
Depending on who else you are wanting to share the dependency with, you may find Phil Hagelberg's s3-wagon-private useful: https://github.com/technomancy/s3-wagon-private On Mon, May 14, 2012 at 4:23 PM, Sean Corfield seancorfi...@gmail.com wrote: Check out lein-localrepo - a way to install

Re: How to use third-party libraries with Leiningen that are not found in Clojars or Maven

2012-05-14 Thread Stuart Sierra
You can create a virtual repository in your project's source tree and add it to your project as an extra repository with the file: protocol. Technique described (for Maven) here: https://devcenter.heroku.com/articles/local-maven-dependencies -S -- You received this message because you are

Re: Troubles with truthiness

2012-05-14 Thread Stuart Sierra
The empty list () is an object, and objects are truthy. `seq` on any empty collection is defined to return nil. So your definition: (deftype Foo [] Seqable (seq [this] ())) should return nil instead of the empty list. `(next x)` is equivalent to `(seq (rest x))` -S -- You received

defrecord serialization and *data-readers*

2012-05-14 Thread Kurt Harriger
When I first started my project I tried using defrecord and defprotocol for various data structurs and when I wanted an easy serialization function I used pr-str and read-string, this worked great!... until I wanted to do some refactoring and move some types to another namespace. After

Re: defs in Clojurescript REPL

2012-05-14 Thread Mark Engelberg
(def tree (function-that-produces-an-enormous-tree 2)) Want do that in Clojurescript, and you'll be treated to tons and tons of nested tree data printed to the REPL. Want to time something that's supposed to be lazy, to make sure it's really lazy, and see how long it takes to produce the eager

Re: defs in Clojurescript REPL

2012-05-14 Thread David Nolen
On Mon, May 14, 2012 at 7:27 PM, Mark Engelberg mark.engelb...@gmail.comwrote: (def tree (function-that-produces-an-enormous-tree 2)) Isn't doing this at the top level bad form? So there are a couple examples of things that are harder to do when your REPL prints the values that are

Re: Faster application startup for rapid development

2012-05-14 Thread blais
On Friday, May 11, 2012 5:33:22 PM UTC-4, Stuart Sierra wrote: What other tricks do you have for speeding up your development cycle with Clojure? I have a similar situation, where I've had to restart a repl a *lot* for a particular program (several times a day, like 10-20 times and

Re: defs in Clojurescript REPL

2012-05-14 Thread Mark Engelberg
On Mon, May 14, 2012 at 4:41 PM, David Nolen dnolen.li...@gmail.com wrote: On Mon, May 14, 2012 at 7:27 PM, Mark Engelberg mark.engelb...@gmail.comwrote: (def tree (function-that-produces-an-enormous-tree 2)) Isn't doing this at the top level bad form? The purpose of a REPL is for

Re: defs in Clojurescript REPL

2012-05-14 Thread kovas boguta
I think this is a pretty valid feature request. The main question is, can this be done without having vars in clojurescript. One way to do it is to surpress output somehow, under certain conditions. Either as a token at the end of a repl input, or in the semantics of def itself. I don't have