GassaFM / interpr

Toy language to learn parallel computing
MIT License
5 stars 4 forks source link

Incorrect exception message while multiplication of array and number #34

Closed lounres closed 3 years ago

lounres commented 3 years ago

Such code fragment as

function sum (id, pr, n, a):
    m := array(5)
    m := m * 2

is not enterpreted but error message is

step 3, id 0, line 3: no such variable: m

that is strange. It is more reasonable to see something like

step 3, id 0, line 3: unsupported operand type(s) for +: integer and array

(like in Python) instead of previous one.

petsernik commented 3 years ago

See question #29 for information on this (the spaces of arrays and variables are separated, so in your example the variable m is undefined)

lounres commented 3 years ago

OK, I understand. Thank you.