• Top
    • Documentation
    • Books
      • Cert.pl
      • Community-books
      • Project-dir-alist
      • Bookdata
      • Book-hash
      • Uncertified-books
      • Sysfile
      • Show-books
      • Best-practices
      • Books-reference
        • Include-book
        • Certify-book
        • Cbd
        • Set-write-ACL2x
        • Book-compiled-file
        • Add-include-book-dir
        • Pathname
        • Add-include-book-dir!
        • Full-book-name
        • Delete-include-book-dir
        • With-cbd
          • Delete-include-book-dir!
          • Set-cbd
          • Certify-book-debug
        • Where-do-i-place-my-book
        • Books-tour
      • Recursion-and-induction
      • Boolean-reasoning
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Books-reference

    With-cbd

    To set the connected book directory

    With-cbd provides a way to set the connected book directory (see cbd) within a given scope. For example, evaluation of the following form is equivalent to evaluation of the form, (include-book "arithmetic/top" :dir :system).

    (with-cbd (cdr (assoc-eq :system (project-dir-alist (w state))))
              (include-book "arithmetic/top"))

    See cbd for a description of the connected book directory.

    General Form:
    (with-cbd str form)

    where str evaluates to a nonempty string that represents the desired directory (see pathname) and form evaluates to an error-triple. Thus, the effect of (with-cbd str form) is to evaluate first (set-cbd str) and then to evaluate form, after which the connected book directory is restored to the value it had before that evaluation of set-cbd. However, the implementation is designed so that the connected book directory is restored even when the evaluation of form causes an error.

    The form (with-cbd str ev) is an event form if ev is an event form; thus, it may occur in books as well as encapsulate and progn events. See embedded-event-form.