[squeak-dev] [:x] considered improper (was Re: The Inbox: ShoutCore-ct.69.mcz)

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Feb 10 22:41:17 UTC 2020


Hi Levente,


alright, I like your arguments (sorry for the bad joke)! I would also not like to support [|] unless it's necessary.


How do you feel about Compiler-ct.417? Another, more expensive approach might be a SyntaxDeprecationWarning. :-)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves at caesar.elte.hu>
Gesendet: Montag, 10. Februar 2020 22:46:42
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] [:x] considered improper (was Re: The Inbox: ShoutCore-ct.69.mcz)

Hi Christoph,

My understanding is that the conclusion was that [:x] should not be
valid[1].
In my option, it makes no sense to support a useless extremal case.
The BNF you posted below says that it is not valid.

But the BNF is from the ANSI standard's draft, so there's an extremely
slim chance that it was changed in the actual standard. But
- I doubt anyone would like to pay for it to find out
- I'm not aware of any smalltalk implementation that would strictly follow
the standard
- the standard is not a good standard

In my option, [|] is another extremal case that I don't think we need to
support.
It's longer than [], and both parsers detect it the same way: the closing
| of the temporary declaration is missing.

So, to sum it up, IMHO neither [:x], [:x :y] nor [|] should be supported.
Parser accepts [:x] and [:x :y], which should be fixed; perhaps just a
warning should be raised.


Levente

[1] http://forum.world.st/The-Inbox-ShoutCore-ct-69-mcz-tp5102398p5102912.html
On Mon, 10 Feb 2020, Thiede, Christoph wrote:

>
> [Ugh, Nabble removed all my code examples again. Resend below:]
>
>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Thiede, Christoph
> Gesendet: Montag, 10. Februar 2020 14:10 Uhr
> An: squeak-dev at lists.squeakfoundation.org
> Betreff: Re: [squeak-dev] [:x] considered improper (was Re: The Inbox: ShoutCore-ct.69.mcz)
> Sorry for reviving this old thread ...
>
> This is still an open issue, isn't it?  (oh, it would be so comfortable if we had something like GitHub issues ...)
>
>
> And just one related question: According to the BNF John mentioned --
>
> <block constructor> ::= '[' <block body> ']'
> <block body> ::= [<block argument>* '|'] [<temporaries>] [<statements>]
> <block argument> ::= ':' identifier
> (from the ANSI Smaltalk Standard)
>  -- the following should be valid syntax as well, shouldn't it?
>
> [|] value.
>
> The explanation is that, according to Wikipedia, an asterisk in the BNF stands for "0 or more times". So provided that there is not a mistake in the official standard document, shouldn't we support the above example?
>
> Which is the exact standard we are following? The Blue Book? The ANSI Smalltalk Standard?
>
> Best,
> Christoph
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200210/3a4d409d/attachment.html>


More information about the Squeak-dev mailing list