Something curious about this new world, is that you could say:
add2x3x+1: enclose ^add f -> [
f.1: f.1 * 2
f.2: f.2 * 3
1 + eval @f
]
This throws in some whizbang things:
- picking frame arguments by number
- using an ARROW lambda
- requesting destructive consumption of the frame via @f...
But beyond showing off random things, what I actually wanted to highlight was the choice of whether to say ^add
vs. add/
Either would work now, but they are different--and you should still prefer add/
add2x3x+1: enclose add/ f -> [
f.1: f.1 * 2
f.2: f.2 * 3
1 + eval @f
]
Because add/
will validate that it's an ACTION!. Even though ENCLOSE would catch if it's not in the typechecking, it's clearer in the source to help readers see "oh, that's a defused function". ^add
would even be willing to give back (not-unspecialized) TRASH! and have worse error locality by having an error on that occur downstream.
And critically, if you were writing:
func1: func2/
The terminal slash makes it "unsurprising", hence averting an error on assignment, which you'd otherwise have to use another operation to "approve".