Anonymous user
Case-sensitivity of identifiers: Difference between revisions
Changed again the whole code.
m (Corrected typo.) |
(Changed again the whole code.) |
||
Line 984:
:– moreover, underline is ignored in identifiers (style insensitivity).
With these rules, we don’t get one dog or three dogs: we get two dogs!
<lang Nim>var dog, Dog: string
(dog, Dog, DOG) = ("Benjamin", "Samba", "Bernie")
if dog == Dog:
if dog == DOG:
echo "There is only one dog, ", DOG)
else:
echo "There are two dogs: ", dog, " and ", DOG
elif Dog == DOG :
echo "There are two dogs: ", dog, " and ", DOG
else:
echo "There are three dogs: ", dog, ", ", Dog, " and ", DOG</lang>
{{out}}
<pre>There are two dogs: Benjamin and Bernie</pre>
=={{header|Oberon-2}}==
|