Advertisement
Guest User

Untitled

a guest
May 2nd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.57 KB | None | 0 0
  1. (defun findmissing (fh)
  2.   (maphash #'(lambda (askbid h)
  3.                (format t askbid)
  4.                (maphash #'(lambda (symbol h)
  5.                             (format t symbol)
  6.                             (let* ((years (hash-table-keys h))
  7.                                    (minyear (apply #'min years))
  8.                                    (maxyear (apply #'max years))
  9.                                    (maphash #'(lambda (year h)
  10.                                                 (let* ((months (hash-table-keys h))
  11.                                                        (startmonth (if (equal year minyear)
  12.                                                                        (apply #'min months)
  13.                                                                        1))
  14.                                                        (endmonth (if (equal year maxyear)
  15.                                                                      (apply #'max months)
  16.                                                                      12)))
  17.                                                   (format t "missing ~a"
  18.                                                           (set-difference (iota
  19.                                                                            (+ endmonth 1)
  20.                                                                            :start startmonth)
  21.                                                                           months))))
  22.                                             h))))
  23.                         h))
  24.            fh))
  25.  
  26.  
  27.  
  28. 1 compiler notes:
  29.  
  30. fx.lisp:56:25:
  31.   style-warning: The variable H is defined but never used.
  32.  
  33. fx.lisp:61:36:
  34.   error:
  35.     The LET* binding spec (MAPHASH
  36.                            #'(LAMBDA (YEAR H)
  37.                                (LET* ((MONTHS (HASH-TABLE-KEYS H))
  38.                                       (STARTMONTH
  39.                                        (IF (EQUAL YEAR MINYEAR)
  40.                                            (APPLY #'MIN MONTHS)
  41.                                            1))
  42.                                       (ENDMONTH
  43.                                        (IF (EQUAL YEAR MAXYEAR)
  44.                                            (APPLY #'MAX MONTHS)
  45.                                            12)))
  46.                                  (FORMAT T "missing ~a"
  47.                                          (SET-DIFFERENCE
  48.                                           (IOTA (+ ENDMONTH 1) :START STARTMONTH)
  49.                                           MONTHS))))
  50.                            H) is malformed.
  51.  
  52. Compilation failed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement