On Wed, Aug 01, 2001 at 12:42:42AM -0400, Tim Peters wrote: > case BINARY_DIVIDE: case? Wowsers. Hey, Ruby does that too. We use function pointers, FWIW. Oh, and here's our divide, for comparison: PP(pp_divide) { dSP; dATARGET; tryAMAGICbin(div,opASSIGN); { dPOPPOPnnrl; NV value; if (right == 0.0) DIE(aTHX_ "Illegal division by zero"); value = left / right; PUSHn( value ); RETURN; } } See, this is why we need a new interpreter. :) In slightly more pseudo code: PP(pp_divide) { get_the_stack_pointer; find_somewhere_to_put_result; check_if_overloaded; { NV right = SvNV(POP); NV left = SvNV(POP); NV value; if (right == 0.0) DIE(aTHX_ "Illegal division by zero"); value = left / right; PUSHn( value ); RETURN; } }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4