Changeset 14693 in project


Ignore:
Timestamp:
05/18/09 08:23:28 (11 years ago)
Author:
felix winkelmann
Message:

different handling of default methods

Location:
release/4/operations
Files:
1 deleted
3 edited

Legend:

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

    r14679 r14693  
    44(module operations
    55
    6     ((object operations:make-object default-methods)
     6    ((object operations:make-object)
    77     (operation operations:get-handler)
    88     define-predicate
     
    2727(define-syntax operations:expand-methods
    2828  (syntax-rules ()
    29     ((_ op) (default-methods op))
     29    ((_ op) #f)
    3030    ((_ op ((proc . llist) body ...) . more)
    3131     (if (eq? op proc)
     
    9191        (else #f) ) )
    9292
    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 
    9993(define-record-printer (t-object x out)
    10094  (print-object x out) )
    10195
    102 (define-operation print-object)
     96(define-operation (print-object self #!optional (port (current-output-port)))
     97  (display "#<t-object>" port) )
    10398
    10499(define (join . objects)
  • release/4/operations/operations.setup

    r14679 r14693  
    88 '("operations.so" "operations.import.so"
    99   "operations-static.o")
    10  '((version 0.3)
     10 '((version 0.4)
    1111   (static "operations-static.o") ) )
  • release/4/operations/tests/run.scm

    r14655 r14693  
    1919     (object
    2020      #f
    21       ((kar self) (* 2 (kar k))) )
     21      ((kar self) (* 2 (kar k)))
     22      ((print-object self port) (display "#<HAHA>" port)))
    2223     k) ) )
    2324
     
    4748
    4849(test-end)
     50
     51(print p)
     52(print fk1)
Note: See TracChangeset for help on using the changeset viewer.