2025-08-30 07:47:21 +09:00
|
|
|
// Python callR positional args demo: int('FF', 16) => Ok(255)
|
|
|
|
|
// @env NYASH_PLUGIN_ONLY=1
|
|
|
|
|
// @env NYASH_PY_AUTODECODE=1
|
|
|
|
|
// Run:
|
2025-11-06 15:41:52 +09:00
|
|
|
// ./target/release/nyash --backend vm examples/py_callR_int_base16_ok_demo.hako
|
2025-08-30 07:47:21 +09:00
|
|
|
|
|
|
|
|
static box Main {
|
|
|
|
|
main() {
|
|
|
|
|
local py, bi, intf, r
|
|
|
|
|
py = new PyRuntimeBox()
|
|
|
|
|
bi = py.import("builtins")
|
|
|
|
|
intf = bi.getattr("int")
|
|
|
|
|
r = intf.callR("FF", 16)
|
|
|
|
|
me.console.println(r) // expect Ok(255)
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
}
|