Re: Light Table - a new IDE concept

2012-04-13 Thread Daniel
My first thought is that I would contribute money for this to be actively developed and maintained. My second thoughts are that it's kind of a bummer it only works in the browser currently, and kind of a bummer that he had to fork clojure to provide metadata changes, and kind of a bummer that w

Re: Practical Clojure

2012-04-13 Thread David Cabana
I need to clarify something, since I unintentionally introduced confusion into this discussion. The initial comment by faenvie referred to the book "Practical Clojure", a very good book (I own a copy). I spaced out and thought that faenvie's comment concerned the newly released "Clojure Programmi

Re: Boolean

2012-04-13 Thread Tassilo Horn
Armando Blancas writes: > It's the other way around: false is boxed into Boolean/FALSE. That's exactly what I've said, no? TH> That [Boolean.FALSE] is the canonical false Boolean object you get TH> when auto-boxing the primitive boolean false, or when calling TH> (Boolean/valueOf). Bye,

Re: Boolean

2012-04-13 Thread Jim - FooBar();
wow!!! i wasn't expecting that one... Jim On 13/04/12 21:17, Armando Blancas wrote: It's the other way around: false is boxed into Boolean/FALSE. Here's the if stmt: public Object eval() { Object t = testExpr.eval(); if(t != null && t != Boolean.FALSE) return thenExpr.eval(); return elseExpr.

Re: Boolean

2012-04-13 Thread Armando Blancas
It's the other way around: false is boxed into Boolean/FALSE. Here's the if stmt: public Object eval() { Object t = testExpr.eval(); if(t != null && t != Boolean.FALSE) return thenExpr.eval(); return elseExpr.eval(); } On Friday, April 13, 2012 12:45:02 PM UTC-7, Andy Fingerhut wrote: > > One li

Re: Light Table - a new IDE concept

2012-04-13 Thread Tassilo Horn
kovas boguta writes: > Holy I've been wanting this for literally the last decade. > > Seeing the data flow through the program. I'd like to try it out and see what it shows for recursive functions. >:) > Being able to instantly see the code for all the functions related to > your function

Re: Boolean

2012-04-13 Thread Tassilo Horn
Andy Fingerhut writes: > Boolean/FALSE is documented as being of type Boolean in Java > documentation, yet it is treated by Clojure the same as primitive > boolean false: > > user=> (clojure-version) > "1.3.0" > user=> (if Boolean/FALSE "logical true" "logical false") > "logical false" > user=> (

Re: Boolean

2012-04-13 Thread Meikel Brandmeyer
Hi, Am 13.04.2012 um 21:45 schrieb Andy Fingerhut: > One little nit that confuses me. > > Boolean/FALSE is documented as being of type Boolean in Java documentation, > yet it is treated by Clojure the same as primitive boolean false: > > user=> (clojure-version) > "1.3.0" > user=> (if Boolean/

Re: noir response

2012-04-13 Thread Mark Rathwell
See [1] for this morning's response to a very similar question ;) There is also a group for Noir-specific questions at [2]. [1] https://groups.google.com/forum/#!msg/clj-noir/mT8L2hnMnNg/jRJ2UdOqKuQJ [2] https://groups.google.com/forum/#!forum/clj-noir On Fri, Apr 13, 2012 at 11:10 AM, Rups wro

Re: Practical Clojure

2012-04-13 Thread Sean Corfield
On Fri, Apr 13, 2012 at 6:51 AM, David Cabana wrote: > I have not read it all (yet), but what I have read is outstanding. I haven't bothered buying it because it's so out of date now. I'll buy a second edition when it gets underway, however. I bought Programming Clojure once the 2nd Ed got under

Re: Clojurescript standards to integrate other libraries

2012-04-13 Thread Mark Rathwell
Hi, Below are some good resources for the questions you have. Just a note, you can advanced compile your own code that calls out to jQuery, and others, you just can't compile those libraries in. So, there are existing extern files for jQuery, and for other libraries you might be using, you can c

Re: Boolean

2012-04-13 Thread Andy Fingerhut
One little nit that confuses me. Boolean/FALSE is documented as being of type Boolean in Java documentation, yet it is treated by Clojure the same as primitive boolean false: user=> (clojure-version) "1.3.0" user=> (if Boolean/FALSE "logical true" "logical false") "logical false" user=> (identica

Re: Light Table - a new IDE concept

2012-04-13 Thread kovas boguta
Holy I've been wanting this for literally the last decade. Seeing the data flow through the program. Being able to instantly see the code for all the functions related to your function call. I 100% agree that we need smaller units of source code than the text file. Interested in how it wou

Re: Light Table - a new IDE concept

2012-04-13 Thread Lee Spector
On Apr 13, 2012, at 3:18 PM, Lee Spector wrote: > > Interlisp did the live propagation of values thing that's in this demo... but > still, it's interesting to see the idea of function editors coming back. OOPS -- I meant "Interlisp DIDN'T DO the live propagation of values thing...". Interlisp

Re: Light Table - a new IDE concept

2012-04-13 Thread Lee Spector
On Apr 13, 2012, at 2:34 PM, looselytyped wrote: > > http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/ Very nice! Small note: In Interlisp, if I remember it correctly, code was structured into functions -- not files -- and one got an editor window for each function defi

Re: Practical Clojure

2012-04-13 Thread faenvie
as i think about it, it seems to me that 'practical clojure' should be updated but stay minimal. This means strictly keep the focus on the core of clojure, correct errors, add a few missing things (add more info on destructuring for instance), add and update things that come new or changed with clo

Re: Light Table - a new IDE concept

2012-04-13 Thread Jim - FooBar();
I am left speecheless...! Jim On 13/04/12 19:49, sean neilan wrote: I wish there was a link to download it. On Fri, Apr 13, 2012 at 1:34 PM, looselytyped > wrote: This is an awesome implementation of Brett Victors "Inventing On Principle" [http://vimeo.c

Re: Light Table - a new IDE concept

2012-04-13 Thread sean neilan
I wish there was a link to download it. On Fri, Apr 13, 2012 at 1:34 PM, looselytyped wrote: > This is an awesome implementation of Brett Victors "Inventing On > Principle" [http://vimeo.com/36579366] using Clojure and Noir by Chris > Granger (who also wrote Noir). > > Figured I would share it w

Re: Light Table - a new IDE concept

2012-04-13 Thread Tamreen Khan
Nope, the source hasn't been released yet. I think Chris is still trying to figure out what to do with it. 2012/4/13 D.Bushenko > This is really interesting. Is there a sourcecode for the light table ? I > couldn't find it... > > пятница, 13 апреля 2012 г., 21:34:54 UTC+3 пользователь looselytyp

Re: Light Table - a new IDE concept

2012-04-13 Thread D.Bushenko
This is really interesting. Is there a sourcecode for the light table ? I couldn't find it... пятница, 13 апреля 2012 г., 21:34:54 UTC+3 пользователь looselytyped написал: > > This is an awesome implementation of Brett Victors "Inventing On > Principle" [http://vimeo.com/36579366] using Clojure

Re: Boolean

2012-04-13 Thread Sean Corfield
On Fri, Apr 13, 2012 at 3:33 AM, Vinzent wrote: > Just like Boolean's javadoc puts a strong > emphasis on the fact that public Boolean(boolean value) constructor usually > shouldn't be used, clojure's docstring should say that (= x false) may give > you a result which will confuse you, so you'd be

Light Table - a new IDE concept

2012-04-13 Thread looselytyped
This is an awesome implementation of Brett Victors "Inventing On Principle" [http://vimeo.com/36579366] using Clojure and Noir by Chris Granger (who also wrote Noir). Figured I would share it with the group. http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/ Raju -- You r

Re: Question on clojurescript symbols <-> strings

2012-04-13 Thread David Nolen
What's your actual code look like? On Thu, Apr 12, 2012 at 11:17 PM, Marius Seritan wrote: > I am not sure if this is the right forum. I am playing with domina and > domina-events and I cannot register and event because of some problem with > symbols. By the time my symbols make it into goog.eve

Re: Loading a huge graph

2012-04-13 Thread László Török
Thanks, I know about transients, but I'm already using mutable arrays for speed :-) On Apr 13, 2012 8:01 PM, "Robert Marianski" wrote: > > If the jvm does have enough memory, you may want to try building up the > map using a transient. > > And not sure if this is faster, (maybe it's slower), but y

moderation anomaly

2012-04-13 Thread Stuart Halloway
For some reason Google Groups is re-asking me to moderate people who have been on the list forever (e.g. it just wanted to know if Chas Emerick should be allowed to post). Moderation got a little backed up as a result, but I think everything that was pending is pushed through now. Sorry for the

Friend: an extensible authentication and authorization library for Clojure Ring webapps and services

2012-04-13 Thread Chas Emerick
For your consideration, a new library: I’m hoping this can eventually be a warden/spring-security/everyauth /omniauth for Clojure; that is, a common abstraction for authentication and authorization mechanisms. Clojure has been around long enough that adding pedestrian things like form and HTTP

Re: == is not always transitive

2012-04-13 Thread Sung Pae
Leif writes: > I'd also like to make sure people are aware of this oddity. I > discovered this after reading an article about the bad design of PHP. > I read that in PHP, "== is not transitive." I thought "Ha ha ha, that > ridiculous PHP!" > > Then I checked c.c/== ; Imagine my reaction when I le

Help using parsatron to parse a list

2012-04-13 Thread rahulpilani
Hi, I am trying to use the parsatron library (https://github.com/youngnh/parsatron) to parse a simple list of digits. I am not able to get it to parse correctly, I was wondering what I was missing. What I have so far: (defparser array-item [] (let->> [_ (many (char \space)) item (

Re: Practical Clojure

2012-04-13 Thread Tom Maynard
On Friday, April 13, 2012 5:19:43 AM UTC-5, faenvie wrote: > > > i simply want to state that i love this book > http://www.apress.com/9781430272311 > > Which version(s) of Closure does the book cover? I have both "Joy of" and "In Action" and I find them somewhat disjointed and confusing in th

Dealing with dynamic header in log file processing

2012-04-13 Thread Cliff Mosley
Prefacing this with being a complete Clojure novice, my question is more about approach than the actual code required. Like many, I have a few tried and true examples that I like to work through in each language. In my case, I have a set of IIS log files that I want to generate usage statistics

Re: Loading a huge graph

2012-04-13 Thread Robert Marianski
If the jvm does have enough memory, you may want to try building up the map using a transient. And not sure if this is faster, (maybe it's slower), but you can spell the function you pass to reduce more succinctly: (fn [G [v1 v2]] (update-in G [v1] (fnil conj []) v2)) Robert On Thu, Apr 12, 201

Question on clojurescript symbols <-> strings

2012-04-13 Thread Marius Seritan
I am not sure if this is the right forum. I am playing with domina and domina-events and I cannot register and event because of some problem with symbols. By the time my symbols make it into goog.events the event is "ï· 'keyup" instead of "keyup". I am trying to figure this out. In my browser

noir response

2012-04-13 Thread Rups
Hi... I am using a noir, I like to download a file on click event. I have a file object in binary formate. How i write code for response for download file in its original formate. -- You received this message because you are subscribed to the Google Groups "Clojure" g

Idea for algorithm for renaming in an Clojure IDE

2012-04-13 Thread André Ferreira
I was thinking about how things like function or variable renaming are complicated by lisps macros. That it's almost impossible to track the scope of anything, since 2 symbols near each other might mean completely different things after macro expansion. So I came up with an algorithm that *might* w

Re: Practical Clojure

2012-04-13 Thread Curtis Gagliardi
I hadn't heard of practical clojure, but while we're praising books, I'd like to say that Clojure Programming is excellent. I've been reading the early access version, and while I haven't finished it, I'm almost done with the first half, which covers the core of the language. It's been incredibly

Re: noir response

2012-04-13 Thread Rups
My download code is like this which reads file from mongodb. but it not downloaded original file. (defpage [:get "/download"] {:as values} (let [f (fetch-one-file :test3) stream (stream-from :test3 f) data (slurp stream)] (resp/content-type (:contentType f) data) ))

compile dynamic ns ?

2012-04-13 Thread ollem
Hi, I want to create and compile java classes on the fly using clojure. I also want to pack the compiled result in a jar file to be used by another system. I have used JavaAssist before but thought that it could be kind of neat to use clojure instead. I have ran into a problem though: (defn dyn

Clojurescript standards to integrate other libraries

2012-04-13 Thread Prasanna Gautam
I'm quite new to clojurescript and I'm working on using clojurescript with some other javascript libraries - most notably I would like to get jQuery and Highcharts to work right now. Are there any established patterns or projects that make it easier to write wrappers for libraries that aren't c

Friend: an extensible authentication and authorization library for Clojure Ring webapps and services

2012-04-13 Thread Chas Emerick
For your consideration, a new library: I’m hoping this can eventually be a warden/spring-security/everyauth /omniauth for Clojure; that is, a common abstraction for authentication and authorization mechanisms. Clojure has been around long enough that adding pedestrian things like form and HTTP

Re: Supporting platform specific code

2012-04-13 Thread Aaron
I posed this question briefly in this post here: https://groups.google.com/d/msg/clojure/K65Va0rCCls/Ow5bAJ_YTGIJ. In this real world example of porting Korma over to ClojureCLR, I encountered the following things: - One namespace which handled JDBC interaction needed to be rewritten c

Re: Supporting platform specific code

2012-04-13 Thread Tassilo Horn
Vinzent writes: >> I'd still prefer a more general plain-macro version for conditional >> compilation with arbitrary tests instead of hardcoded platform and >> version keys. > > I agree, although nothing prevents us from something like :condition > (some-expr) being evaluating for such complex ca

Re: Practical Clojure

2012-04-13 Thread David Cabana
I have not read it all (yet), but what I have read is outstanding. O'Reilly has made the table of contents and first chapter available online. If you are at all curious, check it out. The first chapter contains an exceptionally lucid and thorough section on destructuring. http://cdn.oreilly.com/o

Re: ClojureScript function params shadow top-level namespace segments

2012-04-13 Thread Stuart Campbell
Done: http://dev.clojure.org/jira/browse/CLJS-180 On 13 April 2012 22:14, David Nolen wrote: > Yes. Please open a ticket in JIRA. > > Thanks! > > On Fri, Apr 13, 2012 at 3:40 AM, Stuart Campbell wrote: > >> Given the following ClojureScript: >> >> (ns foo) >> (defn bar [] 42) >> >> (ns baz >>

Re: Supporting platform specific code

2012-04-13 Thread Vinzent
> > But my own programs already use :platform and :version metadata > with completely different semantics. (Well, no, they don't, but it could > > be.) > That's not a problem, since the same is true for :doc, :macro, :arglists, etc, etc. Also, meta on expressions is probably not used so often.

Re: Supporting platform specific code

2012-04-13 Thread Tassilo Horn
Timothy Baldridge writes: > I'm starting to like the hybrid approach as well. We could create a > new version of "require" that's a conditional load: > > (cond-require {:platform :jvm :version 7} 'core.platform.jvm.mymodule) > (cond-require {:platform :clr :version 4.5} 'core.platform.clr.mymodul

Re: Boolean

2012-04-13 Thread Rich Hickey
You are reporting this to the wrong language group. The fact that Java: A) has a public constructor for Boolean (a type with only 2 possible instances) B) whose doc string says "Note: It is rarely appropriate to use this constructor." and then C) goes on to use it in some library functions (refl

Re: ClojureScript function params shadow top-level namespace segments

2012-04-13 Thread David Nolen
Yes. Please open a ticket in JIRA. Thanks! On Fri, Apr 13, 2012 at 3:40 AM, Stuart Campbell wrote: > Given the following ClojureScript: > > (ns foo) > (defn bar [] 42) > > (ns baz > (:require [foo :as x])) > > (defn quux [foo] > (x/bar)) > > baz.quux compiles to: > > baz.quux = function quu

Re: Supporting platform specific code

2012-04-13 Thread Timothy Baldridge
I'm starting to like the hybrid approach as well. We could create a new version of "require" that's a conditional load: (cond-require {:platform :jvm :version 7} 'core.platform.jvm.mymodule) (cond-require {:platform :clr :version 4.5} 'core.platform.clr.mymodule) With a single modification to cor

Re: Supporting platform specific code

2012-04-13 Thread Tassilo Horn
Vinzent writes: >> But why would that be better than a reader macro >> #+:jvm(load "jvm/lib") >> #+:python (load "python/lib") > > > I don't think it's "better", this two options are rather equivalent. > The only difference is that #+ would require new reader entities, > while variant wit

Re: Practical Clojure

2012-04-13 Thread wschnell
Hi, you are not alone. This book is for reading again and again. -- 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

Re: Boolean

2012-04-13 Thread Cedric Greevey
What of the original issue, that deserializing a large nested datastructure with boxed booleans in it results in misbehaving Boolean "false" instances? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Supporting platform specific code

2012-04-13 Thread Vinzent
> > ^{:platform :jvm} (load "jvm/lib") ^{:platform :python} (load "python/lib") or platform metadata attached to the 'ns' form should be trated as "this whole file is for this platform". This way, in src/py/blah.clj you'd have ^{:platform :python} (ns blah) ... (your code) ... without relyi

Re: Loading a huge graph

2012-04-13 Thread László Török
Excellent! Thank you, that did the trick! 2012/4/13 bOR_ > I have this option in my project.clj file, which does the trick if you are > developing from emacs+swank+clojure-jack-in, and using large networks > > :jvm-opts ["-Xmx4000m"] > > And yes, one of the things to do when working with the j

Re: Boolean

2012-04-13 Thread Vinzent
> > http://clojuredocs.org/clojure_core/clojure.core/if It's great, Andy, thank you! I haven't even thought about clojuredocs at all. Since it still doesn't eliminates the problem completely, I believe many clojure newcomers will find it incredibly useful. Stefan Kamphausen writes: > Acco

Re: Boolean

2012-04-13 Thread Softaddicts
Again, (Boolean. false) is an object. Objects returned from Java are values from Clojure's perspective like numbers, Clojure is a Lisp but allows you to access Java's object world. It's not because the object wraps a property containing a boolean primitive value that it should behave the sa

Practical Clojure

2012-04-13 Thread faenvie
hi community, i simply want to state that i love this book http://www.apress.com/9781430272311 it's minimalism is amazing and it helped me a lot. its good to repeatedly read single chapters to get conscious of ... minimal is good. i would love to read a second edition with maybe a chapter about

Re: Loading a huge graph

2012-04-13 Thread bOR_
I have this option in my project.clj file, which does the trick if you are developing from emacs+swank+clojure-jack-in, and using large networks :jvm-opts ["-Xmx4000m"] And yes, one of the things to do when working with the jvm is learning how to use jconsole or visualvm to see why your progr

Re: [ANN] Leiningen 2.0.0-preview3

2012-04-13 Thread nick rothwell
Trivial bug report: saying lein new throws an ArityException rather than reporting an error and suggesting usage. -- 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

Re: Loading a huge graph

2012-04-13 Thread László Török
Thanks, having a C++ background, there is definitely a lot to learn about the JVM. I'm wrote a script in Python that ran in about 10-12s and used up to 320MB of memory. I'm running a clojure repl from Emacs via jack-in. What's the best way to adjust the heap size? swank-clojure and clojure-mode

Re: Boolean

2012-04-13 Thread Tassilo Horn
Stefan Kamphausen writes: > To anyone with some understanding of programming and a basic > understanding how `if' looks like in lisps the following lines would > be at least astonishing Other lisps (I know of) don't have this problem, because in Common Lisp or Emacs Lisp, nil is the only false v

Re: Boolean

2012-04-13 Thread Tassilo Horn
Stefan Kamphausen writes: > According to e.g. > > http://nathanmarz.com/blog/fun-with-equality-in-clojure.html > > it's a speed trade-off. Partly. See Daniel's post where he fixed my contrieved micro-benchmark and showed that testing on Boolean-equality in `if` slows that down about a factor o

Re: Boolean

2012-04-13 Thread Stefan Kamphausen
According to e.g. http://nathanmarz.com/blog/fun-with-equality-in-clojure.html it's a speed trade-off. Something one can live with, but a wart nevertheless. Best, Stefan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

ClojureScript function params shadow top-level namespace segments

2012-04-13 Thread Stuart Campbell
Given the following ClojureScript: (ns foo) (defn bar [] 42) (ns baz (:require [foo :as x])) (defn quux [foo] (x/bar)) baz.quux compiles to: baz.quux = function quux(foo) { return foo.bar.call(null) }; i.e. the parameter name shadows the top-level "foo" namespace. Is that a bug? Regar

Re: Boolean

2012-04-13 Thread Stefan Kamphausen
> Hope I've made my point clear now. > Maybe helping here... To anyone with some understanding of programming and a basic understanding how `if' looks like in lisps the following lines would be at least astonishing user=> (if some-thing "then" "else") "then" user=> (if (= some-thing fals