Author Topic: deleted  (Read 4528 times)

acbaile

  • Newbie
  • *
  • Posts: 22
    • View Profile
deleted
« on: September 22, 2018, 02:17:24 AM »
deleted
« Last Edit: January 27, 2019, 09:12:18 PM by acbaile »

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: Function inside function
« Reply #1 on: September 24, 2018, 12:20:16 PM »
Features like this are not used very often in C and do make a language more complex than needed. So it was removed.

magnusi

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Function inside function
« Reply #2 on: November 09, 2018, 11:44:55 PM »
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.

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: Function inside function
« Reply #3 on: November 14, 2018, 06:30:42 PM »
This C feature is only in GCC/Clang or?