Skip to content

How to represent a for loop #23

@samwaseda

Description

@samwaseda

It's closely related to #24, but since it's getting pretty long, I open a new issue.

Let's talk about the following workflow:

def my_workflow(n):
    for ii in my_list(n):
        n = my_function(ii)
    return n

Now, following the logic from #24, there would be an edge from inputs.n to my_list, then my_list to my_function, finally my_function to output. Now, however, there are two significant differences:

  1. The output of my_function is not the input of my_list, as my_list is evaluated only once when n is inserted
  2. ii is not the output of my_list, but it's each element of the output of my_list.

So I'm feeling that maybe our edge representation is not good enough to cover the for loop. What do you think? @liamhuber

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions