|
|
Author: jhorwitz
Date: Sun Jun 8 11:31:31 2008
New Revision: 346
Modified:
mod_parrot/trunk/lib/APR/Table.pir
mod_parrot/trunk/lib/Apache/RequestRec.pir
mod_parrot/trunk/lib/ModParrot/Context.pir
mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
mod_parrot/trunk/lib/ModParrot/Interpreter.pir
Log:
remove generic protoobject implementation in favor of per-HLL implementations
register mod_parrot classes as perl6 metaclasses
Modified: mod_parrot/trunk/lib/APR/Table.pir
==============================================================================
--- mod_parrot/trunk/lib/APR/Table.pir (original)
+++ mod_parrot/trunk/lib/APR/Table.pir Sun Jun 8 11:31:31 2008
@@ -48,10 +48,6 @@
newclass table_class, [ 'APR'; 'Table' ]
addattribute table_class, 'apr_table'
- # a proto-object will allow HLLs to create new instances of this class
- $P0 = get_hll_global 'Protomaker'
- $P0.'new_proto'(table_class)
-
dlfunc func, nul, "apr_table_get", "tpt"
set_root_global [ 'APR'; 'NCI' ], "apr_table_get", func
Modified: mod_parrot/trunk/lib/Apache/RequestRec.pir
==============================================================================
--- mod_parrot/trunk/lib/Apache/RequestRec.pir (original)
+++ mod_parrot/trunk/lib/Apache/RequestRec.pir Sun Jun 8 11:31:31 2008
@@ -52,10 +52,6 @@
addattribute rr_class, 'r'
addattribute rr_class, 'pmc_notes'
- # a proto-object will allow HLLs to create new instances of this class
- $P0 = get_hll_global 'Protomaker'
- $P0.'new_proto'(rr_class)
-
dlfunc func, nul, "ap_rputs", "itp"
set_root_global [ 'Apache'; 'NCI' ], "ap_rputs", func
Modified: mod_parrot/trunk/lib/ModParrot/Context.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/Context.pir (original)
+++ mod_parrot/trunk/lib/ModParrot/Context.pir Sun Jun 8 11:31:31 2008
@@ -36,12 +36,7 @@
.local pmc context_class
load_bytecode 'ModParrot/Interpreter.pbc'
-
newclass context_class, [ 'ModParrot'; 'Context' ]
-
- # a proto-object will allow HLLs to create new instances of this class
- $P0 = get_hll_global 'Protomaker'
- $P0.'new_proto'(context_class)
.end
=over 4
Modified: mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir (original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir Sun Jun 8 11:31:31 2008
@@ -14,8 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-.namespace [ 'ModParrot'; 'HLL'; 'perl6' ]
-
.sub __onload :anon :load
.local string mp6_path
.local pmc find_file_in_path
@@ -28,4 +26,22 @@
mp6_path = find_file_in_path($S0, 'mod_perl6.pm')
$P0 = compreg 'Perl6'
$P1 = $P0.'evalfiles'(mp6_path)
+
+ # register mod_parrot classes as Perl6 meta classes so Perl 6 can access
+ # them natively
+ $P0 = get_hll_global 'P6metaclass'
+ $P1 = get_class ['Apache'; 'RequestRec']
+ $P0.'register'($P1)
+ $P1 = get_class ['APR'; 'Table']
+ $P0.'register'($P1)
+ $P1 = get_class ['ModParrot'; 'Interpreter']
+ $P0.'register'($P1)
+ $P1 = get_class ['ModParrot'; 'Context']
+ $P0.'register'($P1)
.end
+
+# declare namespace AFTER loading compiler
+# otherwise we get method resolution errors
+.namespace [ 'ModParrot'; 'HLL'; 'perl6' ]
+
+# helper functions go here
Modified: mod_parrot/trunk/lib/ModParrot/Interpreter.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/Interpreter.pir (original)
+++ mod_parrot/trunk/lib/ModParrot/Interpreter.pir Sun Jun 8 11:31:31 2008
@@ -39,10 +39,6 @@
.local pmc interp_class
newclass interp_class, [ 'ModParrot'; 'Interpreter' ]
-
- # a proto-object will allow HLLs to create new instances of this class
- $P0 = get_hll_global 'Protomaker'
- $P0.'new_proto'(interp_class)
.end
=over 4
|
|