Re: [ANNOUNCE] Parrot::DWIM

2003-09-24 Thread Leopold Toetsch
Leopold Toetsch wrote:

As we don't have any libs yet, I thought, I start with an important one. 
It works like Acme::DWIM.
Here is the pod for it, extracted from the source via:
$ perldoc DWIM.imc  DWIM.pod.txt

I should clean up and comment it a bit, then I could submit it - where?
runtime/parrot/lib ?
Have fun,
leo




DWIM.IMC(1)User Contributed Perl DocumentationDWIM.IMC(1)


TTTTIIIITTTTEEEELLLL
   Parrot::DWIM - Parrot's confusing opcodes made easy.

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
   .pcc_sub _main prototyped
   .include DWIM.imc
   print The answer is\n
   add $I0, 20, 23
   dec $I0
   print $I0
   print \nsay's Parrot!\n
   end
   .end


DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
   The first time you run a program under include DWIM, the
   module replaces all the unsightly opcodes from your source
   file with the new DWIM comment: #### DDDDWWWWIIIIMMMM and runs 
normally.

   The code continues to work exactly as it did before, but
   now it looks like this:

   .pcc_sub _main prototyped
   .include DWIM.imc
  # DWIM  The answer is\n
  # DWIM  $I0, 20, 23
  # DWIM  $I0
  # DWIM  $I0
  # DWIM  \nsay's Parrot!\n
  # DWIM
   .end


DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
   Can't open 'file' for reading

   Can't open 'file' for writing

BBBBUUUUGGGGSSSS
   Doesn't work for code like

   I0 = 1

   Probably a lot more.

AAAAUUUUTTTTHHHHOOOORRRR
   Dami^WLeopold Toetsch (as if you couldn't guess)

CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
   Copyright (c) 2003, Leopold Toetsch. All Rights Reserved.
   This module is free software. It may be used,
   redistributed and/or modified under the same terms as
   Parrot.



24/Sep/2003 perl 5.008  1





DWIM.IMC(1)User Contributed Perl DocumentationDWIM.IMC(1)



























































24/Sep/2003 perl 5.008  2




Re: [ANNOUNCE] Parrot::DWIM

2003-09-24 Thread Nicholas Clark
On Wed, Sep 24, 2003 at 12:23:59PM +0200, Leopold Toetsch wrote:
 Leopold Toetsch wrote:

  I should clean up and comment it a bit, then I could submit it - where?
  runtime/parrot/lib ?

Do we have an Acme directory yet?


Dami^WLeopold Toetsch (as if you couldn't guess)

Yet another certifiable Austral^H^Hian :-)

Nicholas Clark


Re: [ANNOUNCE] Parrot::DWIM

2003-09-24 Thread Leopold Toetsch
Nicholas Clark [EMAIL PROTECTED] wrote:
 On Wed, Sep 24, 2003 at 12:23:59PM +0200, Leopold Toetsch wrote:
  runtime/parrot/lib ?

 Do we have an Acme directory yet?

Not even lib. It could go into runtime/parrot/include though, this is at
least searched for :)

Dami^WLeopold Toetsch (as if you couldn't guess)

 Yet another certifiable Austral^H^Hian :-)

Yeah - and don't mix up these countries ... Austria is the big one
easterly of Liechtenstein.

 Nicholas Clark

leo


[ANNOUNCE] Parrot::DWIM

2003-09-23 Thread Leopold Toetsch
As we don't have any libs yet, I thought, I start with an important one. 
It works like Acme::DWIM.

Here is a sample run:

$ cat hello.imc
.pcc_sub _main prototyped
.include DWIM.imc
add $I0, 20, 22
print $I0
print \nHello Parrot!\n
end
.end
$ parrot hello.imc
42
Hello Parrot!
$ cat hello.imc
.pcc_sub _main prototyped
.include DWIM.imc
   # DWIM  $I0, 20, 22
   # DWIM  $I0
   # DWIM  \nHello Parrot!\n
   # DWIM
.end
$ parrot hello.imc
42
Hello Parrot!
So during the first run, the DWIM lib replaces all these nasty opcodes, 
which no one can remember, with the much more handsome DWIM comment.
This makes for much simpler code: just fill in the proper operands.

I should clean up and comment it a bit, then I could submit it - where?
runtime/parrot/lib ?
Have fun,
leo