View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037949 | FPC | Compiler | public | 2020-10-18 14:38 | 2020-10-20 23:04 |
Reporter | Wolfgang Helbig | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | imac | OS | os x | ||
Product Version | 3.2.0 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0037949: Default file for get and put | ||||
Description | This is not a bug report but a change request: The file parameter of get and put can be omitted. That is get is equivalent to get(input) and put is equivalent to put(output) thus resembling all other file related predeclared procedures and functions. (with the exception to rewrite and reset, since they must not be applied to the standard files.) This is far more beautiful than the ISO-standard allows! And, remember E.W. Dijkstra: Beauty is our Business. | ||||
Steps To Reproduce | $ cat >get.p {$MODE ISO} program p(input, output); begin get; put end. $ fpc get.p get.p(4,6) Error: Illegal expression get.p(6,1) Error: Illegal expression get.p(7) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/local/bin/ppcx64 returned an error exitcode The parameter to get shall be defaulted to the input and to put to the output parameter of the program header | ||||
Additional Information | This is not demanded by ISO-7815. Here the output of the p5 compiler: $ pcom get.p get.p5 P5 Pascal compiler vs. 1.3 Pascal-P5 complies with the requirements of level 0 of ISO/IEC 7185. 1 -32 {$MODE ISO} 2 -32 program p(input, output); 3 -32 begin 4 3 get; 4 **** ^9,2,4 5 6 put 6 6 end. 6 **** ^9,2,4 Errors in program: 6 Error numbers in listing: ------------------------- 2 Identifier expected 4 ')' expected 9 '(' expected Jensen, Wirth: Pascal User Manual and Report, 3rd ed. reads on page 205: "If f is omitted, program parameter Input is assumed." Strangely, this clause is not shown under the heading put(f). I think, it | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 47147 | ||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-18 14:38 | Wolfgang Helbig | New Issue | |
2020-10-20 23:04 | Florian | Assigned To | => Florian |
2020-10-20 23:04 | Florian | Status | new => resolved |
2020-10-20 23:04 | Florian | Resolution | open => fixed |
2020-10-20 23:04 | Florian | Fixed in Version | => 3.3.1 |
2020-10-20 23:04 | Florian | Fixed in Revision | => 47147 |
2020-10-20 23:04 | Florian | FPCTarget | => - |