cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Rosetta Code - Partial function application

StuartBruff
23-Emerald II

Rosetta Code - Partial function application

https://rosettacode.org/wiki/Partial_function_application

 

Partial function application, often abbreviated to just partial application (PA), is the ability to take a function of many parameters and apply arguments to some of the parameters to create a new function that needs only the application of the remaining arguments to produce the equivalent of applying all arguments to the original function.

 

The attached worksheets (M15 and Prime 7) are potential staring points for entries for a Mathcad section within the Rosetta Code webpage. I created them some time ago, but ran out of licence before I could finish them off.

 

Only M15 is capable of built-in partial application.   Mathcad Prime had PA in its initial versions but it was removed.   The attached worksheet uses an intermediary function to generate a closure that acts like partial application.  However, a number of the listed programming language have taken this route, so it is acceptable.

 

I haven't found a way to implement partial function application in Mathcad Prime Express.

 

Stuart

 


 

Mathcad 15 - Part 1 - Examples

2021 12 24 a.png

Mathcad Prime 7 - Part 1 - Examples

2021 12 24 b.png

 

 

Mathcad 15 - Part 2 - Rosetta Code Task Implementation

2021 12 24 d.png

 

Mathcad Prime 7 - Part 2 - Rosetta Code Task Implementation

2021 12 24 e.png

 

Along the way, I made some ad hoc notes about PA and the differences between M15 and MP.

 

2021 12 24 f.png

0 REPLIES 0
Top Tags