Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forth local variable assigning variables

Tags:

forth

gforth

I have a simple local variable in Forth:

: subtraction { a b } a b - ;

I would like to assign the output of

a b -

to another variable, say c.

Is this possible?

like image 697
Softey Avatar asked May 10 '26 02:05

Softey


1 Answers

TO works for both VALUEs and local variables, so:

: subtraction { a b | c -- } a b - to c ;
like image 79
Lars Brinkhoff Avatar answered May 14 '26 02:05

Lars Brinkhoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!