|
|
Label: ♦english
|
[57] Summary of language revision proposals |
Comment |
fu
created at Friday, 2009-03-13, 23:19:43
fu
modified at Tuesday, 2009-03-17, 22:41:51
0 Replies, 1156 Hits
Summary of language revision proposals
Many thanks to those who have made these proposals.
- Omit @ for the coroutine creation in the presence of yield
statement.
Andrew Cooke (python-list)
After this changing:
- calling to a function without yield statement
will invoke that function;
- calling to a function with yield statement
will create and return a coroutine or generator object.
- For the self increment or decrement operations ( ++i, --i, i++, i-- ),
support only the prefix ones,
to avoid confusion for people from other languages.
Andor (newsmth.net), and others
- double precision, change to use D suffix instead of 00 ending,
which can become a pitfall in generated codes;
Andor (newsmth.net)
- multiple cases for the same code block in switch-case statements:
use comma instead of colon to seperate the cases.
Andor (newsmth.net)
Without such modification, there will be a pitfall
after commenting a code block:
switch ( value ) { case C1 : case C2 : case C3 : do_sth_else(); default: }
after the modification, it will be OK:
switch( value ) { case C1 : case C2 , C3 : do_sth_else(); default: }
- list/map/tuple/array construction with keywords like:
list(...), map/dict(...), tuple(...), array(...).
Andor (newsmth.net)
they are not absolutely necessary, but could be insteresting
to somebody.
- a few coding style enforcements:
compulsory white space between statement keywords and brackets,
and compulsory no white space between function name and brackets?
Andor (newsmth.net)
- Tuple construction: compulsory field operator =>
for the first item, like:
tup1 = ( x => 1.0, 2.0 ) tup2 = ( => 1.0, 2.0 ) tup3 = ( => 1.0 )
this will solve the problem that sometimes during code modifications,
a tuple expression may be reduced to ( expression )
will not be treated as a tuple.
However, this problem maybe is not serious, since Dao has a typing system,
which can detect the error at compiling time because of the inconsistent
assignment of ( expression ) to a tuple variable,
or because of the inconsistent use of the variable that is supposed to
be certain type of tuple.
If you have any suggestions or comments, please post them as follow-up.
Many thanks in advance.
Comments
|
| | | 1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 |
fu: ...
I forgot to say something about the plan for the whole new year in my previous reply. Well, besides w ... (Jan.19,01:40)
fu: ...
Happy new dragon year (which will start from this sunday)!
Actually, it was a busy month (I wish th ... (Jan.18,22:46)
|