Changeset 16030 in project


Ignore:
Timestamp:
09/22/09 04:37:35 (10 years ago)
Author:
Kon Lovett
Message:

Forgot the %synch oper wrapper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/synch/tags/2.1.0/synch.scm

    r16027 r16030  
    4343  define-constructor/synch
    4444  define-predicate/synch
    45   (define-operation/synch check-mutex+object))
     45  (define-operation/synch check-mutex+object)
     46  define-operation/%synch)
    4647
    4748  (import scheme
     
    498499             (,_synch-with mtx+obj obj (,_apply ,prcnam obj args)))) ) ) ) )
    499500
     501;;
     502
     503;operant must be the 1st argument
     504
     505(define-syntax define-operation/%synch
     506  (lambda (frm rnm cmp)
     507    (define (%synchsym sym) (string->symbol (string-append (symbol->string sym) "/%synch")))
     508    (let ((_define (rnm 'define))
     509          (_apply (rnm 'apply))
     510          (_let (rnm 'let))
     511          (_car (rnm 'car))
     512          (_cdr (rnm 'cdr))
     513          (_if (rnm 'if))
     514          (_pair? (rnm 'pair?))
     515          (_%synch-with (rnm '%synch-with))
     516          (_check-mutex+object (rnm 'check-mutex+object)) )
     517      (let* ((prcnam (cadr frm))
     518             (newnam (%synchsym prcnam)) )
     519        `(,_define (,newnam mtx+obj . args)
     520           (,_let ((mtx (,_if (,_pair? mtx+obj) (,_car mtx+obj) mtx+obj)))
     521             (,_%synch-with mtx+obj obj (,_apply ,prcnam obj args)))) ) ) ) )
     522
    500523) ;module synch
Note: See TracChangeset for help on using the changeset viewer.