missing documentation

#51 · closed · 4 comments

View on GitHub ↗

jko-teenage

Several words in e.g. core.zf seem undocumented, and it is not so easy and fun to figure out.

Comments

jko-teenage

Right now, I am specifically trying to figure out > ( memory management ) > > : allot h +! ; > : var : ' lit , here 5 allot here swap ! 5 allot postpone ; ; > : const : ' lit , , postpone ; ; > : constant >r : r> postpone literal postpone ; ; > : variable >r here r> postpone , constant ; but there are probably other parts that are not obvious.

zevv

`allot`, `constant` and `variable` are pretty much standard Forthism, a good source to learn about these is the original Forth book by LEo Brodie: https://www.forth.com/wp-content/uploads/2018/01/Starting-FORTH.pdf Let me know if this is enough to help you!

jko-teenage

Hi! What I expect is that for each word, there is at least a small comment that documents the stack effects. Similar to this random Gforth snippet: `: rnd ( -- x ) seed @ generator um* drop 1+ dup seed ! ;` This is especially important because zForth is non-standard, I cannot make any assumptions that words behave like standard Forth.

zevv

You're right, not all of the example libraries have these comments - I'd be more than happy to take PRs for this though!