But #(...) and (fn [] ...) should be the same?

On Sat, Nov 29, 2008 at 1:48 PM, Parth Malwankar
<[EMAIL PROTECTED]>wrote:

>
> On Nov 29, 5:29 pm, "Ralf Bensmann" <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > is this the intended behavior?
> >
> > user=> #(nil)
> > java.lang.NullPointerException (NO_SOURCE_FILE:12)
> > user=> (def b #(nil))
> > java.lang.NullPointerException (NO_SOURCE_FILE:13)
> >
>
> This is expected.
> #(nil) is the same as (fn [] (nil)) and hence the failure.
> (fn [] nil) is what you want.
>
> > This works:
> > user=> #('nil)
> > #<user$eval__43$fn__45 [EMAIL PROTECTED]>
> >
>
> I am not very clear on whats happening here to comment.
>
> Parth
>
> > Thanks,
> > -Ralf
>

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to