fix: require parentheses for zero-argument join() method on Sequence

The zero-argument overload of `join` on `Sequence` was previously defined as a
getter-style method without parentheses. This change makes it a regular method
that requires explicit parentheses, consistent with the one-argument `join(sep)`
variant and standard Wren method syntax. The implementation now reads
`join() { join("") }` instead of `join { join("") }`.

All call sites in tests and documentation are updated accordingly.
This commit is contained in:
Bob Nystrom
2015-09-16 14:15:48 +00:00
parent ffe87c271d
commit e0984a5012
5 changed files with 11 additions and 11 deletions
+7 -7
View File
@@ -68,17 +68,17 @@ Returns whether the sequence contains any elements.
This can be more efficient that `count == 0` because this does not iterate over
the entire sequence.
### **join**(sep)
### **join**(separator)
Returns a string representation of the sequence. The string representations of
the elements in the sequence is concatenated with intervening occurrences of
`sep`.
Converts every element in the sequence to a string and then joins the results
together into a single string, each separated by `separator`.
It is a runtime error if `sep` is not a string.
It is a runtime error if `separator` is not a string.
### **join**
### **join**()
Calls `join` with the empty string as the separator.
Converts every element in the sequence to a string and then joins the results
together into a single string.
### **map**(transformation)