Re: evalOnlyDefs

2009-01-23 Thread Konrad Hinsen
On 23.01.2009, at 22:47, Stephen C. Gilardi wrote: > Are you pointing out that closures as well as macros may require > same-world compilation? Yes. > When compiling that to bytecode, one could implement (effectively): > > (declare-private _my-factor-311) > (defn foo [x] (* _my-fa

Re: evalOnlyDefs

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 4:13 PM, Konrad Hinsen wrote: How about something like (let [my-factor (* 3 (. Math sqrt 2) (. Math log 42.))] (defn foo [x] (* my-factor x))) where the let outside of the definition makes sure the constant factor is evaluated only once? Are you pointing out that closu

Re: evalOnlyDefs

2009-01-23 Thread Konrad Hinsen
On 23.01.2009, at 19:04, Stephen C. Gilardi wrote: > is something that ultimately invokes "def". On the way to invoking > def, one could also allow compiling code, but not running it, > deferring initializers until some kind of "load" time. Macros > present a problem with this strategy, of

Re: evalOnlyDefs

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 11:52 AM, Konrad Hinsen wrote: Some questions this raises: - Should libs be restricted to definitions (and lib support things like "ns" and (some kind of) "load-resource") only? - Should the appearance of an "ns" form automatically make that restriction enforced for the re

Re: evalOnlyDefs

2009-01-23 Thread Laurent PETIT
2009/1/23 Konrad Hinsen > > On Jan 23, 2009, at 17:15, Stephen C. Gilardi wrote: > > > I recently changed my "user.clj" file to be purely full of > > definitions. I think it fits well with the "require"/"use" model > > that reloading ought to only affect what's available to call after > > the loa

Re: evalOnlyDefs

2009-01-23 Thread Konrad Hinsen
On Jan 23, 2009, at 17:15, Stephen C. Gilardi wrote: > I recently changed my "user.clj" file to be purely full of > definitions. I think it fits well with the "require"/"use" model > that reloading ought to only affect what's available to call after > the load, not actually "do" (in the Clo

Re: evalOnlyDefs

2009-01-23 Thread Stephen C. Gilardi
On Jan 23, 2009, at 8:38 AM, Peter Wolf wrote: Looking for opinions from Clojure internals Wizards... I can think of only one Clojure internals Wizard, but I have some thoughts. I am thinking about "safe loading" for IDEs (see other thread). IDEs need a way to load and resolve code, wit