On Sun, Feb 22, 2009 at 7:49 AM, Jan Rychter <j...@rychter.com> wrote:
>
> Konrad Hinsen <konrad.hin...@laposte.net> writes:
>
>> On Feb 18, 2009, at 9:39, Jan Rychter wrote:
>>
>>> Is anyone working on a Parenscript
>>> (http://common-lisp.net/project/parenscript/) for Clojure?
>>
>> There's Chouser's ClojureScript in clojure.contrib. I don't know if
>> it is similar to Parenscript, but it has similar goals: compile
>> Clojure (or at least a reasonable subset of it) into JavaScript.
>
> I saw it, but I had the impression that it served a different goal.
>
> I'm not looking for Clojure interpreted in Javascript. I am looking for
> a Javascript generator in Clojure. I know they sound similar, but what I
> need is Javascript semantics with a lispy syntax and macros. I need to
> be able to generate strings of Javascript code.
>
> Parenscript is an excellent example of what I'm looking for.

I'm curious about what you need that's different from what
ClojureScript provides: a mechanism for compiling a subset of Clojure
to JavaScript code that behaves like you'd expect the Clojure code to
behave.

One common category of need that ClojureScript doesn't currently
fulfill is translating Clojure native collections (vectors and maps)
to JavaScript native collections (arrays and Objects).  Instead,
Clojure native collections are translated into immutable,
structural-sharing collections implemented in JavaScript.  ...but I
don't think that's what you're describing as a need here.

user=> (require '[clojure.contrib.clojurescript :as cljs])
nil

user=> (println (cljs/formtojs '(defn foo [x y] (+ x y))))
(function __user_fn_528(){
return (clojure.JS.def(user,"foo",(function __user_fn_528_foo_530(x_1,y_2){
return (clojure.lang.Numbers.add(x_1,y_2))})))}).apply(null,[])
nil

ClojureScript is not yet up to date with the recent lazy-seq changes.

--Chouser

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to