MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / lean_ctor_set

Function lean_ctor_set

lean_py/_runtime.py:479–485  ·  view source on GitHub ↗
(self, o, i, v)

Source from the content-addressed store, hash-verified

477 return ctypes.cast(c_void_p(raw_val), LeanObjectPtr)
478
479 def lean_ctor_set(self, o, i, v):
480 ctor_cls = structs.get("lean_ctor_object")
481 ctor = ctypes.cast(o, POINTER(ctor_cls))
482 offset = ctor_cls.m_objs.offset
483 addr = ctypes.addressof(ctor.contents) + offset
484 arr = ctypes.cast(addr, POINTER(LeanObjectPtr * (i + 1)))
485 arr.contents[i] = v
486
487 def lean_ctor_scalar_addr(self, o, byte_offset):
488 """Base address + byte_offset into the m_objs region of a ctor."""

Callers 3

leanpy_ctor_setFunction · 0.85
leancallable_callFunction · 0.85
lean_py_to_lean_objFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected