Changeset 14679 in project


Ignore:
Timestamp:
05/17/09 22:53:12 (10 years ago)
Author:
felix winkelmann
Message:

added print-object; bumped version to 0.3

Location:
release/4/operations
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/operations/operations.scm

    r14655 r14679  
    44(module operations
    55
    6     ((object operations:make-object)
     6    ((object operations:make-object default-methods)
    77     (operation operations:get-handler)
    88     define-predicate
     
    1010     define-settable-operation
    1111     join
     12     print-object
    1213     operation?)
    1314
     
    2627(define-syntax operations:expand-methods
    2728  (syntax-rules ()
    28     ((_ op) #f)
     29    ((_ op) (default-methods op))
    2930    ((_ op ((proc . llist) body ...) . more)
    3031     (if (eq? op proc)
     
    9091        (else #f) ) )
    9192
     93(define (default-methods op)
     94  (cond ((eq? op print-object)
     95         (lambda (self #!optional (port (current-output-port)))
     96           (display "#<t-object>" port) ) )
     97        (else #f)))
     98
     99(define-record-printer (t-object x out)
     100  (print-object x out) )
     101
     102(define-operation print-object)
     103
    92104(define (join . objects)
    93105  (make-t-object
     
    97109(define-predicate operation?)
    98110
    99 (set! ##sys#setter (let ((old setter)) (operation old)))
    100 (set! setter ##sys#setter)
     111(unless (memq #:setter-operation ##sys#features)
     112  (set! ##sys#setter (let ((old setter)) (operation old)))
     113  (set! setter ##sys#setter)
     114  (register-feature! #:setter-operation))
    101115
    102116)
  • release/4/operations/operations.setup

    r14655 r14679  
    88 '("operations.so" "operations.import.so"
    99   "operations-static.o")
    10  '((version 0.2)
     10 '((version 0.3)
    1111   (static "operations-static.o") ) )
Note: See TracChangeset for help on using the changeset viewer.