Ellipsis (computer programming): Difference between revisions

Content deleted Content added
m some ref cleanup tags should be AFTER </ref>, replaced: {{Self-published inline|date=January 2011}}</ref> → </ref>{{Self-published inline|date=January 2011}}
Citation bot (talk | contribs)
Add: title. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | Linked from User:BrownHairedGirl/Articles_with_bare_links | #UCB_webform_linked 1161/2847
Line 40:
 
== Incomplete code ==
In Perl<ref>{{Cite web | url=https://perldoc.perl.org/perlsyn.html#The-Ellipsis-Statement | title=Perlsyn - Perl syntax - Perldoc Browser }}</ref> and [[Raku (programming language)|Raku]]<ref>{{Cite web | url=https://doc.perl6.org/language/operators#listop_... | title=Operators }}</ref> the 3-character ellipsis is also known as the "yada yada yada" operator and, similarly to its [[linguistic meaning]], serves as a "stand-in" for code to be inserted later.
 
[[Python3]] also allows the 3-character ellipsis to be used as an expressive place-holder for code to be inserted later.
Line 49:
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:
 
:{{code|2=c|int printf( const char* format, ... );}}<ref>{{Cite web | url=http://www.cplusplus.com/reference/cstdio/printf/ | title=Printf - C++ Reference }}</ref>
 
The above function in C could then be called with different types and numbers of parameters such as:
Line 68:
===PHP===
 
PHP 5.6 supports<ref>{{Cite web | url=https://wiki.php.net/rfc/variadics | title=PHP: RFC:variadics }}</ref> use of ellipsis to define an explicitly [[variadic function]], where <code>...</code> before an argument in a function definition means that arguments from that point on will be collected into an array. For example:
 
<syntaxhighlight lang="php">
Line 92:
 
== Multiple dimensions ==
In [[Python (programming language)|Python]], particularly in [[NumPy]], an ellipsis is used for slicing an arbitrary number of dimensions for a high-dimensional array:<ref>{{Cite web | url=http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html | title=Indexing routines — NumPy v1.22 Manual }}</ref>
 
<syntaxhighlight lang="pycon">