Python for air traffic control?
Mirko Liss
mirko.liss at web.de
Tue Jul 3 21:32:32 EDT 2001
On 3 Jul 2001, Russ wrote:
> Consider the type checking in C or C++, for example. Suppose that a
> function takes several ints (or any other type) as arguments, and
> suppose the calls of the function all pass ints in the correct slots.
> The compiler will be perfectly happy. Does that assure that the
> arguments are passed correctly? Of course not. It is a necessary but
> not sufficient condition for correctness. The arguments could be
> completely out of order, and the compiler wouldn't have a clue.
If the arguments of a function are out of order, the compiler
should bark and die, shouldn´t it?
Most programmers use type definitions deliberately, just to provoke
that kind of compile-time errors.
An example in C:
typedef plane_t int ; /* plane no */
typedef lane_t int ; /* lane no */
typedef go_down_in_pieces_t bool ;
go_down_in_pieces_t dispatch( plane_t flightno, \
lane_t neigboring_highway ) ;
If the arguments get swapped, the compiler gets angry.
Is this what you wanted to have in C ?
Run-time exceptions should be treated differently than
compile-time errors and warnings.
In Python, you end up with lots of possible exceptions
at run-time. Supposedly, you might want to drop dynamic
typing for your kind of application.
Regards,
Mirko
More information about the Python-list
mailing list