[Cuis-dev] What is the meaning of "::" in code examples ?

Luciano Notarfrancesco luchiano at gmail.com
Fri Mar 10 02:09:41 PST 2023


Actually the line

   lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .

looks sort of sarcastic to me, if code can be sarcastic. Because :: is
normally used to avoid writing parenthesis, and it has unnecessary
parenthesis around Color black. And also the first :: is not needed. In
standard Smalltalk-80 syntax that line is equivalente to

   (lay1 beRow borderWidth: 1) borderColor: Color black.

which is also not very easy to read. IMO it would be better written as

   lay1 beRow; borderWidth: 1; borderColor: Color black.

because otherwise you’re assuming that beRow, borderWidth and borderColor:
return the receiver (not a crazy assumption, but unnecessary). All a matter
of taste and style anyway.


On Thu, 9 Mar 2023 at 23:08 Alexandre Rousseau via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> For example. per
> https://github.com/nmingotti/The-Cuis-CookBook/wiki/Introduction-to-morphs-Layout
> , I see this code:
>
> lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .
>
> I am assuming it is the same as ";" but cannot find documentation to
> this effect.
>
> --
> 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/20230310/4ba287db/attachment-0001.htm>


More information about the Cuis-dev mailing list