Talk:Anonymous recursion: Difference between revisions

m
 
(7 intermediate revisions by 3 users not shown)
Line 199:
:# [[wp:Fixed_point_combinator]]
:# [[wp:Anonymous_function]]
:# [http://stackoverflow.com/questions/156369/which-languages-support-recursive-function-literals-anonymous-functions] discussion on stack-overflow --[[User:Dgamey|Dgamey]] 22:58, 20 July 2011 (UTC)
:Examples that look like simple recursion no hidden function, no function not bound to an identifier (per #2).:
:* AutoHotkey, Forth
Line 217 ⟶ 218:
::# Unix shell creates a subshell which aims to not pollute the namespace in parent ''process'', but it does pollute the namespace in the same ''source file''. I would say it's not ok. Then again, you don't tend to write very large programs in shell script, so it's probably moot.
::--[[User:Ledrug|Ledrug]] 22:44, 20 July 2011 (UTC)
:: Your observation of "not polluting the global name space" seems to me to be spot on on how this is being interpreted and implemented. But I'm not certain that I know enough about the task author's intent to say. That raises the question, should the task be changed? Clarified? Renamed? Both? Should implementations be marked incorrect? Given the number of solutions in place, the last choice is not one I'd take. If the intent was missed change the task and if desired create a draft with a better description of the intent with clearer guidelines. --[[User:Dgamey|Dgamey]] 23:02, 20 July 2011 (UTC)
::: This was created by Abu in November - can you way in.
:::: Well, the author listed 3 disadvantages, the first two are about the namespace issue; the third one is, IMO, bogus, because immediately after saying "interrupting program flow", the Y combinator is suggested, which interrupts code flow like there's no tomorrow. I think most examples are fine, although some are doing the task for the task's sake (such as the Go Y combinator solution) with no practical benefit. As it stands, maybe only a few examples need to be marked incorrect, while others do show some useful techniques. It never hurts to clarify the task, though. --[[User:Ledrug|Ledrug]] 23:27, 20 July 2011 (UTC)
 
== Task description is a bit childish ==
 
While I think the task is interesting, as a few languages permit this directly or at least clean workarounds, the arguments given are not very serious:
 
* ''You have to think up a name, which then pollutes the namespace'': if thinking up a name is a problem, consider another activity.
* ''Function is created which is called from nowhere else'' : It's called once. For some functions, it's enough to justify them. If it's really a problem, many languages have a way to make a function invisible from outside a given scope (for instance nested functions, static functions or namespaces), and even if there is no such thing, it's easy to add som prefix that make it very clear the function has "internal purpose".
* ''The program flow in the source code is interrupted'': that's the point of any flow control structure, and any function call. Again, if it's a problem, consider another activity.
 
I understand that making a program readable is important (it's one of my top priorities when writing programs, because I know ''I'' won't be able to maintain the program otherwise). However, it's silly to invent a problem where there is not really one. Thinking up a name and taking care of the program flow are basic tasks. Recursion is not adding complexity here. On the contrary, it usually simplifies things.
 
[[User:Eoraptor|Eoraptor]] ([[User talk:Eoraptor|talk]]) 15:19, 3 March 2019 (UTC)
1,336

edits