code wiki / (root) / nx_fn_ptr_test.nx

nx_fn_ptr_test.nx

buildroot/runtime/nx_fn_ptr_test.nx

2216 B64 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic fn
docsdependenciesstructsconstsfunctions

about

nx_fn_ptr_test.nx -- exercise first-class function pointers.

dependencies 1 imports · 0 importers

nx_kernel_v2.nx nx_fn_ptr_test.nx

imports: nx_kernel_v2.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main t1_basic_indirect t2_reassign t3_higher_order apply_op

structs

none

consts

none

functions

5func add(a: nx_int, b: nx_int) -> nx_int { return a + b }
6func sub(a: nx_int, b: nx_int) -> nx_int { return a - b }
7func mul(a: nx_int, b: nx_int) -> nx_int { return a * b }
8func neg_x(a: nx_int, b: nx_int) -> nx_int { return -a }
11func t1_basic_indirect() -> nx_int
called by 1: main
19func t2_reassign() -> nx_int
called by 1: main
34func apply_op(op: func(nx_int, nx_int) -> nx_int, a: nx_int, b: nx_int) -> nx_int
called by 1: t3_higher_order
38func t3_higher_order() -> nx_int
called by 1: main calls 1: apply_op
46func main() -> nx_exit