Richard Nuttall <[EMAIL PROTECTED]> wrote:

> On the DWIM principle, shouldn't Perl then just autoload the DWIM::AI
> module and provide as output the script that they are intending to write ?

That needs of course some support in the inyards of Perl6, i.e. in
Parrot.

$ parrot
,--[ editor-session ]-----
| .sub _main @MAIN
|       print "Hello, World!\n"
| .end
| ~
| ~
| /Wo<enter>
| cwParrot<esc>
| ZZ
`-------------------------
Hello, Parrot!


--- parrot/imcc/main.c  Sun Mar 14 13:19:47 2004
+++ parrot-leo/imcc/main.c      Thu Apr  1 14:08:13 2004
@@ -155,6 +155,8 @@
     struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
     int status;
     if (*argc == 1) {
+        run_pbc = 1;
+        return "autoload.imc";
        usage(stderr);
        exit(1);
     }

$ cat autoload.imc
# autoload.imc
.sub autoload @MAIN
    .param pmc argv
    load_bytecode "dwim_ai.imc"
    .local pmc conf_hash
    conf_hash = _config()
    .local string parrot
    parrot = conf_hash["test_prog"]
    .local string cmd
    cmd = parrot
    cmd .= " hello.imc"
    spawnw $I0, cmd
.end

.include "library/config.imc"

$ cat dwim_ai.imc
# DWIM::AI
.sub _ai @LOAD
     .local pmc O
     open O, "hello.imc", ">"
     print O, ".sub _main @MAIN\n"
     print O, "\tprint \"Hello, World!\\n\"\n"
     print O, ".end\n"
     close O
     spawnw $I0, "$EDITOR hello.imc"
.end

> R.

leo

Reply via email to