the X-Y block doesn't have a drawer like + and * and I've now got used to having one :)
The x / y doesn't have one either but its going to be a rare event to want to use one so not too bothered about that
Simon
x - y block: no drawer
Moderator: MSandro
Re: x - y block: no drawer
Yes, that's intentional.
Addition and multiplication are "associative", meaning that you can apply the operations in any order and get the same result. That is:
(a + b) + c equals a + (b + c)
The same is not true of subtraction or multiplication:
a - (b - c) is not the same as (a - b) - c
Of course, we could adopt a convention, such as left-to-right associativity, but then people would need to know or guess that rule. That's harder for newcomers to GP, and even experts might sometimes misread such code. I would rather have the grouping be made explicit by the programmer, a practice I follow myself in every programming language I use, even if the language doesn't require it.
Note that if you want:
(((a - b) - c) - d) - ...
then you can use:
a - (+ b c d ...)
which is only one extra block.
Addition and multiplication are "associative", meaning that you can apply the operations in any order and get the same result. That is:
(a + b) + c equals a + (b + c)
The same is not true of subtraction or multiplication:
a - (b - c) is not the same as (a - b) - c
Of course, we could adopt a convention, such as left-to-right associativity, but then people would need to know or guess that rule. That's harder for newcomers to GP, and even experts might sometimes misread such code. I would rather have the grouping be made explicit by the programmer, a practice I follow myself in every programming language I use, even if the language doesn't require it.
Note that if you want:
(((a - b) - c) - d) - ...
then you can use:
a - (+ b c d ...)
which is only one extra block.