[ a>> ] [ b>> ] [ c>> ] tri
] unit-test
+TUPLE: slot-protocol-test-4 { x read-only } ;
+
+TUPLE: slot-protocol-test-5 { a-read-only-slot read-only } ;
+
+CONSULT: slot-protocol-test-5 slot-protocol-test-4 x>> ;
+
+[ "hey" ] [
+ "hey" slot-protocol-test-5 boa slot-protocol-test-4 boa
+ a-read-only-slot>>
+] unit-test
+
GENERIC: do-me ( x -- )
M: f do-me drop ;
USING: accessors arrays assocs classes.tuple definitions effects generic
generic.standard hashtables kernel lexer math parser
generic.parser sequences sets slots words words.symbol fry
-compiler.units ;
+compiler.units make ;
IN: delegate
ERROR: broadcast-words-must-have-no-outputs group ;
M: standard-generic group-words
dup "combination" word-prop #>> 2array 1array ;
-: slot-group-words ( slots -- words )
+: slot-words, ( slot-spec -- )
+ [ name>> reader-word 0 2array , ]
[
- name>>
- [ reader-word 0 2array ]
- [ writer-word 0 2array ] bi
- 2array
- ] map concat ;
+ dup read-only>> [ drop ] [
+ name>> writer-word 0 2array ,
+ ] if
+ ] bi ;
+
+: slot-group-words ( slots -- words )
+ [ [ slot-words, ] each ] { } make ;
M: tuple-class group-words
all-slots slot-group-words ;