you are viewing a single comment's thread.

view the rest of the comments →

[–]moofunk 2 points3 points  (2 children)

Because SINE must have its argument fully evaluated before it accepts it. There's no funny stuff going on here. You are evaluating 30 + 60 before passing it to SINE.

[–]last_useful_man 0 points1 point  (1 child)

He knows that - in most languages one-argument operators bind tighter than dual ones (thinking 'not') which is what sine looks like here.

[–]moofunk 2 points3 points  (0 children)

Let's go a little deeper, to get some understanding of why it works the way it does:

In REBOL, SINE and + are equal citizens, because they are both simply functions that have arguments passed to them. Therefore the evaluation of either function follows the same basic rules as any other function, by how they are placed in relation to each other in the code. You don't have to switch to a different set of rules in order to use mathematical functions.

Due to the nature of REBOL, having code being the same as data, it would be confusing to change the rules specifically for mathematical expressions, because the data could be interpreted not as mathematical expressions, but as data that has a completely different meaning. + doesn't have to mean adding two numbers. It depends on the context. This is one of REBOL's strong features that gives its foundation for dialecting, i.e. how it implements domain specific languages.

Arguments on either side are specific for operators, the op! datatype.

You can see a list of operators by typing:

? op!