-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple return types #37
Comments
This is something that should be discussed. With A traditional way to handle multiple return values is with a tuple. See e.g., http://www.codingexplorer.com/tuples-in-swift-create-read-and-return/ Sadly there is no tuple type (that I know of?) in CTO, so this means an extension to the Jura type system. In Jura this could look as follows:
It could be implemented as an 'on the fly record' so as a kind of syntactic sugar for a record (or JS side a JSON object) with the following structure:
or
JavaScript side you could access it as:
Do you think that might work? |
A couple of following up notes:
|
@mttrbrts What's the reason for closing this? |
Reading this again, this should be an Ergo issue, so deferring to your issue accordproject/ergo#20 |
👍 I thought it was! Sounds good. |
Context
Currently, clause logic can only specify a single return type.
e.g.
https://github.com/accordproject/cicero-template-library/blob/master/fragile-goods/lib/logic.js#L25
Expected Behavior
As a template author, I want my logic to be able to specify multiple CTO types without building a wrapper CTO type. This could be in the form of an array, or integer indexed object.
or
Possible Fix
Need to look at this code:
https://github.com/accordproject/cicero/blob/master/packages/cicero-engine/lib/engine.js#L167
Existing issues
None.
The text was updated successfully, but these errors were encountered: