Re: [Oorexx-devel] Are Strings unique?
No, strings are not necessarily unique. The places where a direct compare occurs are safe because these are places where the interpreter itself set the value being tested. A null string is not necessary unique either, though there are lots of places where the global version is returned if a null string is generated. Rick On Sat, Apr 18, 2020 at 12:14 PM Erich Steinböck wrote: > The interpreter doesn't guarantee that String objects are unique, i. e. at > most one copy of e. g. a string "FUNCTION" can exist, does it? > > Most of the interpreter code uses strCompare(GlobalNames::NNN), but there > are rare exceptions doing a direct compare like == GlobalNames::NULLSTRING > or == GlobalNames::FUNCTION. > > Is a null string always unique? > ___ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Are Strings unique?
Don’t know about that. But in JDBC, every SQL type has its own NULL typed value. But I recently learned on this list that there only one NIL in ooRexx, The NIL Object (British Accent required here ;-)). René. > On 18 Apr 2020, at 18:13, Erich Steinböck wrote: > > The interpreter doesn't guarantee that String objects are unique, i. e. at > most one copy of e. g. a string "FUNCTION" can exist, does it? > > Most of the interpreter code uses strCompare(GlobalNames::NNN), but there are > rare exceptions doing a direct compare like == GlobalNames::NULLSTRING or == > GlobalNames::FUNCTION. > > Is a null string always unique? > ___ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Are Strings unique?
The interpreter doesn't guarantee that String objects are unique, i. e. at most one copy of e. g. a string "FUNCTION" can exist, does it? Most of the interpreter code uses strCompare(GlobalNames::NNN), but there are rare exceptions doing a direct compare like == GlobalNames::NULLSTRING or == GlobalNames::FUNCTION. Is a null string always unique? ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel