Period at end of message pattern ?

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

Period at end of message pattern ?

jamesl
Hi All,

While filing in some sources form a friend into Redline Smalltalk the compiler generated an
error on the following message pattern (method signature):

initializeBetween: aPitcher and: aBatter events: aCollectionOfEvents.

The error was the trailing period "."

This is acceptable in Pharo but not in the Blue Book definition.

I think it should be an error in Pharo as well. What do you think?

Rgs, James.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Period at end of message pattern ?

Schwab,Wilhelm K
So that's a method that is empty except for ending in a period?  That probably should be an error.  If the point is to have the last line of a "real" method never end in a period, then I would have a problem.


________________________________________
From: [hidden email] [[hidden email]] On Behalf Of James Ladd [[hidden email]]
Sent: Wednesday, September 29, 2010 6:28 PM
To: [hidden email]
Subject: [Pharo-project] Period at end of message pattern ?

Hi All,

While filing in some sources form a friend into Redline Smalltalk the compiler generated an
error on the following message pattern (method signature):

initializeBetween: aPitcher and: aBatter events: aCollectionOfEvents.

The error was the trailing period "."

This is acceptable in Pharo but not in the Blue Book definition.

I think it should be an error in Pharo as well. What do you think?

Rgs, James.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Period at end of message pattern ?

Igor Stasenko
Hmm , whats wrong with period?
Its an empty nil-statement

try evaluate:
.......................

Of course, if such patter is then followed by temps declaration:

foo.
| a b c |

then this could lead to error.

But message pattern with just period?
I don't feel its wrong.

On 30 September 2010 06:00, Schwab,Wilhelm K <[hidden email]> wrote:

> So that's a method that is empty except for ending in a period?  That probably should be an error.  If the point is to have the last line of a "real" method never end in a period, then I would have a problem.
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of James Ladd [[hidden email]]
> Sent: Wednesday, September 29, 2010 6:28 PM
> To: [hidden email]
> Subject: [Pharo-project] Period at end of message pattern ?
>
> Hi All,
>
> While filing in some sources form a friend into Redline Smalltalk the compiler generated an
> error on the following message pattern (method signature):
>
> initializeBetween: aPitcher and: aBatter events: aCollectionOfEvents.
>
> The error was the trailing period "."
>
> This is acceptable in Pharo but not in the Blue Book definition.
>
> I think it should be an error in Pharo as well. What do you think?
>
> Rgs, James.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Period at end of message pattern ?

Lukas Renggli
The Pharo compiler (even more for the Squeak one) accepts all kind of
strange syntactic constructs. I remember having fixed the refactoring
engine parser dozens of times in the past years to accommodate such
abnormalities. And of course, there more code than you actually think
that uses these constructs (mostly accidental).

Btw, there is a Code Critics rule in Grease that finds the
repeated/mis-placed dots in Smalltalk. In most other Smalltalk such
code doesn't load.

Lukas


On 30 September 2010 05:46, Igor Stasenko <[hidden email]> wrote:

> Hmm , whats wrong with period?
> Its an empty nil-statement
>
> try evaluate:
> .......................
>
> Of course, if such patter is then followed by temps declaration:
>
> foo.
> | a b c |
>
> then this could lead to error.
>
> But message pattern with just period?
> I don't feel its wrong.
>
> On 30 September 2010 06:00, Schwab,Wilhelm K <[hidden email]> wrote:
>> So that's a method that is empty except for ending in a period?  That probably should be an error.  If the point is to have the last line of a "real" method never end in a period, then I would have a problem.
>>
>>
>> ________________________________________
>> From: [hidden email] [[hidden email]] On Behalf Of James Ladd [[hidden email]]
>> Sent: Wednesday, September 29, 2010 6:28 PM
>> To: [hidden email]
>> Subject: [Pharo-project] Period at end of message pattern ?
>>
>> Hi All,
>>
>> While filing in some sources form a friend into Redline Smalltalk the compiler generated an
>> error on the following message pattern (method signature):
>>
>> initializeBetween: aPitcher and: aBatter events: aCollectionOfEvents.
>>
>> The error was the trailing period "."
>>
>> This is acceptable in Pharo but not in the Blue Book definition.
>>
>> I think it should be an error in Pharo as well. What do you think?
>>
>> Rgs, James.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Period at end of message pattern ?

Stéphane Ducasse
In reply to this post by Igor Stasenko
We should clean all these places. Now the problem is that if the compiler is sloppy then we may have to redo that several times.
So we should probably do that with opal (even if I do not like to postpone until it is there).

Stef

On Sep 30, 2010, at 8:25 AM, Lukas Renggli wrote:

> The Pharo compiler (even more for the Squeak one) accepts all kind of
> strange syntactic constructs. I remember having fixed the refactoring
> engine parser dozens of times in the past years to accommodate such
> abnormalities. And of course, there more code than you actually think
> that uses these constructs (mostly accidental).
>
> Btw, there is a Code Critics rule in Grease that finds the
> repeated/mis-placed dots in Smalltalk. In most other Smalltalk such
> code doesn't load.
>
> Lukas
>
>
> On 30 September 2010 05:46, Igor Stasenko <[hidden email]> wrote:
>> Hmm , whats wrong with period?
>> Its an empty nil-statement
>>
>> try evaluate:
>> .......................
>>
>> Of course, if such patter is then followed by temps declaration:
>>
>> foo.
>> | a b c |
>>
>> then this could lead to error.
>>
>> But message pattern with just period?
>> I don't feel its wrong.
>>
>> On 30 September 2010 06:00, Schwab,Wilhelm K <[hidden email]> wrote:
>>> So that's a method that is empty except for ending in a period?  That probably should be an error.  If the point is to have the last line of a "real" method never end in a period, then I would have a problem.
>>>
>>>
>>> ________________________________________
>>> From: [hidden email] [[hidden email]] On Behalf Of James Ladd [[hidden email]]
>>> Sent: Wednesday, September 29, 2010 6:28 PM
>>> To: [hidden email]
>>> Subject: [Pharo-project] Period at end of message pattern ?
>>>
>>> Hi All,
>>>
>>> While filing in some sources form a friend into Redline Smalltalk the compiler generated an
>>> error on the following message pattern (method signature):
>>>
>>> initializeBetween: aPitcher and: aBatter events: aCollectionOfEvents.
>>>
>>> The error was the trailing period "."
>>>
>>> This is acceptable in Pharo but not in the Blue Book definition.
>>>
>>> I think it should be an error in Pharo as well. What do you think?
>>>
>>> Rgs, James.
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Period at end of message pattern ?

jamesl
In reply to this post by jamesl

I should have posted the whole mehod.

It is not just the message pattern, but a method with temps and statements.



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project