expression
.multiply
This function is overloaded, it supports these signatures:
expression
.multiply(
exp
)
The product (i.e., the concatenation) of two expressions:
a.multiply(b)
=>ab
.expression
.multiply(
num
)
The repeated multiplication (concatenation) of an expression with itself:
a.multiply(3)
=>aaa
. Exponent-1
denotes the infinity: the Kleene star.expression
.multiply((
min
,
max
))
The sum of repeated multiplications of an expression:
a.multiply((2,4))
=>aa+aaa+aaaa
. Whenmin = -1
, it denotes0
, whenmax = -1
, it denotes the infinity.
Preconditions:
min
<=
max
See also:
Examples
Simple Multiplication
Instead of a.multiply(b)
, you may write a * b
.
Of course, trivial identities are applied.
In the case of word labels, adjacent words are not fused: concatenation of two expressions behaves as if the expressions were parenthetized. Pay attention to the space between and below, admittedly too discreet.
Repeated Multiplication
Instead of a.multiply(3)
, you may write a ** 3
.
Beware that a * 3
actually denotes a.rweight(3)
.
Use the exponent -1 to mean infinity
. Alternatively, you may invoke a.star
instead of a ** -1
.
Sums of Repeated Multiplications
Instead of a.multiply((2, 4))
, you may write a ** (2, 4)
. Again, use exponent -1 to mean infinity.