work in progress | string

proposal for class STRING

Rename feature empty to is_empty


Proposal for class STRING:

Rename feature 'empty' to 'is_empty'.

Please select one of the following:


Feature is_empty is not present in class ARRAY or STRING in the 1995 standard. However, empty is present in class STRING in the 1995 standard.


is_empty is a convenience feature. It's always possible to test for count > 0 instead.


Although the feature name empty has a long history of use in STRING and ARRAY, most users consider is_empty to be a better choice of name. A particular problem with empty is that it can also be a verb - suggesting a command to empty out the STRING or ARRAY.


If empty is renamed to is_empty in STRING, it makes sense to add is_empty to class ARRAY. This is already part of the current proposal for ARRAY.


Franck Arnaud (20 October 1999):
What about the transition? STRING.empty is a popular feature, so
he should not disappear to easily. Maybe "empty" should be left in
STRING and is_empty be a synonym. So the choice may be

1. is_empty, empty both there.
2. is_empty replaces empty
3. is_empty, empty obsolete but required at least for ELKS2000

Roger Browne (21 October 1999):
I don't think we need to worry about this. Users prefer that their
existing code does not break, and vendors prefer not to break the
existing code of their users.

I expect all vendors will retain the existing feature until there's no
longer a demand for it. The ELKS standard allows a vendor to include
extra features, and I don't think any further action is needed.

Impact of proposed change


A vendor may continue to support empty. Alternatively, a vendor may declare empty to be "obsolete" and recommend the use of is_empty instead.


The proposal was accepted.

Voting details

votes cast at eGroups:

Don't mind (happy either way)
Strongly accept the proposal
Abstain (not happy either way)
Accept the proposal

votes sent to the discussion list:



Joachim Durchholz:

I'm missing the requirement to list 'empty' as an obsolete synonym.
(Hypothetical new vendors should still include 'empty' to remain portable.)

I had to abstain (not happy either way) because of this.