C2 forum
General Category => Ideas => Topic started by: acbaile on September 22, 2018, 02:17:24 AM
-
deleted
-
Features like this are not used very often in C and do make a language more complex than needed. So it was removed.
-
If it has visibility of local variables, then we are talking about a closure rather than a function and when you want to have closures in your language, you need to be wary of many factors, for example:
- Do you clone the values of the local vars as they were when the closure was created?
- Do you keep a reference or move them into the closure?
- Can the closure be freed? If so, how? You probably wouldn't want a memory leak
Solving these is probably beyond the scope of this language.
-
This C feature is only in GCC/Clang or?