I think the NullPointerException was misleading for me... a more
informational error message should be added.
Rich, what do you think?

On Sat, Nov 29, 2008 at 3:41 PM, Ralf Bensmann
<[EMAIL PROTECTED]>wrote:

> Argl... just forgot one of the "basic rules" ;)
>
>
> On Sat, Nov 29, 2008 at 3:33 PM, Randall R Schulz <[EMAIL PROTECTED]>wrote:
>
>>
>> On Saturday 29 November 2008 06:27, Ralf Bensmann wrote:
>> > Thanks for clarification. But I am wondering about a function can
>> > return nil:
>> >
>> > user=> (fn [] ((+ 1 2) nil))
>> > #<user$eval__63$fn__65 [EMAIL PROTECTED]>
>> >
>> > But "just returning nil" is not ok?
>> > user=> (fn [] (nil))
>>
>> You're not returning nil, you're trying to apply nil (as if it were a
>> function) to an empty argument list.
>>
>>
>> > java.lang.NullPointerException (NO_SOURCE_FILE:24)
>> > user=> (fn [] ((nil)))
>> > java.lang.NullPointerException (NO_SOURCE_FILE:25)
>>
>> Now you're trying to apply the result of applying nil to an empty
>> argument list to an empty argument list. Naturally, it fails at the
>> same point, which is the inner attempt.
>>
>>
>> It's just simpler than you're trying to make it:
>>
>> user=> ((fn [] nil))
>> nil
>>
>>
>>
>> > Thanks
>> > -Ralf
>>
>>
>> Randall Schulz
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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