| 579 | |
| 580 | # ----- Numeric conversions (inline in lean.h) ----- |
| 581 | def lean_box_uint64(self, v): |
| 582 | # Boxed uint64: small object holding the 64-bit value. |
| 583 | # Use the exported lean_box_uint64 if present. |
| 584 | fn = getattr(self.lib, "lean_box_uint64", None) |
| 585 | if fn is not None: |
| 586 | fn.argtypes = [c_uint64] |
| 587 | fn.restype = LeanObjectPtr |
| 588 | return fn(v) |
| 589 | # Fallback: scalar tagged pointer (only valid for small values). |
| 590 | return self.lean_box(v) |
| 591 | |
| 592 | def lean_unbox_uint64(self, o): |
| 593 | fn = getattr(self.lib, "lean_unbox_uint64", None) |