joy.in 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!@GUILE@ --no-auto-compile
  2. -*- scheme -*-
  3. !#
  4. ;;; Joy -- implementation of the Joy programming language
  5. ;;; Copyright © 2016, 2017 Eric Bavier <bavier@member.fsf.org>
  6. ;;;
  7. ;;; Joy is free software; you can redistribute it and/or modify it under
  8. ;;; the terms of the GNU General Public License as published by the Free
  9. ;;; Software Foundation; either version 3 of the License, or (at your
  10. ;;; option) any later version.
  11. ;;;
  12. ;;; Joy is distributed in the hope that it will be useful, but WITHOUT
  13. ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  14. ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  15. ;;; License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with Joy. If not, see <http://www.gnu.org/licenses/>.
  19. (let ()
  20. (define-syntax-rule (push! elt v) (set! v (cons elt v)))
  21. (define (maybe-augment-load-paths!)
  22. (unless (getenv "JOY_UNINSTALLED")
  23. (push! "@joymoduledir@" %load-path)
  24. (push! "@guilemoduledir@" %load-path)
  25. (push! "@guileobjectdir@" %load-compiled-path)))
  26. (define (run-joy-main)
  27. (let ((joy-main (module-ref (resolve-interface '(joy ui))
  28. 'joy-main)))
  29. (apply joy-main (program-arguments))))
  30. (maybe-augment-load-paths!)
  31. (exit (run-joy-main)))