[net.lang.forth] Local Variables?

bbanerje@sjuvax.UUCP (10/23/86)

Hi,

Is it possible to get local variables in forth?

A few days ago, I dusted off a very old tape containing my compiler
project from College.  It was an Algol 60 subset, which used a
stack based language as an intermediate representation.  Great,
I thought, I'll rewrite the code generator to output forth, and
I can then take it anywhere (The original was written on a UNIVAC
1100 running Exec 8)

The only thing I know about Forth, is that it is a postfix stack
language.  So, I sat down with Brodie's book -- and found that there
is apparently no such thing as a local variable stack.

The only thing I can think of is to use the parameter stack for
local variables.  I would like to be able to pop off everything
that was pushed on the stack since I entered the routine -- but
would have to know the address of the parameter stack pointer,
the wordsize, and whether the stack grows up or down in memory.

Is there any way to get this info. portably in forth?  I could
hack the system that I currently have access to in order to
provide this -- but I don't think that I should make a habit of
this.  Ideas anyone?

Please reply by mail, as this group is at the end of my .newsrc
and I don't get to it very often.

Thanks,

				Binayak Banerjee
		{allegra | astrovax | bpa | burdvax}!sjuvax!bbanerje
			bbanerje%sjuvax.sju.edu@csnet-relay.arpa