Closed rbuckton closed 3 years ago
I see no mention of what happens when you use the same ordinal placeholder multiple times
const surround = String~(?1, ?0, ?1);
surround("text", "__"); // "__text__" ?
The explainer doesn't say if it is forbidden or if the argument is applied twice as expected (Or did I overlook it ?)
You overlooked it - check line 115.
const surround = String~(?1, ?0, ?1); surround("text", "__"); // "__text__" ?
Although, the String
constructor doesn't work that way. I think you would want "".concat(?1, ?0, ?1)
instead.
Merging, thanks for the feedback!
This make the following changes to the proposal:
~
prefix to denote a partially applied argument list (i.e.,f~(?, x)
).?0
ordinal placeholders....
"rest of the arguments" placeholder.new
.Fixes #48 Fixes #43 Fixes #5