Search the web
Sign In
New User? Sign Up
KR-language
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
MKE 7.0 new syntax: name[char]   Message List  
Reply | Forward Message #282 of 712 |
Why the new syntax? When I invented MKR in 1996,
I decided NOT to allow name[char] because it is
not English-like. I have three reasons for
changing my mind. First, it is a convenient
shorthand, and useful for working with lists.
Second, I also want MKR to be UNIX-shell-like,
and modern versions of the UNIX shell include
associative arrays. Third, I am willing to have
some mathematics-like features in MKR.

Here is a brief summary of the new features.
These new forms

Dick[sex] := male;
x := Bob[sex];
Dick[sex] := Bob[sex];

are equivalent to these old forms

Dick has sex=male;
x := Bob has sex=?;
x := Bob has sex=?; Dick has sex=$x;

Here are a couple of examples using lists

x,y isu list of number;
x isall 1,2,3,4,5;
y isall red,blue,green;
z := x[2]; # 2
y[3] := $z; # 2
y[2] := x[-1]; # 5

The last three statements are equivalent to

z := do list member from x,2 done;
do list member od $z to y,3 done;
do list member from x,-1 to y,2 done;

where "list member" is a method supplied
as part of the MKE system.
(See http://rhm.cdepot.net/kb/method.def)


Dick McCullough
knowledge := man do identify od existent done;
knowledge haspart proposition list;
http://rhm.cdepot.net/




Sun Aug 14, 2005 8:10 pm

rhmcc
Offline Offline
Send Email Send Email

Forward
Message #282 of 712 |
Expand Messages Author Sort by Date

Why the new syntax? When I invented MKR in 1996, I decided NOT to allow name[char] because it is not English-like. I have three reasons for changing my mind....
Richard H. McCullough
rhmcc
Offline Send Email
Aug 14, 2005
8:13 pm

Of course I should have said x isu list of number; y isu list of color; ... <rhm@c...>...
Richard H. McCullough
rhmcc
Offline Send Email
Aug 14, 2005
10:34 pm

Of course I should have said x isu list of number; y isu list of color; ... <rhm@c...>...
Richard H. McCullough
rhmcc
Offline Send Email
Aug 14, 2005
10:35 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help