User Tools


Special Operator GO

Syntax

  • go tag

Arguments and Values

Description

go transfers control to the point in the body of an enclosing tagbody form labeled by a tag eql to tag.

If there is no such tag in the body, the bodies of lexically containing tagbody forms (if any) are examined as well. If several tags are eql to tag, control is transferred to whichever matching tag is contained in the innermost tagbody form that contains the go. The consequences are undefined if there is no matching tag lexically visible to the point of the go.

The transfer of control initiated by go is performed as described in \secref\TransferOfControl.

Examples

(defvar *val*) (tagbody (setf *val* 2) (go lp) (incf *val* 3) lp (incf *val* 4))

NIL

*val*

6

The following is in error because there is a normal exit of the tagbody before the go is executed.

(let ((a nil)) (tagbody t (setf a #'(lambda () (go t)))) (funcall a))

Error: attempt to GO to a tag that no longer exists.

The following is in error because the tagbody is passed over before the go form is executed.

(funcall (block nil (tagbody a (return #'(lambda () (go a))))))

Error: attempt to GO to a tag that no longer exists.

Affected By

None.

Exceptional Situations

None.

See Also

Notes

None.

\issue{EXIT-EXTENT:MINIMAL}