Jump to content

Undefined values: Difference between revisions

→‎{{header|Delphi}}: Adds Déjà Vu example
(Added Erlang)
(→‎{{header|Delphi}}: Adds Déjà Vu example)
Line 237:
 
If P was a Class only the Assigned function would be available; in addition Dispose would have to be replaced by FreeAndNil or calling the .Free method of the instance. For Interfaces no such last call would be necessary as simple removal of the reference would be sufficient to trigger the Garbage Collector.
=={{header|Déjà Vu}}==
There is no undefined value in Déjà Vu. Instead, trying to access an undefined variable raises an exception.
<lang dejavu>try:
bogus
catch name-error:
!print "There is *no* :bogus in the current context"
return
!print "You won't see this."</lang>
If you need to declare a local variable, but don't have a value for it yet, there is the standard function <code>undef</code>, which raises an exception when called but is an actual value that can be passed around and assigned to names.
 
=={{header|E}}==
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.