Icon+Unicon/Intro: Difference between revisions

Content added Content deleted
Line 224: Line 224:
=== Procedure Controls ===
=== Procedure Controls ===
====return expr====
====return expr====
Default value of expr is ''&null''. Apart from the usual meaning of ''return'', if the ''expr'' value fails, then the procedure actually fails too, ie does not yield a value. See description of ''fail'' keyword. If the ''expr'' is capable of yielding more than one result, only the first result is asked for and used.
Default value of expr is ''&null''. Apart from the usual meaning of ''return'', if the ''expr'' fails, then the procedure fails tas well. See [[Icon%2BUnicon/Intro#Failure_is_an_Option|Failure is an Option]] above. If the ''expr'' is capable of yielding more than one result, only the first result is used.

====fail====
====fail====
Causes the the enclosing procedure to terminate without returning value. This is different from returning void or a null value that many other languages do when the code does not return an actual value.
Causes the the enclosing procedure to terminate without returning value. This is different from returning void or a null value that many other languages do when the code does not return an actual value.