[Cuis-dev] change image in ImageMorph

Ezequiel Birman ebirman77 at gmail.com
Tue Jun 4 10:19:04 PDT 2024


I clicked the wrong reply button, and replied only to Mark instead of
sending a message to the list. I won't reiterate my full reply which more
or less reproduced what Hernán said, adding that *statement *has
connotations of imperative style; but I wanted to share, just as a
curiosity, that I searched for the word *statement* in both the ANSI
standard and the Blue Book. Both define *statement* precisely, as an
*expression* with a final dot, or with an explicit return. So if we were to
stick to that formal definition, assignments are not statements at all! Yet
the expression *assignment statement *is all over the place in the ANSI
Standard. The Blue Book uses *statement* more sparingly, mainly for
comparison with Algol and for messages known to have side-effects, but
defines it in the railroad diagram appendix, right at the very end, also as
expressions separated by dots, or an explicit return. As for the method
template text, my hypothesis is that the s-word is used in that very sense.

-- 
Eze

On Sun, 2 Jun 2024 at 15:58, Hernán Wilkinson <hernan.wilkinson at 10pines.com>
wrote:

> Ha ha ha, you are right!
> Statements are used in the programming language parlance and in this case
> as a way to simplify the “receiver message” syntax…
> It could say “collaborations” but an assignment it is not a collaboration…
> Anyway, the thing is that you were not looking for an statement but for a
> message … you can say that syntactically the message send (collaboration)
> was going  to be express in a statement, but you needed the message
>
> Cheers
> Hernan
>
>
> *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
>
>
> On Sun, 2 Jun 2024 at 11:29 Mark Volkmann <r.mark.volkmann at gmail.com>
> wrote:
>
>> Thanks for the feedback! I definitely want to learn the proper
>> terminology for everything in Smalltalk.
>> Interestingly though, in a System Browser when I'm ready to implement a
>> new method I see this in the bottom pane:
>>
>> messageSelectorAndArgumentNames
>> "comment stating purpose of message"
>>
>> | temporary variable names |
>> statements
>>
>> So it seems the term "statement" is used in the template for creating new
>> methods.
>>
>> On Sat, Jun 1, 2024 at 10:25 PM Hernán Wilkinson via Cuis-dev <
>> cuis-dev at lists.cuis.st> wrote:
>>
>>> Just a small comment. In Smalltalk we do not talk about statements but
>>> about messages.
>>> Everything is done sending messages to objects, and if the object knows
>>> how to answer that message, it does it evaluating the related method.
>>> At the end they are all bits and bytes, bit conceptually it is not the
>>> same, and understanding how objects collaborate sending messages is
>>> essential to understand the core of Smalltalk
>>>
>>> Cheers!
>>> Hernan
>>>
>>>
>>> *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
>>>
>>>
>>> On Sun, 2 Jun 2024 at 00:16 Ezequiel Birman via Cuis-dev <
>>> cuis-dev at lists.cuis.st> wrote:
>>>
>>>> There is an example in ImageMorph's comment. You can also look at the
>>>> implementation of ImageMorph >> readFromFile. It prompts for a file name
>>>> and then does what you are asking for:
>>>>
>>>>> ... self image: (Form fromFileNamed: fileName)
>>>>
>>>>
>>>> So the statement could be:
>>>>
>>>>> myImage := Form fromFileNamed:
>>>>> '../Cuis/Learning-Cuis/CuisLiftsAboveItsWeight.png'
>>>>
>>>>
>>>> See also
>>>> *ImageReadWriter class >> imageMorphFromFileEntry:.*
>>>>
>>>> Happy hacking!
>>>>
>>>>
>>>> On Sun, 2 Jun 2024 at 01:36, Mark Volkmann via Cuis-dev <
>>>> cuis-dev at lists.cuis.st> wrote:
>>>>
>>>>> I imagine that changing the image displayed in an `ImageMorph`
>>>>> requires two statements, one to load an image from a file and one to change
>>>>> the `ImageMorph`. I think the second one looks like this:
>>>>>
>>>>> `myImageMorph image: myImage.`
>>>>>
>>>>> What's the statement I need to set the variable `myImage` to an image
>>>>> object?
>>>>>
>>>>> --
>>>>> R. Mark Volkmann
>>>>> Object Computing, Inc.
>>>>> --
>>>>> 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
>>>>
>>> --
>>> Cuis-dev mailing list
>>> Cuis-dev at lists.cuis.st
>>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>>
>>
>>
>> --
>> R. Mark Volkmann
>> Object Computing, Inc.
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240604/5e0abfb2/attachment.htm>


More information about the Cuis-dev mailing list