mlx-c icon indicating copy to clipboard operation
mlx-c copied to clipboard

Allow creating fallible closure

Open minghuaw opened this issue 5 months ago • 0 comments

This is an experimental attempt at solving #34. There are two major changes

  1. Introduce a new type mlx_vector_array_result (and corresponding constructor, getter functions) to indicate status of closure execution
  2. Introduce a new function mlx_fallible_closure_new_with_payload() which takes a fallible closure that returns a mlx_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.

minghuaw avatar Sep 25 '24 13:09 minghuaw