( 2.31.New operators: 'eq', 'ne', 'last', '..' ) ?
Grant Edwards
grant at nowhere.
Thu Jan 20 08:52:53 EST 2000
In article <38862948.5AEE964C at roguewave.com>, Bjorn Pettersen wrote:
>Evguenii Smogailov wrote:
>
>> On 19 Jan 2000, Stephen Coursen wrote:
>> > When did this become a trait of Perl? Gods, what's so hard about knowing
>> > that == is the equality operator?
>>
>> Well, just the same reason as for replacing '||', '&&' with 'or', 'and'.
>
>I see... so you don't really want eq, gt, and ne; you want equal, greater, and
>not equal.
No, no, that would be too hard to read. We really need the
operators 'is_greater_than' 'is_less_than' 'is_equal_to'.
Ideally, the underscores should be spaces, but that might be
problematic.
As long as we're at, I think we should try to make Python code
not only more readable but also more polite. Rather than yet
another imperitive language, the world needs more polite
request languages!
I'm proposing the mandatory use of the keywords 'please',
'excuse_me', 'I'm_sorry' and 'thank_you'. 'Please' will be
used in most of the places where ':' is currently found, and
'thank_you' will be required syntax in the code path were an
exception doesn't occur, or an the end of any block. 'I'm
sorry' will be required in all exception handling code, and
'excuse_me' will be semantically meaningless, but programs will
be required to have at least 5% of the keywords to be
'excuse_me'
excuse_me, try please
if A is_greater_than B please
return A
else please
return B
thank_you
except please
print "exception occurred"
I'm_sorry
thank_you
For non-english speaking localities (or areas with high
concentrations of Modula-3 programmers), the same key words
will be used, but we'll just type the louder, slower, and with
exagerated pronunciation:
E_X_C_U_S_E__M_E, try P_L_E_A_S_E
if A IS_GREATER_THAN B P_L_E_A_S_E
RETURN A
else P_L_E_A_S_E
return B
T_H_A_N_K__Y_O_U
except P_L_E_A_S_E
print "exception occurred"
I'M_S_O_R_R_Y
T_H_A_N_K__Y_O_U
This latter option is based on the fact that everybody
understands English if you speak slowly and loudly (of course
using a bit of an accent to try to sound like the locals who
_do_ speak English is also recommended).
--
Grant Edwards grante Yow! RHAPSODY in Glue!
at
visi.com
More information about the Python-list
mailing list