,---------------. | Contributions | `---------------´ ,------------------------------------------ | 2024-08-12 13:32:06 ruv wrote: | requestClarification - Behavior of EMPTY-BUFFERS when BLK is nonzero | see: https://forth-standard.org/standard/block/EMPTY-BUFFERS#contribution-359 `------------------------------------------ Should not we add: > An ambiguous condition exists if `BLK` contains a non-zero when `EMPTY-BUFFERS` is invoked. ,---------. | Replies | `---------´ ,------------------------------------------ | 2024-08-12 07:40:55 ruv replies: | comment - Resolve the forward reference orig1 using the location following the appended run-time semantics. | see: https://forth-standard.org/standard/core/ELSE#reply-1292 `------------------------------------------ > It talks about then patching the branch added by `else` The spec does not use the term "patching". Some Forth systems employ two-pass compilation of a definition (it is allowed), without any patching. If you patch a branch — it's your implementation detail. Anyway, we can forget about `else` for a moment. The following shall work without errors: ```forth : bool-to-n ( x -- 1|0 ) if 1 ahead [ 1 cs-roll ] then 0 then ; t{ false bool-to-n -> 0 }t t{ true bool-to-n -> 1 }t ``` And the Forth system **is allowed** to compile the above definition to a code that does not contain **any branches at all**, for example to a code like this: ``` : bool-to-n ( x -- 1|0 ) [: 1 ;] [: 0 ;] ifelse ; ``` Where `ifelse` does not perform any jump/branch, but only an indirect call: ``` : ifelse ( i*x x.bool xt.on-true xt.on-false -- j*x ) rot 0= tuck and ( xt.on-true flag xt.on-false|0 ) -rot 0= and ( xt.on-false|0 xt.on-true|0 ) or execute ; ``` ,------------------------------------------ | 2024-08-12 20:23:21 ruv replies: | requestClarification - shadowed names | see: https://forth-standard.org/standard/tools/TRAVERSE-WORDLIST#reply-1293 `------------------------------------------ Just for reference. We forgot that the [change in wording for `traverse-wordlist`](https://forth-standard.org/proposals/traverse-wordlist-does-not-find-unnamed-unfinished-definitions?hideDiff#reply-487) was accepted in 2020. And it says that the old wording (i.e., that in Forth-2012) already gives guarantee that the shadowed words are visited.