GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing elixir.hexdocs.pm — Tuple — Elixir v1.20.5 Functions for working with tuples. Please note the following functions for tuples are found in
Tuples are intended as fixed-size containers for multiple elements.
To manipulate a collection of elements, use a list instead. Tuples are denoted with curly braces: A tuple may contain elements of different types, which are stored contiguously in memory. Accessing any element takes constant time, but modifying a tuple, which produces a shallow copy, takes linear time. Tuples are good for reading data while lists are better for traversals. Tuples are typically used either when a function has multiple return values
or for error handling. The functions in this module that add and remove elements from tuples are rarely used in practice, as they typically imply tuples are being used as collections. To append to a tuple, it is preferable to extract the elements from the old tuple with pattern matching, and then create a new tuple:
SummaryFunctionsRemoves an element from a tuple. Creates a new tuple. Inserts an element into a tuple. Computes a product of tuple elements. Computes a sum of tuple elements. Converts a tuple to a list. Functions@spec delete_at(tuple(), non_neg_integer()) :: tuple() Removes an element from a tuple. Deletes the element at the given Inlined by the compiler. Examples
@spec duplicate(term(), non_neg_integer()) :: tuple() Creates a new tuple. Creates a tuple of Inlined by the compiler. Examples
@spec insert_at(tuple(), non_neg_integer(), term()) :: tuple() Inserts an element into a tuple. Inserts Inlined by the compiler. Examples
Computes a product of tuple elements. Examples
Computes a sum of tuple elements. Examples
Converts a tuple to a list. Returns a new list with all the tuple elements. Inlined by the compiler. Examples
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |