Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun getzips ()
- (uiop:directory-files (merge-pathnames "zips/" (asdf:system-source-directory :fx))))
- (defun substrn (path start end)
- (let* ((s (namestring path))
- (len (length s)))
- (subseq s (- len start) (- len end))))
- (defun getyear (path)
- (parse-integer (substrn path 10 6)))
- (defun getmonth (path)
- (parse-integer (substrn path 6 4)))
- (defun getym (path)
- (parse-integer (substrn path 10 4)))
- (defun getaskbid (path)
- (substrn path 13 10))
- (defun getsymbol (path)
- (substrn path 22 16))
- (defun makefilehash (zips)
- (let ((h (make-hash-table :test 'equal)))
- (iter (for f in zips)
- (let ((year (getyear f))
- (month (getmonth f))
- (symbol (getsymbol f))
- (askbid (getaskbid f)))
- (unless (gethash askbid h)
- (setf (gethash askbid h) (make-hash-table :test 'equal)))
- (unless (gethash symbol (gethash askbid h))
- (setf (gethash symbol (gethash askbid h)) (make-hash-table :test 'equal)))
- (unless (gethash year (gethash symbol (gethash askbid h)))
- (setf (gethash year (gethash symbol (gethash askbid h))) (make-hash-table :test 'equal)))
- (setf (gethash month (gethash year (gethash symbol (gethash askbid h)))) f)
- ))
- h)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement