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

Ignacio Sniechowski 0800nacho at gmail.com
Tue Feb 21 15:48:16 PST 2023


Hi Hilaire
Thanks for answering my questions:

If you print:
'sûr' at: 3. you get $r as expected.


Now if you print:
'sûr' at: 2 put: $o.
You get Error: Instances of UnicodeString are not indexable.

I think that probably Cuis does not take strings as UnicodeString by
default.


If you print
'sûr' class
You get UnicodeString

but if you print
'hello' class
You get String

I think that could be the issue.
I will check with the VM options to see the shortcut and yes, I'm on a mac.
Thanks!
Nacho

*Ignacio Sniechowski*



















On Tue, Feb 21, 2023 at 5:56 PM Hilaire Fernandes via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi Ignacio,
>
> Thanks for your feedback!
> Le 21/02/2023 à 13:25, Ignacio Sniechowski via Cuis-dev a écrit :
>
> *"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."*
>
> From here I understand that the first example should not work, unless
> -which is probably the case here- I'm misunderstanding the  part
> "Therefore, it is immutable and *can not be indexed*, it can be
> converted..."
>
> 'Hello' at: 1 ⇒ $H
> 'Hello' asByteString at: 5 ⇒ $o
>
> Yep, the sentence is not really accurate. Will it be better as "it is
> immutable and
> *can not be indexed properly"? *
>
> And a better example to expose it:
> 'sur' at: 3 $r
> 'sûr' at: 3 $^ (unicode code point value 770)
>
> Advice please, so I can update the book accordingly.
>
>
> The other question is related to shortcuts in SmalltalkEditor, I find the
> shortcut Cmd - " very useful for quoting results of chunks of code in the
> workspace. This works when the keyboard is in
>
> Is your host a Mac, I guess so as mentioned Cmd.
>
> Could be an issue related to the VM. Om my Linux box with an us
> international keyboard, I can comment chunk of code with the keyboard
> combinaision Ctrl-Alt-Shift-["] (on my setup I have to do Alt-Shift to
> access directly the " character, otherwise it will try to compose with
> other character latter on.
>
> May be take a look at your VM options.
>
> Hilaire
>
> --
> GNU Dr. Geohttp://drgeo.euhttp://blog.drgeo.eu
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230221/4728c94f/attachment.htm>


More information about the Cuis-dev mailing list