Pascal is a programming language created in 1970 by Niklaus Wirth.
#48on PLDB | 54Years Old | 49kRepos |
Pascal is an imperative and procedural programming language, which Niklaus Wirth designed in 1968–69 and published in 1970, as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named in honor of the French mathematician, philosopher and physicist Blaise Pascal. Pascal was developed on the pattern of the ALGOL 60 language. Read more on Wikipedia...
unit output;
interface
function Square(const num: Integer): Integer;
implementation
// Type your code here, or load an example.
function Square(const num: Integer): Integer;
begin
Square := num * num;
end;
end.
program Main;
begin
writeln('Hello, world!');
end.
program HelloWorld(output);
begin
writeln('Hello World');
end.
{Hello World in Pascal}
program HelloWorld(output);
begin
WriteLn('Hello World!');
end.
uses
uw27294;
var
p : procedure;
procedure test;
begin
p:=@test;
writeln('OK');
end;
procedure global;
begin
p:=nil;
test;
p();
end;
begin
global;
uw27294.global;
end.
program Printing;
var i : integer;
procedure Print(j : integer);
begin
...
end;
begin { main program }
...
Print(i);
end.
* + - / := < <= <> = > >= and begin boolean break byte continue div do double else end false if integer longint mod not or repeat shl shortint shr single then true until while word xor
Feature | Supported | Example | Token |
---|---|---|---|
Conditionals | ✓ | ||
While Loops | ✓ | ||
Booleans | ✓ | true false | |
Strings | ✓ | ' | |
Assignment | ✓ | := | |
Case Insensitive Identifiers | ✓ | s := (A + a + A); | |
Print() Debugging | ✓ | writeln | |
Function Overloading | ✓ | program Adhoc; function Add(x, y : Integer) : Integer; begin Add := x + y end; function Add(s, t : String) : String; begin Add := Concat(s, t) end; begin Writeln(Add(1, 2)); (* Prints "3" *) Writeln(Add('Hello, ', 'World!')); (* Prints "Hello, World!" *) end. | |
MultiLine Comments | ✓ | (* A comment *) | { } |
Comments | ✓ | { This is a single line comment in pascal. But needs to be closed. } | |
Polymorphism | ✓ | ||
Case Sensitivity | X | ||
Semantic Indentation | X | ||
Operator Overloading | X | ||
Line Comments | X |