tagged release 0.7.1
[parrot.git] / languages / tcl / runtime / builtin / parray.pir
blob23c3255432c7dc370e1eb4273fffe56a63e97ea2
1 .HLL 'Tcl', ''
2 .namespace []
5 # When this sub is invoked, it will load in the actual definition
6 # of [parray] and replace this stub. This allows us to defer the cost of
7 # loading it for every partcl invocation.
10 .sub '&parray'
11   .param pmc args :slurpy
13   .include 'iglobals.pasm'
14   .local pmc tcl_library, config, interp
15   tcl_library = get_global '$tcl_library'
16   interp = getinterp
17   config = interp[.IGLOBALS_CONFIG_HASH]
18   .local string slash
19   slash = config['slash']
21   $S0 = tcl_library
22   $S0 .= slash
23   $S0 .= 'parray.tcl'
25   .local pmc script
26   $P99 = open $S0, '<'
27   $S0 = $P99.'slurp'('')
29   script = get_root_global ['_tcl'], 'compileTcl'
31   # compile to PIR and put the sub in place...
32   $P1 = script($S0)
33   $P1()
35   # Now call the version that we just created.
36   $P3 = find_name '&parray'
37   .return $P3( args :flat )
38 .end
40 # Local Variables:
41 #   mode: pir
42 #   fill-column: 100
43 # End:
44 # vim: expandtab shiftwidth=4 ft=pir: