Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

22
  • 3
    degenerate container? Commented Aug 25, 2020 at 14:42
  • 2
    If it were only designed to hold one element or none, you could use the word full. But if you have a list that is capable of holding zero or many, you can describe the item itself as "lone", but I'm not sure there is a specific word that describes the status of a general purpose container as "currently containing only one item". I think if you were determined, you'd have to adapt a term such as "singular", "simple" or "primal", perhaps even "scant", but I don't think there's an existing term that meets the requirement head-on. Commented Aug 25, 2020 at 15:35
  • 3
    In SQL we speak of a "Singleton" Selection, and there is an answer for this. Commented Aug 26, 2020 at 3:00
  • 11
    Frame challenge: Why are you writing a function to check that two argument lists have exactly one element? This seems quite overspecific. There's no abstraction in that function. Either this function represents something that can be termed in the context of its intended use, or it should not be a function at all, imho. Commented Aug 26, 2020 at 10:35
  • 8
    Method names: HasSingleItem, ContainsSingleItem, NotPluralOrEmpty. Inspired by linq and string methods names in C#. Commented Aug 26, 2020 at 14:23