2 ! USING: kernel quotations namespaces sequences assocs.lib ;
4 USING: kernel namespaces namespaces.private quotations sequences
5 assocs.lib math.parser math sequences.lib locals mirrors ;
9 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11 : save-namestack ( quot -- ) namestack >r call r> set-namestack ;
13 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15 : make* ( seq -- seq ) [ dup quotation? [ call ] [ ] if ] map ;
17 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 : set* ( val var -- ) namestack* set-assoc-stack ;
22 : get-building-seq ( n -- seq )
23 building-seq get nth ;
25 : n, get-building-seq push ;
26 : n% get-building-seq push-all ;
27 : n# >r number>string r> n% ;
45 MACRO:: nmake ( quot exemplars -- )
46 [let | n [ exemplars length ] |
50 [ 0 swap new-resizable ] map
56 exemplars [ like ] 2map
62 : make-object ( quot class -- object )
63 new [ <mirror> swap bind ] keep ; inline
65 : with-object ( object quot -- )
66 [ <mirror> ] dip bind ; inline