After successful evaluation assigner has a return value of circuit function, which now can be printed to stdout (see print_format). However we cannot access this value from API now. It will be nice for users and really helpful for testing assigner.
I suggest we add public method get_return_value:
std::vector<typename BlueprintFieldType::integral_type> get_return_value();
- If the return value is primitive (integer, field), this returns vector of a single element - the value itself;
- Using
BlueprintFieldType::integral_type here allows to return single value for non-native fields (at least as I understood it);
- If the return value is LLVM vector of curve, this returns vector of values of corresponding size;
- Other cases (pointers, structs and etc.) are not defined yet.
If the function is called not after successful evaluation, result must be undefined (probably empty).