PageRenderTime 23ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/util/misc.lisp

http://github.com/skypher/cl-oauth
Lisp | 25 lines | 18 code | 7 blank | 0 comment | 1 complexity | 8d94a6fffb2a4eabd40ae74f918142d0 MD5 | raw file
Possible License(s): LGPL-3.0
  1. (in-package :oauth)
  2. (defun alist->plist (alist)
  3. "Converts an alist to plist."
  4. (let ((keyword-package (find-package :keyword)))
  5. (loop for i in alist
  6. collect (if (symbolp (car i))
  7. (intern (symbol-name (car i)) keyword-package)
  8. (intern (string-upcase (car i)) keyword-package))
  9. collect (cdr i))))
  10. (defun splice-alist (alist)
  11. (reduce #'nconc (mapcar (lambda (x)
  12. (list (car x) (cdr x)))
  13. alist)))
  14. (defun between (what lower upper)
  15. (and (>= what lower) (<= what upper)))
  16. (defconstant +unix-to-universal-time+ 2208988800)
  17. (defun get-unix-time (&optional (ut (get-universal-time)))
  18. (- ut +unix-to-universal-time+))