diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-21 22:54:47 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-21 22:54:47 +0100 |
commit | 10a557db78474e81ba7ad39701a3611c65db0a8a (patch) | |
tree | dc052e0bcafd1eb04ec88e03a26aeb580dccf4b1 /example.lisp | |
parent | 85b983a0eb9c3aec7fc59c560c441ed28c10b85d (diff) |
Add a strictness option to protocols.
darcs-hash:28dd5077fc8cd98403f72f76668046a5b79bef21
Diffstat (limited to 'example.lisp')
-rw-r--r-- | example.lisp | 10 |
1 files changed, 8 insertions, 2 deletions
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 |