Is Apple Shortcuts functional programming?
I'm working on an inadvisably complex Apple Shortcuts widget for studying Japanese language, and just realized two things that may save you some time in the future:
- If statements are expressions: the value of the "If Result" is available and evaluates to the final value of whatever branch was traveled at runtime
- Repeat blocks may say "each" but actually double as map functions: they return a "Repeat Results" value, which evaluates to a List of the final value of each iteration
Because Shortcuts exposes such a gobsmackingly-frustrating UI for actually building programs, it's easy to assume that you're hobbled by the conventions of something like BASIC, but there are some surprisingly modern conveniences lying under the surface!
