[Cuis-dev] Some questions on The Cuis Book & other questions

Hernán Wilkinson hernan.wilkinson at 10pines.com
Wed Feb 22 04:28:46 PST 2023


On Wed, Feb 22, 2023 at 9:25 AM Ignacio Sniechowski via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Yes,
> I can confirm that. But also what puzzles me is the fact that as per The
> Cuis Book all strings in Cuis are Unicode (UTF-8) so there must be
> instances of UnicodeString.
> But 'hello' is just an instance of class String and being an instance of
> class String makes it mutable while UnicodeStrings are immutable.
>

hahaha I just sent you an email with the reason for that.
'hello' will be an instance of String, that is mutable, etc. because of
historical reasons (it is the Smalltalk-80 String)
'héllo' will be an instance of UnicodeString that is immutable...
The Cuis Book was written before having UnicodeString, it needs to be
updated.
If you could help with the update that would be great!!!

Cheers!
Hernan.


>
> Here is the case:
> 'hello' class.                                      " String "
> 'hello' at: 2 put: $a; yourself.                    " 'hallo' "
>
> 'paragüas' at: 6.                                   "$ü"
> 'paragüas' class.                                   " UnicodeString "
> 'paragüas' at: 6 put: $u.                           "Instances of
> UnicodeString are not indexable"
> 'paragüas' asByteString class.                      " String "
> 'paragüas' asByteString at: 6 put: $u; yourself.    " 'paraguas' "
>
>
> So my confusion comes from this paragraph:
>
> *"Note. We wrote earlier a string is a collection of characters. It is
> true for byte string, where each character is encoded with a byte – a byte
> string. However since 2023, the default string format for Cuis-Smalltalk is
> Unicode (UTF-8) where each character can be encoded with 1, 2, 3 or 4
> bytes. Therefore it is immutable and can not be indexed, it can be
> converted as byte string with the message #asByteString."*
>
> It seems that not all strings are UnicodeStrings by default unless they
> have a Unicode character.
> *Thanks Hilaire!*
> *cheers*
>
>
> *Ignacio Sniechowski*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Wed, Feb 22, 2023 at 8:33 AM Hilaire Fernandes via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> Le 22/02/2023 à 12:30, Hilaire Fernandes a écrit :
>>
>> it looks like in the former one there is a composition between two
>> different character (u=117 and ^) and in the *former* one it is just the
>> encoding of one character (û).
>>
>> In the latter one
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230222/0791177c/attachment.htm>


More information about the Cuis-dev mailing list