[1]

If I have a tail recursive function F, which calls function G, there
is normally no problem with G signaling that F needs to exit. Just
return a distinguished value from G and in F have an if statement
which returns when that happens. Since F is tail recursive, nothing
more needs done.

So I would like to see an example of how this description:

>> I have a deeply embedded function that discovers that it has completed the
>> task set before it. ...
>>
>> This function was not part of the initial design.

has anything to do with tail recursion.

[2]

If I have a recursive verb (F y) implemented in J, which satisfies the
constraints for tail recursion, I believe that there is always a pair
of companion functions (FB y) (FT y) such that an F workalike can be
written:

   F=: FB^:FT^:_ y

which satisfies the "bounded stack usage" guarantee of tail recursion.
And this form has an additional advantage, which is that a rewrite
which removes the bounded stack character requires work on the part of
the developer which is quite significant - it's unlikely that you will
have someone making such changes without realizing that they are doing
so.

But I would be interested in seeing a counter-example that destroys my
belief, if counter examples exist.

Thanks,

-- 
Raul


On Wed, Jan 3, 2018 at 5:44 AM, Erling Hellenäs
<[email protected]> wrote:
> Try to remove all references to persons from your postings.
>
> I don't think my post is in any way strange. According to my judgement no
> further explanation is needed.
>
> /Erling
>
>
> Den 2018-01-02 kl. 13:18, skrev Raul Miller:
>>
>> If you would answer those two questions we could do that.
>>
>> Thanks,
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to