cairo icon indicating copy to clipboard operation
cairo copied to clipboard

feat: add function pointer

Open j1mbo64 opened this issue 7 months ago • 1 comments

Feature Request

Describe the Feature Request

Cairo function pointer

Describe Preferred Solution

Like in Rust language ( https://doc.rust-lang.org/reference/types/function-pointer.html )

Describe Alternatives

Related Code

fn add(x: i32, y: i32) -> i32 {
    x + y
}

let mut x = add(5,7);

type Binop = fn(i32, i32) -> i32;
let bo: Binop = add;
x = bo(5,7);

Additional Context

If the feature request is approved, would you be willing to submit a PR? (Help can be provided if you need assistance submitting a PR)

  • [ ] Yes
  • [X] No

j1mbo64 avatar Jul 24 '24 15:07 j1mbo64