umouse

umouse.git
git clone git://git.lenczewski.org/umouse.git
Log | Files | Refs | Submodules | README

A0004.HTM (11872B)


      1 <title>ANS Forth RFI 0004: standard punctuation for double-cell numbers</title>
      2 
      3 This document is produced by TC X3J14 as its clarification of questions
      4 raised about ANSI X3.215-1994, American National Standard for Information
      5 Systems - Programming Languages - Forth.
      6 
      7 <p>The questions covered herein were raised by query
      8 
      9 <p>Q0004, regarding standard punctuation for double-cell numbers when
     10 occurring in programs.
     11 
     12 <p>There are four parts in this document:
     13 
     14 <ol>
     15 <li><a href="#query">The original question as received.</a>
     16 <li><a href="#reply">The TC's reply.</a>
     17 <li><a href="#ballot">The Letter Ballot issued by TC Chair.</a>
     18 <li><a href="#results">TC Chair's statement of ballot results.</a>
     19 </ol>
     20 
     21 <h2><a name="query">Q0004 as received</a></h2>
     22 The following query has been assigned number Q0004 and has been
     23 tentatively assigned to John Hayes for drafting a response.
     24 - Greg Bailey, by direction  950516 0400Z
     25 <hr>
     26 
     27 <pre>
     28 Subject: ANS Forth Clarification Procedures
     29 To: greg@minerva.com
     30 From: BiMu@aol.com (Bill Muench)
     31 Date: Mon, 15 May 1995 15:13:21 -0400
     32 Message-Id: <950515151319_119428296@aol.com>
     33 Received: from aol.com by med3.minerva.com <a href=dpans6.htm#6.1.0460>;</a> Mon, 15 May 1995 12:18 PDT
     34 Request for Clairification.
     35 </pre>
     36 
     37 I have found the following references to *Text interpreter input number
     38 conversion*.
     39 
     40 <p>
     41 The input of Floating-Point numbers is clear, my need for clairification is
     42 with double-cell numbers:
     43 
     44 <p>
     45 Will a number with an *embedded* decimal point be converted to a double-cell
     46 number in a Standard Forth system?
     47 
     48 <p>
     49 If not, what about <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a> *...should treat numbers that have an embedded
     50 decimal point, but no exponent, as floating-point numbers rather than double
     51 cell numbers. This suggestion, although it has merit, has always been voted
     52 down because it would break too much existing code;* ?
     53 
     54 <p>
     55 Is <a href=dpans8.htm#8.3.2>8.3.2</a> an example or the rule? ( a decimal point at the end)
     56 
     57 <blockquote>
     58 <a href=dpans8.htm#8.3.2>8.3.2</a> Text interpreter input number conversion
     59 
     60 <p>
     61 When the text interpreter processes a number that is immediately followed by
     62 a decimal point and is not found as a definition name, the text interpreter
     63 shall convert it to a double-cell number.
     64 For example, entering <a href=dpans6.htm#6.1.1170>DECIMAL</a> 1234 leaves the single-cell number 1234 on the
     65 stack, and entering <a href=dpans6.htm#6.1.1170>DECIMAL</a> 1234. leaves the double-cell number 1234 0 on the
     66 stack.
     67 
     68 <p>
     69 See: <a href=dpans3.htm#3.4.1.3>3.4.1.3</a> Text interpreter input number conversion.
     70 
     71 <p>
     72 <a href=dpans12.htm#12.3.7>12.3.7</a> Text interpreter input number conversion
     73 
     74 <p>
     75 If the Floating-Point word set is present in the dictionary and the current
     76 base is <a href=dpans6.htm#6.1.1170>DECIMAL</a>, the input number-conversion algorithm shall be extended to
     77 recognize floating-point numbers in this form:
     78 
     79 <pre>
     80 Convertible string := &lt;significand&gt;&lt;exponent&gt;
     81 &lt;significand&gt; := [&lt;sign&gt;]&lt;digits&gt;[.&lt;digits0&gt;]
     82 &lt;exponent&gt; := E[&lt;sign&gt;]&lt;digits0&gt;
     83 &lt;sign&gt; := { + | - }
     84 &lt;digits&gt; := &lt;digit&gt;&lt;digits0&gt;
     85 &lt;digits0&gt; := &lt;digit&gt;*
     86 &lt;digit&gt; := { 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 }
     87 </pre>
     88 
     89 These are examples of valid representations of floating-point numbers in
     90 program source:
     91 
     92 <pre>
     93 1E   1.E   1.E0   +1.23E-1   -1.23E+1
     94 </pre>
     95 
     96 See: <a href=dpans3.htm#3.4.1.3>3.4.1.3</a> Text interpreter input number conversion, <a href=dpans12.htm#12.6.1.0558>12.6.1.0558</a> <a href=dpans12.htm#12.6.1.0558>>FLOAT</a>.
     97 
     98 <p>
     99 <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a> Text interpreter input number conversion
    100 
    101 <p>
    102 The Technical Committee has more than once received the suggestion that the
    103 text interpreter in Standard Forth systems should treat numbers that have an
    104 embedded decimal point, but no exponent, as floating-point numbers rather
    105 than double cell numbers. This suggestion, although it has merit, has always
    106 been voted down because it would break too much existing code; many existing
    107 implementations put the full digit string on the stack as a double number and
    108 use other means to inform the application of the location of the decimal
    109 point.
    110 </blockquote>
    111 
    112 <pre>
    113 ( ============================================================ )
    114 ( Bill Muench \ OntoLogic )
    115 (             \ 3901 Branciforte Drive \ 408 425 8740 )
    116 (             \ Santa Cruz  CA  95065  \ BiMu@aol.com )
    117 </pre>
    118 
    119 <h2><a name="reply">TC Reply to Q0004</a></h2>
    120 <pre>
    121 From: Elizabeth D. Rather
    122 Subject: Q0004R, Number Conversion, Official Response
    123 To: X3J14 Technical Committee
    124 Cc: lbarra@itic.nw.dc.us
    125 Date: Wed, 31 May 95 17:04:01 PDT  
    126 Doc#:  X3J14/Q0004R
    127 Reference Doc#:  X3.215.1994 ANS Forth
    128 Date:  May 24, 1995
    129 Title: Response to Request for Interpretation Q0004, Clarification of
    130 Number Conversion
    131 </pre>
    132 
    133 <i><blockquote>
    134 <pre>
    135 Subject: ANS Forth Clarification Procedures
    136 To: greg@minerva.com
    137 From: BiMu@aol.com (Identity not yet established)
    138 Date: Mon, 15 May 1995 15:13:21 -0400
    139 Message-Id: <950515151319_119428296@aol.com>
    140 Received: from aol.com by med3.minerva.com ; Mon, 15 May 1995 12:18 PDT
    141 Request for Clairification.
    142 </pre>
    143 
    144 I have found the following references to *Text interpreter input number
    145 conversion*.
    146 
    147 <p>
    148 The input of Floating-Point numbers is clear, my need for clairification is
    149 with double-cell numbers:
    150 
    151 <p>
    152 Will a number with an *embedded* decimal point be converted to a double-cell
    153 number in a Standard Forth system?
    154 </blockquote></i>
    155 
    156 Not necessarily.  A Standard System is permitted, but not required, to
    157 convert digit strings with embedded periods as double numbers.
    158 Consequently, a Standard Program cannot rely on any particular
    159 interpretation of such digit strings.
    160 
    161 <i><blockquote>
    162 If not, what about <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a> *...should treat numbers that have an embedded
    163 decimal point, but no exponent, as floating-point numbers rather than double
    164 cell numbers. This suggestion, although it has merit, has always been voted
    165 down because it would break too much existing code;* ?
    166 </blockquote></i>
    167 
    168 <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a> would be clearer if it read:
    169 The Technical Committee has more than once received the suggestion that
    170 the text interpreter in Standard Forth systems should treat numbers
    171 that have an embedded decimal point, but no exponent, as floating-point
    172 numbers.  This suggestion, although it has merit, has always been voted
    173 down because it would break too much existing code; many existing
    174 implementations put the full digit string on the stack as a double
    175 number and use other means to inform the application of the location of
    176 the decimal point.
    177 
    178 Note that the only change I made was to delete the phrase "rather than
    179 double cell numbers" from the first sentence <a href=dpansa12.htm#A.12.3.7>A.12.3.7</a>.  The original
    180 sentence implies that numbers with an embedded decimal point and no
    181 exponent are converted to double numbers in a Standard System.  The
    182 intent of the committee was to allow this behavior in a Standard
    183 System, but not to require it.
    184 
    185 <i><blockquote>
    186 Is <a href=dpans8.htm#8.3.2>8.3.2</a> an example or the rule? ( a decimal point at the end)
    187 </blockquote></i>
    188 
    189 It is the rule.
    190 
    191 <i><blockquote>
    192 <a href=dpans8.htm#8.3.2>8.3.2</a> Text interpreter input number conversion
    193 
    194 <p>
    195 When the text interpreter processes a number that is immediately followed by
    196 a decimal point and is not found as a definition name, the text interpreter
    197 shall convert it to a double-cell number.
    198 
    199 <p>
    200 For example, entering <a href=dpans6.htm#6.1.1170>DECIMAL</a> 1234 leaves the single-cell number 1234 on the
    201 stack, and entering <a href=dpans6.htm#6.1.1170>DECIMAL</a> 1234. leaves the double-cell number 1234 0 on
    202 the stack.
    203 
    204 <p>
    205 See: <a href=dpans3.htm#3.4.1.3>3.4.1.3</a> Text interpreter input number conversion.
    206 </blockquote></i>
    207 
    208 Other excerpts deleted.
    209 
    210 <pre>
    211         John R. Hayes
    212         Applied Physics Laboratory
    213         Johns Hopkins University
    214         john.hayes@jhuapl.edu
    215 </pre>
    216 
    217 <pre>
    218 Elizabeth D. Rather             "Forth-based products and
    219 FORTH, Inc.                      Services for real-time
    220 111 N. Sepulveda Blvd. #300      applications since 1973"
    221 Manhattan Beach, CA  90266
    222 (800) 55FORTH or (310) 372-8493
    223 FAX (310) 318-7130
    224 </pre>
    225 
    226 <h2><a name="ballot">Letter Ballot</a></h2>
    227 
    228 <pre>
    229 From: Elizabeth D. Rather
    230 Subject: LB015, RE Q0004, Number Conversion
    231 To: X3J14 Technical Committee
    232 Cc: lbarra@itic.nw.dc.us
    233 Date: Wed, 31 May 95 17:04:23 PDT  
    234 X3 Subgroup Letter Ballot
    235 Authorized by X3 Procedures - Distributed by X3 Subgroup X3J14
    236 Project: X3J14, ANS Forth
    237 Doc#:  X3J14/LB015
    238 Reference Doc#s:  X3J14/Q0004R, X3.215.1994 ANS Forth
    239 Date:  May 31, 1995
    240 Title: Response to Request for Interpretation Q0004, Number Conversion
    241 Ballot Period:  30 Days
    242 Ballot Closes NOON DATE:  June 30, 1995
    243 Respond to:  greg@minerva.com
    244         or:  Elizabeth D. Rather, Chair
    245              FORTH, Inc.
    246              111 N. Sepulveda Blvd.  Suite 300
    247              Manhattan Beach, CA  90266
    248              (310) 372-8493    FAX (310) 318-7130
    249              erather@forth.com
    250 
    251 Statement:
    252     Document X3J14/Q0004R contains a proposed Response to Request for
    253     Interpretation Q0004.
    254 
    255 Question:
    256     Do you agree that this response represents the intended interpretation of
    257     X3.215.1994 ANS Forth?
    258 
    259 
    260 /------------------------  begin response area----------------------\
    261 |
    262 |  YES____ NO____ ABSTAIN____
    263 |
    264 |  Signature:  [not required for email ballots]
    265 |  Name:
    266 |  Organization:
    267 |
    268 |  Explanation (REQUIRED for NO or ABSTAIN votes):
    269 |    <none>
    270 \------------------------  end response area  ----------------------/
    271 
    272 INSTRUCTIONS:
    273 Please return the entire letter ballot with your response _either_ by email
    274 to greg@minerva.com _or_ by regular mail or fax or email to me at the above
    275 address, before the closing date & time.
    276 
    277    If replying electronically PLEASE edit only within the response area
    278    indicated above, inserting any explanatory text in place of <none>.
    279    Any changes made outside that area will likely be overlooked.
    280 
    281 All TC members must vote.  Failure to vote in two consecutive ballots may
    282 cause you to lose your voting rights in X3J14.
    283 
    284 Thank you for your participation.
    285 
    286 Elizabeth D. Rather, Chair, X3J14
    287 
    288 Elizabeth D. Rather             "Forth-based products and
    289 FORTH, Inc.                      Services for real-time
    290 111 N. Sepulveda Blvd. #300      applications since 1973"
    291 Manhattan Beach, CA  90266
    292 (800) 55FORTH or (310) 372-8493
    293 FAX (310) 318-7130
    294 </pre>
    295 
    296 <h2><a name="results">Results of Letter Ballot</a></h2>
    297 
    298 <pre>
    299 From: Elizabeth D. Rather
    300 Subject: LBs 14 & 15
    301 To: X3J14 Technical Committee
    302 Cc: l.barra@itic.nw.dc.us
    303 Date: Fri, 07 Jul 95 12:05:04 PDT  
    304 Letter ballots [14 and] 15 closed at noon July 1 with the following results:
    305 
    306         Y  N  A NV
    307 [...]
    308 LB15:  11, 1, 0, 2
    309 
    310 Negative vote from Dave Harralson on Letter Ballot 15, with the following
    311 comment:
    312 
    313      I disagree with the response, "not necessarily...."  Section <a href=dpans8.htm#8.3.2>8.3.2</a> clearly
    314      states that a number with a decimal point that is not in the dictionary
    315      will be converted to a double-cell number.  If this section is revised,
    316      I vote yes.
    317 
    318 [8.3.2  Text Interpreter Input number conversion
    319         When the text interpreter process a number that is *immediately
    320         followed* by a decimal point and is not found as a definition name,
    321         the text interpreter shall convert it to a double-cell number.]
    322 [Standard quoted by editor; emphasis added where appropriate]
    323 
    324 [...]
    325 
    326 Thank you for your participation.
    327 
    328 Regards,
    329 Elizabeth D. Rather, Chair X3J14
    330 
    331 Elizabeth D. Rather             "Forth-based products and
    332 FORTH, Inc.                      Services for real-time
    333 111 N. Sepulveda Blvd. #300      applications since 1973"
    334 Manhattan Beach, CA  90266
    335 (800) 55FORTH or (310) 372-8493
    336 FAX (310) 318-7130
    337 </pre>