From 10a557db78474e81ba7ad39701a3611c65db0a8a Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 21 Feb 2008 22:54:47 +0100 Subject: Add a strictness option to protocols. darcs-hash:28dd5077fc8cd98403f72f76668046a5b79bef21 --- example.lisp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'example.lisp') diff --git a/example.lisp b/example.lisp index b1dd46d..a8e0690 100644 --- a/example.lisp +++ b/example.lisp @@ -7,10 +7,12 @@ (define-protocol printable () - ((print-object * stream))) + ((print-object * stream)) + (:strictness t)) (define-protocol serialisable () - ((serialise * stream))) + ((serialise * stream)) + (:strictness t)) (define-protocol additive () ((add * *) @@ -58,3 +60,7 @@ (print (conforms-to-p 'b 'printable)) ;=> T (print (really-conforms-to-p 'b 'printable)) ;=> T + +(print (subtypep 'b 'printable)) ;=> T +(print (subtypep 'b 'additive)) ;=> T +(print (subtypep 'b 'serialisable)) ;=> NIL -- cgit v1.2.3