You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function f is mapped over a list (list x0 x1 ...).
Each call returns two values (in the code called a and b).
These values are collected and the final result is
(values (list a0 a1 ...) (list b0 b1 ...)
where ai and bi are the result of calling (f xi).
Note this version is slightly different from the original posed question in that it accepts values directly rather than a list of values. Likewise, the zip should yield multiple lists as independent values, rather than a single list containing them all.
(@benknoble suggested the introduction of a values-oriented form analogous to by that would allow for a different solution here -- this form also sounds like it would be a good addition, to qi core rather than qi/list).
The text was updated successfully, but these errors were encountered:
Yes, I think many languages provide some form of zip, including Python, Haskell, and Ruby. The zip proposed here would be the same except returning separate values instead of a list.
This problem was posed by @soegaard on Discord:
It would be nice if the following worked:
Note this version is slightly different from the original posed question in that it accepts values directly rather than a list of values. Likewise, the
zip
should yield multiple lists as independent values, rather than a single list containing them all.(@benknoble suggested the introduction of a values-oriented form analogous to by that would allow for a different solution here -- this form also sounds like it would be a good addition, to
qi
core rather thanqi/list
).The text was updated successfully, but these errors were encountered: