about summary refs log tree commit diff stats
path: root/archive/0.vm.arc/load.arc
blob: b9037aa4d605fe7affc5e39191ff5b31b8b1fb5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; support for dividing arc files into sections of different level, and
; selectively loading just sections at or less than a given level

; usage:
;   load.arc [level] [arc files] -- [mu files]

(def selective-load (file (o level 999))
;?   (prn "loading @file at level @level")
  (fromfile file
    (whilet expr (read)
;?       (prn car.expr)
      (if (is 'section expr.0)
        (when (<= expr.1 level)
          (each x (cut expr 2)
            (eval x)))
        (eval expr))
;?       (prn car.expr " done")
      )))

(= section-level 999)
(point break
(each x (map [fromstring _ (read)] cdr.argv)
  (if (isa x 'int)
        (= section-level x)
      (is '-- x)
        (break)  ; later args are mu files
      :else
        (selective-load string.x section-level))))
pan>=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>test</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/test/__init__.py">/home/hut/work/ranger/test/__init__.py</a></font></td></tr></table> <p></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="test.tc_bookmarks.html">tc_bookmarks</a><br> <a href="test.tc_colorscheme.html">tc_colorscheme</a><br> </td><td width="25%" valign=top><a href="test.tc_directory.html">tc_directory</a><br> <a href="test.tc_displayable.html">tc_displayable</a><br> </td><td width="25%" valign=top><a href="test.tc_history.html">tc_history</a><br> <a href="test.tc_keyapi.html">tc_keyapi</a><br> </td><td width="25%" valign=top><a href="test.tc_ui.html">tc_ui</a><br> <a href="test.test.html">test</a><br> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> <tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td> <td width="100%"><strong>__all__</strong> = ['tc_history', 'tc_directory', 'tc_ui', 'tc_bookmarks', 'tc_history', 'tc_keyapi', 'tc_ui', 'tc_displayable', 'tc_keyapi', 'tc_colorscheme', 'tc_bookmarks', 'tc_directory', 'tc_colorscheme', 'tc_displayable']</td></tr></table> </body></html>