Closed orlp closed 8 years ago
Fixed by #151
No, no, no, no!
I just realized that Jakob fixed the entirely wrong thing. The reference implementation was (almost) good, the documentation was wrong!
Consider the current (wrong) documentation:
On
<seq><any><int>
pad right. On<int><seq><any>
pad left and right. On<any><int><seq>
pad left.
That is incredibly, incredibly inconsistent. The order of <seq>
and <any>
is inconsistent, and the place of the integer does not match where the padding will occur. I propose the following:
On
<seq><any><int>
pad right. On<seq><int><any>
pad left and right. On<int><seq><any>
pad left.
@orlp With your notation you can't distinguish pad right from pad left and right, when <any>
is also from type <int>
.
My main idea was the following:
<seq>
on the left means, that <seq>
stays on the left, so padding happens on the right. <seq>
in the middle means, that it stays in the middle => padding left and right. <seq>
on the right, stay on the right => padding happens on the left. And the other two parameter rotate with it.
And if you don't rotate the parameters, you get problems with <any> = <seq>
.
The main reason I changed the behavior instead of the documentation was to make the documentation easier. The behavior was correct for <any> = <int>
, but worked differently for <any> = <string>
. The documentation would have been twice as long and more complicated.
I apologize, I totally forgot about distinguishing <any> = <seq>
For example it says:
Which is just flat out wrong.