Method `*()
- Method
`*
mixed`*(mixedarg1)
mixed`*(objectarg1,mixedarg2,mixed...extras)
mixed`*(mixedarg1,objectarg2)
array`*(arrayarg1,intarg2)
array`*(arrayarg1,floatarg2)
string`*(stringarg1,intarg2)
string`*(stringarg1,floatarg2)
string`*(array(string)arg1,stringarg2)
array`*(array(array)arg1,arrayarg2)
float`*(floatarg1,int|floatarg2)
float`*(intarg1,floatarg2)
int`*(intarg1,intarg2)
mixed`*(mixedarg1,mixedarg2,mixed...extras)- Description
Multiplication/repetition/implosion.
Every expression with the
*operator becomes a call to this function, i.e.a*bis the same aspredef::`*(a,b). Longer*expressions are normally optimized to one call, so e.g.a*b*cbecomespredef::`*(a,b,c).- Returns
If there's a single argument, that argument will be returned.
If the first argument is an object that implements lfun::`*(), that function will be called with the rest of the arguments.
If there are more than two arguments, the result will be
`*(`*(.arg1,arg2), @extras)If
arg2is an object that implements lfun::``*(), that function will be called witharg1as the single argument.Otherwise the result will be as follows:
arg1can have any of the following types:arrayarg2can have any of the following types:int|floatThe result will be
arg1concatenatedarg2times.string|arrayThe result will be the elements of
arg1concatenated witharg2interspersed.stringThe result will be
arg1concatenatedarg2times.int|floatThe result will be
, and will be a float if eitherarg1*arg2arg1orarg2is a float.- Note
In Pike 7.0 and earlier the multiplication order was unspecified.
- See also