Does elisp have a way to jump to (goto) labels in the code, ala common lisp's go?

   (setq val 2)
   (go lp)
   (incf val 3)
   lp (incf val 4)) =>  NIL
 val =>  6 

PS: This is a question about control flow, not jumping to locations in files.

  • The cl-lib library offers cl-tagbody (and, I presume, friends), which offers some of the common lisp primitives to do this sort of thing.
    – Dan
    Commented Sep 22, 2021 at 16:03
  • @Dan Thanks, that's the answer.
    – HappyFace
    Commented Sep 22, 2021 at 16:06

1 Answer 1


It works exactly the same, we just need to use cl-tagbody instead.

 (setq val 2)
 (go lp)
 (incf val 3)
 lp (incf val 4))


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.