• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Std/io
      • Oslib
      • Bridge
      • Clex
        • Example-lexer
        • Sin
          • Strin-p
            • Strin
            • Make-strin
            • Strin-left
            • Change-strin
            • Strin-get-file
            • Strin-get-col
            • Strin-nthcdr
            • Strin-get-line
            • Strin-cdr
            • Strin-find
            • Honsed-strin
            • Make-honsed-strin
            • Strin-matches-p
            • Strin-imatches-p
            • Strin-firstn
              • Strin-count-charset
              • Empty-strin
              • Strin-nth
              • Strin-len
              • Strin-endp
              • Strin-car
              • Strin->chars
              • Strin->line
              • Strin->col
              • Strin->file
            • Sin$c
          • Matching-functions
          • Def-sin-progress
        • Tshell
        • Unsound-eval
        • Hacker
        • ACL2s-interface
        • Startup-banner
        • Command-line
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Strin-p

    Strin-firstn

    Extract the first n characters as a string.

    Signature
    (strin-firstn n x) → *
    Arguments
    n — Number of characters to extract.
        Guard (natp n).
    x — The input stream.
        Guard (strin-p x).

    We just leave this enabled.

    Definitions and Theorems

    Function: strin-firstn

    (defun strin-firstn (n x)
      (declare (xargs :guard (and (natp n) (strin-p x))))
      (declare (xargs :guard (<= n (strin-len x))))
      (let ((__function__ 'strin-firstn))
        (declare (ignorable __function__))
        (coerce (take n (strin-left x))
                'string)))