Hi Lodewijk: our research paths cross once more. Doug Orleans, one of my PhD students has a concept, called branches, that can conveniently simulate composition filters. Branches are briefly described at: http://www.ccs.neu.edu/research/demeter/papers/predicate-dispatch-position/submission.txt Do you have some other composition filter examples that you think would challenge the capabilities of branches? Best regards, -- Karl From dougo@ccs.neu.edu Tue Nov 27 10:34:56 2001 From: Doug Orleans Date: Tue, 27 Nov 2001 10:34:53 -0500 (EST) To: lieber@ccs.neu.edu Subject: composition filters example FYI, here's a sketch of how I might translate the composition filters example from the CACM AOP issue into Fred: ;; page 54 ;; Composition filters: ;; DocProt : Error = ;; { FinancialResp => {setApprovedClaim, setClaimAmount}, ;; MedicalResp => {setClientCategory, setMedicalCheckData}, ;; True ~> {setApprovedClaim, setClaimAmount, setClientCategory, ;; setMedicalCheckData} }; (define (responsibility-of-caller dp) (responsibility (car (dp-args (dp-previous dp))) (define-predicate financial-resp? (eq? (responsibility-of-caller dp) 'financial)) (define-predicate medical-resp? (eq? (responsibility-of-caller dp) 'medical)) (define-predicate disallowed-modification? (and (prot-claim-document? (car (dp-args dp))) (let ((msg (dp-msg dp))) (not (or (and (financial-resp? dp) (or (eq? msg set-approved-claim) (eq? msg set-claim-amount))) (and (medical-resp? dp) (or (eq? msg set-client-category) (eq? msg set-medical-check-data))) (not (memq msg (list set-approved-claim set-claim-amount set-client-category set-medical-check-data))))))) (define-around (disallowed-modification? dp) (error "That modification is not allowed.")) --Doug