forked from Mirror/wren
This is not implemented on Sequence because, at least for lists and strings, I think users expect an eager result. Multiplying a string should give you back a string, not a lazy sequence of repeated characters. This also mirrors "+" on strings and lists, which is eager. I like the idea of having a general guideline that operators are eager. Repetition is useful for arbitrary sequences, but for that maybe we should add a "repeat()" method.
4 lines
137 B
Plaintext
4 lines
137 B
Plaintext
System.print("|" + "abc" * 0 + "|") // expect: ||
|
|
System.print("abc" * 1) // expect: abc
|
|
System.print("abc" * 4) // expect: abcabcabcabc
|