4 ms·
input = 1 out1: input + 1 #out1 is now 2 input = 4 #out1 is now 5 out2: out1.replace(+, -) #out2 is now 3 # let's pull an APL input
by abrudz 4y ago
input = 1
out1: input + 1
#out1 is now 2
input = 4
#out1 is now 5
out2: out1.replace(+, -)
#out2 is now 3
# let's pull an APL
input = 4 2
#out1 is 5 3
#out2 is 3 1
Not quite as sleek syntax, but in APL with my Lazy library[1]
input ← 1
]lazy out1 ← input + 1
out1
2
input ← 4
out1
5
⎕FX'out1' '\+'⎕R'out2' '-'⎕NR'out1'
out2
3
input ← 4 2
out1
5 3
out2
3 1
[1] https://github.com/abrudz/Lazy https://github.com/abrudz/Lazy