r/functionalprogramming • u/Deonisos • Jul 19 '23
Question When does Variable Capture happen in substitution?
I want to program a compiler for uni and have to use the locally nameless representation. I just don't get the point of locally nameless. Is it just a functional programming problem or does variable capture happen in java or kotlin too?
4
Upvotes
View all comments
Show parent comment
4
u/pthierry Jul 19 '23
Wait, where that intuition comes from? When I played with lambda calculus, it happened a lot of time that I would have nested lambda functions with the same variable. And it happened a few times with actual programming languages too, although a lot less.