On Wed, Aug 20, 2008 at 3:06 AM, Rastislav Kassak <[EMAIL PROTECTED]> wrote: > > I'm not sure, if it compiles from class files, at least it probably > wasn't true in the beginning (when I was studying GWT).
GWT appears to still compile from .java sources (not .class files). I
flailed around with it a bit today, trying to get some of Clojure's
collections to compile, since they're written in Java. In the end, I
don't think that'll be worth it.
Instead, here a first cut at PersistentVector ported to JavaScript. I
intend to do some timing tests to see if different arrangements might
run faster, but at least this seems to work. To use it, you can do
this sort of thing in JavaScript:
var v = PersistentVector.EMPTY;
for( var i = 0; i < 100; ++i ) {
v = v.cons( i );
}
The other methods work just like the Java version: v.peek(), v.pop(),
v.nth( i ), v.assocN( i, val ), v.count(), etc.
The only create method I wrote takes a JS array:
PersistentVector.create( ["a", "b", "c"] )
--Chouser
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---
PersistentVector.js
Description: JavaScript source
