On Wed, 8 May 2024 at 17:57, Marcus Comstedt (ACROSS) (Hail
Ilpalazzo!) @ Pike (-) developers forum <[email protected]>
wrote:
>
> Yes, although I'm still not sure this follows the principle of least
> astonishment:
>
> If no matches results in "", and the result is the sum of the matches,
> wouldn't you expect the result in this case to be ""+4+7, i.e. the
> string "47"?  If an arithmetic sum is expected then you should get 0
> from a non-match IMO...

Well, you do get zero for a non-match, so ... I guess so? :)

> object buf = Stdio.Buffer("asdf");
> buf->match("qwer");
(1) Result: 0

But I don't think that's quite the same as a null sum.

ChrisA
  • Und... Chris Angelico
    • ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
      • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
      • ... Chris Angelico
        • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
        • ... Chris Angelico
          • ... Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
    • ... Chris Angelico

Reply via email to