CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread Brandon Bloom
I've noticed that a lot of the new CLJS optimizations, such as direct arity dispatch, don't work correctly across namespaces. Upon deeper investigation, it seems like files are analyzed in an arbitrary order (alphabetically?) during builds. This means that the necessary metadata for such optimi

Re: Alan Kay talk

2012-04-25 Thread d...@axiom-developer.org
On Apr 24, 11:33 pm, Kai wrote: > The implications of Kay's talk are potent; and when one considers that his > team at VPRI have mostly fulfilled their vision to reduce the tens/hundreds > of millions of lines of code needed for personal computing down to under > 20,000 lines (includes OS, netwo

Re: Alan Kay talk

2012-04-25 Thread Timothy Baldridge
> In case you haven't had time to see the talk, the feature of > most interest, at least to me, was that Kay managed to create > a mathematical foundation for the 2.5D screen geometry. > From that mathematical basis, they derived a correct, small, > fast, and clean program. In 20,000 lines of code

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread David Nolen
On Wed, Apr 25, 2012 at 5:22 AM, Brandon Bloom wrote: > I've noticed that a lot of the new CLJS optimizations, such as direct > arity dispatch, don't work correctly across namespaces. Upon deeper > investigation, it seems like files are analyzed in an arbitrary order > (alphabetically?) during bu

Cheap defrecord transformation

2012-04-25 Thread Shantanu Kumar
Hi, I have a scenario where I have two records: (defrecord Foo [a b]) (defrecord Bar [a b c]) You will notice Bar has only an attribute more than Foo. Both Foo and Bar are data abstractions where Foo is a subset of Bar. Now, when I try to construct a Bar from an existing Foo instance, I get thi

Re: Cheap defrecord transformation

2012-04-25 Thread Ambrose Bonnaire-Sergeant
On Wed, Apr 25, 2012 at 10:30 PM, Shantanu Kumar wrote: > 2. It is quite verbose to construct a Bar from a Foo. Knowing that > there is an overlap of attributes, is there a less verbose way to do > it? > > Have you tried this? user=> (map->B (merge (A. 1 2) {:c 1})) #user.B{:a 1, :b 2, :c 1} Tha

Re: Cheap defrecord transformation

2012-04-25 Thread Shantanu Kumar
> user=> (map->B (merge (A. 1 2) {:c 1})) > #user.B{:a 1, :b 2, :c 1} Pretty cool – thanks! Didn't know about map-> Shantanu -- 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 post

Re: Cheap defrecord transformation

2012-04-25 Thread Lars Nilsson
On Wed, Apr 25, 2012 at 10:30 AM, Shantanu Kumar wrote: > user=> (let [x (Foo. 10 20)] (time (Bar. (:a x) (:b x) 30))) > "Elapsed time: 0.686 msecs" > #user.Bar{:a 10, :b 20, :c 30} > > Whereas, doing the same with a map is very cheap: > > user=> (let [x {:a 10 :b 20}] (time (assoc x :c 30))) > "E

Re: Cheap defrecord transformation

2012-04-25 Thread Meikel Brandmeyer (kotarak)
Hi, your comparison is not fair. The map example merely assoc's a new value, while in the record case you create a complete fresh value with a different type. Here some more comparisons: user=> (defrecord Foo [a b]) user.Foo user=> (defrecord Bar [a b c]) user.Bar user=> (let [x (->Foo 10 20)]

ClojureScriptOne remote

2012-04-25 Thread Pierre-Henry Perret
When returning a response from a remote call, it fails to a server error: __ Uncaught Error: No protocol method ILookup.-lookup defined for type object: [object Object] Have someone any idea what it origins from ? Thanks -- You received this message because you a

Re: ClojureScriptOne remote

2012-04-25 Thread David Nolen
Perhaps you are calling 'get' on something which has not implemented or not been extended to ILookup. On Wed, Apr 25, 2012 at 2:38 PM, Pierre-Henry Perret wrote: > When returning a response from a remote call, it fails to a server error: > > __ > Uncaught Error: No protocol method ILo

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread Brandon Bloom
> > The current optimizations are really only guaranteed to work on core.cljs. > I encountered the dependency problem while working on the optimizations. > It occurs to me that these sorts of optimizations would need to tunable. Direct arity dispatch, for example, eliminates an indirection whic

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread Evan Mezeske
> > Shell scripts have PATH, Java has CLASS_PATH, Python has PYTHONPATH, Ruby > has RUBYLIB, Node.js has NODE_PATH... it's annoying that there are so many > of them, but they exist for a reason: It's about as simple as it gets for > getting a piece of code for a given file name. > ClojureScrip

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread David Nolen
On Wed, Apr 25, 2012 at 2:53 PM, Brandon Bloom wrote: > The current optimizations are really only guaranteed to work on core.cljs. >> I encountered the dependency problem while working on the optimizations. >> > > It occurs to me that these sorts of optimizations would need to tunable. > Direct a

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread David Nolen
On Wed, Apr 25, 2012 at 3:02 PM, Evan Mezeske wrote: > Shell scripts have PATH, Java has CLASS_PATH, Python has PYTHONPATH, Ruby >> has RUBYLIB, Node.js has NODE_PATH... it's annoying that there are so many >> of them, but they exist for a reason: It's about as simple as it gets for >> getting a

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread Brandon Bloom
> > ClojureScript implicitly uses the CLASSPATH, by accessing source files as > resources: > > > https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L576 > Ah. Missed that. I was looking for calls to io/resource in compiler.clj, not closure.clj. I really need to s

Re: CLJS: Cross-namespace analysis (and classpaths?)

2012-04-25 Thread Brandon Bloom
> > cljs.closure/build takes a source path parameter where it recursively > looks for cljs files. We could use this path for resolution. > I've been *mostly* ignoring that file, since I haven't had to change it yet :-) I guess I need to study it some more. -- You received this message because

Re: Alan Kay talk

2012-04-25 Thread Martin Forsgren
Den onsdagen den 25:e april 2012 kl. 15:47:52 UTC+2 skrev tbc++: > > > In case you haven't had time to see the talk, the feature of > > most interest, at least to me, was that Kay managed to create > > a mathematical foundation for the 2.5D screen geometry. > > From that mathematical basis, they de

Re: ANN clojure.java.jdbc 0.2.0

2012-04-25 Thread Sean Corfield
Just so you don't think I'm ignoring these posts, I'm a bit tied up with work for the next week or so but will dig into your questions when I get a chance and I'd certainly like to make it easier for you to work with Oracle than it appears to be right now (although it would help me a lot if you cou

Convention for configuration files?

2012-04-25 Thread Brian Marick
Midje is getting to the point where it probably wants some sort of configuration/customization file. Is there any sort of emerging idiom for those in Clojure-land? - Naming convention? Beginning with a dot? Ending in "rc"? Etc. - If Joe User wants a config file in his home directory, will we fo

Re: Convention for configuration files?

2012-04-25 Thread Phil Hagelberg
Brian Marick writes: > Midje is getting to the point where it probably wants some sort of > configuration/customization file. Is there any sort of emerging idiom > for those in Clojure-land? You could always piggy-back on Leiningen user-level profiles. Propagating the :midje key from the project

Having trouble running clojurescript repl

2012-04-25 Thread Sean Neilan
Hi All, I'm not sure if this has been asked before. I followed the quickstart guide: https://github.com/clojure/clojurescript/wiki/Quick-Start and did git clone git://github.com/clojure/clojurescript.git cd clojurescript ./script/bootstrap Then I tried rmc-235-244:clojurescript seanneilan$ ./sc

Re: Having trouble running clojurescript repl

2012-04-25 Thread nchurch
Did you try using lein-cljsbuild (together with the instructions on Using Clojurescript in a Web Page on Quick Start)? That works fine for me. The instructions on the lein-cljsbuild REPL are here (repl listen should be enough to get you going): https://github.com/emezeske/lein-cljsbuild/blob/0.1

Re: Having trouble running clojurescript repl

2012-04-25 Thread David Nolen
sounds like you didn't set CLOJURESCRIPT_HOME or that it was set incorrectly. On Wed, Apr 25, 2012 at 9:40 PM, Sean Neilan wrote: > Hi All, > > I'm not sure if this has been asked before. > > I followed the quickstart guide: > https://github.com/clojure/clojurescript/wiki/Quick-Start and did > >

Re: Having trouble running clojurescript repl

2012-04-25 Thread Sean Neilan
Holy shnikes! That did it! Thank you so much! I'll submit a patch to the documentation. On Wed, Apr 25, 2012 at 11:27 PM, David Nolen wrote: > sounds like you didn't set CLOJURESCRIPT_HOME or that it was set > incorrectly. > > On Wed, Apr 25, 2012 at 9:40 PM, Sean Neilan wrote: > >> Hi All, >>

Re: Having trouble running clojurescript repl

2012-04-25 Thread nchurch
BTW, I pushed a minimal lein-cljsbuild project with REPL here: https://github.com/nchurch/ctest On Apr 25, 9:30 pm, Sean Neilan wrote: > Holy shnikes! That did it! > > Thank you so much! > > I'll submit a patch to the documentation. > > On Wed, Apr 25, 2012 at 11:27 PM, David Nolen wrote: > > >