[EMAIL PROTECTED] wrote:

Leo --


If .sub ... .end bracket not a subroutine, but a unit of compilation (module?), then
shouldn't we make the name reflect the purpose?


A thing compiled in one piece ist mostly a subroutine.

I disagree. A think what is most often compiled in one piece is a file,
with a combination of sub and not-sub stuff in it, possibly a whole
class, or possibly just chunks of code (as with Jako and Perl).

I wanted to say: you can compile one sub in one piece, while you can't compile smaller pieces. So a sub is the smallest compilation unit. Of course you can compile one file containing many subs as one piece of code.

WRT you jako code - I thought about it a little longer: It wouldn't be a big problem to gather code outside subs and compile it at the end, after interpsarsed subs. It would only need one additional instruction** pointer to collect all ins there. Likewise nested subs.

Though the HL still has to generate appropriate "bsr" to call the main routine.

Your example code would be spit out aus:

callmainsub
sub1
sub2
main (code goes here (containing everything outside subs))


Regards,

-- Gregor

leo



Reply via email to