Python3k extended grammar

Steven D. Arnold stevena at permanent.cc
Fri May 19 02:57:34 EDT 2000


At 02:53 PM 5/18/2000 -0400, Roy Katz wrote:
>    int = Integer
>    def add( (int) x, (int) y )     # specifies type of the parameter
>            return int;             # specifies the return type
>            raise  exGenException:  # specifies the exceptions thrown
>
>         z = x + y                  # body
>         return z                   # exit.

I like your style better than the alternative; note I haven't read the 
TYPE-SIG stuff in detail yet.  I agree that the spirit of python seems to 
favor making things as clear as possible, avoiding either perl-style 
terseness or COBOL-style wordiness.  The words that you use make the 
meaning clearer to me than do the symbols.


>(what kind of situation
>necessates changing the starting array index from 0, anyway?).

Perhaps for UNIX nice values, which range from -20 to 20.  I don't so much 
dislike the idea itself; it's just that setting a variable such as:

         $[ = -20;

...almost couldn't be uglier.  On the other hand, python's pleasant class 
interface makes you want to write a class to handle nice values, if they 
needed special management, and just keep lists zero-based so everyone can 
easily maintain it.


steve


--
Steven D. Arnold          Que quiero sera           stevena at permanent.cc
"We choose to go to the moon in this decade and do the other things, not
because they are easy, but because they are hard."    -- John F. Kennedy





More information about the Python-list mailing list