[Python-ideas] Modern language design survey for "assign and compare" statements

Julien Salort listes at salort.eu
Tue May 22 15:22:43 EDT 2018


Le 20/05/2018 à 03:43, Steven D'Aprano a écrit :

> I've somewhat arbitrarily cut the list off at "languages ranked above 1%
> on TIOBE", but we have to cut the list of somewhere. And of course in
> certain specific industries the standard languages may be very
> different, e.g. there are still tens of millions of lines of COBOL code
> being maintained in the banking industry.
And also many lines of Matlab/Octave code in experimental science.
Surprisingly enough, it seems that Matlab does not support AE, but GNU 
Octave does.
I don't know if that was ever discussed when GNU Octave was designed.

octave:1> y=(x=2)+1
y =  3
octave:2> x
x =  2

versus Matlab R2018b:
 >> y=(x=2)+1
  y=(x=2)+1
      ↑
Error: Incorrect use of '=' operator. To assign a
value to a variable, use '='. To compare values for
equality, use '=='.

Julien


More information about the Python-ideas mailing list