[comp.lang.scheme.c] Fixes for extend-syntax for mit-scheme 7.1

markf@altdorf.ai.mit.EDU (Mark Friedman) (04/17/91)

There is a problem with the extend-syntax.scm that I placed on
altdorf.ai.mit.edu in archive/scheme-library/unsupported/CScheme/
yesterday. I essentially forgot to define-macro-both
"define-macro-both". The source on altdorf is fixed and I have
appended a diff to this message for those of you who don't feel like
FTPing again.


Mark Friedman
MIT Artificial Intelligence Lab
545 Technology Sq.
Cambridge, Ma. 02139

markf@zurich.ai.mit.edu


*** extend-syntax.scm	Wed Apr 17 12:25:37 1991
--- extend-syntax.scm.~1~	Mon Apr 15 14:46:40 1991
***************
*** 9,15 ****
  ;;; Added define-macro-both to define macros in this file and in
  ;;; user-initial-syntax-table.
  
! (syntax-table-define user-initial-syntax-table 'define-macro-both
    (macro (pattern . body)
      `(begin
         (define-macro ,pattern ,@body)
--- 9,15 ----
  ;;; Added define-macro-both to define macros in this file and in
  ;;; user-initial-syntax-table.
  
! (syntax-table-define user-initial-syntax-table 'define-both
    (macro (pattern . body)
      `(begin
         (define-macro ,pattern ,@body)
***************
*** 17,36 ****
  	 (macro ,(cdr pattern)
  	   ,@body)))))
  
- (define-macro (define-macro-both pattern . body)
-   `(begin
-      (define-macro ,pattern ,@body)
-      (syntax-table-define user-initial-syntax-table ',(car pattern)
-        (macro ,(cdr pattern)
- 	 ,@body))))
- 
  (define gensym generate-uninterned-symbol)
  
  (define gensym generate-uninterned-symbol)
  
! (define-macro-both (unless *cond . e1 ) `(if (not ,*cond) (begin ,@e1) #f))
  
! (define-macro-both (when *cond . e1) `(if ,*cond (begin ,@e1) #f))
  
  (define-macro (kerror msg-line . args)
    `(begin
--- 17,29 ----
  	 (macro ,(cdr pattern)
  	   ,@body)))))
  
  (define gensym generate-uninterned-symbol)
  
  (define gensym generate-uninterned-symbol)
  
! (define-both (unless *cond . e1 ) `(if (not ,*cond) (begin ,@e1) #f))
  
! (define-both (when *cond . e1) `(if ,*cond (begin ,@e1) #f))
  
  (define-macro (kerror msg-line . args)
    `(begin
***************
*** 377,383 ****
  
  
  
!     `(define-macro-both (,(car keys) . body)
  
         (,(make-syntax keys clauses)  (cons ',(car keys) body)))))
  
--- 370,376 ----
  
  
  
!     `(define-both (,(car keys) . body)
  
         (,(make-syntax keys clauses)  (cons ',(car keys) body)))))