1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
guile/module/scheme/process-context.scm
Mark H Weaver 2d76447bda Support R7RS.
* module/Makefile.am: Add r7rs-libraries.scm as dependency for boot-9.go.
  (SOURCES): Add $(R7RS_SOURCES).
  (R7RS_SOURCES): New variable.
  (NOCOMP_SOURCES): Add ice-9/r7rs-libraries.scm.

* module/ice-9/boot-9.scm: Include r7rs-libraries.scm.
  (%cond-expand-features): Add r7rs, exact-closed, ieee-float,
  full-unicode, and ratios.  Add TODO comments.
  (%cond-expand): New procedure, derived from code in 'cond-expand'.
  (cond-expand): Reimplement in terms of '%cond-expand'.

* module/ice-9/r7rs-libraries.scm:
  module/scheme/base.scm:
  module/scheme/case-lambda.scm:
  module/scheme/char.scm:
  module/scheme/complex.scm:
  module/scheme/cxr.scm:
  module/scheme/eval.scm:
  module/scheme/file.scm:
  module/scheme/inexact.scm:
  module/scheme/lazy.scm:
  module/scheme/load.scm:
  module/scheme/process-context.scm:
  module/scheme/r5rs.scm:
  module/scheme/read.scm:
  module/scheme/repl.scm:
  module/scheme/time.scm:
  module/scheme/write.scm: New files.
2014-08-14 03:37:23 -04:00

42 lines
1.6 KiB
Scheme
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; process-context.scm --- The R7RS process-context library
;; Copyright (C) 2013 Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
;; License as published by the Free Software Foundation; either
;; version 3 of the License, or (at your option) any later version.
;;
;; This library 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
;; Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
(define-library (scheme process-context)
(export command-line
exit
emergency-exit
get-environment-variable
get-environment-variables)
(import (scheme base)
(only (srfi srfi-13) string-index)
(rename (only (guile)
command-line
exit primitive-_exit
getenv environ)
(primitive-_exit emergency-exit)
(getenv get-environment-variable)))
(begin
(define (get-environment-variables)
(map (lambda (s)
(let ((i (string-index s #\=)))
(cons (substring s 0 i)
(substring s (+ i 1) (string-length s)))))
(environ)))))