Cheddar icon indicating copy to clipboard operation
Cheddar copied to clipboard

Number * Array Gives Error

Open kckennylau opened this issue 7 years ago • 2 comments

print [4]*5 produces [4, 4, 4, 4, 4] as expected, but print 5*[4] is an error.

kckennylau avatar Jun 19 '17 12:06 kckennylau

Source diving shows that Number has undefined behaviour for a * b where b is neither a Number nor String. Source.

Y no define behavior? :sob:

schas002 avatar Jun 20 '17 06:06 schas002

@schas002 NO_OP_BEHAVIOR does not mean undefined behavior

vihanb avatar Jun 20 '17 14:06 vihanb