Digest #58 2019-06-26
Contributions
Why this word was called unescape?
Usually escape
function does what this word — it replaces some characters with an encoded form, and unescape
function does reverse transformation — it replaces an encoded form with its original. For example, see in JavaScript, Python, Rust, T-SQL, etc.
Did the committee have examples when the conventional Forth practice for unescape
word was so opposite to common usage of escape
and unescape
functions in many other languages?
Replies
That's a good idea.
# deals with double numbers, and the stack effect reflects that. Not all words dealing with numbers deal with double numbers, e.g., + does not. So the answer to your first question is no.
The result of # goes to the pictured numeric output buffer, and that's the reason why it is required to be used inside <#...#>; <# does not change or look at the data stack. So the answer to your second question is no.
When you call # or #>, there has to be a double on top of the stack. The words are designed such that this is easy to achieve in usual usage, but if you want to use the words in unusual ways, you may have to put more thought into that. It's not necessary to have a double on the stack at all times between <# and #> (as demonstrated in GP3), so technically the answer to your third question is no.