Why does std.string.munch take a string ref?
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jun 11 20:43:14 PDT 2014
On Wed, 11 Jun 2014 20:27:40 +0000
Sean Kelly via Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> It's the only function in std.string that takes a string by ref
> instead of by value, and this screws up call chaining. What's
> the reason for this?
It looks like it's trying to act like std.conv.parse, though that behavior
isn't useful in quite the same way when what's being returned is a string.
However, it _is_ among the std.string functions which take patterns and
would ideally be changed to take regexes, so if that ever/finally gets done,
then that would be a prime time to change the function's behavior if its
current behavior is undesirable.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list