Open
Description
is there any way to achieve a "thread as" experience like there is in Clojure ??
https://clojuredocs.org/clojure.core/as-%3E
my goal is to be able to use the result from the previous evaluation, anywhere in the current evaluation .. i get that the "variable" declaration (v
) could conflict with future args, but if i am allowed to "name" my variable and it is unique enough -- i could reasonably assume my positional arguments would be safe from conflicts ..
for example, i would hope to be able to do something like this ::
v = f"{uuid.uuid4()}some_variable_name_that_wont_collide_with_future_derived_vals"
def add(x, y): return x + y
def pow(x, y): return x**y
thread_as(
1, v,
(add, 4, v),
(pow, v, 2),
)
# 25
if there is another way to achieve it -- i would love to hear it ..
thanks for the help !!
Metadata
Metadata
Assignees
Labels
No labels