Re: anonymous functions with names

2012-09-03 Thread Mayank Jain
@dmirylenka Thanks. That is useful to know. On Mon, Sep 3, 2012 at 3:00 PM, dmirylenka wrote: > Just 2 cents: > > A name you give to the anonymous function also appears in the stack traces > instead of the things like fn_123_4532, > which is very convenient for debugging. > > On Friday, August 31

Re: anonymous functions with names

2012-09-03 Thread Stathis Sideris
Thanks, this is a *very* useful bit of information. On Monday, 3 September 2012 10:30:21 UTC+1, dmirylenka wrote: > > Just 2 cents: > > A name you give to the anonymous function also appears in the stack traces > instead of the things like fn_123_4532, > which is very convenient for debugging. >

Re: anonymous functions with names

2012-09-03 Thread dmirylenka
Just 2 cents: A name you give to the anonymous function also appears in the stack traces instead of the things like fn_123_4532, which is very convenient for debugging. On Friday, August 31, 2012 5:52:55 PM UTC+2, Erlis Vidal wrote: > > Hi guys, > > I've been reading but I'm still confused abou

Re: anonymous functions with names

2012-08-31 Thread Erlis Vidal
Thank you guys!! On Fri, Aug 31, 2012 at 11:59 AM, Jim - FooBar(); wrote: > defn will create a global var while fn won't...it is only visible in the > scope it was originally defined...remember you can always do: > > (def f (fn [x] ...)) which is he same as defn > > Jim > > > On 31/08/12 16:52, E

Re: anonymous functions with names

2012-08-31 Thread Jim - FooBar();
defn will create a global var while fn won't...it is only visible in the scope it was originally defined...remember you can always do: (def f (fn [x] ...)) which is he same as defn Jim On 31/08/12 16:52, Erlis Vidal wrote: Hi guys, I've been reading but I'm still confused about the differenc

Re: anonymous functions with names

2012-08-31 Thread Tamreen Khan
The name given an anonymous function can only be used within the scope of that function. This will work: (fn my-func1 [x] (my-func x)) ; Leads to infinite recursion, of course This won't work because my-func1 is called outside of the function's lexical scope: (fn my-func1 [x] x) (my-func1 100)

Re: anonymous functions with names

2012-08-31 Thread Baishampayan Ghose
In case of a named anonymous function the name is only bound in the lexical scope of the anonymous function being defined. This is useful when defining recursive anonymous functions. Sent from phone. Please excuse brevity. On 31 Aug 2012 21:22, "Erlis Vidal" wrote: > Hi guys, > > I've been read