Talk:Pascal (programming language)
This is the talk page for discussing improvements to the Pascal (programming language) article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
Archives: 1, 2Auto-archiving period: 3 months ![]() |
![]() | Pascal (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. | |||||||||
|
![]() | Computing: Software / CompSci C‑class Mid‑importance | ||||||||||||||||||||||
|
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)
- I assume you were talking about the FPC IDE image. This is not Pascal, but a dialect of it. FPC is capable of using regular/Wirth Pascal, the image shown is not an example of it. I removed it. Samiam95124 (talk) 23:29, 12 July 2023 (UTC)
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)
- Seems OK to merge to me. Bubba73 You talkin' to me? 03:01, 8 February 2022 (UTC)
- I'm unsure. Several variations have their own article. Bubba73 You talkin' to me? 04:06, 8 February 2022 (UTC)
- I feel in this case that the VSI Pascal dialect does not have enough notable distinctions to warrant a standalone article, unlike some of the other dialects which have their own articles. Vt320 (talk) 22:03, 27 March 2022 (UTC)
- I'm unsure. Several variations have their own article. Bubba73 You talkin' to me? 04:06, 8 February 2022 (UTC)
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)
- I've updated with a simpler, less potentially controversial, example. Chris Burrows (talk) 23:41, 6 September 2022 (UTC)
- Just my opinion, but this is not the place to have off topic discussions about if men can or cannot get pregnant. Can we stick if the examples are or are not valid Pascal? Samiam95124 (talk) 23:31, 12 July 2023 (UTC)
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)