To decide which real number is the absolute value of (R - a real number)
(documented at ph_absolutevalue)
(this is the abs function):
(- REAL_NUMBER_TY_Abs({R}) -).
What is the purpose of the “(this is the abs function)” part? I know you can name rules like this, but there don’t seem to be any mentions in the documentation about naming phrases. Can the name be used in some manner?
This lets you store a reference to the phrase in a phrase variable. This is described in chapter 22.
The func-global is a phrase real numbers -> real numbers variable.
When play begins:
let func-global be the sin function;
say "[func-global applied to -0.5].";
let func-global be the abs function;
say "[func-global applied to -0.5].";