binary selectors ambiguity and space
Stephan Rudlof
sr at evolgo.de
Mon May 15 18:25:13 UTC 2006
Nicolas,
On 15.05.2006 13:26, nicolas cellier wrote:
> Le Lundi 15 Mai 2006 07:41, Wolfgang Helbig a écrit :
>> The Scanner>>xBinary method should not at all accept expressions like
>> "x+-3". Instead it should kindly ask the programmer to resolve the
>> ambiguity by inserting white space. Without taking a default action.
>> Expressions are ambiguous, if a minus character can be parsed both as the
>> second character of a binary selector and as the first character of a
>> number literal.
>>
>> If the folks start grumbling at this pedantry tell them Monk was here :-)
>>
>> Greetings
>> Wolfgang
>> --
>> Weniger, aber besser.
>
> I totally agree,
> user shall be kindly invited to, for code he has responsibility on.
> That is, when he accepts a method in a browser debugger or any other
> interactive text pane.
>
> But this turn out very annoying when you get warned 20 times or more that you
> should resolve ambiguity over wich you do not have control yet, for example
> when you try to load a package from SqueakMap or Monticello.
How often are cases like
x+-1
while loading 'normal' packages?
If I've understood correctly
x+-y
(only variables) would not make problems.
>
> This is why i propose the notification to raise a popup dialog only if
> Parser>>interactive answer true.
An idea:
Announcement of the strict behaviour some time ago: then package
maintainers can fix there packages (shouldn't be too hard ;-) ).
On 13.05.2006 02:10, nicolas cellier wrote:
nc>...
nc> Funny, in current 3.9 spaces are ignored:
nc> i have '1 +- 2' interpreted as (1) + (-2)
At least, if there should be a change in the semantics - for e.g.
allowing selector #+- in the case above -, it would be *much* better to
fail loading a package instead of loading it silently: otherwise the
code would just break at runtime!
Regards,
Stephan
>...
>
> This is exactly the same when temporary variables names clash with inst var
> names: you cannot accept the method interactively, but you can when you load
> it from any repository.
>
> See senders of #interactive.
>
> Nicolas
>
>
>
--
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev
mailing list
|