Talk:Anonymous recursion: Difference between revisions
Content added Content deleted
(Trying to squeeze my comments into this overly long talk page.) |
(→completion of the task: Removed REXX comments.) |
||
Line 194: | Line 194: | ||
* Ruby is different from PicoLisp here: the first pass through the 'recur' block really is a function call! For example, <tt>recur { recurse }</tt> would be an infinite loop (until I run out of memory, with a very long stack trace), but <tt>recur { next 5; recurse }</tt> would return 5, because 'next' is the Ruby keyword to return from a block. |
* Ruby is different from PicoLisp here: the first pass through the 'recur' block really is a function call! For example, <tt>recur { recurse }</tt> would be an infinite loop (until I run out of memory, with a very long stack trace), but <tt>recur { next 5; recurse }</tt> would return 5, because 'next' is the Ruby keyword to return from a block. |
||
* I cannot find the difference between an ''invisible function'' and a ''function-that-is-not-considered-a-function''. If the wrong solutions use the invisible functions, and the correct solutions use the functions that are not considered functions, then I cannot know whether each solution is correct or wrong! --[[User:Kernigh|Kernigh]] 04:04, 11 February 2011 (UTC) |
* I cannot find the difference between an ''invisible function'' and a ''function-that-is-not-considered-a-function''. If the wrong solutions use the invisible functions, and the correct solutions use the functions that are not considered functions, then I cannot know whether each solution is correct or wrong! --[[User:Kernigh|Kernigh]] 04:04, 11 February 2011 (UTC) |
||
=== completion of the task === |
|||
I am the author of the REXX solution. |
|||
There is a note which says in part: " .. The task was not to check for a negative argument..." |
|||
The task as stated: |
|||
"If possible, ..... which checks for a negative argument before doing the autual recursion." |
|||
I did the neg arg check before the actual recursion. |
|||
In the anonymous call ranch example for REXX, "doThat" was a recursive call for the solution, |
|||
as well as "doMore", which did likewise. |
|||
<br>I can break the REXX code to NOT invoke a recursive call for the solution, but merely delay it, which |
|||
would seem to defeat the purpose of the example (by adding more unecessary code). |
|||
Was it against the rules to have a different version of the recursive call as part of "doThat"? |
|||
[[User:Gerard Schildberger|Gerard Schildberger]] 20:39, 18 January 2011 (UTC) |
|||
: Surely my REXX skills are near to zero, I just see that the function 'fib' calls the function 'fib' again, which is not "anonymous" (but calls the named function). The task talks about "in-place" recursion, without calling a name. The fibonacci is just thought as a simple example. Anonymous recursion should work stand-alone, completely without the presence of a function. There might in fact be 1000 lines before and 1000 lines after the recursive part. --[[User:Abu|Abu]] 06:52, 19 January 2011 (UTC) |