I tried to do something similar to this:
def some_expensive_function(a) = a*10
def f(a) = (c:=some_expensive_function(a)) :: f(c)
but it compiles to code which throws:
SyntaxError: assignment expression cannot be used in a comprehension iterable expression