+= operator not working anymore?

hehimself
Posts:9
Joined:Wed Oct 23, 2019 6:22 am
+= operator not working anymore?

Postby hehimself » Wed Oct 23, 2019 2:16 pm

I just upgraded from Ember 1.9 to Ember 2.0. First thing I tried was recompiling my libraries that compile smoothly with Ember 1.9. Ember 2.0 throws a syntax error at a construct similar to '$a += $b;'

Error at line 587 of script 'library.lite'.
Error is 'syntax error near [+=]'

When I change to '$a = $a + $b' the error message is gone. The same error is thrown for all instances of += in my library. It would not be a big deal replacing all instances of the += operator, but my guess is that it should work as described on page 3 of the Ember manual.

Cheers
Gerhard

hehimself
Posts:9
Joined:Wed Oct 23, 2019 6:22 am

Re: += operator not working anymore?

Postby hehimself » Fri Oct 25, 2019 3:13 pm

A little followup:

I started with Debian 10 Buster. After some discussions with the guys at IT I switched to Ubuntu 14. I again ran into the already discussed and solved error with popen_exec.c. Other than Debian the Ubuntu compiler threw a couple of warnings, usually complaining about destination structs providing less memory than the expressions filling the structs were yielding. I'm too bad with Unix and C to see if this is relevant . . .

BUT, same error with += operator with Ubuntu 14:

ember -l library.lite
Error at line 587 of script 'library.lite'.
Error is 'syntax error near [+=]'

Recoding the expressions from $a+=$b to $a = $a + $b also works with Ubuntu.

david
Hughes Tech Staff
Posts:25
Joined:Mon Feb 13, 2017 4:55 am

Re: += operator not working anymore?

Postby david » Fri Sep 10, 2021 6:08 am

Hi

Regarding what you described as the "discussed and solved error with popen_exec.c", it has been solved and the fix is in the current release.

As for += and friends, yes, they have been removed for reasons internal to the virtual machine that runs the pcode. I thought that had been removed from the doco, but if not I'll have that fixed.


David
...