ClojureScript keywords

2011-09-02 Thread Stuart Campbell
Hi, When I compile the following to JavaScript, I expected it to output foo in the console log: (.log js/console (name :foo)) However, it outputs ï· 'foo. Is that right? Regards, Stuart -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

On Lisp with Clojure

2011-09-02 Thread Michael Jaaka
Hi! Is there any project on github which goal is to implement all code from On Lisp book in Clojure? There are so many useful concepts. For example pattern maching looks like Business Rules, Query Interpreter looks like Semantic Web Repository and so on.. -- You received this message because

Re: ClojureScript keywords

2011-09-02 Thread Stuart Campbell
Please excuse the self-reply; Looking at the compiled version of (keyword?), I can see a line that appears to compare the first character of the keyword string against a multi-character string constant: cljs.core.keyword_QMARK_ = (function keyword_QMARK_(x){ var and__3574__auto2211 =

Re: ClojureScript keywords

2011-09-02 Thread David Powell
Clojurescript represents symbols and keywords as strings with a one character unicode prefix (as an implementation detail). But, by default it outputs javascript as utf-8, and unless you are serving javascript from a server and have setup the headers accordingly, this will be misinterpreted by

Re: ClojureScript keywords

2011-09-02 Thread Stuart Campbell
Thanks David. I added meta charset=UTF-8 to my HTML document (this is just a static test project) and it fixed the problem. Regards, Stuart On 2 September 2011 18:36, David Powell d...@djpowell.net wrote: Clojurescript represents symbols and keywords as strings with a one character unicode

Re: On Lisp with Clojure

2011-09-02 Thread Eric Lavigne
Is there any project on github which goal is to implement all code from On Lisp book in Clojure? Michael Fogus and Stuart Halloway have both ported parts of On Lisp to Clojure. Michael http://blog.fogus.me/tag/onlisp/ Stuart http://thinkrelevance.com/blog/2008/12/12/on-lisp-clojure.html

Re: is there a 4Clojure forum anywhere?

2011-09-02 Thread z_axis
Can http://try-clojure.org/; support pasting ? On 8月27日, 上午10时08分, Alan Malloy a...@malloys.org wrote: I haven't heard of one either, and I'm maintainer and co-founder of 4clojure. If someone (that means you!) starts such a forum, I'm happy to link to it from 4clojure proper. On Aug 26, 5:59

Broken Sequences screencast

2011-09-02 Thread Irakli Gozalishvili
Hi, Not sure if this right place to report about this, but I could not thing of any better. I'm in a process of learning Clojure and I found screen-casts linked from clojure.org http://blip.tv/clojure very useful. Unfortunately thought [Clojure

Unable to use/refer/require clojure.contrib

2011-09-02 Thread Ryan
I'm getting such strange results trying to use the clojure contrib libraries (1.1.0). Some I can use, others I can only refer, but some I can't do either. I'm using clojure-1.2.1 and clojure- contrib-1.1.0 from:

Re: Top secret clojure project names

2011-09-02 Thread Wilker
Never say bug free, the bugs will hear... --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600 On Thu, Sep 1, 2011 at 8:47 PM, Islon Scherer islonsche...@gmail.comwrote: I have a big clojure project at work but it's not a secret. It superseded a old java

Eval in future ... Bug or feature?

2011-09-02 Thread Nils Bertschinger
Hi everyone, it appears that eval works differently when used inside a future. The following example REPL session shows what I mean: user (clojure-version) 1.2.0-master-SNAPSHOT user (defn my-inc [x] (+ x 1)) #'user/my-inc user (eval '(my-inc 1)) 2 user (future (eval '(my-inc 1)))

test a serie list

2011-09-02 Thread Wilker
Hi Guys, I'm just starting with Clojure (finished reading Programming Clojure, from PragProg). I mean may question should be really newbie, but I'm still confused about all functional stuff... I have this test code: (def subdb-test-data {:dexter{:path fixtures/dexter.mp4,:hash

Re: test a serie list

2011-09-02 Thread Tassilo Horn
Wilker wilkerlu...@gmail.com writes: My problem is, I wanna do somekind of loop and test each entry on test-data, all in one, I tried some (for) loops but it made the test run no assertion at all... This is my (for) trial (don't works): (deftest test-compute-hash (for [{:keys [path hash]}

Re: ClojureScript and lein?

2011-09-02 Thread Jim Blomo
On Mon, Aug 29, 2011 at 6:09 PM, Eric Lavigne lavigne.e...@gmail.com wrote: So the other thought is why can the lein do the job? Has anyone tried? Someone has created a Leiningen-installable ClojureScript compiler, including automatic recompilation when your source code changes.

Re: Eval in future ... Bug or feature?

2011-09-02 Thread Vijay Lakshminarayanan
Nils Bertschinger nils.bertschin...@googlemail.com writes: Hi everyone, it appears that eval works differently when used inside a future. The following example REPL session shows what I mean: user (clojure-version) 1.2.0-master-SNAPSHOT user (defn my-inc [x] (+ x 1)) #'user/my-inc user

not= counterintuitive?

2011-09-02 Thread ax2groin
This code doesn't return the value I intuitively expect: user= (not= 1 2 1) true When I write that, I was expecting the equivalent of (and (= 1 2) (= 1 1)), but the macro expansion is essentially (not (= 1 2 1)). Note: This came out of the :while condition of a (for) expression not

Re: not= counterintuitive?

2011-09-02 Thread Mark Engelberg
On Fri, Sep 2, 2011 at 11:14 AM, ax2groin ax2gr...@gmail.com wrote: This code doesn't return the value I intuitively expect: user= (not= 1 2 1) true This is exactly what I expect. Those values are not all equal. -- You received this message because you are subscribed to the Google

Re: not= counterintuitive?

2011-09-02 Thread Laurent PETIT
2011/9/2 Mark Engelberg mark.engelb...@gmail.com On Fri, Sep 2, 2011 at 11:14 AM, ax2groin ax2gr...@gmail.com wrote: This code doesn't return the value I intuitively expect: user= (not= 1 2 1) true This is exactly what I expect. Those values are not all equal. same for me -- You

Finite lazy sequence

2011-09-02 Thread Wilker
Hi guys, I'm writing a simple parser here, and for parsing I'm creating a lazy-sequence this way: (defn tokens-sec [string] (iterate (fn [info] (next-token info)) [0 0 string []])) but there is a problem, this sequence has a limit (that's when there are no more tokens to consume). How I stop

Re: Finite lazy sequence

2011-09-02 Thread Wilker
Solved by wrapping iterate on take-while :) (defn tokens-sec [string] (take-while identity (iterate (fn [[_ _ string :as info]] (if ( (count string) 0) (next-token info))) [0 0 string []]))) --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600

clojure-based non-blocking webserver like Node.js

2011-09-02 Thread billh2233
Is there a clojure-based webserver that uses non-blocking IO like Node.js, or any effort like that being considered? I like Node.js's non-blocking IO for performance reasons, though it is built around a single-threaded model whereas clojure is built around a multi-core/concurrency model. I

Re: clojure-based non-blocking webserver like Node.js

2011-09-02 Thread Laurent PETIT
Hi, AFAIK, there's a java version of node.js, called Node.x : https://github.com/purplefox/node.x HTH, -- Laurent 2011/9/2 billh2233 bill.har...@gmail.com Is there a clojure-based webserver that uses non-blocking IO like Node.js, or any effort like that being considered? I like Node.js's

Re: clojure-based non-blocking webserver like Node.js

2011-09-02 Thread Wilson MacGyver
look at https://github.com/ztellman/aleph it supprorts async, websocket, server side and client side, plus has redis support. very happy with it. On Fri, Sep 2, 2011 at 2:20 PM, billh2233 bill.har...@gmail.com wrote: Is there a clojure-based webserver that uses non-blocking IO like Node.js, or

Re: clojure-based non-blocking webserver like Node.js

2011-09-02 Thread Raoul Duke
On Fri, Sep 2, 2011 at 11:20 AM, billh2233 bill.har...@gmail.com wrote: I like Node.js's non-blocking IO for performance reasons, though it is built around a single-threaded model whereas clojure is built around a multi-core/concurrency model.  I wonder if the two concepts can be combined

Re: clojure-based non-blocking webserver like Node.js

2011-09-02 Thread Michael Klishin
2011/9/2 billh2233 bill.har...@gmail.com Is there a clojure-based webserver that uses non-blocking IO like Node.js, or any effort like that being considered? Java ecosystem has at least two very mature asynchronous I/O libraries: Netty and Apache MINA. Several Clojure projects that use Netty

== is not always transitive

2011-09-02 Thread Patrick Houk
Greetings, I think that I've encountered a bug in ==. user= (and (== 1 1.0) (== 1.0 1.0M) (not (== 1 1.0M))) true This happens with 1.2.1 and 1.3-beta2. I think it has to do with the precision of the BigDecimal. user= (== 1 1.0M) false user= (== 1 1M) true I think a solution would be to use

Re: http-client and ignoring ssl errors

2011-09-02 Thread John Newman
Maybe I should just build the SSL logic into http-client.core/request and have request instantiate a different DefaultHttpClient based on the value of :noauth in the request map? Will try when I get home. John On Thu, Sep 1, 2011 at 4:31 PM, John Newman john...@gmail.com wrote: Hello All,

Re: not= counterintuitive?

2011-09-02 Thread Alan Malloy
On Sep 2, 11:14 am, ax2groin ax2gr...@gmail.com wrote: This code doesn't return the value I intuitively expect:   user= (not= 1 2 1)   true When I write that, I was expecting the equivalent of (and (= 1 2) (= 1 1)), but the macro expansion is essentially (not (= 1 2 1)). This is not a

Land of Lisp music video

2011-09-02 Thread finbeu
Just found this: http://www.youtube.com/watch?v=HM1Zb3xmvMc Awesome ... -- 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

Re: Unable to use/refer/require clojure.contrib

2011-09-02 Thread Stuart Sierra
Hi Ryan, Clojure-contrib versions 1.1.0 and 1.2.0 work only with the matching major.minor Clojure version. So if you're using Clojure 1.2.0 or 1.2.1, you need to use clojure-contrib 1.2.0. Starting with 1.3, Clojure contrib is many libraries, each with their own independent version numbers.

Re: not= counterintuitive?

2011-09-02 Thread ax2groin
That's what I get for posting a question while feeding a 1-year-old child and getting ready to leave for lunch. I was trying to put together a (for) construct to output the combinations of a set, and my logic was flawed. Here's what I really wanted [for sets of 3]: (for [m x n x o x :while (and

Re: Land of Lisp music video

2011-09-02 Thread Tassilo Horn
finbeu info_pe...@t-online.de writes: Just found this: http://www.youtube.com/watch?v=HM1Zb3xmvMc Awesome ... Totally. Now I'll have a earwig for weeks. Bye, Tassilo ...simple but refined, guaranteed to blow your mind... -- You received this message because you are subscribed to the

Re: Land of Lisp music video

2011-09-02 Thread Wilker
Because of you I know had to spend $40 do get this e-book :P hehe --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600 On Fri, Sep 2, 2011 at 6:59 PM, Tassilo Horn tass...@member.fsf.org wrote: finbeu info_pe...@t-online.de writes: Just found this:

new Getting Started page

2011-09-02 Thread nchurch
There was some discussion about the Getting Started page last night at the Bay Area meetup. I've put together an (I think) improved version at http://dev.clojure.org/display/doc/Getting+Started+for+Beginners Any suggestions/additions/deletions? If this overall looks good, may I replace the

Re: new Getting Started page

2011-09-02 Thread Sean Corfield
I think this is a much better on ramp for folks new to Clojure and the bullet list of the current Getting Started page really should be the next page not the first one. On Fri, Sep 2, 2011 at 3:13 PM, nchurch nchubr...@gmail.com wrote: There was some discussion about the Getting Started page

Re: Eval in future ... Bug or feature?

2011-09-02 Thread Sean Corfield
Looks like it doesn't work in 1.2.1 but does work in 1.3.0: (! 516)- lein repl REPL started; server listening on localhost port 61980 user= (clojure-version) 1.2.1 user= (defn my-inc [x] (+ x 1)) #'user/my-inc user= (eval '(my-inc 1)) 2 user= (future (eval '(my-inc 1))) java.lang.Exception:

A bit of fun with core.logic

2011-09-02 Thread Ambrose Bonnaire-Sergeant
Hi, For those with a bit of free time to experiment at a REPL this weekend. https://github.com/frenchy64/Logic-Starter/wiki/Arithmetic Thanks, Ambrose -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: clojure-based non-blocking webserver like Node.js

2011-09-02 Thread Tal Liron
Jetty and Grizzly also work great, and can be used as easily swappable connectors for Restlet, which in turn is used by Prudence's Clojure flavor (I'm the lead developer): http://threecrickets.com/prudence/ Jetty is the most mature of the bunch (Grizzly, Netty, MINA, etc.) and offers many

Re: A bit of fun with core.logic

2011-09-02 Thread David Nolen
Good stuff! On Fri, Sep 2, 2011 at 7:58 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: Hi, For those with a bit of free time to experiment at a REPL this weekend. https://github.com/frenchy64/Logic-Starter/wiki/Arithmetic Thanks, Ambrose -- You received this message

Re: new Getting Started page

2011-09-02 Thread jonathan.watmo...@gmail.com
Is there any reason why the 'Getting Started' shouldn't essentially follow the form: 1. Download clojure and unzip 2. Move to the folder and type 'java -cp clojure.jar clojure.main' in a terminal For the sake of testing your new page, I downloaded clooj (ugly ugly name) and ran it. On trying to

Re: Eval in future ... Bug or feature?

2011-09-02 Thread Brian Goslinga
The future is probably executing in a different thread, so the dynamic binding of *ns* probably isn't the user namespace. -- 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: new Getting Started page

2011-09-02 Thread Lee Spector
FWIW I think nchurch's proposed new page is very nice and I disagree with almost all of jonathan.watmough's critiques. I won't rebut them all systematically, but one top-level issue is that I think that a reasonable getting-started path should include an editor with at least minimal

Re: new Getting Started page

2011-09-02 Thread nchurch
Jonathan--- I think some of your criticisms of Clooj are valid, as Lee has said; my question is not whether Clooj is perfect or even good, my question is if there is a better option for an outright newcomer. An outright newcomer may not be so worried about adding jars, or used to existing REPL

Re: new Getting Started page

2011-09-02 Thread Jeff Heon
I like the new page, and I do think Clooj is filling a much needed (or at least much wanted) space for beginners to both Clojure and Java, especially for those who have been accustomed to the practical IDLE while learning Python. I'm reasonably experienced in both Java Clojure, and I use the

[ANN] Clojure 1.3 Beta 3

2011-09-02 Thread Christopher Redinger
Clojure 1.3 Beta 3 is now available at http://clojure.org/downloads The list of changes: * Load resources when baseLoader() is null (CLJ-673) * Equiv overload added for primitive booleans * Documentation updates for juxt and defrecord (CLJ-815, CLJ-736 respectively) We think this is ready to

Re: new Getting Started page

2011-09-02 Thread Sean Corfield
On Fri, Sep 2, 2011 at 5:27 PM, jonathan.watmo...@gmail.com jonathan.watmo...@gmail.com wrote: 1. Download clojure and unzip 2. Move to the folder and type 'java -cp clojure.jar clojure.main' in a terminal Because this is exactly what's wrong with the current getting started process. It's not

Re: Land of Lisp music video

2011-09-02 Thread Timothy Washington
Brilliant. I love it :) Tim Washington twash...@gmail.com 416.843.9060 On Fri, Sep 2, 2011 at 4:11 PM, finbeu info_pe...@t-online.de wrote: Just found this: http://www.youtube.com/watch?v=HM1Zb3xmvMc Awesome ... -- You received this message because you are subscribed to the Google

Re: new Getting Started page

2011-09-02 Thread Kevin Downey
I largely agree, what more do you need to get started than just a repl? writing functions and run them. The bells and whistles you get from various editors and ides are not a requirement for having fun writing functions and running them. It is great to let people know how to get a good integrated