Introduction to D-Functions (Part 1)
summary
Dfns are APL inline functions written in braces using alpha/omega for left/right arguments, local names for subexpressions, and guards with colon to return different cases. Recursion replaces loops (gcd and sum examples), with a special recursive-call token and visible tail-call optimization that makes tail-recursive versions ~39% faster in the demo. The workshop uses the supplied defenses.dws workspace, the tracer and cmpx timing tool, and shows defaults for omitted left arguments.
AI-written summary · about
chapters (13)
- 0:00Introduction to D-Functions
- 1:47Motivation and history
- 5:21Basic D-Function syntax
- 15:05Guards in D-Functions
- 22:19Procedural vs functional style
- 27:11Recursion in D-Functions
- 34:29Local names in D-Functions
- 41:45Tail calls optimization
- 48:04Optional left arguments
- 55:10Nested D-Functions
- 56:13Operators in D-Functions
- 1:00:41Recursive operators
- 1:06:25Error guards and shy results
