Commits

Taku Miyakawa committed 9ca3979

Adds an example of assignment operators in the manual

Comments (0)

Files changed (1)

src/doc/language/syntax.rst

       - ``A.op_pow_set(B)``
       - Stores the power in A
 
+Assignment operators are usually used for assignments.
+For example:
+
+::
+
+    :NUM = 42
+    printline(NUM)  # => 42
+
+    :NUM *= 2
+    printline(NUM)  # => 84
+
+    [:X :Y :Z] = ['voxxx' 'twift' 'peng']
+    printline([X Y Z])  # => ['voxxx' 'twift' 'peng']
+
 Note that right-hand-side values of ``||=`` and ``&&=`` are generated as a body chunk of a function.
 Therefore, values of pseudo variables such as \\env, \\args and \\0
 differ from ones on the enclosing context.