From: SourceForge.net <no...@so...> - 2012-07-09 11:25:10
|
Feature Requests item #3541572, was opened at 2012-07-09 04:25 Message generated for change (Tracker Item Submitted) made by bigrixx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3541572&group_id=119701 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Classes Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Rick McGuire (bigrixx) Assigned to: Nobody/Anonymous (nobody) Summary: String compares should have special exception for .nil Initial Comment: Currently, the string implementations of comparison operations unconditionally convert the right-hand-side of the comparison to a string value. This means compares like if arg == .nil then .... If the variable arg is .nil, then these objects are compared directly. If variable arg is a string value, .nil gets converted to the string "The NIL object" and this value is compared. This has two problems: 1) There is a potential for a false positive on this compare if the string value happens to be the string "The NIL object" 2) a NOSTRING condition is raised, which causes unexpected problems if SIGNAL ON ANY is in use. The workaround is to code "if .nil == arg then ..." to get .nil on the left side of the operator. In practice, people almost universally prefer the first form. Comparison to .nil is such an important thing on the ooRexx language that the string class should recognize .nil as a special case and always return .false (avoiding the NOSTRING condition as well). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=684733&aid=3541572&group_id=119701 |