compat.scm 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!r6rs
  2. ;;; compat.guile.sls --- include compatibility for Guile
  3. ;; Copyright (C) 2010 Andreas Rottmann <a.rottmann@gmx.at>
  4. ;; This program is free software, you can redistribute it and/or
  5. ;; modify it under the terms of the MIT/X11 license.
  6. ;; You should have received a copy of the MIT/X11 license along with
  7. ;; this program. If not, see
  8. ;; <http://www.opensource.org/licenses/mit-license.php>.
  9. ;;; Commentary:
  10. ;;; Code:
  11. (library (arguile lib private include compat)
  12. (export stale-when
  13. read-annotated
  14. annotation?
  15. annotation-expression
  16. file-mtime
  17. merge-path
  18. library-search-paths)
  19. (import (rnrs base)
  20. (rnrs io simple)
  21. (arguile lib private include utils)
  22. (prefix (only (guile)
  23. %load-path
  24. stat
  25. stat:mtime)
  26. guile:))
  27. (define-syntax stale-when
  28. (syntax-rules ()
  29. ((_ conditition body ...)
  30. (begin body ...))))
  31. (define (read-annotated port)
  32. (read port))
  33. (define (annotation? thing)
  34. #f)
  35. (define (annotation-expression thing)
  36. thing)
  37. (define (merge-path path origin)
  38. (string-append origin "/" (string-join path "/")))
  39. (define (file-mtime filename)
  40. (let ((st (guile:stat filename)))
  41. (guile:stat:mtime st)))
  42. (define (library-search-paths)
  43. guile:%load-path)
  44. )