Ellipsis (computer programming)
In computer programming, ellipsis notation (.. or ...) is used to denote ranges, an unspecified number of arguments, or a parent directory. Most programming languages require the ellipsis to be written as a series of periods; a single (Unicode) ellipsis character cannot be used.
In computer programming, ellipsis notation (.. or ...) is used to denote ranges, an unspecified number of arguments, or a parent directory. Most programming languages require the ellipsis to be written as a series of periods; a single (Unicode) ellipsis character cannot be used. In Rust the ..= operator denotes an inclusive range for cases in matches and the .. operator represents a range not including the end value. Perl and Ruby overload the ".." operator in scalar context as a flip-flop operator - a stateful bistable Boolean test, roughly equivalent to "true while x but not yet y", similarly to the "," operator in sed and AWK. GNU C compatible compilers first provided an extension to the C and C++ language to allow case ranges in switch statements. This was later officially added to C in C2Y. include include include void writeUnicode(char32_t c) { switch (c) { // matches any value between [0, 0x7F] inclusive case 0 ... 0x7F: putchar(c); break; // matches any value between [0x80, 0x7FF] inclusive case 0x80 ... 0x7FF: putchar(0xC0 + c >> 6); putchar(0x80 + c & 0x3f); break; // matches any value between [0x800, 0xFFFF] inclusive case 0x800 ... 0xFFFF: putchar(0xE0 + c >> 12); putchar(0x80 + (c >> 6) & 0x3f); putchar(0x80 + (c >> 12)); break; default: unreachable(); } } Additionally, GNU C allows a similar range syntax for designated initializers, available in the C language only: int nums[10] = { [0...5] = 1 }; Delphi / Turbo Pascal / Free Pascal: var FilteredChars: set of [#0..#32,#127,'a'..'z']; var CheckedItems: set of [4,10..38,241,58]; In the Unified Modeling Language (UML), a two-character ellipsis is used to indicate variable cardinality of an association. For example, a cardinality of 1..* means that the number of elements aggregated in an association can range from 1 to infinity (a usage equivalent to Kleene plus). ==Parent directory== On Windows and Unix-like operating systems, ".." is used to access the parent directory in a path. In Abstract Syntax Notation One (ASN.1), the ellipsis is used as an extension marker to indicate the possibility of type extensions in future revisions of a protocol specification. In a type constraint expression like A ::= INTEGER (0..127, ..., 256..511) an ellipsis is used to separate the extension root from extension additions. The definition of type A in version 1 system of the form A ::= INTEGER (0..127, ...) and the definition of type A in version 2 system of the form A ::= INTEGER (0..127, ..., 256..511) constitute an extension series of the same type A in different versions of the same specification. The ellipsis can also be used in compound type definitions to separate the set of fields belonging to the extension root from the set of fields constituting extension additions. Here is an example: ===C and C++=== In the C and C++ programming languages, an ellipsis is used to represent a variable number of parameters to a function. These C-style variadic parameters are type-unsafe, not capturing any information about types of the passed variadic arguments, and must be stored in a va_list type and read using macros like va_start() , va_arg() , and va_end() . For example: int printf(const char* fmt, ...); The above function in C could then be called with different types and numbers of parameters such as: // prints "numbers 5 10 15" printf("numbers %i %i %i", 5, 10, 15); // prints "input string another string, 0.5" printf("input string %s, %f", "another string", 0.5); C99 introduced macros with a variable number of arguments. C++11 included the new variadic macro features introduced in the C99 preprocessor, and also introduced templates with a variable number of arguments, called variadic templates, which are how type-safe variadic parameters are implemented in C++. using std::string_view; template void myPrintf(string_view fmt, Args... parameters); ===Java=== As of version 1.5, Java has adopted this "varargs" functionality. For example: public int func(int num, String... names); This actually converts to String[] names , but is not required to be wrapped in an array. ===PHP=== PHP 5.6 supports use of ellipsis to define an explicitly variadic function, where ... before an argument in a function definition means that arguments from that point on will be collected into an array. For example: function variadic_function($a, $b, ...$other) { return $other; } var_dump(variadic_function(1, 2, 3, 4, 5)); Produces this output: array(3) { [0]=> int(3) [1]=> int(4) [2]=> int(5) } (define-syntax let* (syntax-rules () ((let* () body1 body2 ...) (let () body1 body2 ...)) ((let* ((name1 val1) (name2 val2) ...) body1 body2 ...) (let ((name1 val1)) (let* ((name2 val2) ...) body1 body2 ...))))) SRFI 46 was proposed to extend syntax-rules to allow the user to specify an ellipsis identifier. This is useful for disambiguating when ellipsis are use in nested macro definitions. This feature was later included in R7RS. import numpy as np from typing import NDArray t: NDArray[int] = np.random.rand(2, 3, 4, 5) select 1st element from last dimension, copy rest (2, 3, 4) t[..., 0].shape select 1st element from first dimension, copy rest (3, 4, 5) t[0, ...].shape x = [ 1 2 3 ... 4 5 6 ]; semantically equivalent to the single line x = [ 1 2 3 4 5 6 ]; In Raku an actual Unicode (U+2026) ellipsis (…) character is used to serve as a type of marker in a format string. // old style: PHP 8.0 and older $foo = [$this, 'foo']; $fn = Closure::fromCallable('strlen'); // new style: PHP 8.1 and newer $foo = $this->foo(...); $fn = strlen(...); type IntTuple = tuple[int, ...] one_int: IntTuple = (0,) two_ints: IntTuple = (0, 1) three_ints: IntTuple = (0, 1, 2) with_bools: IntTuple = (0, True, 1, False) # OK; bool is a subtype of int, so True and False are of type int The ellipsis can also be used as the first parameter in a collections.abc.Callable annotation to denote a callable object with an arbitrary parameter list. Any callable that returns values of type R is a Callable[..., R] , regardless of how many or what kinds of arguments it accepts: from collections.abc import Callable type ReturnsInt = Callable[..., int] def no_arguments() -> int: return 0 def one_positional_argument(spam: None, /) -> int: return 1 def one_keyword_argument(*, ham: int) -> int: return 2 def variadic_argument_list(*args: str, **kwargs: str) -> int: return 3 def returns_bool(eggs: bool) -> bool: return eggs none: ReturnsInt = no_arguments positional: ReturnsInt = one_positional_argument keyword: ReturnsInt = one_keyword_argument variadic: ReturnsInt = variadic_argument_list returns_subtype: ReturnsInt = returns_bool # OK; every bool is of type int ==References==
References
- perlop - perldoc.perl.org Wikipedia revision 1372636131, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "perlop - perldoc.perl.org Wikipedia revision 1372636131, retrieved 2026-11-19." perlop - perldoc. 2026-11-18. http://perldoc.perl.org/perlop.html#Range-Operators-operator%2c-range-range-..-.... Accessed 24 November 2026.
Chicago "perlop - perldoc.perl.org Wikipedia revision 1372636131, retrieved 2026-11-19." perlop - perldoc. 2026-11-18. http://perldoc.perl.org/perlop.html#Range-Operators-operator%2c-range-range-..-....
APA perlop - perldoc. (2026). perlop - perldoc.perl.org Wikipedia revision 1372636131, retrieved 2026-11-19. Retrieved November 24, 2026, from http://perldoc.perl.org/perlop.html#Range-Operators-operator%2c-range-range-..-...
- SRFI 46 · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "SRFI 46." 2026-11-18. https://srfi.schemers.org/srfi-46/srfi-46.html. Accessed 24 November 2026.
Chicago "SRFI 46." 2026-11-18. https://srfi.schemers.org/srfi-46/srfi-46.html.
APA encyclopegia.org. (2026). SRFI 46. Retrieved November 24, 2026, from https://srfi.schemers.org/srfi-46/srfi-46.html
- Indexing routines — NumPy v1.22 Manual · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Indexing routines — NumPy v1.22 Manual." "Indexing routines — NumPy v1. 2026-11-18. http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html. Accessed 24 November 2026.
Chicago "Indexing routines — NumPy v1.22 Manual." "Indexing routines — NumPy v1. 2026-11-18. http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html.
APA "Indexing routines — NumPy v1. (2026). Indexing routines — NumPy v1.22 Manual. Retrieved November 24, 2026, from http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
- Mathworks.com · retrieved 2011-04-13 · rev 1372636131
Cite this reference
MLA "Mathworks.com." "Mathworks. 2011-04-13. https://web.archive.org/web/20110629105840/http://www.mathworks.com/help/techdoc/matlab_env/f0-5789.html#f0-5857. Accessed 24 November 2026.
Chicago "Mathworks.com." "Mathworks. 2011-04-13. https://web.archive.org/web/20110629105840/http://www.mathworks.com/help/techdoc/matlab_env/f0-5789.html#f0-5857.
APA "Mathworks. (2011). Mathworks.com. Retrieved November 24, 2026, from https://web.archive.org/web/20110629105840/http://www.mathworks.com/help/techdoc/matlab_env/f0-5789.html#f0-5857
- Exegesis 7: Formats · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Exegesis 7: Formats." Conway, Damian (2006-05-29) [2004-02-26]. 2026-11-18. https://en.wikipedia.org/wiki/Damian_Conway. Accessed 24 November 2026.
Chicago "Exegesis 7: Formats." Conway, Damian (2006-05-29) [2004-02-26]. 2026-11-18. https://en.wikipedia.org/wiki/Damian_Conway.
APA Conway, Damian (2006-05-29) [2004-02-26]. (2026). Exegesis 7: Formats. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Damian_Conway
- PHP 8.1.0 Release Announcement · retrieved 2023-03-28 · rev 1372636131
Cite this reference
MLA "PHP 8.1.0 Release Announcement." "PHP 8. 2023-03-28. https://www.php.net/releases/8.1/en.php#first_class_callable_syntax. Accessed 24 November 2026.
Chicago "PHP 8.1.0 Release Announcement." "PHP 8. 2023-03-28. https://www.php.net/releases/8.1/en.php#first_class_callable_syntax.
APA "PHP 8. (2023). PHP 8.1.0 Release Announcement. Retrieved November 24, 2026, from https://www.php.net/releases/8.1/en.php#first_class_callable_syntax
- Perlsyn - Perl syntax - Perldoc Browser · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Perlsyn - Perl syntax - Perldoc Browser." 2026-11-18. https://perldoc.perl.org/perlsyn.html#The-Ellipsis-Statement. Accessed 24 November 2026.
Chicago "Perlsyn - Perl syntax - Perldoc Browser." 2026-11-18. https://perldoc.perl.org/perlsyn.html#The-Ellipsis-Statement.
APA encyclopegia.org. (2026). Perlsyn - Perl syntax - Perldoc Browser. Retrieved November 24, 2026, from https://perldoc.perl.org/perlsyn.html#The-Ellipsis-Statement
- Operators · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Operators." 2026-11-18. https://doc.perl6.org/language/operators#listop_.... Accessed 24 November 2026.
Chicago "Operators." 2026-11-18. https://doc.perl6.org/language/operators#listop_....
APA encyclopegia.org. (2026). Operators. Retrieved November 24, 2026, from https://doc.perl6.org/language/operators#listop_...
- <cstdarg> (stdarg.h) - C++ Reference · retrieved 2007-10-01 · rev 1372636131
Cite this reference
MLA "<cstdarg> (stdarg.h) - C++ Reference." "<cstdarg> (stdarg. 2007-10-01. https://web.archive.org/web/20121031160547/http://www.cplusplus.com/reference/clibrary/cstdarg/. Accessed 24 November 2026.
Chicago "<cstdarg> (stdarg.h) - C++ Reference." "<cstdarg> (stdarg. 2007-10-01. https://web.archive.org/web/20121031160547/http://www.cplusplus.com/reference/clibrary/cstdarg/.
APA "<cstdarg> (stdarg. (2007). <cstdarg> (stdarg.h) - C++ Reference. Retrieved November 24, 2026, from https://web.archive.org/web/20121031160547/http://www.cplusplus.com/reference/clibrary/cstdarg/
- Printf - C++ Reference · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Printf - C++ Reference." 2026-11-18. http://www.cplusplus.com/reference/cstdio/printf/. Accessed 24 November 2026.
Chicago "Printf - C++ Reference." 2026-11-18. http://www.cplusplus.com/reference/cstdio/printf/.
APA encyclopegia.org. (2026). Printf - C++ Reference. Retrieved November 24, 2026, from http://www.cplusplus.com/reference/cstdio/printf/
- Variadic Macros - Using the GNU Compiler Collection (GCC) Wikipedia revision 1372636131, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Variadic Macros - Using the GNU Compiler Collection (GCC) Wikipedia revision 1372636131, retrieved 2026-11-19." 2026-11-18. https://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html. Accessed 24 November 2026.
Chicago "Variadic Macros - Using the GNU Compiler Collection (GCC) Wikipedia revision 1372636131, retrieved 2026-11-19." 2026-11-18. https://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html.
APA encyclopegia.org. (2026). Variadic Macros - Using the GNU Compiler Collection (GCC) Wikipedia revision 1372636131, retrieved 2026-11-19. Retrieved November 24, 2026, from https://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html
- Working draft changes for C99 preprocessor synchronization - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm Wikipedia revision 1372636131, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Working draft changes for C99 preprocessor synchronization - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm Wikipedia revision 1372636131, retrieved 2026-11-19." Working draft changes for C99 preprocessor synchronization - http://www. 2026-11-18. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm. Accessed 24 November 2026.
Chicago "Working draft changes for C99 preprocessor synchronization - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm Wikipedia revision 1372636131, retrieved 2026-11-19." Working draft changes for C99 preprocessor synchronization - http://www. 2026-11-18. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm.
APA Working draft changes for C99 preprocessor synchronization - http://www. (2026). Working draft changes for C99 preprocessor synchronization - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm Wikipedia revision 1372636131, retrieved 2026-11-19. Retrieved November 24, 2026, from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
- Working Draft, Standard for Programming Language C++ · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "Working Draft, Standard for Programming Language C++." "Working Draft, Standard for Programming Language C++" (PDF). 2026-11-18. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf. Accessed 24 November 2026.
Chicago "Working Draft, Standard for Programming Language C++." "Working Draft, Standard for Programming Language C++" (PDF). 2026-11-18. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf.
APA "Working Draft, Standard for Programming Language C++" (PDF). (2026). Working Draft, Standard for Programming Language C++. Retrieved November 24, 2026, from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
- PHP: RFC:variadics · retrieved 2026-11-18 · rev 1372636131
Cite this reference
MLA "PHP: RFC:variadics." 2026-11-18. https://wiki.php.net/rfc/variadics. Accessed 24 November 2026.
Chicago "PHP: RFC:variadics." 2026-11-18. https://wiki.php.net/rfc/variadics.
APA encyclopegia.org. (2026). PHP: RFC:variadics. Retrieved November 24, 2026, from https://wiki.php.net/rfc/variadics
- typing — Support for type hints § Annotating callable objects · retrieved 2026-08-31 · rev 1372636131
Cite this reference
MLA "typing — Support for type hints § Annotating callable objects." 2026-08-31. https://docs.python.org/3.14/library/typing.html#annotating-callable-objects. Accessed 24 November 2026.
Chicago "typing — Support for type hints § Annotating callable objects." 2026-08-31. https://docs.python.org/3.14/library/typing.html#annotating-callable-objects.
APA encyclopegia.org. (2026). typing — Support for type hints § Annotating callable objects. Retrieved November 24, 2026, from https://docs.python.org/3.14/library/typing.html#annotating-callable-objects
- typing — Support for type hints § Annotating tuples · retrieved 2026-08-31 · rev 1372636131
Cite this reference
MLA "typing — Support for type hints § Annotating tuples." 2026-08-31. https://docs.python.org/3.14/library/typing.html#annotating-tuples. Accessed 24 November 2026.
Chicago "typing — Support for type hints § Annotating tuples." 2026-08-31. https://docs.python.org/3.14/library/typing.html#annotating-tuples.
APA encyclopegia.org. (2026). typing — Support for type hints § Annotating tuples. Retrieved November 24, 2026, from https://docs.python.org/3.14/library/typing.html#annotating-tuples
Cite this article
MLA
"Ellipsis (computer programming)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/ellipsis-computer-programming. Accessed 24 November 2026.
Chicago
"Ellipsis (computer programming)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/ellipsis-computer-programming.
APA
encyclopegia.org. (2026). Ellipsis (computer programming). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/ellipsis-computer-programming
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON