https://futureofcoding.org/ logo
#two-minute-week
Title
# two-minute-week
o

oPOKtdJ4UbTdPaZig6jg

11/30/2023, 12:18 PM
Last week I worked on entering a subnet, this is used for condition, match, filter, map etc.. See description under video. (no audio)

https://youtu.be/hWzxG2oeu0E

k

Kartik Agaram

11/30/2023, 3:18 PM
I couldn't understand at all what happened in this video.
s

Stew O'Connor

11/30/2023, 10:40 PM
I believe they wrote the program "`if global->frame = 15 then "Alice" else "42`
they instantiated a predicate object, then showed creating subprograms that here were called "subnet"s for each half of the if, one subgraph produced "15" and the other "Alice"
o

oPOKtdJ4UbTdPaZig6jg

12/01/2023, 5:20 AM
Thanks Stew, that's about it. Note that one subgraph produces 42 the integer and the other "Alice" the string, the result is then of type <int | string>, a variant type of either type. One could also write this as an expression:
global->frame = 15 ? "Alice" : 42
and wrap/unwrap from one to the other.
2 Views