Content deleted Content added
m Ruud Koot moved page Ellipsis (programming operator) to Ellipsis (computer programming): consistency |
copyedit |
||
Line 1:
In [[computer programming]], '''ellipsis''' notation (.. or ...) is mostly used for two usages: Either to denote ranges or to denote a variable or unspecified number of arguments.▼
▲{{unreferenced section|date=January 2011}}
▲In programming, '''ellipsis''' notation (.. or ...) is mostly used for two usages: Either to denote ranges or to denote a variable or unspecified number of arguments.
Most programming languages other than [[Perl6]] require the ellipsis to be written as a series of periods; a single (Unicode) ellipsis character cannot be used.
In some [[programming language]]s (including [[Perl]], [[Ruby (programming language)|Ruby]], [[Groovy (programming language)|Groovy]], [[Haskell (programming language)|Haskell]], and [[Pascal (programming language)|Pascal]]), a shortened two-dot ellipsis is used to represent a range of values given two endpoints; for example, to iterate through a list of [[integer]]s between 1 and 100 inclusive in Perl:
Line 29 ⟶ 28:
</source>
{{unreferenced section|date=January 2011}}
In the [[C (programming language)|C programming language]], an ellipsis is used to represent a [[variadic function|variable number of parameters]] to a [[function (programming)|function]]. For example:
Line 48 ⟶ 47:
[[C++0x]] introduces templates with a [[variadic template|variable number of arguments]].
{{unreferenced section|date=January 2011}}
In [[Python (programming language)|Python]], particularly in [[numpy]], an ellipsis is used for slicing an arbitrary number of dimensions for a high-dimensional array:
Line 61 ⟶ 60:
</source>
In [[MATLAB]], a three-character ellipsis is used to indicate [[line continuation]],<ref>[http://www.mathworks.com/help/techdoc/matlab_env/f0-5789.html#f0-5857 Mathworks.com]</ref> making the sequence of lines
:<code>x = [ 1 2 3 ...<br />4 5 6 ];</code>
|