3 ms·
I totally understand. In fact, Kitten has named variables for that reason. You can write code that looks imperative, expressiony, or dataflowy, according to tas
by evincarofautumn 13y ago
I totally understand. In fact, Kitten has named variables for that reason. You can write code that looks imperative, expressiony, or dataflowy, according to taste. Here’s a silly example:
// Implicitly thread state between functions.
def promptInt:
": " cat prompt
readInt
fromSome
// Write stacky code if you want.
def squareDiff:
- dup *
// Use locals as much as you need to.
"x0" promptInt ->x0
"y0" promptInt ->y0
"x" promptInt ->x
"y" promptInt ->y
x0 x squareDiff ->a
y0 y squareDiff ->b
a b + sayInt