Forth local variable assigning variables

怎甘沉沦 提交于 2020-01-15 08:08:30

问题


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?


回答1:


TO works for both VALUEs and local variables, so:

: subtraction { a b | c -- } a b - to c ;


来源:https://stackoverflow.com/questions/49115901/forth-local-variable-assigning-variables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!