Python from Wise Guy's Viewpoint
Duncan Booth
duncan at NOSPAMrcp.co.uk
Tue Oct 21 06:56:10 EDT 2003
Alex Martelli <aleax at aleax.it> wrote in
news:WP7lb.322453$R32.10677047 at news2.tin.it:
> Duncan Booth wrote:
> ...
>>> Indeed, such languages as Visual Basic and Ruby do allow calling
>>> without parentheses, no doubt because of this "nice look" thing.
>>
>> I know we are agreed that Visual Basic is fundamentally broken, but it
>> might be worth pointing out the massive trap that it provides for
>
> I'm not sure, but I think that's one of the many VB details changed
> (mostly for the better, but still, _massive_ incompatibility) in the
> current version (VB7 aka VB.NET) wrt older ones (VB6, VBA, etc).
>
Yes, I just checked and VB7 now requires parentheses on all argument lists,
so:
someProcedure x
is now illegal.
someProcedure(x)
and
call someProcedure(x)
now do the same thing. The Visual Studio.Net editor will automatically
'correct' the first form into the second (unless you tell it not to).
Of course, while it is less likely to cause a major headache, the confusing
behaviour is still present, just pushed down a level. These are both legal,
but the second one ignores changes to x. At least you are less likely to
type it accidentally.
someProcedure(x)
someProcedure((x))
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list