-
Notifications
You must be signed in to change notification settings - Fork 7
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
Processing/iterating a sequence in a session #1302
Comments
The operations on sequences are indeed limited at the moment:
What is the return type of the external function? Would adding support for function calls in list comprehensions solve your issue? |
In my current case the return type would be an enumeration, so I believe allowing function calls in a list comprehension would indeed solve my current issue. The protocol requires that for each element of the sequence I return a 1:1 list of "return codes", so a map function is what I'd need.
While playing around with this I believe I found a bug: the RecordFlux documentation indicates that the "if" portion of a list comprehension is optional, but the validator/generator generated a Python exception.
causes an exception
also causes an exception, but the documentation implies that 'True' is a valid boolean expression.
succeeds, though I'm not sure it is correct since the documentation implies that the output needs to be a selector expression (though I haven't tried to compile the generated code). I'm using 0.23.0 |
Support for function calls in list comprehensions would be a useful improvement. We have created an internal ticket for this feature request. Unfortunately, we cannot yet estimate when this feature will be available.
Thank you for reporting this! All three examples (without condition, with |
…ondition Ref. #1302, eng/recordflux/RecordFlux#1786
I'm trying to sort out how I might process the elements of a sequence in the context of a session. I've tried a couple things but I'm stumped:
The examples in the repo seem to only ever use the 'Head of a sequence to select the first element or some specific element using a list comprehension.
I'd like to be able to call an external function on each element of a sequence.
I suppose a workaround is to write the sequence to a channel and then have the external code re-parse the sequence?
The text was updated successfully, but these errors were encountered: