Re: Short tutorials on ClojureScript

2012-11-07 Thread Ravindra Jaju
Perfect! Had been waiting for some thing like this, and I followed the first two parts - worked flawlessly! Thanks! -- jaju On Mon, Nov 5, 2012 at 8:59 PM, Mimmo Cosenza mimmo.cose...@gmail.comwrote: Hi, I started a short series of tutorials on ClojureScript that I'm writing in my spare

Re: Short tutorials on ClojureScript

2012-11-07 Thread Mimmo Cosenza
Thanx jaju… I'll try my best to go on with modern cljs tutorial in my spare time. I just published the 4th tutorial (form validation). Hope to be useful and fun. Mimmo On Nov 7, 2012, at 9:14 AM, Ravindra Jaju ravindra.j...@gmail.com wrote: Perfect! Had been waiting for some thing like

Re: Short tutorials on ClojureScript

2012-11-07 Thread Linus Ericsson
This looks really promising. One question: when one builds modern-cljs, is there any extra configuration needed for getting the clojurescript compiler up and running? I get a java.lang.String cannot be cast to clojure.lang.Associative when doing $ lein buildcljs once, which I don't really know

Re: Short tutorials on ClojureScript

2012-11-07 Thread Giacomo Cosenza
On Nov 7, 2012, at 11:44 AM, Linus Ericsson wrote: Nah, just forgot the vector in :cljsbuild {:builds *[* {:source ...} *]* :-) anyway to run the tutorials without code yourself just follow this steps 1. clone the git repository: $ git clone https://github.com/magomimmo/modern-cljs.git 2.

ClojureScript quick-start?

2012-11-07 Thread Alexandru Nedelcu
Hi, I'm a total newb and I'd like to play around with ClojureScript to learn it and maybe build something with it. However starting/configuring a project is difficult and I want 3 things - (1) a mixed clojure/clojurescript project + (2) a way to automatically compile the files on changes + (3)

Re: ClojureScript quick-start?

2012-11-07 Thread Laurent PETIT
2012/11/7 Alexandru Nedelcu m...@alexn.org Hi, I'm a total newb and I'd like to play around with ClojureScript to learn it and maybe build something with it. However starting/configuring a project is difficult and I want 3 things - (1) a mixed clojure/clojurescript project + (2) a way to

Polymorphism based on predicates instead of dispatch value types

2012-11-07 Thread Matt Ridsdale
Hi, I was thinking about multimethods and the flexibility given by being able to dispatch on the value of an arbitrary function of the arguments, instead of just the class of the first argument as in Java. It seems to me that we could be even more flexible if each method implementation was

Re: Polymorphism based on predicates instead of dispatch value types

2012-11-07 Thread Raoul Duke
On Wed, Nov 7, 2012 at 10:08 AM, Matt Ridsdale mridsd...@gmail.com wrote: that we could be even more flexible if each method implementation was associated with a predicate function of the args, instead of being associated with a fixed dispatch value. See the below code for an example of ah, so

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
I know I'm coming a bit late in this thread but i did not have the chance to reply earlier... Can somebody elaborate briefly what is the problem with the combination of with-open/doseq/line-seq? In a project of mine I'm dealing with files larger than 200MB (which of course will not even open

Re: with-open and line-seq

2012-11-07 Thread Dave Ray
There aren't any problems with with-open/doseq/line-seq. The issue is with with-open/line-seq. For example, it's instinctive (at least for me anyway) to want to write a function like this: (defn get-records [file-name] (with-open [r (reader file-name)] (line-seq r))) Of course, the problem

Re: with-open and line-seq

2012-11-07 Thread Meikel Brandmeyer
Hi Dave, Am 07.11.2012 um 20:09 schrieb Dave Ray: There aren't any problems with with-open/doseq/line-seq. The issue is with with-open/line-seq. For example, it's instinctive (at least for me anyway) to want to write a function like this: (defn get-records [file-name] (with-open [r

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
aaa ok this is clearer now...I guess I never wanted/tried to do that - it seems plain weird to me since I know that there is a try/finally hidden in there and escaping its scope will render the stream useless by closing it. anyway thanks for the quick and clear response :) If you 're dealing

Re: ClojureScript quick-start?

2012-11-07 Thread Mimmo Cosenza
Hi Alexandru, I don't know if it's what your're looking for. I just started trying to be helpful for this kind of quick start guide. you can find it at https://github.com/magomimmo/modern-cljs HIH mimmo On Wednesday, November 7, 2012 3:17:12 PM UTC+1, Alexandru Nedelcu wrote: Hi, I'm a

Re: with-open and line-seq

2012-11-07 Thread Sean Corfield
On Wed, Nov 7, 2012 at 11:09 AM, Dave Ray dave...@gmail.com wrote: (defn get-records [file-name] (with-open [r (reader file-name)] (line-seq r))) I suspect it's considered more idiomatic to do: (defn process-records [process file-name] (with-open [r (reader file-name)] (doseq

Re: with-open and line-seq

2012-11-07 Thread Jim - FooBar();
This is exactly the approach I'm taking...'doall' retains the head so with massive files it will break...'doseq' will not. at least this is my understanding... Jim On 07/11/12 19:25, Sean Corfield wrote: I suspect it's considered more idiomatic to do: (defn process-records [process

[core.logic] Type inference examples

2012-11-07 Thread Timo Westkämper
I am searching for non-trivial type inference example code for a small language project I am doing I took this as the basis https://gist.github.com/997140 and ended up with this https://github.com/timowest/symbol/blob/master/src/symbol/types.clj I read some basic papers on Hindley-Milner type

Re: [core.logic] Type inference examples

2012-11-07 Thread Ben Wolfson
If you don't require the example to be in Clojure, there are some examples here: http://kanren.sourceforge.net/ under type-inference.scm and typeclasses.scm. On Wed, Nov 7, 2012 at 11:25 AM, Timo Westkämper timo.westkam...@mysema.com wrote: I am searching for non-trivial type inference example

gen-class with :extend and overloaded methods in superclass

2012-11-07 Thread Bartosz Krupa
Hello, I have clojure code like: (gen-class :name SomeName :extends SomeSuperClass) (defn -clojure-fn [this] (.f this 1) (.f this string)) and in java there is SomeSuperClass class with overloaded methods, let's say: public void f(int a); public void f(String a); Is gen-class

Re: gen-class with :extend and overloaded methods in superclass

2012-11-07 Thread Bartosz Krupa
or is it dynamically dispatched by JVM? W dniu środa, 7 listopada 2012 23:43:20 UTC+1 użytkownik Bartosz Krupa napisał: Hello, I have clojure code like: (gen-class :name SomeName :extends SomeSuperClass) (defn -clojure-fn [this] (.f this 1) (.f this string)) and in

Re: gen-class with :extend and overloaded methods in superclass

2012-11-07 Thread Stuart Sierra
Hi Bartek, In this case, I don't think `gen-class` has any part to play at all. All `gen-class` does is generate a class with stub methods that dispatch to Clojure functions by name. What matters is an expression like `(.f this a)`. If the Clojure compiler can statically determine the types

Re: with-open and line-seq

2012-11-07 Thread Stuart Sierra
On Wednesday, November 7, 2012 2:29:06 PM UTC-5, Jim foo.bar wrote: This is exactly the approach I'm taking...'doall' retains the head so with massive files it will break...'doseq' will not. at least this is my understanding... That is correct. `doall` retains the head because it returns

[ANN] new book: ClojureScript: Up and Running

2012-11-07 Thread Stuart Sierra
Not to toot our own horn, but people have been asking about getting started with ClojureScript, so here's our contribution, just released in book form: ClojureScript: Up and Running by Stuart Sierra and Luke VanderHart published by O'Reilly in paper, eBook, and Safari

Re: [ANN] new book: ClojureScript: Up and Running

2012-11-07 Thread Softaddicts
Already bought it weeks ago, like it, it's a concise recipe, right on target. Disclaimer: I am not a blonde Stuart Sierra groupie :) Luc P. Not to toot our own horn, but people have been asking about getting started with ClojureScript, so here's our contribution, just released in book form:

list of special forms that introduce bindings?

2012-11-07 Thread Ben Wolfson
Is there a list of the special forms that can introduce names (fn*, let*, catch ...)? (keys clojure.lang.Compiler/specials) gives a list of all the special forms, but not all of them introduce new bindings. -- Ben Wolfson Human kind has used its intelligence to vary the flavour of drinks, which

Re: Cdr car

2012-11-07 Thread JvJ
That's good to know! On Tuesday, 6 November 2012 12:48:27 UTC-5, Sean Corfield wrote: On Tue, Nov 6, 2012 at 9:34 AM, JvJ kfjwh...@gmail.com javascript: wrote: There's quite a number of functions like caar, cadr, cadadr, etc. It's lengthy to do that in clojure with just first and rest.