• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Java
        • C
        • Syntheto
        • Number-theory
        • Cryptography
        • Lists-light
        • File-io-light
          • Read-file-into-byte-array-stobj
          • Read-file-into-character-array-stobj
          • Write-strings-to-file!
          • Write-strings-to-file
          • Write-bytes-to-file!
          • Read-object-from-file
          • Write-strings-to-channel
          • Write-bytes-to-file
          • Write-bytes-to-channel
            • Read-objects-from-file
            • Read-file-into-byte-list
            • Read-file-into-character-list
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • File-io-light

    Write-bytes-to-channel

    Write bytes to an output channel.

    ;; Writes the BYTES to CHANNEL.  Returns STATE.
    (defund write-bytes-to-channel (bytes channel state)
      (declare (xargs :stobjs state
                      :guard (and (all-bytep bytes)
                                  (symbolp channel)
                                  (open-output-channel-p channel :byte state))
                      :guard-hints (("Goal" :in-theory (enable open-output-channel-p
                                                               open-output-channel-p1 ; todo
                                                               )))))
      (if (atom bytes)
          state
        (pprogn (write-byte$ (car bytes) channel state)
                (write-bytes-to-channel (cdr bytes) channel state))))