chickadee » operations » define-operation

(define-operation (variable . argument-vars) . body)syntax

Returns: undefined

Defines variable to be an operation. The syntax is intended to be analogous to that of DEFINE. The operation's default method is defined by argument-vars and body. If there is no body, then the operation's default method is undefined. In this case, the argument-vars appear only for documentary purposes.

 (define-operation (var . args) . body)
   ==> (define var (operation (lambda args . body)))
 (define-operation (var . args))
   ==> (define var (operation undefined-effect))
 [syntax] (define-settable-operation (variable . argument-vars) . body)   --> undefined

Defines variable to be an operation, as with DEFINE-OPERATION, but arranges for the operation's ``setter to be another operation, so that the operation is ``settable

 (define-settable-operation (var . args) . body)
 (define var
 (let ((the-setter (operation undefined-effect))) 
   (operation (lambda args . body) 
     ((setter self) the-setter))))