This came up as I'm in near the end of converting tcl in leo-ctx5:
versions to date have used two return codes to indicate their return
status: something like "TCL_OK", "5"... now OK will simply be a
parrot '.return()', but any other type (i.e., TCL_CONTINUE,
TCL_RETURN, TCL_BREAK, TCL_ERROR) will be handled with 'throw'.
This should
- improve future interoperability in some ways (no longer odd two-
value return system; [error]s are now exceptions)
- simplify quite a few cases where I can now simply let an
exception propagate instead of checking and branching;
- break future interoperability in other ways (what do you mean,
return is an exception?)
All in all, I think it's a step in the right direction.
(Also, just an FYI: I have enough modified tcl code in the leo-ctx5
branch that I am now primarily developing off this branch. I had
wanted to keep it separate, but it's the most practical solution
until the merge back.)
Once I get all tests passing locally again, I'll commit and have
every one retest on the various platforms.
Regards.
On Sep 15, 2005, at 11:13 AM, co...@cvs.perl.org wrote:
> Author: coke
> Date: Thu Sep 15 08:13:44 2005
> New Revision: 9197
>
> Modified:
> branches/leo-ctx5/classes/exception.pmc
> Log:
> Whoops. 3 and 4 *are* used. Add enough slots for all the documented
> slots,
> plus 2 for HLL's to use for now.
>
>
>
> Modified: branches/leo-ctx5/classes/exception.pmc
> ======================================================================
> ========
> --- branches/leo-ctx5/classes/exception.pmc (original)
> +++ branches/leo-ctx5/classes/exception.pmc Thu Sep 15 08:13:44
> 2005
> @@ -66,8 +66,8 @@ Any information attached by the HL. This
> underscore (that is reserved for Parrot's internal usage. These are
> stored as properties.
>
> -Note: currently, HLL information must be indexed by number. Slots
> 3 and
> -4 are available. This is subject to change.
> +Note: currently, HLL information must be indexed by number. Slots
> 9 and 10
> +are available for the HLL - This is subject to change.
>
> =back
>
> @@ -103,12 +103,18 @@ Initializes the exception with default v
>
> void init() {
> SUPER();
> - DYNSELF.set_integer_native(5);
> + DYNSELF.set_integer_native(11);
> DYNSELF.set_string_keyed_int(0, NULL);
> DYNSELF.set_integer_keyed_int(1, 0);
> DYNSELF.set_integer_keyed_int(2, 0);
> DYNSELF.set_pmc_keyed_int(3, NULL);
> DYNSELF.set_pmc_keyed_int(4, NULL);
> + DYNSELF.set_pmc_keyed_int(5, NULL);
> + DYNSELF.set_pmc_keyed_int(6, NULL);
> + DYNSELF.set_pmc_keyed_int(7, NULL);
> + DYNSELF.set_pmc_keyed_int(8, NULL);
> + DYNSELF.set_pmc_keyed_int(9, NULL);
> + DYNSELF.set_pmc_keyed_int(10, NULL);
> }
>
> /*
>
>
>
This should also fix the problem on windows, as the missing functions
have been uncommented, and are now available.
Please svn up and retest.
That test consists of the code:
inline PASM {
print "ok\n"
}
which should do the obvious thing. Odd that it's squawking about
MMD_add.
Can you 1) try this PIR, and 2) if that *works*, copy that tcl
snippet to "examples/foo.tcl", cd to examples and run "make test" and
send me the results? (If it doesn't work, it's probably a problem
with the PASM compiler.)
.sub main
.local string code
.local pmc pasm_compiler,invokable
code = " print \"ok\\n\"\n "
pasm_compiler = compreg "PASM"
invokable = pasm_compiler(code)
invokable()
.end
On Sep 19, 2005, at 4:27 PM, Andy Dougherty wrote:
> On Thu, 15 Sep 2005, Will Coleda wrote:
>
>
>> Done. All tests pass for tcl in leo-ctx5. (And with leo's recent
>> fixes,
>> hopefully this means on all platforms for real this time. =-)
>>
>> This should also fix the problem on windows, as the missing
>> functions have
>> been uncommented, and are now available.
>>
>> Please svn up and retest.
>>
>
> Down to one failure now on Sparc/Solaris 8 (r9205):
>
> t/cmd_inline....
> # Failed test (t/cmd_inline.t at line 18)
> # got: 'ok
> # MMD function __add not foundfor types (1, -100)
> # '
> # expected: 'ok
> # '
> # Looks like you failed 1 test of 3.
> dubious
> Test returned status 1 (wstat 256, 0x100)
> DIED. FAILED test 2
> Failed 1/3 tests, 66.67% okay
> Failed 1/1 test scripts, 0.00% okay. 1/3 subtests failed, 66.67% okay.
> Failed Test Stat Wstat Total Fail Failed List of Failed
> ----------------------------------------------------------------------
> ---------
> t/cmd_inline.t 1 256 3 1 33.33% 2
>
>
> --
> Andy Dougherty doug...@lafayette.edu
>
>
> Done. All tests pass for tcl in leo-ctx5. (And with leo's recent fixes,
> hopefully this means on all platforms for real this time. =-)
>
> This should also fix the problem on windows, as the missing functions have
> been uncommented, and are now available.
>
> Please svn up and retest.
Down to one failure now on Sparc/Solaris 8 (r9205):
> Good! [inline] isn't real Tcl, it's specific to partcl.
>
> That test consists of the code:
>
> inline PASM {
> print "ok\n"
> }
>
> which should do the obvious thing. Odd that it's squawking about MMD_add.
It's very strange. It copied that snippet above to examples/foo.tcl.
Whether or not it works seems to depend on whether or not there's a slash
in the filename. Here's what I see:
$ cat foo.tcl
inline PASM {
print "ok\n"
}
$ ../../../parrot ../tcl.pbc foo.tcl
ok
$ ../../../parrot ../tcl.pbc ./foo.tcl
ok
MMD function __add not foundfor types (1, -100)
$ ../../../parrot -tf ../tcl.pbc foo.tcl > nodot.trace 2>&1
$ ../../../parrot -tf ../tcl.pbc ./foo.tcl > dot.trace 2>&1
(The traces are huge -- 64k each after compression -- so I've just sent
them by private mail, and not to the whole list.)
--
Andy Dougherty doug...@lafayette.edu