Behavior of #sameAs: has changed
The behavior of Character>>#sameAs: and EsString>>#sameAs: changed when the method is passed an arbitrary non-string, non-character class. Previously, the behavior was to return false. Now the behavior is to raise a #DNU does not understand error. When classes which implement #sameAs: are passed as a parameter, they always return a Boolean.
Reason for Change
#sameAs: is meant to do a case-insensitive comparison between Characters/Strings/Graphemes/UnicodeStrings. The following two expressions should return the same result.
$a sameAs: $a asGrapheme.
$a asGrapheme sameAs: $a.
Likewise, the following two expressions should return the same result.
$a sameAs: $a asGrapheme.
$a asGrapheme sameAs: $a.
Action required
If sameAs: is used with arbitrary classes as parameters, it needs to be changed.
If this was intended behavior, and comparison with strings should return false, either introduce a new comparison method extension which preserves the old behavior, or extend the arbitrary class (and base classes) following the same pattern now used to double delegate sameAs:.
Last modified date: 07/15/2025