Skip to content
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

Add pure runtime or "control" versions of all forms #17

Open
countvajhula opened this issue Jan 6, 2022 · 1 comment
Open

Add pure runtime or "control" versions of all forms #17

countvajhula opened this issue Jan 6, 2022 · 1 comment

Comments

@countvajhula
Copy link
Collaborator

All of Qi's forms can be fully specified syntactically, e.g. (>< sqr). But some of them can also be specified using flows encoded as input values (which we'll call "control" inputs) to these forms at runtime, e.g. (~> (-< (gen sqr) 1 2 3) ><). In this second version, the >< form is specified purely at runtime, including the function to map over the input values which is provided here as a "control" input. This allows the >< form to be controlled at runtime rather than determined at compile time.

Many Qi forms (such as pass, feedback, and more) already support full runtime specification, but many still don't. Review these and ensure that all forms that need to support this behavior, do.

Note to the reader: if you arrived here having encountered a case where you wanted a form to be controllable at runtime, please comment below and that form will be prioritized.

@countvajhula
Copy link
Collaborator Author

Cassie on the Racket Discord reports this case for group: (lambda (x) (~> (data) sep (group (add1 x) selection-flo remainder-flo)))

We could either support this via the usual control inputs way:

(lambda (x)
  (~> (data)
      sep
      (-< (gen (add1 x))
          _)
      (group selection-flo
             remainder-flo)))

as well as:

(lambda (x)
  (~> (data)
      sep
      (-< (gen (add1 x))
          (gen selection-flo)
          (gen remainder-flo)
          _)
      group))

Or we could potentially introduce a new way where designated parts of the form specification (e.g. in the case of group, perhaps just the number of values to group) could be treated as Racket expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant