>> This statement is ironic, considering the definition of a functional
>> closure, after which Clojure is presumably named.
> You're missing the point. A defn inside another defn doesn't do what you
> think it does. defn always creates a global variable, even when it looks
> like it should crea
Similarly, don't use def inside of a defn. Use let.
On Tue, Aug 3, 2010 at 9:10 PM, Mark Engelberg wrote:
> On Tue, Aug 3, 2010 at 1:06 PM, Dale wrote:
>
>> This statement is ironic, considering the definition of a functional
>> closure, after which Clojure is presumably named.
>>
>>
> You're m
On Tue, Aug 3, 2010 at 1:00 PM, Dale wrote:
> On Aug 2, 11:07 pm, Mark Engelberg wrote:
> > Can you distill this down to the smallest possible example that
> demonstrates
> > the error?
>
> Nope. Just spent some time trying to duplicate the nested function bug
> in a simpler context.
>
>
Well if
On Tue, Aug 3, 2010 at 1:06 PM, Dale wrote:
> This statement is ironic, considering the definition of a functional
> closure, after which Clojure is presumably named.
>
>
You're missing the point. A defn inside another defn doesn't do what you
think it does. defn always creates a global variabl
On Aug 3, 11:26 am, Moritz Ulrich
wrote:
> Defining function (with defn) inside another function isn't very
> beautiful (def* outside of the top-level is generally disregarded). It
> looks like you use thhelp only inside the thsolve-function. Use either
> letfn or (let [thhelp (fn )] ...) here
On Aug 2, 11:07 pm, Mark Engelberg wrote:
> Can you distill this down to the smallest possible example that demonstrates
> the error?
Nope. Just spent some time trying to duplicate the nested function bug
in a simpler context.
A pointer to the place where I should deposit code that manifests a
r
Defining function (with defn) inside another function isn't very
beautiful (def* outside of the top-level is generally disregarded). It
looks like you use thhelp only inside the thsolve-function. Use either
letfn or (let [thhelp (fn )] ...) here.
On Tue, Aug 3, 2010 at 5:07 AM, Mark Engelberg
Can you distill this down to the smallest possible example that demonstrates
the error?
--
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 - plea
In the program below, if I use the commented-out version of thsolve
(program is the N queens puzzle), the with-local-vars construct causes
a NullPointerException when its block exits, after appearingt o work
correctly. The same thing happens if I use binding instead.
The non-commented version of t