From 5546da8b666e66ae10828e9291e3f0ad12befe6d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 31 Oct 2025 16:53:17 +0100 Subject: [PATCH] Cut dependency of Collection-Strings to Unicode Currently Collections-Strings depends explicitly on Unicode. It would lead to error to move the methods as extension of Unicode because the error would not be clear. I propose to make the dependency weaker by checking if unicode is in the image and raise a right warning if it is not in the image. --- src/Collections-Strings/WideString.class.st | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Collections-Strings/WideString.class.st b/src/Collections-Strings/WideString.class.st index f387f553cb3..6d32221723b 100644 --- a/src/Collections-Strings/WideString.class.st +++ b/src/Collections-Strings/WideString.class.st @@ -85,7 +85,10 @@ WideString >> asLowercase [ "Answer a copy of self with all characters in a lower case. This might be a difficult task, ask Unicode." - ^ Unicode toLowercaseString: self + ^ self class environment + at: #Unicode + ifPresent: [ :class | class toLowercaseString: self ] + ifAbsent: [ self error: 'In order to do this operation you need the Unicode support in Pharo but it is currently not present.' ] ] { #category : 'converting' } @@ -93,7 +96,10 @@ WideString >> asUppercase [ "Answer a copy of self with all characters in an upper case. This might be a difficult task, ask Unicode." - ^ Unicode toUppercaseString: self + ^ self class environment + at: #Unicode + ifPresent: [ :class | class toUppercaseString: self ] + ifAbsent: [ self error: 'In order to do this operation you need the Unicode support in Pharo but it is currently not present.' ] ] { #category : 'converting' }