[Pharo-project] Fwd: Issue 1129 in pharo: UIManager #request: and #multilineRequest do not distinguish between empty and cancel
Hi I kind of agree on this one. So what is the preferred solution. Now this is important to be able to distinguish an empty string from a cancel. Stef Begin forwarded message:
From: codesite-noreply@google.com Date: September 26, 2009 5:07:13 AM CEDT To: stephane.ducasse@gmail.com Subject: Issue 1129 in pharo: UIManager #request: and #multilineRequest do not distinguish between empty and cancel
Comment #17 on issue 1129 by andreas.raab: UIManager #request: and #multilineRequest do not distinguish between empty and cancel http://code.google.com/p/pharo/issues/detail?id=1129
Can I ask to reopen this issue before 1.0 goes out? It introduces a superficial incompatibility between Pharo and Squeak or other external code that is really unecessary. There are two excellent alternatives:
1) Extend the existing protocol, by means of, e.g, result := UIMananger default request: 'What is your name?' onCancel: ["whatever"]. This allows for a simple and straightforward use in cases where one needs to distinguish between cancel and empty return and it trivially extends to uses of multiLineRequest: as well re requestPassword:.
2) Alternatively, introduce a new protocol and deprecate the old one. For example: result := UIManager default ask: 'What is your name?'. With a changed protocol any breakage is straightforward and obvious and not subtle and in corner cases that may not be tested for by some external code. Plus, it is possible to provide a compatibility layer where necessary.
From my point of view both of the above are far better solutions and do not require any additional work.
-- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings
On Sat, Sep 26, 2009 at 7:39 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
I kind of agree on this one. So what is the preferred solution. Now this is important to be able to distinguish an empty string from a cancel.
I'm not sure. I think the fixes are small enough to apply everywhere to avoid complicating the API. To fix external packages, you just have to change the #isEmpty test after the #request by #isEmptyOrNil. I already did it for part of the Pharo image (see issue #1233 ). I vote for closing this report again. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
I know now waht andreas propose is more a process to make sure that other places where this should be changed will be noticed automatically Stef On Sep 27, 2009, at 9:51 AM, Damien Cassou wrote:
On Sat, Sep 26, 2009 at 7:39 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
I kind of agree on this one. So what is the preferred solution. Now this is important to be able to distinguish an empty string from a cancel.
I'm not sure. I think the fixes are small enough to apply everywhere to avoid complicating the API. To fix external packages, you just have to change the #isEmpty test after the #request by #isEmptyOrNil. I already did it for part of the Pharo image (see issue #1233 ).
I vote for closing this report again.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (2)
-
Damien Cassou -
Stéphane Ducasse