> Rich, the "pseudo class model" with the new keyword is a syntactic > obfuscation, semantically javascript is prototypical inheritance. It's > class free. In addition to the pseudo class inheritance advocated by > google closure and the prototypical inherent in javascript, others > like Doug Crockford advocated functional inheritance.
Almost every big JS library I know of adds in traditional inheritance, so I don't think the community has decided what the best design pattern is. There are many vocal people in the community who advocate for prototypal inheritance, but I think this is a far cry from consensus. But the real issue is that this has very little to do with ClojureScript. Whether the underlying library uses one or the other is of little concern to the higher level. I don't think there is anything in ClojureScript preventing you from interop with *any* JS lib, unless of course you also want to use Closure compiler, in which case there are some rules to follow. > I respectfully dispute that; for what they both do - dom, css, ajax, > events, cookies, ui, effects, animations etc - jquery does it far > better and is much more pleasant an api. What jquery itself doesn't do > the huge ecosphere of libs around it do, for example: > http://metajack.im/2009/03/13/jquery-and-strophe-made-for-each-other/ > http://strophe.im/ I wrote that post and the Strophe.js library. I can tell you there is nothing at all in Strophe that is jQuery dependent. It turns out that jQuery's selector engine is quite useful at picking apart XML (and strangely the other libraries selector engines aren't), which makes using Strophe.js a lot easier. Plenty of people use Strophe.js alongside other JS libs without any problems. Many libraries are like this. Underscore.js is another example, but there are tons of others. It's certainly true that jQuery has a lot of plugins that already exist. I can't say yet whether any of those would be useful in ClojureScript. There's nothing preventing you using jQuery and ClojureScript together (aside from a few kB overhead which they claim to be working on minimizing). I don't see what benefit ClojureScript would get from being built on jQuery, and it would be giving up a lot (the Closure compiler!) for any such benefits. Strophe is actually a great example because it's nearly impossible to write any javascript library that satisfies some consensus of javascript design. What dependency management tool should it use? What type of object structure? No matter what I choose, there are large swaths of major libraries that will not have made the same choices. ClojureScript doesn't seemed particularly tied to anything but the Closure compiler and it's dependency requirements. The benefits are huge, and don't exist anywhere else to my knowledge. If jQuery or YUI offered such a system, I think there would be more to argue about, but even though I'm not a fan of Closure or YUI either (I tend to reach for jQuery), I am perfectly happy with ClojureScript's choices and have started down the road to embracing Closure library as well. jack. -- 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 your first post. 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