Closed dbaileychess closed 1 year ago
Wow, this is done with less changes than I expected, and such a nice improvement!
One thing is that you've chose not to reuse the vector ops that are commutative, which leads to more code, but thinking about I may prefer it this way, since it keeps evaluation order. E.g. f() * g()
where these functions have side effects would need some kind of argument swap operation to be passed to *
when reusing the commutative vector op, OR I would need to declare that the evaluation order for operators is implementation defined, whereas so far we have a nice left to right order.
Currently, the binary ops for
numeric struct
and ascalar
only work if the left value is theNumeric Struct
:This PR makes it so the scalar can be the left value.
See
tests/structtest.lobster
for all the implications.