Expression lists
The right-hand side of a binary operation in Rockstar can be a list of primary expressions.
Print 1 + 2, 3, 4 n' 5. (prints: 15)
Print 10 - 4, 3, 2 & 1. (prints: 0)
Print 27 / 3, 3 (prints: 3)
Print 1 * 2, 3, 4 & 5 (prints: 120)
Print 1 + 2, 3, 5 'n' 6 (prints: 17)
My world says baby
My heart says, yeah
Shout my world with my heart, my heart, my heart
(prints: baby, yeah, yeah, yeah)
Compound Expressions
Languages like C support shorthand expressions like x++
, x += 2
, and so on.
The equivalent in Rockstar looks like this:
X is 1
X is with 2
Print X (prints: 3)
Y is 5
It is without 3
Print it. (prints: 2)
Z is 100
It is over 5, 4, & 2
Shout it (prints: 2.5)