Key Pages: [ Rope Home Page | Basics (tutorial) | Language Reference | Download ]
ROPE's actions words (like "add", "println") etc take (pop) items off the top of the stack, manipulate them and possibly put (push) items back as a result. Most action words have a default number of items that they pop off the stack. On the whole those defaults are obvious and instinctive.
For example: the "add" action by default adds the top 2 items and pushes back their sum. So..
1 3 5 11 add
leaves the values 1,3,16 on the stack because "add" has taken the 5 and 11, added them and pushed back the resulting value.
If you want to change the number of arguments that "add" processes, you use brackets like this..
1 add( 3 5 11 )
This leaves the values 1 and 19 on the stack because "add" has taken the three values in brackets, added them and pushed back the result. This syntax is called "AnchorBrackets" because what rope does when it sees this style of syntax is this..
It should be noted that some ROPE action words must not be called with AnchorBrackets in this way - but it is the run-time (rather than the compiler) that complains if the wrong syntax is used. Similarly, some action words must be called with AnchorBrackets because they have no default number of items to take from the stack.
Lowth.com: [ Home | Rope | P2PWall | LinWiz | cutter | Protector - Free Antivirus software | TapeIO ]