in reply to Re^6: Puzzled by value of $overload::ops{binary}
in thread Puzzled by value of $overload::ops{binary}
That seems to me to be asserting that these operations (unlike '++' and '--') do require a value to be returned.* *Assignments* += -= *= /= %= **= <<= >>= x= .= &= |= ^= &.= |.= ^.= [snip] The subroutine for the assignment variant of an operator is required only to return the result of the operation.
andvoid overload_add_eq(pTHX_ SV * a, SV * b, SV * third) { dXSARGS; PERL_UNUSED_ARG(third); mpz_add_ui(*(INT2PTR(mpz_t *, SvIVX(SvRV(a)))), *(INT2PTR(mpz_t * +, SvIVX(SvRV(a)))), SvUV(b)); XSRETURN(1); }
But I wonder if that achieves anything significant over the implementation that has been working fine for the last umpteen years.void overload_add_eq (a, b, third) SV * a SV * b SV * third CODE: overload_add_eq (aTHX_ a, b, third); XSRETURN(1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Puzzled by value of $overload::ops{binary}
by etj (Priest) on Jun 26, 2024 at 22:08 UTC | |
by syphilis (Archbishop) on Jun 27, 2024 at 02:30 UTC | |
by etj (Priest) on Jun 27, 2024 at 10:01 UTC | |
by syphilis (Archbishop) on Jun 27, 2024 at 10:42 UTC | |
by etj (Priest) on Jun 27, 2024 at 13:36 UTC | |
|