[ nice-Feature Requests-1153262 ] notNull antipode

"SourceForge.net" <[email protected]> Mon, 28 Feb 2005 11:45:11 -0800
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Feature Requests item #1153262, was opened at 2005-02-28 09:55
Message generated for change (Comment added) made by artemgr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=362788&aid=1153262&group_id=12788

Category: None
Group: None
Status: Open
Priority: 1
Submitted By: Artem Gr Kozarezov (artemgr)
Assigned to: Artem Gr Kozarezov (artemgr)
Summary: notNull antipode

Initial Comment:
Nice guesses about nullness of existing java arguments
and returned values are often incorrect. It is not
always feasible to correct nullness assumptions using
"native" keyword. And it is not convenient to loose
type inference only to convert the type to the option one.

Following statement works with Nice:
<T> ?T maybeNull( !T value ) = cast( value );

Proporsal is to add this statement or some other method
into the Nice prelude.

----------------------------------------------------------------------

>Comment By: Artem Gr Kozarezov (artemgr)
Date: 2005-02-28 22:45

Message:
Logged In: YES 
user_id=289741

notNull method have the following comment: """
    This call presently does no check, assuming that a
dereferencing
    is coming next and will detect nullness.
    This should probably be fixed so that the semantics is
well defined.
""".
But there IS an "assert(value != null);" in the method.
Is the commend still true or does i misunderstood something?

----------------------------------------------------------------------

Comment By: Daniel Bonniot (bonniot)
Date: 2005-02-28 11:30

Message:
Logged In: YES 
user_id=88952

I agree with the need for such a method in nice.lang. Only
question to me is the name. Neither notNull nor maybeNull is
especially elegant. On the other hand, they are quite
descriptive, while for instance using an operator (!/? or
others) would make the language look more cryptic,
especially since the nullness notion is new. Furthermore,
it's not a bad thing to make them a bit verbose to not
encourage their use, since those methods should still be
considered a workaround, it's of course better when you can
find a design where they are not needed. So unless a better
idea comes up, maybeNull is fine with me.

Implementation note: you don't need the cast, because you
are simply losing type information (a !T is always a ?T).


----------------------------------------------------------------------

Comment By: Artem Gr Kozarezov (artemgr)
Date: 2005-02-28 09:57

Message:
Logged In: YES 
user_id=289741

If this RFE is valid and accepted,
i can put the statement and a testcase into CVS.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=362788&aid=1153262&group_id=12788


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click