name puzzle: how to name a message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

name puzzle: how to name a message

Tobias Pape
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 :)

Best regards
        -Tobias

PS: #by: is already taken for #to:by:
PPS: A workaround is
        (0 to: z) + x

Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Stéphane Rollandin
x extra: z

?

Stef

Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Jakob Reschke-2
In reply to this post by Tobias Pape
x withSuccessors: z

Jakob

2015-07-07 15:14 GMT+02:00 Stéphane Rollandin <[hidden email]>:
> x extra: z
>
> ?
>
> Stef
>

Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Tobias Pape
but what if z is negative?

On 07.07.2015, at 15:39, Jakob Reschke <[hidden email]> wrote:

> x withSuccessors: z
>
> Jakob
>
> 2015-07-07 15:14 GMT+02:00 Stéphane Rollandin <[hidden email]>:
>> x extra: z
>>
>> ?
>>
>> Stef



Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Jakob Reschke-2
In reply to this post by Jakob Reschke-2
Then maybe x toOffset: z?

2015-07-07 15:40 GMT+02:00 Tobias Pape <[hidden email]>:

> but what if z is negative?
>
> On 07.07.2015, at 15:39, Jakob Reschke <[hidden email]> wrote:
>
>> x withSuccessors: z
>>
>> Jakob
>>
>> 2015-07-07 15:14 GMT+02:00 Stéphane Rollandin <[hidden email]>:
>>> x extra: z
>>>
>>> ?
>>>
>>> Stef
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Stéphane Rollandin
x walking: z


?

Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Nicolai Hess
In reply to this post by Tobias Pape


2015-07-07 15:09 GMT+02:00 Tobias Pape <[hidden email]>:
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 :)

Best regards
        -Tobias

PS: #by: is already taken for #to:by:
PPS: A workaround is
        (0 to: z) + x


How about doing it the otherway around, and find a good name for (0  to: z)
for example #asRange

z asRange + x
or
z asRangeOffsetBy:x

maybe, asRange is not  a good name.

nicolai




cbc
Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

cbc
x andNext: z

x length: z

?

On Tue, Jul 7, 2015 at 7:06 AM, Nicolai Hess <[hidden email]> wrote:


2015-07-07 15:09 GMT+02:00 Tobias Pape <[hidden email]>:
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 :)

Best regards
        -Tobias

PS: #by: is already taken for #to:by:
PPS: A workaround is
        (0 to: z) + x


How about doing it the otherway around, and find a good name for (0  to: z)
for example #asRange

z asRange + x
or
z asRangeOffsetBy:x

maybe, asRange is not  a good name.

nicolai








Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Stéphane Rollandin
> x andNext: z


+1

Stef


Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Eliot Miranda-2
In reply to this post by Tobias Pape
Hi Tobias,

On Jul 7, 2015, at 6:09 AM, Tobias Pape <[hidden email]> 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)
Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Bert Freudenberg
In reply to this post by Tobias Pape
On 07.07.2015, at 06:09, Tobias Pape <[hidden email]> 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 :)
>
> Best regards
> -Tobias

x steps: z
x steps: z by: b

x withNext: z
x withNext: z by: b

- Bert -






smime.p7s (5K) Download Attachment
cbc
Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

cbc
#steps: reminds me of mophic - step interval, right?

#withNext: reminds me of #withIndexDo:.  I'd expect it to provide two arguments to the block (until I learned otherwise).

#next: is stream, and definitely not what we want.

I like Eliot's questioning of adding a new method at all, although I'm guilty of doing that a lot.

What about a new constructor on Interval?

Interval startAt: x next: z
Interval startAt: x next: z by: b
?

On Tue, Jul 7, 2015 at 1:06 PM, Bert Freudenberg <[hidden email]> wrote:
On 07.07.2015, at 06:09, Tobias Pape <[hidden email]> 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 :)
>
> Best regards
>       -Tobias


x steps: z
x steps: z by: b

x withNext: z
x withNext: z by: b

- Bert -









Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Tobias Pape
Hi all


thanks for your feedback, and to calm Chris C. and Eliot, I don't
intend to add yet another convenience message™ just because.
If there had been immediate consensus, probably. I just found it
stunning that quite a few people at my lab had to think hard to
a) explain the problem and b) suggest a name :).

Best regards
        -Tobias

On 07.07.2015, at 23:27, Chris Cunningham <[hidden email]> wrote:

> #steps: reminds me of mophic - step interval, right?
>
> #withNext: reminds me of #withIndexDo:.  I'd expect it to provide two arguments to the block (until I learned otherwise).
>
> #next: is stream, and definitely not what we want.
>
> I like Eliot's questioning of adding a new method at all, although I'm guilty of doing that a lot.
>
> What about a new constructor on Interval?
>
> Interval startAt: x next: z
> Interval startAt: x next: z by: b
> ?
>
> On Tue, Jul 7, 2015 at 1:06 PM, Bert Freudenberg <[hidden email]> wrote:
> On 07.07.2015, at 06:09, Tobias Pape <[hidden email]> 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 :)
> >
> > Best regards
> >       -Tobias
>
>
> x steps: z
> x steps: z by: b
>
> x withNext: z
> x withNext: z by: b
>
> - Bert -



Reply | Threaded
Open this post in threaded view
|

Re: name puzzle: how to name a message

Tobias Pape

On 08.07.2015, at 15:19, Tobias Pape <[hidden email]> wrote:

> Hi all
>
>
> thanks for your feedback, and to calm Chris C. and Eliot, I don't
> intend to add yet another convenience message™ just because.
> If there had been immediate consensus, probably. I just found it
> stunning that quite a few people at my lab had to think hard to
> a) explain the problem and b) suggest a name :).

This came just to my mind:
        5 toBias: 4

… I show myself out
        -T