Re: Clojurescript long polling questions

2012-05-03 Thread Daniel Renfer
>From the Lamina result-channel documentation[1]: A result-channel represents a single potential value, as opposed to a normal channel which represents a stream of values. The way it works is that the result channel waits for only a single value and then closes. If the connection is closed (you c

[ANN] The "It starts to look like a real App", 1.2.0 release of the Clojure Namespace Browser (clj-ns-browser)

2012-05-03 Thread Frank Siebenlist
Dear fellow Clojurians, We're happy to announce the new release 1.2.0 of the "Clojure Namespace Browser". Clj-ns-browser is a namespace/class/var browser for Clojure's doc strings, source code, ClojureDocs.org examples & comments, and values. The browser's GUI is inspired by Smalltalk class li

Re: what is "js/" in clojurescript?

2012-05-03 Thread Devin Walters
Some additional information if you're interested: http://dev.clojure.org/jira/browse/CLJS-89 http://dev.clojure.org/display/design/Unified+ClojureScript+and+Clojure+field+access+syntax '(Devin Walters) On Thursday, May 3, 2012 at 10:47 AM, David Nolen wrote: > I would not rely on this behavior

Re: weird pprint behaviour ?

2012-05-03 Thread Frank Siebenlist
Thanks for catching that - I didn't even notice that I was printing the binding var itself… need coffee… -FS. On May 3, 2012, at 9:59 AM, Meikel Brandmeyer wrote: > Hi, > > Am 03.05.2012 um 18:43 schrieb Frank Siebenlist: > >> user=> (pprint #'clojure.core/*print-length*) >> # >> nil >> user

Re: Using dynamic variables in libraries [Re: ANN clojure.java.jdbc 0.2.0]

2012-05-03 Thread Phil Hagelberg
On Wed, May 2, 2012 at 10:15 PM, Sean Corfield wrote: > I think the problem is that "good" Clojure style is still evolving and > a lot of the libraries were started a while ago before the "no dynamic > variables" guideline really took hold. That's to be expected in a new > and evolving language.

require without :as in clojurescript?

2012-05-03 Thread Rob
Hi, Is there a reason I can't leave out the :as in when requiring namespaces in clojurescript, like: (ns foo (:require bar.baz)) ? Especially when wrapping these google Closure libs, I often don't want it. If the only reason is "we haven't implemented it yet" I might take a shot at fixing tha

Re: [PATCH] Re: creating a varargs method with gen-class

2012-05-03 Thread Neale Swinnerton
Updated patch to support varargs in constructors. > e.g with the patch you add some meta data to make the method a varargs > method like this. > (ns foo (:gen-class :name Foo :init init :constructors {^:varargs ["[Ljava.lang.String;"] []} :methods [^:varargs [foo ["[Ljava.la

Re: weird pprint behaviour ?

2012-05-03 Thread Meikel Brandmeyer
Hi again, Am 03.05.2012 um 18:59 schrieb Meikel Brandmeyer: > user=> (def f nil) > #'user/f > user=> (binding [*print-length* 32] (clojure.pprint/pprint f)) > nil Of course I should have printed the Var. user=> (binding [*print-length* 32] (clojure.pprint/pprint #'f)) # Kind regards Meikel --

Re: weird pprint behaviour ?

2012-05-03 Thread Meikel Brandmeyer
Hi, Am 03.05.2012 um 18:43 schrieb Frank Siebenlist: > user=> (pprint #'clojure.core/*print-length*) > # > nil > user=> (clj-ns-browser.utils/pprint-str #'clojure.core/*print-length*) > "#\n" > user=> (with-out-str (binding [*print-length* 32 *print-level* 6] (pprint > #'clojure.core/*print-leng

weird pprint behaviour ?

2012-05-03 Thread Frank Siebenlist
I'm using the following function to have pprint write into a string and limit the output: (defn pprint-str "Return string with pprint of v, and limit output to prevent blowup." [v] (with-out-str (binding [*print-length* 32 *print-level* 6] (pprint v Everything seems to work as expect

Re: what is "js/" in clojurescript?

2012-05-03 Thread David Nolen
I would not rely on this behavior. Follow Clojure's property access conventions. David On Thursday, May 3, 2012, Rob wrote: > Hi, > > Syntax like this doesn't work in normal Clojure, right? > > js/document.body.style > > It just did in a ClojureScript repl. Is there something magic about "j

[PATCH] Re: creating a varargs method with gen-class

2012-05-03 Thread Neale Swinnerton
On Thu, May 3, 2012 at 10:16 AM, Neale Swinnerton wrote: > > In the clojure-1.4.0 src  I found that the flag is defined in > ./src/jvm/clojure/asm/Opcodes.java  but is never referenced anywhere, which > leads me to the conclusion that currently it isn't possible to generate a > varargs method

Re: In clojurescript (extend-protocol undefined ...) should be error?

2012-05-03 Thread David Nolen
It is helpful to post here. Thanks! File a ticket in JIRA. David On Thursday, May 3, 2012, Rob wrote: > This should probably throw something, right? > > (extend-protocol undefined js/Text (foo [x] x)) > > I had mis-typed the name of the protocol and I didn't get an error until > later. > >

creating a varargs method with gen-class

2012-05-03 Thread Neale Swinnerton
Hi, On SO recently, someone asked how to generate a varargs method with gen-class [1] i.e how can the equivalent of this method be generated: void foo(String... args) { ...} I did some investigation into a possible answer. Thinking that varargs methods in java are a trick of the compiler I

Re: How to handle dependencies on multiple versions of the same library?

2012-05-03 Thread Tassilo Horn
Andy Fingerhut writes: Hi Andy, > I haven't actually run across this before, but I suspect someone else > has. I was curious how people handle it. > > Suppose you have your project A, and it uses Leiningen (the issue is > more widely applicable, but for the sake of example). > > * A depends on