nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
91 stars 7 forks source link

Message literal (and constant reference probably too) can be used as a trigger/unlocker for deferred connection #615

Open emil14 opened 4 months ago

emil14 commented 4 months ago

Only port should be used at a left side of the -> (...) connection. Constant messages are unconditionally sent in infinite loops by New emitter component.

component Main(start) (stop) {
    nodes { Println, Eq<string>,If,Del}
    :start -> [
        ('neva is cool' -> eq:val),
        ('neva' -> eq:val2)
       ]

       eq:res -> if
        0 -> [('test' -> println -> del), ('other test' -> println -> del)]
       if:then -> ('They match' -> println -> :stop)
       if:else -> ('They do not match' -> println -> :stop)
}