View Issue Details

IDProjectCategoryView StatusLast Update
0037949FPCCompilerpublic2020-10-20 23:04
ReporterWolfgang Helbig Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformimacOSos x 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0037949: Default file for get and put
DescriptionThis 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 InformationThis 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
TagsNo tags attached.
Fixed in Revision47147
FPCOldBugId
FPCTarget-
Attached Files

Activities

There are no notes attached to this issue.

Issue History

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 => -