Undefined values: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Modified comments to stress creation/deletion. There is no 'undefined' value to give.) |
m (→[[Undefined values#ALGOL 68]]: rename some variables) |
||
Line 9: | Line 9: | ||
Note: Some implementations (eg [[ALGOL 68C]]) also have a procedure named ''undefined'' that is called to indicated that the behaviour at a particular point in a program is unexpected, undefined, or non-standard. |
Note: Some implementations (eg [[ALGOL 68C]]) also have a procedure named ''undefined'' that is called to indicated that the behaviour at a particular point in a program is unexpected, undefined, or non-standard. |
||
<lang algol68>MODE |
<lang algol68>MODE R = REF REAL; |
||
R r := NIL; |
|||
MODE U = UNION(COMPL, VOID); |
MODE U = UNION(COMPL, VOID); |
||
U u := EMPTY; |
U u := EMPTY; |
||
IF |
IF r IS R(NIL) THEN |
||
print((" |
print(("r IS NIL", new line)) |
||
ELSE |
ELSE |
||
print((" |
print(("r ISNT NIL", new line)) |
||
FI; |
FI; |
||
Line 24: | Line 24: | ||
(VOID):print(("u is EMPTY", new line)) |
(VOID):print(("u is EMPTY", new line)) |
||
OUT print(("u isnt EMPTY", new line)) |
OUT print(("u isnt EMPTY", new line)) |
||
ESAC |
ESAC |
||
</lang> |
|||
Output: |
Output: |
||
<pre> |
<pre> |
||
r IS NIL |
|||
u is EMPTY |
u is EMPTY |
||
</pre> |
</pre> |