topic Re: Prime - local recursive function definition in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397783#M156130
<HTML><HEAD></HEAD><BODY><P>I think it is an error in Mathcad Prime 1.0 and 2.0 - see the picture</P><P><IMG alt="LocFuncRecursPrimeError.png" class="jive-image" src="https://community.ptc.com/legacyfs/online/33451_LocFuncRecursPrimeError.png" /></P></BODY></HTML>Sat, 26 May 2012 04:45:12 GMTValeryOchkov2012-05-26T04:45:12ZPrime - local recursive function definition
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397782#M156129
I've been trying to port a worksheet to Prime 1.0, but have got stuck because, whilst recursion is supported, local recursive function definition is giving me a problem. How does one define local function f to be recursive in the attached worksheet? Does it work in Prime 2.0?Thanks,StuartThu, 03 May 2018 18:03:31 GMThttps://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397782#M156129StuartBruff2018-05-03T18:03:31ZRe: Prime - local recursive function definition
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397783#M156130
<HTML><HEAD></HEAD><BODY><P>I think it is an error in Mathcad Prime 1.0 and 2.0 - see the picture</P><P><IMG alt="LocFuncRecursPrimeError.png" class="jive-image" src="https://community.ptc.com/legacyfs/online/33451_LocFuncRecursPrimeError.png" /></P></BODY></HTML>Sat, 26 May 2012 04:45:12 GMThttps://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397783#M156130ValeryOchkov2012-05-26T04:45:12ZRe: Prime - local recursive function definition
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397784#M156131
<HTML><HEAD></HEAD><BODY><P><SPAN class="hps">Спасибо,</SPAN> <SPAN class="hps">Валерий</SPAN></P><P></P><P><SPAN class="hps">In this instance (a worksheet I intend to post on filling matrices with implied polynomial data) I could easily rewrite the algorithm to avoid recursion, but there are many instances where this cannot be reasonably done.</SPAN></P><P></P><P><SPAN class="hps">Stuart<BR /></SPAN></P></BODY></HTML>Sat, 26 May 2012 19:21:14 GMThttps://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397784#M156131StuartBruff2012-05-26T19:21:14ZRe: Prime - local recursive function definition
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397785#M156132
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD>
<P>StuartBruff wrote:</P>
<P></P>
<P>I've been trying to port a worksheet to Prime 1.0, but have got stuck because, whilst recursion is supported, local recursive function definition is giving me a problem. How does one define local function f to be recursive in the attached worksheet? Does it work in Prime 2.0?</P>
<P></P>
</TD></TR></TBODY></TABLE></BLOCKQUOTE><P>I've just been going through the process of updating my utility functions to try and make them work in both M15 and Prime 3.1. Whilst converting a number of my worksheets I spent a good few minute painfully editing some functions to get them to work. I'd forgotten about this particular problem, which turned out to be the source of my particular problems this time as well. Rewriting these functions will be a pain, plus they lose the natural elegance of the recursive definition. </P><P></P><P>I hope this 3 year old bug is in the pipeline to be fixed in Prime 4.0, along with restoration of currying (partial function application), the ability to pass a range definition as an argument to a function (eg, f(2..5)), re-definable global definitions and Math Styles (or equivalent) ... the lack of these capabilities is proving somewhat irritating.</P><P></P><P>It would be helpful if the Prime Converter:</P><P>converted an equation as best it could rather than, or in addition to, replacing it with an image of a non-convertible region.</P><P>extended a variable name with a Math Style name (eg, func_MSU5 for function func defined in Math Style User 5) rather than convert to Variable ... this requires more attention to detail and effort than I'd like to manually separate converted functions with the same lexical name but differing Math Styles.</P><P></P><P>Stuart</P></BODY></HTML>Sun, 23 Aug 2015 21:48:14 GMThttps://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/397785#M156132StuartBruff2015-08-23T21:48:14ZRe: Prime - local recursive function definition
https://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/649069#M188784
<P>Unfortunately, Prime still seems to lack the ability to define a local recursive function.</P>
<P> </P>
<P>As I'm trying to write a few brief worksheets / articles on functional programming in Mathcad, this is adding to the problem of having to work around the lack of an empty array (not to mention having currying back would make life a lot easier!).</P>
<P> </P>
<P>Are there any plans to fix this problem in, say, the next release of Prime ... </P>
<P> </P>
<P>Stuart</P>Thu, 13 Feb 2020 17:08:41 GMThttps://community.ptc.com/t5/PTC-Mathcad/Prime-local-recursive-function-definition/m-p/649069#M188784StuartBruff2020-02-13T17:08:41Z