Digest #64 2019-07-11

Contributions

[93] 2019-07-10 14:52:51 ruv wrote:

requestClarification - POSTPONE [IF]

Why does an ambiguous condition exist if [IF] is POSTPONEd? And why does not it spread to[ELSE]?

What can be wrong with:

: [UNLESS] 0= POSTPONE [IF] ; IMMEDIATE

Replies

[r250] 2019-07-10 07:22:06 AntonErtl replies:

requestClarification - Address between runs

The code is standard.

Images are not standardized, so what a system does on image creation and restoration is up to the system.

I think that it would be too restrictive to not support this kind of code (at least if FOO was an address in the dictionary), so systems will support it in some way, either by always restoring the image to the same addresses, or by supporting relocatable images.

E.g., Gforth supports relocatable images, so even though the address of FOO may change across image saving and restoring, BAR will work as intended. Some not so common uses do not work across image saving and restoring, though, e.g., if you compute a hash value from data that includes an address.


[r251] 2019-07-10 07:29:39 AntonErtl replies:

requestClarification - the confusing names

All the new names with : at the end were introduced because the corresponding names without colon already have a conflicting meaning in a widely used system. I know this for sure for the field words and for {:, for BUFFER: I don't remember any discussion about the name.


[r252] 2019-07-10 07:39:57 AntonErtl replies:

comment - Etymology and naming convention issue

PARSE-NAME was originally proposed as PARSE-WORD, but that name has conflicting behaviour in some widely-used systems, so PARSE-NAME was chosen.

While consistency in naming conventions is desirable, and it would be nice if no name existed that might be considered to belong to a different group of words than it actually belongs to, that seems too high a standard to satisfy in all cases. And in particular, I don't think the benefits of this principle are worth the cost that renaming existing standard words would entail.


[r253] 2019-07-10 07:50:02 StephenPelc replies:

requestClarification - Address between runs

Good catch. IMHO it is entirely sensible that children of BUFFER: may return different addresses on different runs. Apart from Anton's example, consider a buffer allocated from the heap. Heap allocation may vary from run to run.


[r254] 2019-07-10 07:54:38 StephenPelc replies:

requestClarification - the confusing names

At the time (early 1990s) it was expected that BLOCK and friends would slowly die away. Especially with the rise of retro-computing BLOCK and friends remain healthy.


[r255] 2019-07-10 14:33:51 ruv replies:

comment - Etymology and naming convention issue

When PARSE-NAME was chosen (2005) the definitions from the first group (2012) was not proposed yet. So this inconsistency did not exist in those time (and I did not have any objection for PARSE-NAME name too). It has appeared far later.

Perhaps in the future some kind of namespaces will be introduced in Forth to distinguish the groups of words. But for now we should choose names more carefully. I suppose that inconsistency in naming confuses the newbies and gives the impression of a bad designed programming language. So I would like to make Forth Standard better.

I agree that we can't just rename the already existing standard words. But we can add the synonyms with better names, and leave the old variants for back compatibility.


[r256] 2019-07-10 19:06:17 JennyBrien replies:

requestClarification - POSTPONE [IF]

[IF] ... [ELSE] ... [THEN] can be nested, in which case subsequent [IF]s all paste to a matching [THEN].

Consider what happens when [UNLESS] is placed within an [IF] ... [THEN] block.