singleton variable

Computing Dictionary

singleton variable definition

programming
A variable which is only referred to once in a piece of code, probably because of a programming mistake. To be useful, a variable must be set and read from, in that order. If it is only referred to once then it cannot be both set and read.
There are various exceptions. C-like assignment operators, e.g. "x += y", read and set x and return its new value (they are abbreviations for "x = x+y", etc). A function argument may be passed only for the sake of uniformity or to support future enhancements. A good compiler or a syntax checker like lint should report singleton variables but also allow specific instances to be marked as deliberate by the programmer.
(1997-12-20)
The Free On-line Dictionary of Computing, © Denis Howe 2010 http://foldoc.org
Cite This Source
Explore Dictionary.com
Previous Definition: singleton
Next Definition: singletrack
Words Near: singleton variable
More from Thesaurus.com
Synonyms and Antonyms for singleton variable
More from Reference.com
Search for articles containing singleton variable
Dictionary.com Word FAQs

Dictionary.com presents 366 FAQs, incorporating some of the frequently asked questions from the past with newer queries.

Copyright © 2014 Dictionary.com, LLC. All rights reserved.
  • Please Login or Sign Up to use the Recent Searches feature
FAVORITES
RECENT

;