..
.. is the replicator operator. It reuses the entire left-hand side expression on the right-hand side so you do not have to write it twice.
Syntax
x = any expression with ..
x(id) = any expression with ..
x(id1:id2) = any expression with ..
x(id1:id2,jd1:jd2) = any expression with ..
x(t1~t2) = any expression with ..
Notes
- Whatever appears on the left-hand side is replicated wherever
..appears on the right-hand side. - For example,
very_long_variable_name = any_function(..)is equivalent tovery_long_variable_name = any_function(very_long_variable_name). - Dot notation also works, so
x = ...any_functionis valid when that function supports object-function style. - This behaves like a generalized compound assignment. For example,
x = x + 50can be written asx += 50orx = .. + 50. - The replicator is especially useful when no dedicated compound operator exists, such as
x = sqrt(x), which can be written asx = sqrt(..). - It can also avoid redundant evaluation. In a statement like
x(400~500) = x(400~500).sqrt, the indexed expression is evaluated twice, whilex(400~500) = ...sqrtavoids that duplication.
Examples
long_var_name = [values ..]
long_var_name = values ++ ..
AUX> x=wave("mop");
AUX> x(400~500) = ...sqrt;


Current source basis:
op_replicator.html