Results 1 to 4 of 4

Thread: what is a tuple? how do i handle it

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Posts
    58

    what is a tuple? how do i handle it

    What is a tuple and how do i handle a function that returns it?
    -------------------------------
    StupidMonkee

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    ? Is a tuple a row from a database table ?
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2002
    Posts
    58
    well if it is, how do i handel it?
    -------------------------------
    StupidMonkee

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    I just did a Google search and pulled this from one of the first hits:
    "A tuple (or n-tuple) is a fixed size collection of elements. Pairs, triples, quadruples etc. are tuples. In a programming language, a tuple is a data object containing other objects as elements. These element objects may be of different types.

    Tuples are convenient in many circumstances. For instance, tuples make it easy to define functions that return more than one value.

    Some programming languages, such as ML, Python and Haskell, have built-in tuple constructs. Unfortunately C++ does not. To compensate for this "deficiency", the Boost Tuple Library implements a tuple construct using templates. "

    From another:
    "There are six sequence types: strings, Unicode strings, lists, tuples, buffers, and xrange objects.

    Strings literals are written in single or double quotes: 'xyzzy', "frobozz". See chapter 2 of the Python Reference Manual for more about string literals. Unicode strings are much like strings, but are specified in the syntax using a preceeding "u" character: u'abc', u"def". Lists are constructed with square brackets, separating items with commas: [a, b, c]. Tuples are constructed by the comma operator (not within square brackets), with or without enclosing parentheses, but an empty tuple must have the enclosing parentheses, e.g., a, b, c or (). A single item tuple must have a trailing comma, e.g., (d,). "

    You may be able to find some good examples of usage.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width