Jump to content

Talk:Pascal (programming language)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 00:20, 30 November 2022 (Archiving 1 discussion(s) to Talk:Pascal (programming language)/Archive 2) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Vital article

Former featured article candidatePascal (programming language) is a former featured article candidate. Please view the links under Article milestones below to see why the nomination was archived. For older candidates, please check the archive.
Article milestones
DateProcessResult
March 1, 2008Featured article candidateNot promoted
WikiProject iconComputing: Software / CompSci C‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (assessed as Mid-importance).
Taskforce icon
This article is supported by WikiProject Computer science (assessed as Low-importance).
Things you can help WikiProject Computer science with:


The image contains terrible Pascal code

The indentation is odd and there are unnecessary begin/end pairs. It appears to be from a beginner programmer who has cut-and-pasted parts that work. It makes Pascal look more cryptic than it is. --Abandondero (talk) 23:09, 29 November 2022 (UTC)[reply]

Merger Proposal (VSI Pascal)

The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
Merged

I propose merging VSI Pascal into this article. I think the information from that article can be condensed and added to Pascal (programming language)#Other variants without making this article too long. Vt320 (talk) 20:04, 7 February 2022 (UTC)[reply]

The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

wrong, but understandable variant record example

The following example is understandable, but wrong:

TYPE
     TSystemTime = record
       Year, Month, DayOfWeek, Day : word;
       Hour, Minute, Second, MilliSecond: word;
     end;  
     TPerson = RECORD
        FirstName, Lastname: String;
        Birthdate: TSystemTime;
        Case isPregnant: Boolean of 
           true: (DateDue:TSystemTime);
           false: (isPlanningPregnancy: Boolean);
        END;

Person's sex is omitted, but pregnancy status is required even for men. Only women can be pregnant, is this a women record? also END for RECORD is missing. The following code is the union of male and female records, also female records have two variants for pregnant and not pregnant women:

TYPE
     TSex = (male, female) ;
     TSystemTime = record
       Year, Month, DayOfWeek, Day : word;
       Hour, Minute, Second, MilliSecond: word;
     end;  
     TPerson = Record
        FirstName, Lastname : String;
        Birthdate : TSystemTime;
        Case Sex : TSex of 
           female: Case isPregnant: Boolean of 
                      true: (DateDue:TSystemTime);
                      false: (isPlanningPregnancy: Boolean);
                   End {isPregnant Case};
           male: (hasVasectomy : Boolean);
        End {Sex Case} ;
     End {Record} ;

I did not change the example because I don't have a Pascal compiler to try it and many years have passed since the last time I wrote a program in Pascal. I am not sure it has a correct syntax. The second an maybe more important reason is because it is more complex than the original one. Another option is to rewrite the original example as follows:

TYPE
     TSystemTime = Record
       Year, Month, DayOfWeek, Day : word;
       Hour, Minute, Second, MilliSecond: word;
     end;  
     TWoman = Record
        FirstName, Lastname: String;
        Birthdate: TSystemTime;
        Case isPregnant: Boolean of 
           true: (DateDue:TSystemTime);
           false: (isPlanningPregnancy: Boolean);
        End {isPregnant case};
      End {TWoman Record};

Whichever option is taken, this example comes from another article, it should be changed in that page too. Of course not necessary identical each according to what is explained. — Preceding unsigned comment added by 2806:106E:B:400F:F9:F69F:2ED7:3753 (talk) 05:50, 4 September 2022 (UTC)[reply]

I've updated with a simpler, less potentially controversial, example. Chris Burrows (talk) 23:41, 6 September 2022 (UTC)[reply]

Enumerations missing in the article

Nothing about enumerate types. The table:

Data type Type of values which the variable is capable of storing
integer integer (whole) numbers
real floating-point numbers
boolean the values True or False
char a single character from an ordered character set
set equivalent to an array of boolean values
array a countable group of any of the preceding data types or records
record A collection of any of the preceding data types
string a sequence or "string" of characters is declared as a "packed array of char" with a starting index of 1. These can be assigned string constants and individual characters can be accessed as elements of the array.

must have an enumeration row, maybe:

Data type Type of values which the variable is capable of storing
integer integer (whole) numbers
real floating-point numbers
boolean the values True or False
char a single character from an ordered character set
set equivalent to an array of boolean values
enums type including different lables
array a countable group of any of the preceding data types or records
record A collection of any of the preceding data types
string a sequence or "string" of characters is declared as a "packed array of char" with a starting index of 1. These can be assigned string constants and individual characters can be accessed as elements of the array.

and the corresponding section containing the syntax and an example. — Preceding unsigned comment added by 2806:106E:B:400F:F9:F69F:2ED7:3753 (talk) 06:12, 4 September 2022 (UTC)[reply]