mes/module/mes/guile.scm
Jan Nieuwenhuizen fd13741eb3 mescc: Resurrect guile-1.8.
* guile/mescc.scm: Use GUILE_LOAD_COMPILED_PATH instead of -C.
  [guile]: Include syncase.
* module/language/c99/compiler.scm [guile]: Stub pretty-print-c99.
  Set stack to unlimited.
* module/language/c99/info.scm [guile]: Include (ice-9 syncase).
* module/mes/as-i386.scm [guile]: Likewise.
* module/mes/guile.scm [guile]: Add compose, export it.
2018-01-03 08:33:55 +01:00

87 lines
2.9 KiB
Scheme

;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software
;;; Copyright © 2017,2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of Mes.
;;;
;;; Mes is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; Mes is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(define-module (mes guile)
#:export (core:display core:display-error)
;;#:re-export (open-input-file open-input-string with-input-from-string)
)
(cond-expand
(guile
(define core:display display)
(define (core:display-error o) (display o (current-error-port)))
;; (define core:open-input-file open-input-file)
;; (define (open-input-file file)
;; (let ((port (core:open-input-file file)))
;; (when (getenv "MES_DEBUG")
;; (core:display-error (string-append "open-input-file: `" file " port="))
;; (core:display-error port)
;; (core:display-error "\n"))
;; port))
;; (define core:open-input-string open-input-string)
;; (define (open-input-string string)
;; (let ((port (core:open-input-string string)))
;; (when (getenv "MES_DEBUG")
;; (core:display-error (string-append "open-input-string: `" string " port="))
;; (core:display-error port)
;; (core:display-error "\n"))
;; port))
;; (define core:with-input-from-string with-input-from-string)
;; (define (with-input-from-string string thunk)
;; (if (getenv "MES_DEBUG")
;; (core:display-error (string-append "with-input-from-string: `" string "'\n")))
;; (core:with-input-from-string string thunk))
)
(mes))
(cond-expand
(guile-2.2)
(guile-2
(eval-when (compile load eval)
(define-syntax include-from-path
(lambda (x)
(syntax-case x ()
((k filename)
(let ((fn (syntax->datum #'filename)))
(with-syntax ((fn (datum->syntax
#'filename
(canonicalize-path
(or (%search-load-path fn)
(syntax-violation 'include-from-path
"file not found in path"
x #'filename))))))
#'(include fn))))))))
(export include-from-path))
(guile
(use-modules (ice-9 syncase))
(define (compose proc . rest)
(if (null? rest) proc
(lambda args
(proc (apply (apply compose rest) args)))))
(export compose))
(mes))