Closed robrix closed 9 years ago
This isn’t going to be quite so easy. Given prefix & postfix operators on the same term, postfix is applied first, i.e. %"x"*
= %("x"*)
which won’t compile because there’s no postfix *
function defined for String
.
You’re trying to write a simple, obvious parser for some simple syntax, and you end up with
literal
everywhere clouding everything:range
is similarly noisy, and since it fits into the same category asliteral
I think there might be a common solution.A prefix operator would be one solution. We could also add overloads for bare strings but I don’t think that will work as well:
is cute, but going to run into trouble as soon as there’s any
++
defined overSequenceType
.%
would apply equally well to ranges (I think):