home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / SYMBMATH.H06 < prev    next >
Text File  |  1993-11-07  |  1KB  |  21 lines

  1.           3.1.5.6  Procedures
  2.     A procedure is similar to a function, but the right side of
  3. assigment in its definition is multi statements grouped by block().
  4. block(a,b,c) groups a,b,c and only returns the last arguement as its
  5. value, or returns the second last arguement as its value if the last
  6. arguement is local(). It is used as grouper in definition of a procedure.
  7. All variables in block are global, except for variables declared by
  8. local().
  9.         e.g. f(x_):=block(p:=x^6,p,local(p))
  10.         Remember that you can split a line of program into multi-lines
  11. program at comma ,.
  12.  
  13.           3.1.5.7  Rules
  14.     Defining rules is similar to defining functions. In definition 
  15. of function, all arguements of function are simple variables, but in 
  16. definition of rules, the first arguement may be a complicated expression.
  17.     e.g.
  18.     f(x_,y_) := x^2+y^2                     # defining function
  19.     f(x_,y_) := block(a:=2, a+x^2+y)        # defining procedure
  20.     log(x_ * y_) := log(x)+log(y)           # defining rule
  21.