Welcome to the CHICKEN Scheme pasting service

salmonella -full-version (git stuff) added by mario-goulart on Sat Jan 7 15:45:11 2017

(define salmonella-full-version
  (let* ((head (handle-exceptions exn
                 #f
                 (with-input-from-file ".git/HEAD" read-line))))
    (if head
        (let* ((rev-file
                (if (string-prefix? "ref: " head)
                    (make-pathname ".git" (substring head 5)) ;; remove "ref: "
                    #f))
               (rev (if rev-file
                        (handle-exceptions exn
                          #f
                          (with-input-from-file rev-file read-line))
                        head)))
          (if rev
              (sprintf
               "~a (rev ~a, branch ~a)"
               salmonella-version
               (substring rev 0 10)
               (if (and rev-file
                        ;; slashes can be mixed up on Windows.
                        ;; make-pathname will use Windows' separator
                        ;; and git may use Unix's separator.
                        (or (string-prefix? ".git/refs/heads/" rev-file)
                            (string-prefix? ".git\\refs/heads/" rev-file)
                            (string-prefix? ".git\\refs\\heads\\" rev-file)))
                   (substring rev-file 16)
                   "<detached>"))
              salmonella-version))
        salmonella-version)))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the one-argument procedure to check if a list is empty?
Visually impaired? Let me spell it for you (wav file) download WAV