Although I designed MKR to use numbered arguments
to be consistent with the UNIX shell, I implemented
MKE in a way that actually permits you to use
named arguments.
Thus your subtract method
subtract iss method with
# Product = $1 - $2
format=[number:1,number:2],
local=[count,difference],
meaning={
set echo=off;
set count = 1;
difference := do decrease od $1 done;
until $count is $2 {
count := do increase od $count done;
difference := do decrease od $difference done;
};
set echo=on;
set Product = $difference;
};
can be written as
subtract iss method with
# Product = $subtrahend - $minuend
format=[number:subtrahend,number:minuend],
local=[count,difference],
meaning={
set echo=off;
set count = 1;
difference := do decrease od $subtrahend done;
until $count is $minuend {
count := do increase od $count done;
difference := do decrease od $difference done;
};
set echo=on;
set Product = $difference;
};
MKR also permits variable length argument lists.
For example:
add is method with
format=[number:*],
meaning={
# use MKE built-in method
do sum od $* done;
};
Dick McCullough
knowledge := man do identify od existent done;
knowledge haspart proposition list;
http://rhm.cdepot.net/