# HG changeset patch # User Steve Losh # Date 1598060909 14400 # Node ID 64303dece1779cb2c167380795e24928dadce320 # Parent 7fbb6f4abee83746c5baa79564a79408dd3a034d Set :allow-print and :allow-read to t when not explicitly provided If we don't do this, reevaluating a `defclass` after removing an `(:allow-print nil)` option won't update the class, and still won't allow printing. You'd have to set `(:allow-print t)`, eval, then remove it, which is silly. diff -r 7fbb6f4abee8 -r 64303dece177 .TODO.done --- a/.TODO.done Fri Aug 21 00:34:26 2020 -0400 +++ b/.TODO.done Fri Aug 21 21:48:29 2020 -0400 @@ -1,4 +1,5 @@ Add read/print disabling mechanism | id:1268bf0b10c13aec23aafbd8f5e236db1e485fa5 +Fix :allow-print and :allow-read to set t when removing them during class redef. | id:21cce1bed829a138de33b33e3ad3219f7888be04 Optimize discarding | id:93105ef9d21d33bfb10c67fcac36bc60434d3fb4 Add after-read and before-print functions | id:9f982ca45b68d644159e0c64f0dc1b185f72a2f8 Add opaque-json type | id:a1a380eb9782d088693dfb75402b99c2b30cf039 diff -r 7fbb6f4abee8 -r 64303dece177 TODO --- a/TODO Fri Aug 21 00:34:26 2020 -0400 +++ b/TODO Fri Aug 21 21:48:29 2020 -0400 @@ -1,4 +1,3 @@ -Fix :allow-print and :allow-read to set t when removing them during class redef. | id:21cce1bed829a138de33b33e3ad3219f7888be04 Clean up error hierarchy | id:3d3efa4af649474151661a9d294080ab24e22ff7 Add basic wrapper definition | id:861f048b3b69079dedf8779be1cb73c05e6fc732 Add extra key preservation | id:cfb63b37d87893083fc98477ec3d488fb909a984 diff -r 7fbb6f4abee8 -r 64303dece177 src/mop.lisp --- a/src/mop.lisp Fri Aug 21 00:34:26 2020 -0400 +++ b/src/mop.lisp Fri Aug 21 21:48:29 2020 -0400 @@ -128,8 +128,8 @@ (apply #'call-next-method class slot-names (append (arg :slot-name-to-json-name slot-name-to-json-name) (arg :unknown-slots unknown-slots) - (arg :allow-read allow-read) - (arg :allow-print allow-print) + (arg :allow-read (or allow-read '(t))) + (arg :allow-print (or allow-print '(t))) initargs)))) (defmethod c2mop:finalize-inheritance :after ((class json-class))