Skip to content

Conversation

@tahina-pro
Copy link
Member

So far an external function could not return any value (more precisely, return values were actually ignored, and 3D type-checked an external function call as returning unit even if the user stated a non-void return type in the declaration of the external function.)

This PR fixes that issue, by:

  • allowing non-unit return type in the extern_action combinator in the prelude
  • taking the user-declared external function return type into account in the 3D type-checker

With this PR, an action can, for instance, call an external function and decide to succeed or fail depending on its return value. (This was long due; until now, one had to use out-parameters to painfully mimic this behavior.)

It also:

  • adds an array iterator example that calls external functions to populate an output array
  • documents external function calls in the 3D manual

@tahina-pro tahina-pro requested review from aseemr and nikswamy June 17, 2024 22:58
@tahina-pro tahina-pro added the 3d The 3d dependent data description language and frontend label Jun 17, 2024
@tahina-pro tahina-pro merged commit f774ad4 into master Aug 8, 2024
@tahina-pro tahina-pro deleted the _taramana_3d_external_functions_with_return_values branch October 25, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3d The 3d dependent data description language and frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants