Actions - pwdlugosz/Rye GitHub Wiki

#Actions Expressions return something, actions do something. Below are Rye's built in actions. The user had the ability to build custom native actions which can be run within Rye (called structure methods).

###Assignment

  • Scalar to Scalar: X = Y will assign the value of Y to X.
  • Matrix to Matrix: A[] = B[] will assign the value of B to A.
  • Scalar to Matrix: A[] = X will assign all values of A to X.
  • Matrix to Scalar: X = A[c,d] will assign X to the c x d element of A.

Increment and decrement work similar to assignment:

  • A += B sets A to A + B.
  • A -= B sets A to A - B.
  • A++ add 1 to A (nulls out strings, blobs and Booleans)
  • A-- subtracts 1 from A

The same operations above apply to matrices.

###For Loop Does a traditional FOR loop. If the control variable doesn't exist, Rye will create one in the global or local heap.

###While Loop Does a traditional WHILE loop.

###IF-THEN-ELSE Does a traditional IF-THEN-ELSE statement, where ELSE is optional.

###Escapes Escape-for will break a for loop, and escape read will break a read statement. Note that escape read may not work correctly if executing over more than one thread.

###EXEC Rye supports the 'EXEC' statement, which can execute Rye code within Rye. Parameters can be passed and are bound at runtime. The script is compiled at runtime. The 'EXEC' statement cannot be used in a read/select statement that runs over multiple threads.