[[project @ 2000-10-15 20:14:50 by ghouston] ghouston**20001015201450 Ignore-this: 9af46648e203154fed8170f9b331da87 2000-10-15 Gary Houston * bitwise.scm: define module (scsh bitwise). * utilities.scm: define module (scsh utilities). (reverse!): removed, since guile primitive is compatible. * syntax-helpers.scm: define module (scsh syntax-helpers). * signals.scm: new file. move syntax-error here from alt-syntax.scm. define module (scsh signals). * module-system.scm: new file. define module (scsh module-system). dummy definitions for define-structure, structure-ref moved from init.scm. * loophole.scm: new file from scsh-0.5.2: alt/loophole.scm. define module (scsh loopholes). used by check-arg in utilities.scm. * defrec.scm (define-record-discloser): moved from init.scm. * let-opt.scm: define module (scsh let-opt). define module (scsh receive). * alt-syntax.scm: define module (scsh alt-syntax). * init.scm: use these modules. ] addfile ./loophole.scm addfile ./module-system.scm addfile ./signals.scm hunk ./ChangeLog 1 +2000-10-15 Gary Houston + + * bitwise.scm: define module (scsh bitwise). + * utilities.scm: define module (scsh utilities). + (reverse!): removed, since guile primitive is compatible. + + * syntax-helpers.scm: define module (scsh syntax-helpers). + * signals.scm: new file. move syntax-error here from alt-syntax.scm. + define module (scsh signals). + * module-system.scm: new file. define module (scsh module-system). + dummy definitions for define-structure, structure-ref moved from + init.scm. + * loophole.scm: new file from scsh-0.5.2: alt/loophole.scm. + define module (scsh loopholes). used by check-arg in utilities.scm. + + * defrec.scm (define-record-discloser): moved from init.scm. + * let-opt.scm: define module (scsh let-opt). + define module (scsh receive). + * alt-syntax.scm: define module (scsh alt-syntax). + * init.scm: use these modules. + hunk ./INCOMPAT 11 -everything is defined at the top level, no modules. +the Guile module system is not compatible with that of Scheme48. the +module system isn't yet used for all files. hunk ./README 37 -The Guile module system is not currently used. The package can be -loaded into a running Guile interpreter with: +The entire package can be loaded into a running Guile interpreter with: hunk ./README 41 -The Guile port uses a record type to represent the multiple values -returned by many scsh procedures. The values can be retrieved -using call-with-values or receive. FIXME: check modern multiple values -usage in guile-core. +Note that this will clobber various Guile definitions. It would be +more useful to be able to import parts of scsh individually using the +Guile module system, but this work is not yet complete. At present +the following modules are defined: + +(scsh alt-syntax): define-syntax syntax-rules +;; not compatible with (ice-9 syncase) + +(scsh receive): receive +;; compatible with (ice-9 receive), which is not available in Guile 1.4 + +(scsh module-system): define-structure structure-ref +;; dummy definitions. + +(scsh let-opt): let-optionals let-optionals* :optional +;; not compatible with (ice-9 optargs). + +(scsh loophole): loophole +;; dummy definition. + +(scsh signals): syntax-error + +(scsh syntax-helpers): transcribe-process-form + +(scsh bitwise): arithmetic-shift bitwise-not bitwise-and bitwise-ior + bitwise-xor + +(scsh utilities): del delete filter first first? nth fold fold-right + any every mapv mapv! vector-every? copy-vector initialize-vector + vector-append vfold vfold-right check-arg conjoin disjoin negate + compose call/cc deprecated-proc deposit-bit-field + real->exact-integer) +;; "delete" is incompatile with guile primitive. + hunk ./alt-syntax.scm 2 -; for Guile: redefined define-syntax, added syntax-error definition. + +;; original file: alt/syntax.scm. +(define-module (scsh alt-syntax) + :use-module (scsh signals)) +(export-syntax define-syntax syntax-rules) hunk ./alt-syntax.scm 30 -(define syntax-error error) - hunk ./bitwise.scm 5 +;; original file: alt/bitwise.scm. + hunk ./bitwise.scm 13 +(define-module (scsh bitwise)) +(export arithmetic-shift bitwise-not bitwise-and bitwise-ior bitwise-xor) + hunk ./defrec.scm 77 +(defmacro define-record-discloser args #f) ;; guile. + hunk ./init.scm 3 -(defmacro define-record-discloser args #f) hunk ./init.scm 12 -;; just pick out the begin forms. -(defmacro define-structure (name interface . body) - (let loop ((rest body) - (result '(begin))) - (if (null? rest) - (reverse result) - (loop (cdr rest) - (if (eq? (caar rest) 'begin) - (cons (car rest) result) - result))))) - -(defmacro structure-ref (structure symb) - symb) - -(use-modules (ice-9 format)) - -(load-from-path "scsh/alt-syntax.scm") -(load-from-path "scsh/receive.scm") -(load-from-path "scsh/let-opt.scm") - -(load-from-path "scsh/syntax-helpers.scm") - -;; "delete" primitive is replaced, but doesn't seem worth saving. -(load-from-path "scsh/utilities.scm") +(use-modules (ice-9 format) + (scsh alt-syntax) + (scsh receive) + (scsh module-system) + (scsh let-opt) + (scsh loophole) + (scsh signals) + (scsh syntax-helpers) + (scsh bitwise) + (scsh utilities) ;; replaces primitive "delete". +) hunk ./init.scm 33 -(load-from-path "scsh/bitwise.scm") hunk ./let-opt.scm 91 +(define-module (scsh let-opt) + :use-module (scsh alt-syntax) + :use-module (scsh module-system)) +(export-syntax let-optionals let-optionals* :optional) + hunk ./loophole.scm 1 +; Copyright (c) 1993, 1994 Richard Kelsey and Jonathan Rees. See file COPYING. + +;; original file: alt/loophole.scm. +(define-module (scsh loophole) + :use-module (scsh alt-syntax)) + +(define-syntax loophole + (syntax-rules () + ((loophole ?type ?form) + (begin (lambda () ?type) ;Elicit unbound-variable warnings, etc. + ?form)))) + hunk ./module-system.scm 1 +;;; dummy definitions for Guile. + +(define-module (scsh module-system)) +(export-syntax define-structure structure-ref) + +;; pick out the begin forms. +(defmacro define-structure (name interface . body) + (let loop ((rest body) + (result '(begin))) + (if (null? rest) + (reverse result) + (loop (cdr rest) + (if (eq? (caar rest) 'begin) + (cons (car rest) result) + result))))) + +(defmacro structure-ref (structure symb) + symb) hunk ./receive.scm 3 +;; original file: big/receive.scm. +(define-module (scsh receive) + :use-module (scsh alt-syntax)) +(export-syntax receive) hunk ./signals.scm 1 +(define-module (scsh signals)) +(export syntax-error) + +(define syntax-error error) + +;;; scsh interface: +;; (export error warn syntax-error call-error +;; signal signal-condition +;; make-condition)) hunk ./syntax-helpers.scm 8 +(define-module (scsh syntax-helpers) + :use-module (scsh alt-syntax) + :use-module (scsh signals) + :use-module (scsh receive)) +(export transcribe-process-form) + hunk ./utilities.scm 4 +(define-module (scsh utilities) + :use-module (scsh loophole) + :use-module (scsh bitwise)) +(export del delete filter first first? nth + fold fold-right + any every + mapv mapv! vector-every? copy-vector initialize-vector vector-append + vfold vfold-right + check-arg conjoin disjoin negate compose call/cc + deprecated-proc + deposit-bit-field + real->exact-integer + ;; reverse! omitted. +) + hunk ./utilities.scm 168 - -(define (reverse! lis) - (let lp ((lis lis) (prev '())) - (if (not (pair? lis)) prev - (let ((tail (cdr lis))) - (set-cdr! lis prev) - (lp tail lis))))) +;; guile primitive is compatible. +;;(define (reverse! lis) +;; (let lp ((lis lis) (prev '())) +;; (if (not (pair? lis)) prev +;; (let ((tail (cdr lis))) +;; (set-cdr! lis prev) +;; (lp tail lis)))))