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

Jon Hylands jhylands at gmail.com
Fri Mar 10 06:10:12 PST 2023


On Fri, 10 Mar 2023 at 01:52, Alexandre Rousseau <yalexr at gmail.com> wrote:

>
> So,
>
>> lay1 beRow :: borderWidth: 1 :: borderColor: (Color black) .
>
>
> can also be expressed as
>
>> lay1 beRow; borderWidth: 1; borderColor: (Color black).
>
> since all messages are intended for the original receiver (lay1).
>

No, that is not the same at all.

Your first example is equivalent to this:

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

The second example would be:

lay1
    beRow;
    borderWidth: 1;
    borderColor: Color black

in the first example #borderWidth: is sent to the result of the #beRow
method, whereas in the second it is sent to lay1. If #beRow is a method
that has side effects and returns self then they are functionally
equivalent, but if it returns a new object then they are not the same at
all.

- Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230310/090a116e/attachment.htm>


More information about the Cuis-dev mailing list