SLeeLa Recursion
This directory contains documentation, examples, and implementation notes for recursive programming in SLeeLa. The curated C/C++ source-file prototypes are collected in stanchion/.
Scope
- Recursive function and method design
- Base cases and termination conditions
- Direct and indirect recursion
- Stack usage, depth limits, and safe failure behavior
- Tests for correctness and edge cases
Guidance
- Define a clear base case before implementing the recursive step.
- Ensure each recursive step makes measurable progress toward a base case.
- Consider iterative alternatives when recursion depth may be large or input is untrusted.
- Test empty, minimal, typical, and boundary inputs.
- Document expected depth and resource limits where they matter.
Status
The stanchion/ subdirectory provides 26 standalone C/C++ prototypes for generic, applied, scientific, and teaching use. These are reference examples, not SLeeLa-language implementations; compile and test them before treating them as verified.
The stanchion also includes type-specialized C and C++ recursion prototypes for the seven primitive contracts documented in lib/CORE.BASE.md (Boolean, Byte, Character, Integer, Long, Float, and Double).