qi icon indicating copy to clipboard operation
qi copied to clipboard

[Feature Request] better way to define recursion.

Open NoahStoryM opened this issue 2 years ago • 0 comments

In order to define recursive flow, I have to manually wrap it. I wonder if Qi can give a more elegant solution?

(And in this case, -< is not equivalent to (~> (fanout N) (== flo ...)), is it necessary to point out in the documentation?)

Welcome to Racket v8.6 [cs].
> (require qi)
> (define inf1 (☯ (-< inf1)))
> (define inf2 (☯ (== inf2)))
inf2: undefined;
 cannot reference an identifier before its definition
  in module: top-level
 [,bt for context]
> (define inf3 (☯ (~> inf3)))
inf3: undefined;
 cannot reference an identifier before its definition
  in module: top-level
 [,bt for context]
> (define inf4 (let ([inf4 (λ _ (apply inf4 _))]) (☯ (~> inf4))))

NoahStoryM avatar Aug 18 '22 06:08 NoahStoryM