[[project @ 2000-12-06 23:10:39 by ghouston] ghouston**20001206231039 Ignore-this: e7c0ad0ac25f49ff0b4d34782bcd0ae * init.scm: load (scsh fdports) * scsh.scm (stringify): export. * Makefile.am (pkgdata_DATA): add fdports.scm. * fdports.scm: new file from scsh 0.5.2, with definitions already provided by libguile removed. * syntax-helpers.scm: export transcribe-process-form. use module (scsh utilities) for check-arg. * syntax.scm (scsh): don't use (scsh scsh) module, there are mutual dependency problems. code generated by macros in syntax.scm will still need (scsh scsh). ] addfile ./fdports.scm hunk ./ChangeLog 1 +2000-12-06 Gary Houston + + * init.scm: load (scsh fdports) + * scsh.scm (stringify): export. + * Makefile.am (pkgdata_DATA): add fdports.scm. + * fdports.scm: new file from scsh 0.5.2, with definitions already + provided by libguile removed. + * syntax-helpers.scm: export transcribe-process-form. + use module (scsh utilities) for check-arg. + * syntax.scm (scsh): don't use (scsh scsh) module, there are + mutual dependency problems. code generated by macros in + syntax.scm will still need (scsh scsh). + hunk ./INCOMPAT 4 -extended process forms don't work: - -(run (echo hello) (> out.log))) - hunk ./INCOMPAT 7 -the Guile module system is not compatible with that of Scheme48. the -module system isn't yet used for all files. - -loading guile-scsh may redefine Guile builtins. e.g., map is -redefined by list-lib.scm. This isn't very good. Maybe use of the -module system will make this more manageable in future. Other -affected procedures are: read-delimited read-delimited! pipe sleep -exit make-fluid string->list and probably open-file. - -the interfaces to the I/O system may be incompatible. +the Guile module system is not compatible with the one in Scheme48. hunk ./INCOMPAT 16 +the interfaces to the I/O system may be incompatible. + hunk ./Makefile.am 9 - defrec.scm ekko.scm errno.scm features.scm \ + defrec.scm ekko.scm errno.scm fdports.scm features.scm \ hunk ./USAGE 9 -It's probably more useful to import parts of scsh individually using -the Guile module system. +For script usage it's probably more useful to import parts of scsh +individually using the Guile module system. However note that macros +may expand to code that requires additional modules. e.g., `run' is +defined in (scsh syntax), but requires loading (scsh procobj), (scsh +scsh), (scsh fdports) and (scsh syntax-helpers) to execute sucessfully. + +One way to avoid clobbering definitions from libguile is to define a +new module for the code that uses guile-scsh. e.g., + +#!/usr/bin/guile -s +!# +(define-module (test) + :use-module (scsh syntax) + :use-module (scsh syntax-helpers) + :use-module (scsh procobj) + :use-module (scsh scsh) + :use-module (scsh fdports)) +(run (echo hello) (> out.log)) hunk ./USAGE 56 +(scsh fdports) +(open/create+trunc open/write+append+create shell-open) + hunk ./USAGE 96 +;; replaces: +;; string-downcase string-downcase! +;; string-upcase string-upcase! string-index +;; string-fill! string-copy string->list hunk ./USAGE 186 +;; replaces make-fluid hunk ./USAGE 202 +;; define-simple-syntax generates code that requires +;; (scsh alt-syntax). +;; other macros generate code that requires +;; (scsh scsh), (scsh procobj), (scsh syntax-helpers). hunk ./USAGE 237 -(call-terminally fork/pipe %fork/pipe tail-pipe tail-pipe+ alist-update alist-compress add-before add-after with-env* with-total-env* with-cwd* with-umask* create-temp-file temp-file-channel run/collecting* run/port+proc* run/port* run/file* run/string* run/strings* run/sexp* run/sexps* port->string port->string-list port->sexp-list port->list port-fold char-filter string-filter y-or-n? stdio->stdports with-stdio-ports* stdports->stdio command-line-arguments arg* arg argv home-directory exec-path-list suspend exec/env exec-path/env exec-path exec fork %fork with-cwd with-umask with-env with-total-env run/port run/file run/string run/strings run/sexp run/sexps with-stdio-ports) +(call-terminally fork/pipe %fork/pipe tail-pipe tail-pipe+ alist-update alist-compress add-before add-after with-env* with-total-env* with-cwd* with-umask* create-temp-file temp-file-channel run/collecting* run/port+proc* run/port* run/file* run/string* run/strings* run/sexp* run/sexps* port->string port->string-list port->sexp-list port->list port-fold char-filter string-filter y-or-n? stdio->stdports with-stdio-ports* stdports->stdio command-line-arguments arg* arg argv home-directory exec-path-list suspend exec/env exec-path/env exec-path exec fork %fork stringify with-cwd with-umask with-env with-total-env run/port run/file run/string run/strings run/sexp run/sexps with-stdio-ports) hunk ./fdports.scm 1 +;;; Copyright (c) 1993 by Olin Shivers. See file COPYING. + +(define-module (scsh fdports) + :use-module (scsh bitwise) + :use-module (scsh syscalls) + :use-module (scsh scsh) +) +(export open/create+trunc open/write+append+create shell-open) + +;; move->fdes, dup, dup->fdes, dup->inport, dup->outport are defined by +;; libguile. + + +(define open/create+trunc + (bitwise-ior open/write (bitwise-ior open/create open/truncate))) + +(define open/write+append+create + (bitwise-ior open/write + (bitwise-ior open/append open/create))) + +(define (shell-open path flags fdes) + (move->fdes (open-fdes (stringify path) flags #o666) fdes)) hunk ./init.scm 8 + (scsh fdports) hunk ./init.scm 75 + ;; other macros generate code that requires + ;; (scsh scsh) and (scsh procobj). hunk ./make-module-list 15 + fdports hunk ./scsh.scm 38 - fork %fork + fork %fork stringify hunk ./syntax-helpers.scm 11 - :use-module (ice-9 receive)) -(export transcribe-process-form) + :use-module (ice-9 receive) + :use-module (scsh utilities) +) +(export transcribe-process-form transcribe-extended-process-form) hunk ./syntax.scm 9 - :use-module (scsh scsh)