Jump to content

Null object: Difference between revisions

→‎Undefined values: elaborate a bit
(show how to check for undefined names in J)
(→‎Undefined values: elaborate a bit)
Line 294:
If you later assign a value to X in another thread, the original thread will resume and print the result of the addition. This is the basic building block of Oz' [http://c2.com/cgi/wiki?DeclarativeConcurrency declarative concurrency].
===Undefined values===
Access to undefined values (like using an out-of-range array index or a non-existing record feature) will usually provoke an exception in Oz.
 
It is also possible to assign a unique "failed" value to a variable. Such a failed value encapsulates an exception. This can be useful in concurrent programming to propagate exceptions across thread boundaries.
<lang oz>declare
X = {Value.failed dontTouchMe}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.