New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove arithmetic/bitwise metamethods? #60

Closed
JarrettBillingsley opened this Issue Oct 10, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@JarrettBillingsley
Owner

JarrettBillingsley commented Oct 10, 2012

This includes op(Add|Sub|Mul|Div|Mod|And|Or|Xor|Shl|Shr|UShr)(Assign|_r)? and op(Neg|Com|Inc|Dec). Honestly I just don't see them being that useful. Croc has no value types and therefore anything that implements these correctly is going to generate a ton of heap-allocated intermediates. It's one of the reasons I haven't really made any inroads on the bignum thing -- I'd rather not make the "easy" case grossly inefficient. And other than bignums (and what Vector uses them for), is there really that much of a use case? Seriously, how often do you really need to implement "numbers"?

This pretty much just leaves op(Index|Slice|Field|Length)(Assign)?, opCat(Assign|_r)?, opCmp, opEquals, opCall, opMethod, opApply, and opIn. Most of these are useful for containers, which are much more common. What's left is either generally useful (opCmp/opEquals) or used to mock other behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment