Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!compulink.co.uk!aph From: aph@compulink.co.uk (Andrew Haley) Newsgroups: comp.lang.forth Subject: ANS Forth Message-ID: Date: 13 Aug 90 19:02:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 113 The following is a proposal I intend to send to the ANS Forth Technical Committee in a few days time. Anyone who wishes to comment on this, please do so soon; it might save me some embarrassment! I will post a message detailing the reply I get after I send this. Andrew Haley Software Manager Computer Solutions Ltd. Canada Road Byfleet Surrey KT13 8HT England 13th Aug 1990 ANS ASC X3/X3J14 Forth Technical Committee 111 N. Sepulveda Boulevard Manhattan Beach California 90266 The following are proposals for the Technical Committee; please note that all comments below refer to BASIS 12. 1. The word PAUSE should be defined as doing nothing (i.e., having no execution semantics) but having multiprogramming impact. 2. In systems that implement CATCH and THROW, there should be no words predefined in the system which QUIT; all exceptions should be raised by THROW. This way, a portable application can be written in such a way that a user will NEVER be dumped into the Forth interpreter. 3. The definition of WITHIN is incorrect in that it assumes a particular overflow behaviour for - (minus) which is not specified by the standard. 4. The word " (quote) should be removed from the non- portable word set (p119). 5. The definition of floating-point numbers as rationals is unnecessarily confusing. It would be more helpful to define floating-point numbers as an implementation-defined subset of reals. 6. It is not specified whether the word EVALUATE is "state smart". If EVALUATE is executed by a word (presumably defined as IMMEDIATE) whilst the system is compiling, does it compile execution tokens into the dictionary or execute words? If EVALUATE is not "state smart", there seems to be no way to specify the compilation behaviour. 7. There seems to be no way to use ?DO with a negative step in +LOOP so that the loop executes just once. I don't think that with the existing FORTH-83 loop structure there is anything that can be done about this, but this somewhat odd behaviour should be documented somewhere, perhaps in ?DO. 8. There are many Forth systems which compile for a small target computer which does not, itself, have a dictionary, (or an interpreter) but relies on another computer to compile for it. Some of these (such as chipFORTH) have full support for interaction. These are an important (and increasing) part of the market for Forth systems. It would be unwise to exclude them from the standardisation process. I propose that there should be a recognised "Run Time Subset" of ANS Forth for such systems. This should specify a MINIMUM set of core words for these systems. The subset I propose is: ! ( * */ */ */MOD + +! +LOOP - / /MOD 0< 0= 0> 1+ 1- 2! 2* 2/ 2>R 2@ 2DROP 2DUP 2OVER 2R> 2SWAP < = > >R ?DUP @ ABS ALIGNED AND BEGIN C! C@ CELL + CELLS CHAR CHAR+ CHARS D+ D< DEPTH DNEGATE DO DROP DUP ELSE EXECUTE EXIT FILL HERE HOLD I IF INVERT J LEAVE LITERAL LOOP MAX MIN MOD MOVE NEGATE OR OVER R> R@ RECURSE REPEAT ROT S>D SWAP THEN U< UM* UM/MOD UNLOOP UNTIL WHILE XOR [ ['] [CHAR] ] In addition, the following words may be used, but only outside a definition, i.e. they may not be used between : and ; ' , : ; ALIGN ALLOT C, CONSTANT CREATE VARIABLE Clearly this subset lacks some of the power of Forth, but it specifies a means of partial compliance for these important systems which have no way to comply fully with the standard. It is unlikely that any application program written for such a microcontroller-like system will be fully portable, because of I/O hardware dependencies. However, this subset defines a minimum subset which a Forth vendor must supply. Unfortunately, there seems to be no portable way to allow compiling and defining words. Despite this fact, it is better to have the minimum commonality which this list represents than none at all. 9. PICK should be moved from the CORE to the EXT CORE word set. 10. [ has been lost from the left hand column on page 110.