1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators combinators.smart fry kernel lexer quotations
4 sequences sequences.generalizations slots words ;
8 "]" [ reader-word 1quotation ] map-tokens
9 '[ _ cleave ] append! ;
12 "}" [ reader-word 1quotation ] map-tokens
13 '[ [ _ cleave ] output>array ] append! ;
15 : >>writer-word ( name -- word )
16 ">>" prepend "accessors" lookup-word ;
18 : writer-word<< ( name -- word )
19 ">>" prepend "accessors" lookup-word ;
22 "]" [ >>writer-word 1quotation ] map-tokens
23 '[ _ spread ] append! ;
26 "}" [ >>writer-word 1quotation ] map-tokens
28 '[ _ firstn _ spread ] append! ;
32 [ reader-word 1quotation ]
33 [ writer-word<< 1quotation ] bi append
35 '[ swap _ cleave ] append! ;
37 SYNTAX: get[ POSTPONE: slots[ ;
38 SYNTAX: get{ POSTPONE: slots{ ;
39 SYNTAX: set[ POSTPONE: set-slots[ ;
40 SYNTAX: set{ POSTPONE: set-slots{ ;