Reputation: 53
Im reading through A Play On Regular Expressions and came across this block of code (at the end of page 8).
LeftLong x ⊕ LeftLong y = LeftLong (leftlong x y)
where leftlong …
leftlong (Range i j) (Range k l)
| i < k ∨ i == k ∧ j >= l = Range i j
| otherwise = Range k l
What is this …
operater used on the second line? I can't find it anywhere else and do not understand what its doing.
Upvotes: 0
Views: 128
Reputation: 369526
This is not really a question about programming, but about understanding English language, but I will try to answer it anyway.
This punctuation (…) is called an ellipsis and generally denotes that something is missing. For example, when citing or quoting some text, an editor could use an ellipsis to indicate where they have left out parts of the quote. In more creative writing, an ellipsis could indicate parts of a sentence that the listener couldn't understand because they were drowned out by noise, for example. Ellipses are also sometimes used to indicate pauses, when an author wants to evoke the mental picture of a person speaking very slowly and deliberately, or a person that is very sick and needs to gather their strength for every word.
So, in short, in the English language (and some others as well), an ellipsis indicates that something is missing.
In this particular case, the text explicitly states
First, they only sketch how to implement this.
So, in other words, this is a sketch with missing bits.
I will note that there are some programming languages that actually have an ellipsis either explicitly as a language construct, or where …
or ...
are simply boring standard legal identifiers.
E.g. in Haskell, both …
and ...
are legal identifiers, so it would be easy to use them in code. In Ruby, ...
is special syntax for indicating "not explicitly specified parameters and / or arguments of a method", and is used for argument forwarding. In Java, it is used for an unspecified number of parameters of the same type.
Upvotes: 3