peforth icon indicating copy to clipboard operation
peforth copied to clipboard

Parameters from and to forth

Open Pfontvilanova opened this issue 1 year ago • 0 comments

I’m very interested in the version of forth: peforth. Well, I find it very useful and interesting to be able to use forth or python interchangeably and with the great integration it has. I’m starting to learn python and I still don’t understand all its explanations very well. That’s why I would like if you could help me with any question that I don’t know how to apply.

My goal would be:

  1. Use a python line within a forth definition, example:

: looping py> sum(range(1, 1000)) .” The value of the sum is: “. Cr;

And somehow pass the value of the sum in python to the stack or to a forth variable to be able to use it in forth.

  1. The same but the other way around. Within a python function or program, add a block in forth and be able to use the values obtained in forth and pass them to the python....

If you could give me a couple of tips for these objectives it would be of great help to continue deepening the practical use of the peforth for my projects.

Thank you in advance

Pfontvilanova avatar Oct 13 '24 21:10 Pfontvilanova