clojurescript: js* question

2012-02-14 Thread Dave Sann
I know it is not the done thing but I have a question regarding js* I have a complex fn defined in a javascript file. it is self contained and uses no globals. It is not currently worth my while to rewrite. I can use this by doing: (def my-fn (js* ...file contents with escaped chars...)) and

[Ann] [cljs-hash 0.0.1] - hash functions for clojurescript

2012-02-14 Thread Dave Sann
currently md5, sha1, sha356 * clojars [cljs-hash 0.0.1] * github https://github.com/davesann/cljs-hash Dave -- 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

Persistent Data Structure and Persistent Types

2012-02-14 Thread Ido Ran
Hi, I'm post the question at clojure group because I am looking for way to solve a problem which clojure's persistent data structure seem fit. I am use CLR (C#) as programming language and I'm developing a simulation application. Without going to much into detail the simulation involve

Re: A Bug of map function?

2012-02-14 Thread Eric Fong
Thanks Alan. Hope this will be changed. On 2月14日, 上午3时06分, Alan Malloy a...@malloys.org wrote: If this is a bug, it's in eval, not in map. eval apparently just doesn't like to be handed lazy sequences, or something: repl-1= (eval `(quote ~(lazy-seq nil))) CompilerException

replace a list element

2012-02-14 Thread James
Hi, I am new to clojure and I am very excited about learning the language. I have a question about replacing an element in a list. I have elements that look like this : {:id G__781, :value 1} The list looks like this: ({:id G__821, :value 1} {:id G__820, :value 1} {:id G__819, :value 1}

Re: ClojureScript def, vars, and binding

2012-02-14 Thread Brandon Bloom
To redeem myself for the noob threading mistake, *I've implemented Var and friends in ClojureScript*: https://github.com/brandonbloom/clojurescript/compare/8ba4849e60e5957cdac36ef6946c647e824ca3c8...vars This branch includes (almost) the full set of relevant functionality, but for performance

Re: Persistent Data Structure and Persistent Types

2012-02-14 Thread Timothy Baldridge
Is that a good way to go? I couldn't find much documentation about how to create full immutable application. I understand I'm mixing functional and OO principles, I hope I'm not to wrong about it. I've done more or less this exact thing in C# before. What I've found to be most useful, is to

Re: replace a list element

2012-02-14 Thread Cedric Greevey
On Mon, Feb 13, 2012 at 5:16 PM, James jegathi...@gmail.com wrote: Hi, I am new to clojure and I am very excited about learning the language.  I have a question about replacing an element in a list.   I have elements that look like this : {:id G__781, :value 1} The list looks like this:

Released: nREPL 0.2.0-beta1

2012-02-14 Thread Chas Emerick
I have released nREPL 0.2.0-beta1, which should show up in Maven central soon. For those that don't know, nREPL is a Clojure network REPL that provides a REPL server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote

Re: Hierarchical logs

2012-02-14 Thread jweiss
Thanks, Alan, The solution I used looks exactly like yours: (defn mktree [vz [i out?]]   (if out?     (- vz (zip/append-child i) zip/up )     (- vz (zip/append-child [i]) zip/down zip/rightmost))) (defn as-tree [tracelist]   (zip/root (reduce mktree (zip/vector-zip []) tracelist))) Thinking

Re: replace a list element

2012-02-14 Thread Moritz Ulrich
I'd use clojure.core/replace It takes a replacement-map in the form of {before after, ...} and a collection. It replaces all befores with the corresponding afters: = (replace {:answer 42} [:the :answer :to :life]) [:the 42 :to :life] On Mon, Feb 13, 2012 at 23:16, James jegathi...@gmail.com

Re: ForkJoin updates

2012-02-14 Thread pron
Here's a new blog post describing the effect the improved fork-join pool has had on Akka actors: http://letitcrash.com/post/17607272336/scalability-of-fork-join-pool -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: ClojureScript def, vars, and binding

2012-02-14 Thread David Nolen
This is interesting. However it seems, at least to me, like a big change with too little justification. When you're CA is in, please setup a design document for this line of development - http://dev.clojure.org/display/design/ClojureScript. David On Tue, Feb 14, 2012 at 5:15 AM, Brandon Bloom

Re: clojurescript: js* question

2012-02-14 Thread David Nolen
I don't think ClojureScript is going to support what you want, js* is an implementation detail - not something for general use. You can however provide your own special form that does what you want. The ClojureScript compiler is built on top of multimethods so you can just add parse/emit cases for

Re: what stack traces include / exclude regarding monads

2012-02-14 Thread Andrew
I guess the use of domonads leaves behind do statements with m_bind's and m_result's... and since these expressions are not fn's, they don't count as method calls and are thus not part of the stack trace. But if I'm mistaken or if anyone has figured out how to use monads and still get detailed

Re: [Ann] [cljs-hash 0.0.1] - hash functions for clojurescript

2012-02-14 Thread Dave Sann
or there are some in goog.cryptwhich I didn't see when I did this...you won't find sha356 though - that's special :) -- 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

Re: clojurescript: js* question

2012-02-14 Thread Dave Sann
Ok, I'll leave it for now, but that is good to know. thanks Dave -- 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

Error in the example on the Multimethods page?

2012-02-14 Thread László Török
Hi, I've just been brushing up my knowledge about clojure multimethods and was wondering about an example at http://clojure.org/multimethods (see below). What I don't get is how a (class []) gets dispatched to ::collection. (class []) returns clojure.lang.PersistentVector which doesn't seem to

Re: Error in the example on the Multimethods page?

2012-02-14 Thread Aaron Cohen
On Tue, Feb 14, 2012 at 3:14 PM, László Török ltoro...@gmail.com wrote: What I don't get is how a (class []) gets dispatched to ::collection. (class []) returns clojure.lang.PersistentVector which doesn't seem to satisfy the isa? relationship. (defmulti foo class) (defmethod foo

Re: Error in the example on the Multimethods page?

2012-02-14 Thread Meikel Brandmeyer
Hi, the ancestor chain seems to be: c.l.PersistentVector - c.l.APersistentVector - j.u.List - j.u.Collection Meikel -- 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

Re: Error in the example on the Multimethods page?

2012-02-14 Thread László Török
Damn, I missed that, it's getting late, thanks! 2012/2/14 Aaron Cohen aa...@assonance.org On Tue, Feb 14, 2012 at 3:14 PM, László Török ltoro...@gmail.com wrote: What I don't get is how a (class []) gets dispatched to ::collection. (class []) returns clojure.lang.PersistentVector which

Problem with the Chas Emerick: Modeling the world ... video

2012-02-14 Thread Julio
Hi, Saw that the video was available in the podcast feed but it stops playing around 13:40 looked on blip tv and it does something similar. Is someone aware of the issue? I'd love to see the end of the talk. Thanks. Julio -- You received this message because you are subscribed to the Google

Re: ClojureScript def, vars, and binding

2012-02-14 Thread Brandon Bloom
Can we continue the conversation on this thread while my CA waits on the USPS? Three things to cover: 1) motivation 2) design 3) impact 1. Why do I want this? Why would anyone want this? - Better parity with JVM Clojure - async Javascript (ie. nearly all Javascript) makes the

Re: A Bug of map function?

2012-02-14 Thread Stuart Sierra
A sequence is equal to a list because Clojure defines = to compare similar collections by their contents. For example, the vector [1 2 3] is equal (by the = function) to the list (1 2 3). `eval` calls the Clojure compiler. The compiler operates on lists returned by the reader, so I would not

Re: ClojureScript def, vars, and binding

2012-02-14 Thread David Nolen
I put your notes here, http://dev.clojure.org/display/design/Dynamic+Binding How are you ensuring that the binding frames are local to a particular asynchronous block of code and that they are removed when that asynchronous block of code exits? David On Tue, Feb 14, 2012 at 3:41 PM, Brandon

Re: A Bug of map function?

2012-02-14 Thread Cedric Greevey
On Tue, Feb 14, 2012 at 5:00 PM, Stuart Sierra the.stuart.sie...@gmail.com wrote: A sequence is equal to a list because Clojure defines = to compare similar collections by their contents. For example, the vector [1 2 3] is equal (by the = function) to the list (1 2 3). `eval` calls the

Re: A Bug of map function?

2012-02-14 Thread Armando Blancas
eval doesn't mind lazy seqs as input: user= (map identity ['quote ()]) (quote ()) user= (class (map identity ['quote ()])) clojure.lang.LazySeq user= (eval (map identity ['quote ()])) () But it can't handle a form that contains an (evaluated) empty lazy seq. Another example: user= (eval `(quote

Re: Hierarchical logs

2012-02-14 Thread jweiss
It occurred to me that ultimately what I want is just a pretty-printed output that I can put on a webpage and apply syntaxhighlighter to. I should be able to use a custom pprint dispatch to take this [[(+ 5 (- 4 2 (* 9 3)) (* 5 (+ 6 3))) nil] [(- 4 2 (* 9 3)) nil] [(* 9 3) nil] [27 true] [-25