From Newsgroup: comp.lang.ada
Stefan Ram <
[email protected]> schrieb: |------------------------------------------------------------------------|
|"[. . .] |
| |
| I think the character case aspect is similar in Python and C: |
| |
| The following program has a case-related bug, and Python shows |
| no error message: |
| |
|c = 299792458 |
|C = 1 | |print( f"The speed of light is {C}." ) |
| |
| . But the same can be written in C: |
| |
|[. . .]" | |------------------------------------------------------------------------|
This bug cannot happen in Ada.
|------------------------------------------------------------------------|
|" But here's a Python program trying to use an integer as an associative|
| array: |
| |
|c = {} # associative array |
|C = 1 # integer |
|key = 0 # example key | |value = 0 # example value |
|C[ key ]= value |
| |
| Console Transcript |
| | |Traceback (most recent call last): |
| File "demo.py", line 5, in <module> |
| C[ key ]= value | |TypeError: 'int' object does not support item assignment |
| |
| . That's typing at work!" | |------------------------------------------------------------------------|
Ada compilers refuse to let this mistake even become compiled, so an Ada-runtime executive does not perpetrate such a crash. This is a
crosspost to comp.lang.ada
(S.
HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)
--- Synchronet 3.22a-Linux NewsLink 1.2