Ellipsis (computer programming): Difference between revisions

Content deleted Content added
Variable number of parameters: PHP 5.6 now effectively uses the ellipsis
Elegmit (talk | contribs)
No edit summary
Line 4:
 
== Ranges ==
In some [[programming language]]s (including [[Ada]], [[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:
 
:<code>foreach (1..100)</code>
 
InThe <code>...</code> operator in Ruby, and the <code>...</code> operator denotesin Rust denote a half-open range, i.e. that includes the start value but not the end value.
 
Perl [[Operator overloading|overloads]] the ".." operator in scalar context as a [[stateful]] [[bistability|bistable]] [[Boolean datatype|Boolean]] test, roughly equivalent to "true while ''x'' but not yet ''y''", similarly to the "," operator in [[Sed (programming language)|sed]] and [[AWK programming language|AWK]].<ref>[http://perldoc.perl.org/perlop.html#Range-Operators-operator%2c-range-range-..-... perlop - perldoc.perl.org<!-- Bot generated title -->]</ref> In [[Perl6]], the 3-character ellipsis is also known as the "yadda yadda yadda" operator and, similarly to its [[linguistic meaning]], serves as a "stand-in" for code to be inserted later. In addition, an actual [[Unicode]] ellipsis character is used to serve as a type of marker in a perl6 format string.<ref>[http://dev.perl.org/perl6/doc/design/exe/E07.html#And_mark_what_way_I_make... Exegesis 7: Formats - perl6<!-- Bot generated title -->]{{Self-published inline|date=January 2011}}</ref>