All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

throw-if-tag-found Macro

Summary

Throws to a specified catch tag or returns nil if the catch tag is not found.

Package

hcl

Signature

throw-if-tag-found catch-tag result-form => result

Arguments
catch-tag
A catch tag.
result-form
A Lisp form.
Values
result
nil if a non-local exit does not occur.
Description

The macro throw-if-tag-found checks whether it can find the catch tag catch-tag by using find-throw-tag. If it finds catch-tag it throws to catch-tag the value(s) of evaluating result-form. Otherwise throw-if-tag-found returns nil, without evaluating result-form.

The throwing operation is done by a normal throw. Therefore the only the difference between this and cl:throw is when the tag is not found. In this case, cl:throw would evaluate the result form and then give an error, but throw-if-tag-found simply returns nil.

See also

find-throw-tag


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35