Error when compiling the node.js example on the quick page.

2012-10-19 Thread Jiajian Huang
I am trying clojurescript right now and when I compiling the node example on the quick page, an error happens. * temp : cat nodehello.cljs (ns nodehello) (defn -main [& args] (println (apply str (map [\ "world" "hello"] [2 0 1] (set! *main-cli-fn* -main) * temp : cljsc nodehello.cljs '

Re: ANN: data.json 0.2.0

2012-10-19 Thread Michael Klishin
2012/10/20 Sean Corfield > Just bringing this up as a general issue for discussion around breaking > API changes in low-level libraries that many things may depend on. I'd like to point out that there was 0 upfront communication about the changes and it was not made clear in the announcement th

Re: CLJS: println stopped working (r1514) ?

2012-10-19 Thread Frank Siebenlist
When I eval in the cljs-repl: (set! *print-fn* clojure.browser.repl/repl-print) all works again. Seems that the "(defmethod handle-post :ready [_ conn _] …)" in cljs.repl.browser doesn't assign the *print-fn* in the cljs-repl (?). Not sure if anything changed there (?). -FS. On Oct 19,

CLJS: println stopped working (r1514) ?

2012-10-19 Thread Frank Siebenlist
Not sure if its my cljs-config somehow (working off head r1514), but println doesn't seem to be working anymore: ClojureScript:cljs.user> (println "JAJA") "Error evaluating:" (println "JAJA") :as "cljs.core.println.call(null,\"JAJA\");\n" # _STAR_print_fn_STAR_@http://10.0.1.18:9000/js/main-debu

Re: UTF-8 behavior ClojureScript (vs. Clojure)

2012-10-19 Thread Chas Emerick
I've filed a CLJS issue for this, and attached a patch: http://dev.clojure.org/jira/browse/CLJS-400 Thanks for keeping on this, Dave. :-) - Chas On Oct 19, 6:18 pm, Dave Sann wrote: > Chas, If your patch works without issue - this is probably better because > it will then work with existing ve

Re: ANN: data.json 0.2.0

2012-10-19 Thread Sean Corfield
Removing the old API causes problems for projects that have transitive dependencies on multiple versions of c.d.json. For example, congomongo depends on c.d.json 0.1.3, specifically on json-str. At World Singles we depend on c.d.json directly and we depend on congomongo. We can't move to c.d.json

Re: UTF-8 behavior ClojureScript (vs. Clojure)

2012-10-19 Thread Dave Sann
Chas, If your patch works without issue - this is probably better because it will then work with existing versions of Clojure - clojurescript is changing faster and people a probably upgrading faster. I don't think it does any harm for Clojure to be able to read these chars but fixing the inte

Re: I can get this if() clause to ever be true

2012-10-19 Thread Sean Corfield
On Fri, Oct 19, 2012 at 12:53 AM, Kevin Downey wrote: > conj can surely produce maps, and does so happily in the following cases: > Doh! Of course. Thank you for the correction. I assumed that was his problem without actually trying it - my bad :( -- Sean A Corfield -- (904) 302-SEAN An Archite

Re: Write stream to two outputs

2012-10-19 Thread Herwig Hochleitner
The typehint of output should be ^java.io.OutputStream, sorry. Also to your use case: If you don't actually want to stream simultanously, you need to write the data into a buffer and later stream from that. Sorry again for the whopping triple post. -- You received this message because you are

Re: Write stream to two outputs

2012-10-19 Thread Herwig Hochleitner
Sorry, I mistakenly pressed the send shortcut in gmail. The modified-version of io/copy is: (defn copy-multi ([input outputs] (copy-multi input outputs (make-array Byte/TYPE 1024))) ([^java.io.InputStream input outputs buffer] (let [size (.read input buffer)] (when (pos? size)

Write stream to two outputs

2012-10-19 Thread Petar Radosevic
Hi, I'm building an app (MIT license) which let's you share files easily without depending on a third party service like CloudApp or Droplr. I'm having the following problem; while uploading the file to your server I want to stream the file directly to S3 and disk. Why both? Because when the reque

ANN: ClojureScript release 0.0-1513

2012-10-19 Thread Stuart Sierra
ClojureScript release 0.0-1513 is on its way to the Maven Central Repository. Changes: http://build.clojure.org/job/clojurescript-release/18/ -S -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Re: Is there any reason to make different file extension (clj and cljs) for Clojure and ClojureScript?

2012-10-19 Thread David Nolen
On Fri, Oct 19, 2012 at 3:02 PM, Tamreen Khan wrote: > While Clojurescript aims to be close to Clojure, they're still > different languages, with entirely different compilers. Much of the > Clojure toolchain uses the extension to figure out how to compile a > given file. Otherwise, as far as I kn

Re: Is there any reason to make different file extension (clj and cljs) for Clojure and ClojureScript?

2012-10-19 Thread Tamreen Khan
While Clojurescript aims to be close to Clojure, they're still different languages, with entirely different compilers. Much of the Clojure toolchain uses the extension to figure out how to compile a given file. Otherwise, as far as I know there's no reasonable way to tell apart Clojure code from Cl

ANN: data.json 0.2.0

2012-10-19 Thread Stuart Sierra
https://github.com/clojure/data.json Highlights: - New API - Customizable type conversion functions - big int and big decimal support - Performance improvements -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
Does the println show you what you expect? On Fri, Oct 19, 2012 at 5:35 PM, larry google groups < lawrencecloj...@gmail.com> wrote: > > > I suggesting adding printlns or logging or a debugger > > and checking the > > value of this-users-params, it is almost certainly not > > what you expect > > i

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
maybe make the string "username" be a symbol ie. 'username On Fri, Oct 19, 2012 at 6:39 PM, larry google groups < lawrencecloj...@gmail.com> wrote: > >you have `username` a symbol as the key in your map, but you are > >looking for `:username` they keyword as a key > > Ah, interesting, perhaps I t

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
On Fri, Oct 19, 2012 at 6:39 PM, larry google groups < lawrencecloj...@gmail.com> wrote: > >you have `username` a symbol as the key in your map, but you are > >looking for `:username` they keyword as a key > > Ah, interesting, perhaps I tested this somewhere else. To be sure, I tried > this again:

Is there any reason to make different file extension (clj and cljs) for Clojure and ClojureScript?

2012-10-19 Thread Mamun
Hi All, I've just started to learn Clojure and interested to see more ClojureScript. It is really nice stuff- data structure, function and code sharing. But Is there any reason to make different file extension (*.clj and *.cljs) for Clojure and ClojureScript? Regards, Mamun -- You received t

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
On Fri, Oct 19, 2012 at 5:47 PM, larry google groups < lawrencecloj...@gmail.com> wrote: > > > Also: > > > > > I suggesting adding printlns or logging or a debugger and checking the > > value of this-users-params, it is almost certainly not what you expect > > it to be. > > I showed the output pre

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
(get {:username "a"} "username") nil (get {:username "a"} :username) "a" *(get {'username "a"} :username)* nil (get {'username "a"} 'username) "a" (get {:username "a"} 'username) nil *(get {'username "a"} "username")* nil On Fri, Oct 19, 2012 at 6:26 PM, larry google groups < lawrencecloj...@gmail

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
Okay, thanks for that last tip. I removed the use of :username everywhere and instead replaced it with: (get new-user-entry "username") everywhere in the code. Now everything works fine. I realize now that was the big difference between the REPL and the live server -- I used :username at the R

Re: UTF-8 behavior ClojureScript (vs. Clojure)

2012-10-19 Thread Chas Emerick
On Oct 19, 2012, at 11:25 AM, David Nolen wrote: > On Fri, Oct 19, 2012 at 4:52 AM, Henrik Mohr wrote: > Still I hope someone can answer the question on why ClojureScript behaves > differently from Clojure. > > Output from Clojure: > user=> (str "ø") > "ø" > > Output from ClojureScript: > #_

Re: Core.logic performance of looping over a list with tabling

2012-10-19 Thread David Nolen
On Fri, Oct 19, 2012 at 11:47 AM, Coen De Roover wrote: > Hi David, > > What are your plans about the tables? > I would side with the title of the issue rather than its description :) > I don't have any current plans to further improve the performance of tabling. The only thing I am looking to f

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
>you have `username` a symbol as the key in your map, but you are >looking for `:username` they keyword as a key Ah, interesting, perhaps I tested this somewhere else. To be sure, I tried this again: (defn add-to-logged-in-registry [this-users-params] (let [right-now (. (Date.) getTime)

Re: XML parsing with namespace prefixes

2012-10-19 Thread Jack Moffitt
>> (zf/xml-> zipper :ListRecords :record :metadata :oai_dc:dc :dc:language >> zf/text) This would require a namespace aware thing, but a possible syntax for this (called Clark notation) is to use the URI of the namespace instead of the prefix: (zf/xml-> zipper :ListRecords :record :metadata :dc :

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
>you have `username` a symbol as the key in your map, but you are >looking for `:username` they keyword as a key At some point I tried: (get new-user-entry "username") but that had the same result. Username is clearly a key, yes? What would you suggest? On Friday, October 19, 2012 12:0

Re: I can get this if() clause to ever be true

2012-10-19 Thread Kevin Downey
you have `username` a symbol as the key in your map, but you are looking for `:username` they keyword as a key On Fri, Oct 19, 2012 at 8:47 AM, larry google groups wrote: > > > Also: > > > >> I suggesting adding printlns or logging or a debugger and checking the >> value of this-users-params, it

Re: Core.logic performance of looping over a list with tabling

2012-10-19 Thread Coen De Roover
On 17 Oct 2012, at 19:31, David Nolen wrote: > On Mon, Oct 8, 2012 at 10:00 AM, Reinout Stevens wrote: > Another question: is it possible to manually reset the contents of the tables? > > > Thanks a lot > > > Reinout > > After some more thinking, I agree that the current behavior is not on

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
Also: > I suggesting adding printlns or logging or a debugger and checking the > value of this-users-params, it is almost certainly not what you expect > it to be. I showed the output previously, but I will do it again. If I add a println like this: (defn add-to-logged-in-registry [this-

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
On Friday, October 19, 2012 3:10:19 AM UTC-4, larry google groups wrote: > > Assume data that looks like this: > > {ziri {:last_name ziri, :image ziggy_stardust.jpg, :username larry, > :first_name larry, updated 1350626694791}, erich {:last_name 7ich, > :image 7ot_mein.jpg, :usernam

Re: I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
> I suggesting adding printlns or logging or a debugger > and checking the > value of this-users-params, it is almost certainly not > what you expect > it to be. I already showed the output of the println statements I'd done, but I'll go through this again. I eventually try to output my i

Re: UTF-8 behavior ClojureScript (vs. Clojure)

2012-10-19 Thread David Nolen
On Fri, Oct 19, 2012 at 4:52 AM, Henrik Mohr wrote: > Still I hope someone can answer the question on why ClojureScript behaves > differently from Clojure. > > Output from Clojure: > user=> (str "ø") > *"ø"* > > Output from ClojureScript: > #_=> (str "ø") > *"\xF8"* > > Output from node.js: > >

Re: Redubicle NIO

2012-10-19 Thread Herwig Hochleitner
> - Herwig Holchleitner: how would that solution with protocols be? I write > a protocol that defines methods like `get` and `duplicate` and extend it > for each buffer, delegating the methods to their specific implementations? > ie, (defprotocol UnifiedBuffers (get [buff] "get data from buf") (du

Re: Replacing nested let statements with assignments

2012-10-19 Thread Bob Hutchison
On 2012-10-18, at 2:11 PM, Evan Gamble wrote: > For the situation where the lets are nested because you're checking the > values in some way after each binding, I wrote a macro called let?. I find it > very useful and use it in nearly all my code. > https://github.com/egamble/let-else Hmmm,

Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
Hi again, On Friday, October 12, 2012 10:40:28 PM UTC+11, Arlen Christian Mart Cuss wrote: > > https://github.com/unnali/rouge#readme > As an aside, I've set up a Google Group mailing list for discussion and announcements: https://groups.google.com/forum/#!forum/rouge-talk Cheers, Arlen --

Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
Hi Armando, On Wednesday, October 17, 2012 2:48:44 AM UTC+11, Armando Blancas wrote: > > Finally came around to install a recent Ruby build and ran a little test > script just to get a feel for the startup time. Looks good, though the > faster the merrier. That's a neat little check! It's enc

Re: I can get this if() clause to ever be true

2012-10-19 Thread AtKaaZ
On Fri, Oct 19, 2012 at 9:10 AM, larry google groups < lawrencecloj...@gmail.com> wrote: > Assume data that looks like this: > > {ziri {:last_name ziri, :image ziggy_stardust.jpg, :username larry, > :first_name larry, updated 1350626694791}, erich {:last_name 7ich, > :image 7ot_mein.jp

Re: Rouge: Ruby + Clojure

2012-10-19 Thread Arlen Christian Mart Cuss
On Wednesday, October 17, 2012 2:20:09 PM UTC+11, Brian Marick wrote: > hash.become(TimesliceShaped) > For the longest time I thought you were talking about the core Hash#become (Hash#replace since 2002!). I've since become acquainted with Stunted. :) That said, I'm a sucker for "non-OO"

Re: UTF-8 behavior ClojureScript (vs. Clojure)

2012-10-19 Thread Henrik Mohr
Still I hope someone can answer the question on why ClojureScript behaves differently from Clojure. Output from Clojure: user=> (str "ø") *"ø"* Output from ClojureScript: #_=> (str "ø") *"\xF8"* Output from node.js: > console.log ("ø"); *ø* Output from Chrome Console: console.log ("ø") *ø*

Re: I can get this if() clause to ever be true

2012-10-19 Thread Kevin Downey
conj can surely produce maps, and does so happily in the following cases: (conj {} [:foo :bar]) (conj {} {:foo :bar}) I suggesting adding printlns or logging or a debugger and checking the value of this-users-params, it is almost certainly not what you expect it to be. as a side note creating a

Re: I can get this if() clause to ever be true

2012-10-19 Thread Sean Corfield
On Fri, Oct 19, 2012 at 12:10 AM, larry google groups < lawrencecloj...@gmail.com> wrote: > (defn add-to-logged-in-registry [this-users-params] > (let [right-now (. (Date.) getTime) > new-user-entry (conj this-users-params { "updated" right-now })] > (if (:username new-user-entry) >

Re: ANN: cljs-info 1.0.0 "Help and reflection facilities for ClojureScript"

2012-10-19 Thread Sean Corfield
Frank demo'd a lot of this to the Bay Area Clojure Meetup tonight and it is very cool stuff that makes development with ClojureScript a lot more interactive and "natural". Great work! On Thu, Oct 18, 2012 at 12:28 AM, Frank Siebenlist < frank.siebenl...@gmail.com> wrote: > "cljs-info" is a collec

Re: Coming from Common Lisp to Clojure

2012-10-19 Thread Sean Corfield
On Thu, Oct 18, 2012 at 4:28 PM, Brian Craft wrote: > C is a "C-language", and it seems a lot simpler than clojure to me. K&R is > about 200 pages. I expect you mean C++, Java, etc. No, I think Clojure is a lot simpler than C. As for C++, I was on the standards committee for eight years so I kn

I can get this if() clause to ever be true

2012-10-19 Thread larry google groups
Assume data that looks like this: {ziri {:last_name ziri, :image ziggy_stardust.jpg, :username larry, :first_name larry, updated 1350626694791}, erich {:last_name 7ich, :image 7ot_mein.jpg, :username erich, :first_name 754545_halle, updated 1350626679436}} When fed into th