develooper Front page | perl.cvs.mod_parrot | Postings from January 2009

[svn:mod_parrot] r591 - in mod_parrot/trunk/lib: . ModParrot/HLL

From:
jhorwitz
Date:
January 18, 2009 07:15
Subject:
[svn:mod_parrot] r591 - in mod_parrot/trunk/lib: . ModParrot/HLL
Message ID:
20090118151521.CCF9DCB9AE@x12.develooper.com
Author: jhorwitz
Date: Sun Jan 18 07:15:21 2009
New Revision: 591

Modified:
   mod_parrot/trunk/lib/ModParrot/HLL/perl6.pir
   mod_parrot/trunk/lib/mod_parrot.pir

Log:
move class registration to mod_parrot.pir, as we need to instantiate some
classes during HLL module configuration.


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 Jan 18 07:15:21 2009
@@ -16,31 +16,11 @@
 
 .sub __onload :anon :load
     load_bytecode 'languages/perl6/perl6.pbc'
-    load_bytecode 'ModParrot/Apache/Module.pbc'
-    load_bytecode 'ModParrot/Constants.pbc'
 
     # load mod_perl6.pm, which may be precompiled
     $P0 = compreg 'Perl6'
     $P1 = $P0.'compile'('use mod_perl6')
     $P1()
-
-    # register mod_parrot classes as Perl6 meta classes so Perl 6 can access
-    # them natively.  use 'name' to register the class under a different
-    # name, letting mod_parrot provide scaffolding for functionality not yet
-    # available in the HLL layer.
-    $P0 = get_hll_global 'P6metaclass'
-    $P1 = get_class ['ModParrot'; 'Apache'; 'RequestRec']
-    $P0.'register'($P1, 'name' => 'Apache;RequestRec')
-    $P1 = get_class ['ModParrot';'APR'; 'Pool']
-    $P0.'register'($P1, 'name' => 'APR;Pool')
-    $P1 = get_class ['ModParrot';'APR'; 'Table']
-    $P0.'register'($P1, 'name' => 'APR;Table')
-    $P1 = get_class ['ModParrot'; 'Interpreter']
-    $P0.'register'($P1)
-    $P1 = get_class ['ModParrot'; 'Context']
-    $P0.'register'($P1)
-    $P1 = get_class ['ModParrotHandle']
-    $P0.'register'($P1)
 .end
 
 # declare namespace AFTER loading compiler

Modified: mod_parrot/trunk/lib/mod_parrot.pir
==============================================================================
--- mod_parrot/trunk/lib/mod_parrot.pir	(original)
+++ mod_parrot/trunk/lib/mod_parrot.pir	Sun Jan 18 07:15:21 2009
@@ -121,14 +121,41 @@
     set_root_global [ 'ModParrot'; 'NCI' ], "get_module_config", func
 
     # load required libraries
-    load_bytecode 'Protoobject.pbc'
+    load_bytecode 'P6object.pbc'
     load_bytecode 'ModParrot/Interpreter.pbc'
     load_bytecode 'ModParrot/Context.pbc'
     load_bytecode 'ModParrot/Apache/Constants.pbc'
+    load_bytecode 'ModParrot/Apache/Module.pbc'
     load_bytecode 'ModParrot/Apache/RequestRec.pbc'
+    load_bytecode 'ModParrot/Apache/ServerRec.pbc'
     load_bytecode 'ModParrot/APR/Pool.pbc'
     load_bytecode 'ModParrot/APR/Table.pbc'
 
+    # some languages make use of the Perl6 metamodel, so we register several
+    # mod_parrot classes as Perl6 meta classes so languages can access them
+    # natively.  use 'name' to register the class under a different name,
+    # letting mod_parrot provide scaffolding for functionality not yet
+    # available in the HLL layer.
+
+    # XXX this MUST be done before the mod_parrot classes are instantiated,
+    # so it can't be done in the HLL modules.  this needs to be fixed.
+
+    $P0 = get_hll_global 'P6metaclass'
+    $P1 = get_class ['ModParrot'; 'Apache'; 'RequestRec']
+    $P0.'register'($P1, 'name' => 'Apache;RequestRec')
+    $P1 = get_class ['ModParrot'; 'Apache'; 'ServerRec']
+    $P0.'register'($P1, 'name' => 'Apache;ServerRec')
+    $P1 = get_class ['ModParrot';'APR'; 'Pool']
+    $P0.'register'($P1, 'name' => 'APR;Pool')
+    $P1 = get_class ['ModParrot';'APR'; 'Table']
+    $P0.'register'($P1, 'name' => 'APR;Table')
+    $P1 = get_class ['ModParrot'; 'Interpreter']
+    $P0.'register'($P1)
+    $P1 = get_class ['ModParrot'; 'Context']
+    $P0.'register'($P1)
+    $P1 = get_class ['ModParrotHandle']
+    $P0.'register'($P1)
+
     # global to indicate that we're actually running
     $P0 = new 'Integer'
     $P0 = 1



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About