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
There're (probably) no problems with things like ternary/binary/cond/if-else/etc - components that we wanna support at syntax level, that are NOT implemented as HOCs.
On the other hands there are things like For(Each), etc. They have dependencies. Let's imagine this kind of syntax for #687
def Foo(foo stream<int>, bar any) (sig any) {
:foo -> for {
// accessing :bar from here
data -> ...
idx -> ...
last -> ...
} -> :sig
}
For(Each) is a component that takes dependency and DI in Nevalang is not inline (see #720 for details). This mean that we don't have closures. In other words we can't access :bar from inside for loop here. Same goes for switch, match, etc. All syntax features that implemented as HOCs under the hood.
The text was updated successfully, but these errors were encountered:
Simplest solution is to check that all port-addresses that we use are (in this case) data, idx and last.
Problem
The power of for-loop construct in C-like languages comes with being able to access outside scope and early termination with break, both of these features are not implemented in this. This is more problem of #687 issue but not having closures might be confusing
emil14
changed the title
HOCs as desugared base for "controlflow" constructs
HOCs as desugared base for "controlflow" constructs ("Closure" Problem)
Oct 29, 2024
Related to #724
There're (probably) no problems with things like ternary/binary/cond/if-else/etc - components that we wanna support at syntax level, that are NOT implemented as HOCs.
On the other hands there are things like For(Each), etc. They have dependencies. Let's imagine this kind of syntax for #687
For(Each)
is a component that takes dependency and DI in Nevalang is not inline (see #720 for details). This mean that we don't have closures. In other words we can't access:bar
from insidefor
loop here. Same goes for switch, match, etc. All syntax features that implemented as HOCs under the hood.The text was updated successfully, but these errors were encountered: