Comment by wk_end
6 hours ago
All OP is asking for is the ability to declare variables at first use instead of at the top of a function. You don't need closures or anything that'd inhibit C compatibility for this - C itself has supported this since C99. It's fairly simple if you're willing to give up single-pass compilation, which (I think?) FPC already has.
Could probably just get the source and have an LLM vibe code that, for personal use seems fine.