home .. forth .. colorforth mail list archive ..

Re: [colorforth] ?dup


Samuel A. Falvo II wrote:
Arthur W. Green wrote:

Perhaps the optimizing word  ?dup  could be renamed  /dup . The
original mnemonic intention was: is a  dup  necessary? The new
mnemonic would be: cancel  dup  if possible.

Personally, I find ?DUP more intuitive. My first impulse is that /DUP
has something to do with division. But, either one is fine by me.

I would have chosen ?dup<- -- a bit lengthy and awkward to type, perhaps, but it's a bit symbolic and more or less follows other established Forth conventions. The ? *prefix* indicates that the word *optionally* does something. In this case, it'd be dup<- , which to me reads as 'backspace over DUP'. But, hey, that's just me. :D

I'd suggest it's a question of practicality. Will you want to add enough translation stuff to let you run traditional Forth? It hardly seems likely. So it doesn't matter for porting code. If you do decide to port code inward, you can write a translator to do it automatically -- maybe something that does some of the work and you do the rest. You could expect to wind up with something that isn't as good as what you'd write from scratch, but ?DUP wouldn't be an issue since it would get automatically changed; you'd just keep track of which side of the tranlator you were looking at.

Another issue is porting Forth programmers. When it starts looking like a commercial reality we'll get some Forth programmers coming in as late adapters. Things like a changed ?DUP would slow them down a bit. But it would only slow down people who were used to traditional Forth, and at that point they should be a small fraction of the new ColorForth programmers.

The third issue is whether it confuses people who are working on it now, particularly ones who switch among forths.

So if it's easy to change, then the sooner the better. But if it's hard to change it may not be worth doing.



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com