qdk
qdk copied to clipboard
Backend can call callable arguments in intrinsic callables
Is your feature request related to a problem? Please describe. For an intrinsic that takes as input a callable, e.g.,
function Twice(f : Int -> Int, a : Int): Int {
body intrinsic;
}
I cannot evaluate f within Backend::custom_intrinsic with respect to the simulator that implements Backend.
Describe the solution you'd like
An argument in Backend::custom_intrinsic that allows me to evaluate f on some expression.
Describe alternatives you've considered
- Having a mutable reference to the
fir::PackageStoreinside the custom backend, but the package store is immutably borrowed by eval, so this does not work.
@swernli will follow up on this.