[Cuis-dev] Some small issues

Hilaire Fernandes hfern at free.fr
Wed Jan 11 05:13:13 PST 2023


Hi Barry,

You are asking at the right place!

Le 11/01/2023 à 13:04, Barry Perryman via Cuis-dev a écrit :
>
> I'm slowly working through The Cuis-Smalltalk book, and playing around 
> with the system 

Cool! It is always rewarding to read about people using The Cuis book to 
learn Smalltalk.


> and I've come across a couple of small issues - I've tested these with 
> the latest code from git on both an intel mac and a 64-bit raspberry 
> pi and I've even compared to squeak where I think it makes sense.
>
> The first one is the when I set the size of the GUI elements to 
> something other than default I can see a gap on the left and the right 
> hand sides between the top of the window and the title bar, I've 
> attached a small screen shot so you can see what I'm 

I think we all observed that. It is likely a rounding error in the title 
bar morph revealed when VectorGraphics was set as default in Cuis. I 
will try to look at it. But you don't need to worry about it.


> The second one is I don't seem to be able to make a LinkedList. I get 
> a message not understood. So in squeak if I do an inspect on the 
> following it works:
>
> (LinkedList  new) add: 1; add: 2; add: 3; yourself.

To a LinkedList isntance you can only add object kind of Link. You can 
add any sort of object. For example:

LinkedList new
     add: (Link new);
     add: (Link new);
     yourself

However Link is an abstract class not capable to hold data for the link. 
It only provides the mechanism to navigate to the next link in the 
LinkedList (#nextLink message)

So to make anything useful with LinkedList, you must subclass Link and 
add the appropriate attributes to hold the data you want for a Link.

For example in DrGeo, to sample a Locus I use a LinkList and each sample 
of the Locus is  a sort of Link with the appropriate attributes related 
to a sample, some of the attributes are only cache for optimization:

Link subclass: #DrGLocusSample
     instanceVariableNames: 'abscissa pointScreen pointWorld offScreen 
exist'
     classVariableNames: ''
     poolDictionaries: ''
     category: 'DrGeo-Item-Views'

> Finally the Cuis-Smalltalk book says that the following will return 
> false, it does in squeak but in Cuis it returns true.
>
> 'hello' == 'hello' copy

Good catch! Thanks. I think it is a bug related to the recent adoption 
of Unicode as the default string representation in Cuis because :

(String withAll: 'hello') == (String withAll: 'hello') copy
=> false

Adoption of Unicode as the default string representation in Cuis is an 
important change impacting many area and external package of Cuis. So it 
mY take a few cycles to get it bug free but it is a big win in the long 
term.

Thanks a lot for your detailed reports.

Hilaire

>
> Regards
>
> Barry

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230111/f9ecf4f6/attachment-0001.htm>


More information about the Cuis-dev mailing list