Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Stefan Schmiedl
On Tue, 07 Oct 2008 23:54:02 +0100 Keith Hodges <[EMAIL PROTECTED]> wrote: > After all purists don't have to interface to databases... do they? Or users: +---+ | | | Please enter your comment: | |

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Keith Hodges
Rob Rothwell wrote: > Just today I was loading objects from an ODBCRow and wrote a: > > Collection>>addIfNotNilOrBlank ! > > Like you said...sometimes you get '', sometimes you get nil! > > Take care, > > Rob So... if it becomes something that every "pragmatic" user would like to add at least once

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Rob Rothwell
Just today I was loading objects from an ODBCRow and wrote a: Collection>>addIfNotNilOrBlank ! Like you said...sometimes you get '', sometimes you get nil! Take care, Rob On Tue, Oct 7, 2008 at 6:02 PM, Keith Hodges <[EMAIL PROTECTED]>wrote: > When I think about this issue in different terms

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Keith Hodges
When I think about this issue in different terms I think it makes more sense. No matter how perfect my code I find myself interfacing to things like MySQL where it is happy to return nil when it means an empty string. someValue ifNotUsefulUse: [ defaultValue ]. but then the question "what does us

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Stéphane Ducasse
On Oct 6, 2008, at 11:28 PM, Michael Roberts wrote: I agree with Lukas, and the other comments on the naming that really you imply a test for nil first before the empty. My experience with coming across and recalling heavy usage is that the receiver is always a String. I took it to be a conve

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-07 Thread Stéphane Ducasse
The arguments to not remove it are inertia as usual. I see 163 senders in the 10074 image and probably many more in Squeak packages. Le ver est dans le fruit. I can understand that to manage cancel button the UI returns nil Now I do not see the gain with always returning '' even on cancel.

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-06 Thread Bill Schwab
Strings, eh??? Now this makes more sense. I have defined some methods named #isNonTrivial that I use in some "defensive" situations (ok, a few are quite simly cowardly), all the way up to decisions about how to represent chunks of medical records. Most senders are of the latter type. Lookin

Re: [Pharo-project] Re: about ifEmptyOrNil:

2008-10-06 Thread Michael Roberts
I agree with Lukas, and the other comments on the naming that really you imply a test for nil first before the empty. My experience with coming across and recalling heavy usage is that the receiver is always a String. I took it to be a convenience (laziness) for typing the longer form during stri

[Pharo-project] Re: about ifEmptyOrNil:

2008-10-06 Thread nicolas cellier
Stéphane Ducasse <[EMAIL PROTECTED]> writes: > > Hi > > I would like to have your take on that one: > > isEmpty > "Answer whether the receiver contains any elements." > > ^self size = 0 > > Why do we need ifEmptyOrNil: > > isEmptyOrNil >