;;; -*-Scheme-*-
;;;
-;;;$Id: clsmac.scm,v 1.5 2001/12/19 01:41:36 cph Exp $
+;;;$Id: clsmac.scm,v 1.6 2001/12/21 18:41:10 cph Exp $
;;;
;;; Copyright (c) 1986, 1989, 1999, 2001 Massachusetts Institute of Technology
;;;
;;; likely will not ever, be supported as a part of the Scheme system.
;;; ******************************************************************
\f
-(define window-environment
- (->environment '(EDWIN WINDOW)))
-
-(set-environment-syntax-table! window-environment
- (make-syntax-table (->environment '(EDWIN))))
-
-(syntax-table/define window-environment 'DEFINE-CLASS
+(define-syntax define-class
(lambda (name superclass variables)
(guarantee-symbol "Class name" name)
(if (not (null? superclass))
,(if (null? superclass) false superclass)
',variables))))
-(syntax-table/define window-environment 'DEFINE-METHOD
+(define-syntax define-method
(lambda (class bvl . body)
(syntax-class-definition class bvl body
(lambda (name expression)
(make-syntax-closure
(make-method-definition class name expression))))))
-(syntax-table/define window-environment 'WITH-INSTANCE-VARIABLES
+(define-syntax with-instance-variables
(lambda (class self free-names . body)
(guarantee-symbol "Self name" self)
(make-syntax-closure
(syntax-class-expression class self free-names body))))
-(syntax-table/define window-environment '=>
+(define-syntax =>
(lambda (object operation . arguments)
(guarantee-symbol "Operation name" operation)
(let ((obname (string->uninterned-symbol "object")))
,obname
,@arguments)))))
-(syntax-table/define window-environment 'USUAL=>
+(define-syntax usual=>
(lambda (object operation . arguments)
(guarantee-symbol "Operation name" operation)
(if (not *class-name*)
;;; -*-Scheme-*-
;;;
-;;; $Id: macros.scm,v 1.67 2001/12/19 01:46:08 cph Exp $
+;;; $Id: macros.scm,v 1.68 2001/12/21 18:41:22 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
;;;
(declare (usual-integrations))
\f
-(define edwin-environment (->environment '(EDWIN)))
-(define edwin-syntax-table edwin-environment) ;upwards compatibility
+(define edwin-syntax-table (->environment '(EDWIN))) ;upwards compatibility
-(set-environment-syntax-table! edwin-environment
- (make-syntax-table (->environment '())))
-
-(let ((runtime-environment (->environment '(RUNTIME))))
- (for-each
- (lambda (name)
- (syntax-table/define edwin-environment name
- (syntax-table/ref runtime-environment name)))
- (syntax-table/defined-names runtime-environment)))
-
-(syntax-table/define edwin-environment 'DEFINE-COMMAND
+(define-syntax define-command
(lambda (name description interactive procedure)
(let ((name (canonicalize-name name)))
(let ((scheme-name (command-name->scheme-name name)))
,@(cddr procedure))
procedure)))))))
-(syntax-table/define edwin-environment 'REF-COMMAND-OBJECT
+(define-syntax ref-command-object
(lambda (name)
(command-name->scheme-name (canonicalize-name name))))
-(syntax-table/define edwin-environment 'REF-COMMAND
+(define-syntax ref-command
(lambda (name)
`(COMMAND-PROCEDURE
,(command-name->scheme-name (canonicalize-name name)))))
-(syntax-table/define edwin-environment 'COMMAND-DEFINED?
+(define-syntax command-defined?
(lambda (name)
(let ((variable-name (command-name->scheme-name (canonicalize-name name))))
`(LET ((_ENV (->ENVIRONMENT '(EDWIN))))
(define (command-name->scheme-name name)
(symbol-append 'EDWIN-COMMAND$ name))
\f
-(let ((variable-definition
- (lambda (buffer-local?)
- (lambda (name description #!optional value test normalization)
- (let ((name (canonicalize-name name)))
- (let ((scheme-name (variable-name->scheme-name name)))
- `(BEGIN
- (DEFINE ,scheme-name
- (MAKE-VARIABLE ',name
- ,description
- ,(if (default-object? value) '#F value)
- ',buffer-local?))
- ,@(if (default-object? test)
- '()
- `((SET-VARIABLE-VALUE-VALIDITY-TEST! ,scheme-name
- ,test)))
- ,@(if (default-object? normalization)
- '()
- `((SET-VARIABLE-VALUE-NORMALIZATION!
- ,scheme-name
- ,normalization))))))))))
- (syntax-table/define edwin-environment 'DEFINE-VARIABLE
- (variable-definition false))
- (syntax-table/define edwin-environment 'DEFINE-VARIABLE-PER-BUFFER
- (variable-definition true)))
-
-(syntax-table/define edwin-environment 'REF-VARIABLE-OBJECT
+(define-syntax define-variable
+ (lambda args
+ (apply (variable-definition #f) args)))
+
+(define-syntax define-variable-per-buffer
+ (lambda args
+ (apply (variable-definition #t) args)))
+
+(define (variable-definition buffer-local?)
+ (lambda (name description #!optional value test normalization)
+ (let ((name (canonicalize-name name)))
+ (let ((scheme-name (variable-name->scheme-name name)))
+ `(BEGIN
+ (DEFINE ,scheme-name
+ (MAKE-VARIABLE ',name
+ ,description
+ ,(if (default-object? value) '#F value)
+ ',buffer-local?))
+ ,@(if (default-object? test)
+ '()
+ `((SET-VARIABLE-VALUE-VALIDITY-TEST! ,scheme-name
+ ,test)))
+ ,@(if (default-object? normalization)
+ '()
+ `((SET-VARIABLE-VALUE-NORMALIZATION!
+ ,scheme-name
+ ,normalization))))))))
+
+(define-syntax ref-variable-object
(lambda (name)
(variable-name->scheme-name (canonicalize-name name))))
-(syntax-table/define edwin-environment 'REF-VARIABLE
+(define-syntax ref-variable
(lambda (name #!optional buffer)
(let ((name (variable-name->scheme-name (canonicalize-name name))))
(if (default-object? buffer)
`(VARIABLE-VALUE ,name)
`(VARIABLE-LOCAL-VALUE ,buffer ,name)))))
-(syntax-table/define edwin-environment 'SET-VARIABLE!
+(define-syntax set-variable!
(lambda (name #!optional value buffer)
(let ((name (variable-name->scheme-name (canonicalize-name name)))
(value (if (default-object? value) '#F value)))
`(SET-VARIABLE-VALUE! ,name ,value)
`(SET-VARIABLE-LOCAL-VALUE! ,buffer ,name ,value)))))
-(syntax-table/define edwin-environment 'LOCAL-SET-VARIABLE!
+(define-syntax local-set-variable!
(lambda (name #!optional value buffer)
`(DEFINE-VARIABLE-LOCAL-VALUE!
,(if (default-object? buffer) '(CURRENT-BUFFER) buffer)
(define (variable-name->scheme-name name)
(symbol-append 'EDWIN-VARIABLE$ name))
\f
-(syntax-table/define edwin-environment 'DEFINE-MAJOR-MODE
+(define-syntax define-major-mode
(lambda (name super-mode-name display-name description
#!optional initialization)
(let ((name (canonicalize-name name))
(initialization)
(else `(LAMBDA (BUFFER) BUFFER UNSPECIFIC)))))))))
-(syntax-table/define edwin-environment 'DEFINE-MINOR-MODE
+(define-syntax define-minor-mode
(lambda (name display-name description #!optional initialization)
(let ((name (canonicalize-name name)))
`(DEFINE ,(mode-name->scheme-name name)
initialization
`(LAMBDA (BUFFER) BUFFER UNSPECIFIC)))))))
-(syntax-table/define edwin-environment 'REF-MODE-OBJECT
+(define-syntax ref-mode-object
(lambda (name)
(mode-name->scheme-name (canonicalize-name name))))