Re: ClojureScript in IE 9 (does it work?)

2012-01-16 Thread David Powell
On Mon, Jan 16, 2012 at 7:59 AM, gchristnsn gchrist...@gmail.com wrote: I can't even call `(js/alert test)' in IE 9, it compiles into: alert.call(null,test); and says: Invalid calling object (IE 9 standards mode, in IE 8 standards mode it doesn't recognize the `call' method) I need `alert'

Re: A STM profile tool

2012-01-16 Thread Jonathan Cardoso
Interesting! -- 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 first post. To unsubscribe from this group, send

Re: Proxies and overriding protected methods

2012-01-16 Thread Chris Perkins
Norman, Finalize is a protected method, so you can't call it. You get the same error trying to call finalize on anything - it has nothing to do with proxy. user (.finalize (Object.)) No matching field found: finalize for class java.lang.Object - Chris -- You received this message because

Re: Proxies and overriding protected methods

2012-01-16 Thread Chris Perkins
On Monday, January 16, 2012 6:12:34 AM UTC-5, Chris Perkins wrote: Norman, Finalize is a protected method, so you can't call it. You get the same error trying to call finalize on anything - it has nothing to do with proxy. user (.finalize (Object.)) No matching field found: finalize for

Re: Proxies and overriding protected methods

2012-01-16 Thread Norman Gray
Chris, hello. On 2012 Jan 16, at 11:23, Chris Perkins wrote: Oops, ignore that - haven't had my morning coffee yet :) I see that you are trying to make finalize accessible by overriding it. Indeed! Agreed that it seems like it should work. Assuming that proxy can successfully override

Re: A STM profile tool

2012-01-16 Thread dennis zhuang
hi,all I've upgraded the version to 1.0.1-SNAPSHOT. And added a new function ref-stats to get the statistics information of a reference.For example: =(use'stm) =(def a (ref 1)) =(def b (ref 2)) =(dotimes [_ 100] (future (dosync (alter a + 1) (alter b - 1 =@a 101 =@b -98 =(stm-stats) {(alter

Re: Proxies and overriding protected methods

2012-01-16 Thread Cedric Greevey
On Sun, Jan 15, 2012 at 5:26 PM, Norman Gray norman.x.g...@gmail.com wrote: Section 6.6.2 of the JLS mentions that A protected member or constructor of an object may be accessed from outside the package in which it is declared only by code that is responsible for the implementation of that

Re: 4Clojure exersice question

2012-01-16 Thread Meikel Brandmeyer
Hi, Am 14.01.2012 um 14:19 schrieb Erlis Vidal: Sometimes while solving a problem, we can not see simpler solutions. What do you think? Clojure is homoiconic. Walk the output of the reader and for each symbol do a (resolve sym) and check the Var against the list of forbidden Vars. Inform

Re: ClojureScript in IE 9 (does it work?)

2012-01-16 Thread ckirkendall
I ran into the same thing with .setTimeout in enfocus. I moved to using the wrapper function inside the goog library. In the case of .setTimeout I used goog.async.Delay and for alert maybe you could use goog.ui.dialog. http://closure-library.googlecode.com/svn/docs/class_goog_ui_Dialog.html

Re: Could be my favourite improvement in 1.4

2012-01-16 Thread Tavis Rudd
This issue could be avoided by only treating a colon as whitespace when followed by a comma. As easy cut-paste of json seems to be the key motivation here, the commas are going to be there anyway: valid {v:, 1234} vs syntax error {a-key: should-be-a-keyword}. -- You received this message

Lazy sequence transformation with item merge

2012-01-16 Thread Ulrich Küttler
Hi all, I am looking for a function that gives me a lazy sequence from a simple key, value file. Keys are words at the beginning of a line. Value start after a key and can span multiple lines. Thus, a file looks something like: key1 = value1 is there and continues key2 = new value key3 = value3

Re: Libraries for ClojureScript.

2012-01-16 Thread Kevin Lynagh
Manoj, I wrote a ClojureScript wrapper around the D3 JavaScript library, https://github.com/lynaghk/cljs-d3 and took some liberties with the D3 API to make it more concise and otherwise Clojure-like. For instance, you set attributes in D3 like d3_selection .attr(x, 5)

Controlling the test environment

2012-01-16 Thread Matt Stump
Is there a way to set different values for global vars when running tests as opposed to the development or production environment? I need to control which database my tests for a noir project connect to. Ideally I would like to do something like the following: for production and

Re: Clojurescript One: (def fiv 5) compiles to .fiv = 5;\n ?

2012-01-16 Thread Indy
Having the same issue and the only way I've resolved it is by having both the server and the cljs-repl running in the same repl. - run script/repl from the *shell* or launch it as an inferior-lisp - (use '[one.sample.dev-server :only (run-server cljs-repl)]) - (run-server) -

(= difference in java-clojure and clojure.net)

2012-01-16 Thread Roope
In java-clojure 1.3: user= (= 10.0 10) false In clojure.net 1.3: user= (= 10.0 10) true Sorry if this has been reported already Robert -- 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

Re: converting a string to a list

2012-01-16 Thread Samuel Lê
Thanks for the answsers! Jay's last answer is just what I was looking for. thanks, Sam 2012/1/14 Jay Fields j...@jayfields.com this seems easier... user= (map str abc) (a b c) Though the original question says a list to a string and the example shows a string to a list (of symbols)

Re: Lazy sequence transformation with item merge

2012-01-16 Thread Cedric Greevey
Something like: (defn skv [str] (seq (.split str = 2))) (defn second-bit-not-equal-sign? [str] (not (second (skv str (defn extract* [lseq] (when lseq (lazy-seq (let [[f r] lseq] (if (second-bit-not-equal-sign? f) (throw (Exception. no key here))) (let [[p1

Re: Proxies and overriding protected methods

2012-01-16 Thread Norman Gray
Cedric, hello. Thanks for these further notes. Following your remarks and Chris's, I've logged this as a bug at http://dev.clojure.org/jira/browse/CLJ-911 I've added a few further comments below. On 16 Jan 2012, at 17:56, Cedric Greevey wrote: A proper clojure finalizer would have to be

Re: Lazy sequence transformation with item merge

2012-01-16 Thread Cedric Greevey
On Mon, Jan 16, 2012 at 5:28 PM, Cedric Greevey cgree...@gmail.com wrote: If you want a map, (into {} (extract ...)). The obvious input source is a line-seq obtained somehow. If you want spaces or newlines at the concatenation sites (e.g. value3 takes some more lines as well or value3\ntakes

Re: Proxies and overriding protected methods

2012-01-16 Thread Cedric Greevey
On Mon, Jan 16, 2012 at 5:29 PM, Norman Gray norman.x.g...@gmail.com wrote: Anything called by a Java library in a tight loop via an interface, though, you might prefer reify for. Reify has some other features, too, and probably some other limitations. Though there's a sizable overlap region

Re: Controlling the test environment

2012-01-16 Thread Cedric Greevey
On Sun, Jan 15, 2012 at 6:18 PM, Matt Stump mst...@sourceninja.com wrote: Is there a way to set different values for global vars when running tests as opposed to the development or production environment?  I need to control which database my tests for a noir project connect to. Ideally I would

Re: Lazy sequence transformation with item merge

2012-01-16 Thread Meikel Brandmeyer
Hi, here another, slightly different, although in the core similar solution. (defn pair-seq [lines] (lazy-seq (when-let [lines (seq lines)] (let [line (first lines) lines (next lines) equal-sign (.indexOf line =) contd (take-while

clojurescript goog libs - dispose - and garbage collection

2012-01-16 Thread Dave Sann
If you use something like goog.async.Delay, or other goog closure libs that produce objects that have a dispose method, Is it imperative that .dispose is called when you are done with this object? What happens if not? memory leak? How do you manage this if you are passing such objects around in

Re: strange problem

2012-01-16 Thread Andy Fingerhut
I don't have enough knowledge to tell you Oh, just do this, and your Emacs issues will be solved. but I can give some hints as to what these characters are, so perhaps others can say, or you can direct your Google searches in a more focused manner. I believe those are Unicode characters, and ones

Re: lein-cljsbuild 0.0.1 released

2012-01-16 Thread Dave Sann
This looks interesting. I have a couple of comments and questions: 1. I am wary of the copying of cls - cljs files in the src tree. Due to the (inevitable at some point) confusion over which code is authored as cljs and which copied. I really think that these need to be kept separate

Re: clojurescript goog libs - dispose - and garbage collection

2012-01-16 Thread ckirkendall
Dave, I think you are right that my implementation does cause a memory leak over time. It interesting that I can't find a single example of someone calling dispose on an object like this. The google code for disposable hold a global reference to all disposable instances and only removes when

Re: Could be my favourite improvement in 1.4

2012-01-16 Thread Alex Baranosky
This seems like a strange special case. What percentage of users need to paste JSON into the REPL? Of those users, what percentage of the time do they need to do this? On Mon, Jan 16, 2012 at 1:19 PM, Tavis Rudd tavis.r...@gmail.com wrote: This issue could be avoided by only treating a colon

Re: clojurescript goog libs - dispose - and garbage collection

2012-01-16 Thread ckirkendall
Dave, I found a good explanation of disposables: http://groups.google.com/group/closure-library-discuss/browse_thread/thread/b2b38d0045464439 Creighton Kirkendall On Jan 16, 6:25 pm, Dave Sann daves...@gmail.com wrote: If you use something like goog.async.Delay, or other goog closure libs that

nrepl client test suite?

2012-01-16 Thread Martin DeMello
I'm helping develop a native nrepl client for jark, which mostly works for jark, but doesn't adhere fully to the spec (e.g. multiple value fields are not handled properly, status doesn't distinguish between various types of error). I'd like to get it into full compliance so that it can be useful

Re: nrepl client test suite?

2012-01-16 Thread Chas Emerick
Martin, nREPL has a decent set of tests (in https://github.com/clojure/tools.nrepl), though I'm not sure of how applicable / helpful it will be in testing alternative client implementations. Making what's there more helpful for use cases like yours is something I'd like to hear about. BTW,