ExpressProcExampleClient.mesa
Created July 11, 1984 10:24:42 pm PDT
Last edited by Eric Nickell, July 18, 1984 1:23:39 pm PDT
DIRECTORY
ExpressProc,
ExpressTree,
RealFns USING [Sin];
ExpressProcExampleClient:
CEDAR PROGRAM
IMPORTS ExpressProc, ExpressTree, RealFns
~ {
OPEN ET: ExpressTree;
Test2:
PROC []
RETURNS [proc:
PROC
ANY
RETURNS
ANY] ~ {
tree:
ET.XTree ←
ET.ApplyTrinOp [
$If,
ET.ApplyBinOp [
$GT,
ET.XTreeFromId[$Id1],
ET.XTreeFromConstant[.5]
],
ET.ApplyFcn [
RealFns.Sin,
LIST [ET.XTreeFromId[$Id1]]
],
ET.ApplyUnOp [
$Negate,
ET.XTreeFromId[$Id2]
]
];
proc ← ExpressProc.GetProc[tree];
};
Test:
PROC []
RETURNS [proc:
PROC
ANY
RETURNS
ANY] ~ {
tree: ET.XTree ← ET.XTreeFromId[$Id4];
proc ← ExpressProc.GetProc[tree];
};
}.