A0001.HTM (8065B)
1 <title>ANS Forth RFI 0001: regarding the "flag" returned 2 by <a href=dpans11.htm#11.6.1.2090>READ-LINE</a> at end of file</title> 3 4 This document is produced by TC X3J14 as its clarification of questions 5 raised about ANSI X3.215-1994, American National Standard for Information 6 Systems - Programming Languages - Forth. 7 8 <p>The questions covered herein were raised by query 9 10 <p>Q0001, regarding the "flag" returned 11 by <a href=dpans11.htm#11.6.1.2090>READ-LINE</a> at end of file boundary 12 conditions. 13 14 <p>There are four parts in this document: 15 16 <ol> 17 <li><a href="#query">The original question as received.</a> 18 <li><a href="#reply">The TC's reply.</a> 19 <li><a href="#ballot">The Letter Ballot issued by TC Chair.</a> 20 <li><a href="#results">TC Chair's statement of ballot results.</a> 21 </ol> 22 23 <h2><a name="query">Q0001 as received</a></h2> 24 25 The following query has been assigned number Q0001 and has been 26 tentatively assigned to Mitch Bradley for drafting a response. 27 - Greg Bailey, by direction, Tue, 21 Mar 95 12:40:30 PST 28 <hr> 29 30 <pre> 31 Subject: Request for clarification--READ-LINE 32 To: x3j14@minerva.com, erather@aol.com 33 From: lgc@bluemax.jpl.nasa.gov (Loring Craymer) 34 Date: Mon, 23 Jan 95 09:14:21 -0800 35 Message-Id: <9501231714.AA00637@bluemax> 36 Received: from bluemax.jpl.nasa.gov by med3.minerva.com 37 ; Mon, 23 Jan 1995 38 11:00 PST 39 Content-Type: text 40 >From lgc Mon Jan 23 09:14:21 0800 1995 remote from bluemax.jpl.nasa.gov 41 Received: from bluemax (bluemax.jpl.nasa.gov [128.149.53.31]) by 42 telerobotics.jpl.nasa.gov (8.6.8/8.6.6) with SMTP id KAA00235; Mon, 23 Jan 43 1995 10:57:40 -0800 44 Received: by bluemax (920110.SGI/911001.SGI) for 45 @telerobotics.jpl.nasa.gov:erather@aol.com id AA00637; Mon, 23 Jan 95 09:14:21 46 -0800 47 Content-Length: 1072 48 </pre> 49 50 Dear Elizabeth: 51 52 <p>In the course of writing a test suite for the FILE wordset, I've discovered 53 that the <a href=dpans11.htm#11.6.1.2090>READ-LINE</a> definition is glaringly 54 incomplete. For this reason, 55 I am submitting this request for clarification (I assume that email is 56 sufficient; I don't recall that a more formal process is required). 57 58 59 <p>Request for clarification: 60 61 <pre> 62 <a href=dpans11.htm#11.6.1.2090>11.6.1.2090</a> 63 READ-LINE 64 ( c-addr u1 fileid -- u2 flag ior) 65 </pre> 66 67 What is the meaning of "flag"? The rationale suggests that it is 68 an end-of-file flag (or not-end-of-file from the behavior documented 69 in the definition), but this is not clear from the definition. 70 71 <p>What happens if the end of the file is encountered while reading a 72 line? The definition states that "If the operation succeeded, flag 73 is true and ior is zero", but success is not defined. I assume that 74 success is either that u1 characters were read or that a line terminator 75 was encountered. 76 77 <p>Suggested resolution: flag is true unless the end-of-file is encountered, 78 in which case it is false. ior does not reflect whether the 79 end-of-file was encountered or not. 80 81 <p> 82 --Loring 83 84 85 <h2><a name="reply">TC Reply to Q0001</a></h2> 86 <pre> 87 From: Erather@aol.com 88 Subject: Official Response to Q0001 89 To: X3J14 Technical Committee 90 Cc: lbarra@itic.nw.dc.us 91 Date: Fri, 31 Mar 95 12:51:59 PST 92 Doc#: X3J14/Q0001R 93 Reference Doc#: X3.215.1994 ANS Forth 94 Date: March 31, 1995 95 Title: Response to Request for Interpretation Q0001, Clarification of 96 READ-LINE 97 </pre> 98 99 Q0001 DRAFT rev 1 100 101 <hr> 102 Key 103 104 <i><blockquote> 105 Indicates lines from the original inquiry. The entirty text of the 106 inquiry is cited in this way. 107 </blockquote></i> 108 109 <b><blockquote> 110 Indicates excerpts from the standard 111 </blockquote></b> 112 113 Unmarked lines comprise the response to the inquiry. 114 <hr> 115 116 <i><blockquote> 117 Request for clarification: 118 119 <pre> 120 <a href=dpans11.htm#11.6.1.2090>11.6.1.2090</a> 121 READ-LINE 122 ( c-addr u1 fileid -- u2 flag ior) 123 </pre> 124 125 What is the meaning of "flag"? The rationale suggests that it is 126 an end-of-file flag (or not-end-of-file from the behavior documented 127 in the definition), but this is not clear from the definition. 128 </blockquote></i> 129 130 In the following excerpt from the definition of 131 <a href=dpans11.htm#11.6.1.2090>READ-LINE</a> 132 , the word "if" 133 means "If and only if". 134 135 <b><blockquote> 136 If the operation is initiated when the value returned by 137 <a href=dpans11.htm#11.6.1.1520>FILE-POSITION</a> 138 is equal to the value returned by 139 <a href=dpans11.htm#11.6.1.1522>FILE-SIZE</a> for the file identified 140 by fileid, flag is false ... 141 </blockquote></b> 142 143 144 145 <i><blockquote> 146 What happens if the end of the file is encountered while reading a 147 line? The definition states that "If the operation succeeded, flag 148 is true and ior is zero", but success is not defined. I assume that 149 success is either that u1 characters were read or that a line terminator 150 was encountered. 151 </blockquote></i> 152 153 "success" means that one of the following situations occurred: 154 155 <ol> 156 <li>Some non-terminator characters were read into the buffer or 157 158 <li>A line with a valid terminator sequence, but no characters other 159 than the terminator sequence, was read. In this case, u2=0, 160 flag=true, and ior=zero. 161 </ol> 162 163 Specifically, if the last line in the file is non-empty, but has no 164 terminator, an attempt to read that line will "succeed", returning the 165 number of characters thus read, and flag will be true. The next 166 read, assuming that no intervening 167 <a href=dpans11.htm#11.6.1.2142>REPOSITION-FILE</a> occurs, will return 168 u2=0, flag=false, ior=false. 169 170 <p>Here is complete list of return value combinations and their meanings: 171 172 <pre> 173 u2 flag ior Meaning 174 -- ---- --- ------- 175 X X nonzero Something bad and unexpected happened 176 (end-of-file is not "unexpected") 177 178 0 false zero End-of-file; no characters were read 179 180 0 true zero A blank line was read 181 182 0<u2<u1 true zero The entire line was read 183 184 u1 true zero A partial line was read; the rest would 185 not fit in the buffer, and can be acquired 186 by additional calls to <a href=dpans11.htm#11.6.1.2090>READ-LINE</a>. 187 </pre> 188 189 <i><blockquote> 190 Suggested resolution: flag is true unless the end-of-file is encountered, 191 in which case it is false. ior does not reflect whether the 192 end-of-file was encountered or not. 193 </blockquote></i> 194 195 <h2><a name="ballot">Letter Ballot</a></h2> 196 197 <pre> 198 From: Erather@aol.com 199 Subject: Letter Ballot 012 200 To: X3J14 Technical Committee 201 Cc: lbarra@itic.nw.dc.us 202 Date: Fri, 31 Mar 95 12:54:23 PST 203 X3 Subgroup Letter Ballot 204 Authorized by X3 Procedures - Distributed by X3 Subgroup X3J14 Project: 205 X3J14, ANS Forth 206 Doc#: X3J14/LB012 207 Reference Doc#s: X3J14/Q0001R, X3.215.1994 ANS Forth 208 Date: March 31, 1995 209 Title: Response to Request for Interpretation Q0001 210 Ballot Period: 30 Days 211 Ballot Closes NOON DATE: April 30, 1995 212 Respond to: greg@minerva.com 213 or: Elizabeth D. Rather, Chair 214 FORTH, Inc. 215 111 N. Sepulveda Blvd. Suite 300 216 Manhattan Beach, CA 90266 217 (310) 372-8493 FAX (310) 318-7130 218 219 Statement: 220 Document X3J14/Q0001R contains a proposed Response to Request for 221 Interpretation Q0001. 222 223 Question: 224 Do you agree that this response represents the intended interpretation of 225 X3.215.1994 ANS Forth? 226 227 YES____ NO____ ABSTAIN____ [NO or ABSTAIN votes require an explanation] 228 229 Signature: [not required for email ballots] 230 Name: 231 Organization: 232 233 INSTRUCTIONS: 234 Please return the entire letter ballot with your response _either_ by email 235 to greg@minerva.com _or_ by regular mail or fax to me at the above address, 236 before the closing date & time. 237 238 All TC members must vote. Failure to vote in two consecutive ballots may 239 cause you to lose your voting rights in X3J14. 240 241 Thank you for your participation. 242 243 Elizabeth D. Rather, Chair, X3J14 244 </pre> 245 246 <h2><a name="results">Results of Letter Ballot</a></h2> 247 248 <pre> 249 From: Erather@aol.com 250 Subject: Letter Ballot Results 251 To: X3J14 Technical Committee 252 Date: Fri, 05 May 95 18:50:18 PDT 253 Letter ballots 12 [and 13] have closed. Both passed. Results follow. 254 255 Letter ballot 12: 13 yes, 0 no, 0 abstaining. 256 257 [irrelevant material deleted] 258 259 Thank you all for your participation. Of the 14 votes received, 9 came by 260 email, and the rest by fax (plus mine!). 261 262 Regards... 263 Elizabeth 264 </pre>