home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / maj / 666 / h1.hlp < prev    next >
Text File  |  1993-04-04  |  3KB  |  59 lines

  1.  
  2.                              COMMANDS
  3.  
  4. There are two types of commands: system commands, and "desk calculator"
  5. commands. There are four system commands: load (to load a Proxy file),
  6. transcript (to store in a file a transcript of all subsequent keystrokes),
  7. help (to obtain the syntax and functionality of different commands,
  8. statements and composite data structures), and exit (to return to the
  9. DOS prompt). Desk calculator commands are the expressions, assignments,
  10. and definitions that can be typed at the Proxy prompt for immediate
  11. evaluation and execution.
  12.  
  13. The simplest desk calculator command is an expression to be evaluated, i.e.
  14. 2+2. Note that every command must be terminated with a semi-colon. There
  15. are four types of expressions: integer, real, string, and boolean. Real
  16. literals are written in decimal form, i.e., 3.14159; there must be at least
  17. one digit before the decimal point. Boolean literals are written true, false,
  18. and strings are written with double quotes, i.e. "This is a string".
  19.  
  20. Slightly more complicated expressions involve identifiers (variables).
  21. All identifiers must start with a letter. The rest of the identifier may
  22. consist of letters, underscores, or digits. Identifiers are not case
  23. sensitive, i.e. aBcD is considered to be the same identifier as abcd.
  24.  
  25. The standard arithmetic, relational and Boolean operators are supported
  26. with their relative precedence given by the following table:
  27.  
  28.      ! - (unary minus)                highest
  29.      * / % &&                            |
  30.      + - ||                              v
  31.      == != < > <= >=                  lowest
  32.  
  33. where ! represents logical negation, % is the modulo operator, && is logical
  34. conjunction, || is logical disjunction, == represents equal, and !=
  35. represents not equal.
  36.  
  37. A list of the commands and simple examples of their use is given below.
  38.  
  39. Type of Command                      Example
  40.  
  41. load command                         load "topsort.prx";
  42. transcript command                   transcript "session.txt";
  43. help command                         help;
  44. exit command                         exit;
  45. expression                           x + 3 ;
  46. function definition                  fun(y) {return y + 1;};
  47. assignment                           y = 17 ;
  48. struct declaration                   struct empl {age, citizen;};
  49. struct instantiation                 p = new empl(25, true);
  50. struct component update              p.age = 26;
  51. map update                           table[3] = 4;
  52. class definition                     class stack(;rep) {
  53.                                        stack() {rep = [];}
  54.                                        push(x) {rep = [x] conc rep;}
  55.                                        top() {return hd rep;}
  56.                                        pop() {rep = tl rep;}
  57.                                        empty() {return rep == [];}};
  58. class instantiation                  s = new stack();
  59.