Talk:Nested function

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

C syntax[edit]

I was under the impression that the c language didn't support nested functions... Fresheneesz 21:01, 7 December 2006 (UTC)[reply]

I does not, but C syntax is only syntax, not the same as legal C code. I was contemplating the word "hypothetical" when i wrote it, but as there is at least one "C syntax programming language", the D language, supporting nested functions, that word would probably be somewhat misleading. /HenkeB 05:54, 24 December 2006 (UTC)[reply]

Actually I just tested minGW's gcc - and it does it fine. But when I tried compiling a c program (something.c) with dev c++, it gave me this error "in make_decl_rtl varasm.c: 752". Compiling it as a c++ program (something.cpp ), it refused the declaration entirely. Fresheneesz 21:25, 7 December 2006 (UTC)[reply]

To make things really confusing, the gnu c compiler (as you have discovered) actually supports nested functions even in C programs, but this is a non-standard language extension. /HenkeB 05:54, 24 December 2006 (UTC)[reply]

Formatting[edit]

I was under the impression that ==heading name== was the usual format for top-level headings, and the convention followed by most articles (as per WP:HEAD). Is this incorrect, or is this article just going against convention? If the latter, why? JoeKearney 20:19, 29 March 2007 (UTC)[reply]

I agree with you. I'm going to perform the change so that the article formatting will comply to the Wikipedia formatting guidelines. --Antonielly (talk) 23:06, 4 December 2008 (UTC)[reply]

Nesting dolls[edit]

I somehow fail to understand what have "Nesting dolls (Japanese version)" to do with a nested function. Furthermore, there is a separate page for nesting dolls. Cooldemo (talk) 11:32, 25 November 2008 (UTC)[reply]

I completely agree with you. The only relationship of that figure with the concept of "nested function" is the concept of nesting. This is a very weak relationship. I think that figure should belong to the article Matryoshka doll, not to this. I vote for transferring that figure to the Matryoshka doll article. (I prefer a transfer (move) operation, not simply a delete.) --Antonielly (talk) 23:02, 4 December 2008 (UTC)[reply]
I agree as well and have removed the image. fraggle (talk) 14:50, 25 April 2009 (UTC)[reply]

in Mathematics...[edit]

The article begins saying, "In computer programming..." but it seems there should be at least some mention or cross reference to the use of nested functions in mathematics. Some very simple nested functions show up in the SAT (exam).

Where (in mathematics) do they get used mainly? Maybe add some references like these:

DKEdwards (talk) 02:31, 3 December 2022 (UTC)[reply]

Examples: expand or TMI?[edit]

I was thinking of adding Python and Ruby to the Examples section; would that be TMI? [based on history seems to be from Chatul]

Knock yourself out :) I would suggest Python and not Ruby due to their respective popularities. And keep it short. The example for C++ using lambdas is too long ... not to mention off topic since it doesn't use nested functions. Stevebroshar (talk) 13:13, 7 April 2024 (UTC)[reply]
I wound up adding PL/I and Python examples. In the process, I noticed that the simple examples don't use local variables. -- Shmuel (Seymour J.) Metz Username:Chatul (talk) 14:02, 9 April 2024 (UTC)[reply]