Leo --

Thats going to be a problem for Jako.

Can't nest .sub, so I can't have a bracketing .sub for the whole script, 
with my real subs' .subs inside. So, I have to choose (I think) from these 
options in order to leverage IMCC:

  * Bracket with one big .sub ... .end, and don't use .sub for my real 
subs (yuck -- I want to use .param, .arg, etc for subs and calls)

  * Use the anonymous blocks to bracket all non-sub linear code in the 
script as I have done (yuck -- results in the problems I've reported)

  * Change the Jako language to require all linear code to be either 
before or after all the subs (yuck -- Perl doesn't force this, and I don't 
want to, either)

  * Change the Jako compiler to collect all linear code into a single 
segment and emit it at the end, inside .sub ... .end, with a preamble 
..sub; goto __COLLECTED_LINEAR_CODE; .end at the beginning of the .imc file 
(yuck -- To date, the Jako compiler has gotten away with doing its job as 
a single pass essentially in filter mode, and I'd like to retain that 
feature)

Given these 4 choices, I choose #5: try to change the rules of the game. 
:)

        I suggest that imcc should allow code outside .sub ... .end 
brackets, which should be good for Jako, Perl and other languages.

I don't know how popular that will be, but it seems reasonable to me...


Regards,

-- Gregor





Leopold Toetsch <[EMAIL PROTECTED]>
12/05/2002 11:34 AM

 
        To:     [EMAIL PROTECTED]
        cc:     [EMAIL PROTECTED]
        Subject:        Re: Subroutine IMC example with problem


[EMAIL PROTECTED] wrote:

> 
>         error:imcc:iANY file sub.imc line 36: op not found 'set_ic_ic' 


2 "mistakes" here:
- branches between subs are not subject to fixup
- x is not declared in here:


>                  .sub     __ANON_BLOCK__1 
>                  set      x, 42                     # x = 42


A .sub is a unit which is parsed/compiled in one piece. As I already 
wrote: for your code put one .sub at the begin and one .end at the end - 
that's all.

To see, what the parser thinks run: imcc -y x.imc 2>&1 | less

leo




Reply via email to