kyren / piccolo

An experimental stackless Lua VM implemented in pure Rust
Creative Commons Zero v1.0 Universal
1.62k stars 59 forks source link

Implement comparison metamethods, support them in `math.min`/`max` #89

Closed Aeledfyr closed 2 months ago

Aeledfyr commented 2 months ago

Implements the __lt and __le metamethods, and implements versions of math.min and math.max that support those metamethods.

This also changes the default comparison behavior to not automatically convert strings to numbers in comparisons, to match PRLua 5.4.

Along with #88, this implements the last of the missing metamethods.

kyren commented 2 months ago

This looks really good, thank you!