[squeak-dev] name puzzle: how to name a message

Eliot Miranda eliot.miranda at gmail.com
Tue Jul 7 17:05:45 UTC 2015


Hi Tobias,

On Jul 7, 2015, at 6:09 AM, Tobias Pape <Das.Linux at gmx.de> wrote:

> Hi all
> 
> I've got a small naming puzzle:
> 
> So we have
>    x to: y
> that makes 
>    Intervall (x, x+1, x+2, ... , y)
> 
> And we can do
>    x to: x + z
> to get
>    Intervall (x, x+1, x+2, ..., x+z)
> 
> 
> But we have x twice in there.
> 
> What would you name the message
>    x ???? z
> that gives
>    Intervall (x, x+1, x+2, ..., x+z)
> 
> I'm curious for your answers :)

I'm in two mins about this.  I really think that considering the reader is important.  Is a variable to hold x so bad?  Adding yet another API call puts cognitive load in us and forces the new reader to go to the browser to learn what this tiny piece of syntactic sugar adds.  Is it really worth it?

But since extreme brevity and lots of brief syntactic sugar is the de jure style I guess I'll have to deal with this so let me say

      andNext:

doesn't have any correlates that I know of but

      throughNext:
      throughSum:

have correlates in stream methods, and

      toSum:

correlates with to: and implies toProduct: if ever someone really wanted it ;-)

> 
> Best regards
>    -Tobias
> 
> PS: #by: is already taken for #to:by:
> PPS: A workaround is
>    (0 to: z) + x

Eliot (phone)


More information about the Squeak-dev mailing list