From: Allison Randal <[EMAIL PROTECTED]> Date: Mon, 01 Oct 2007 15:58:24 -0700
My goal was to wrap up the pdd15oo branch by the end of September. We're quite close. The two remaining big things are PGE and multiple dispatch, and then test cleanup. Thanks to chromatic and particle for their work on the tests. I've been giving chromatic small tasks to work on, which seems to be a good way of breaking out the load. Here are a few anyone could tackle . . . I could only find a few find_type hits in t/**/*.t; these are now fixed. (I assume this is because I'm late to the party.) All of the rest (besides the implementation of the op itself) seems to be in documentation. Attatched are a few that ought to be changed (diff against the pdd15oo branch) -- but perhaps you are planning a wholesale rewrite of these sections? -- Bob Rogers http://rgrjr.dyndns.org/
* docs/compiler_faq.pod: * docs/imcc/calling_conventions.pod: + Replace some "find_type" references with "get_class". Diffs between last version checked in and current workfile(s): Index: docs/compiler_faq.pod =================================================================== --- docs/compiler_faq.pod (revision 21955) +++ docs/compiler_faq.pod (working copy) @@ -396,15 +396,23 @@ =head2 How do I instantiate a class? -You can do so either with an integer type identifier: +You can do so either with the class name: - $I0 = find_type 'Dog' - new $P0, $I0 # creates a Dog object and stores it in register $P0 + new $P0, 'Dog' -or with the class name: +or with the class object: - new $P0, 'Dog' + $P1 = get_class 'Dog' # find the 'Dog' class + unless null $P1 goto have_dog_class + printerr "Oops; can't find the 'Dog' class.\n" + .return () + have_dog_class: + new $P0, $P1 # creates a Dog object and stores it in register $P0 +The chief difference is that using a string constant will produce the +specific error "Class 'Dog' not found" if that happens to be the case; +the other code has to check explicitly. + During the C<new> opcode the constructor is called. =head2 How can I pass arguments to a constructor? Index: docs/imcc/calling_conventions.pod =================================================================== --- docs/imcc/calling_conventions.pod (revision 21955) +++ docs/imcc/calling_conventions.pod (working copy) @@ -222,8 +222,7 @@ .local pmc class .local pmc obj newclass class, "Foo" - find_type $I0, "Foo" - new obj, $I0 + new obj, class .pcc_begin .arg x .arg y End of diffs.