mlx-c
mlx-c copied to clipboard
Allow creating fallible closure
This is an experimental attempt at solving #34. There are two major changes
- Introduce a new type
mlx_vector_array_result
(and corresponding constructor, getter functions) to indicate status of closure execution - Introduce a new function
mlx_fallible_closure_new_with_payload()
which takes a fallible closure that returns amlx_vector_array_result
, and the inner lambda throws an exception if the closure returns an error
This is by no means a complete solution, but rather to start a discussion about this.