Python for air traffic control?
Ralf Muschall
ralf.muschall at alphasat.de
Wed Jul 4 22:12:01 EDT 2001
Mirko Liss <mirko.liss at web.de> writes:
> 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.
No, typedef just creates aliases, *not* types. One might consider
creating something like
typedef struct { int value; } plane_t;
instead (and get bitten by the fact that struct tag names are not
local to the struct scope for some versions of C (i.e. adding
typedef struct { int value; } lane_t;
would clash)).
> at run-time. Supposedly, you might want to drop dynamic
> typing for your kind of application.
Agreed. For stuff like planes I'd use the strictest typing available
(probably something like SML's) in order to get fine-grained
compile-time errors, even from e.g. confusing fuel states given in
gallons or liters. C's is far too weak, I don't remember whether
Pascal also did silent promotions like int->float or similar evil
things.
Ralf
More information about the Python-list
mailing list