RecordFlux icon indicating copy to clipboard operation
RecordFlux copied to clipboard

Processing/iterating a sequence in a session

Open NickFoubert opened this issue 5 months ago • 3 comments

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:

  1. I tried "iterating" through a sequence using list comprehensions and 'Head but since copying sequences isn't yet supported there doesn't seem to be a way to store the Tail of a list to process the remaining elements.
  2. It appears that sequences can't be used as a function parameter, either directly or as a component of a message type.

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?

NickFoubert avatar Sep 04 '24 17:09 NickFoubert