Content deleted Content added
No edit summary |
General editing, together with an additional point 10 re differences in RTL philosophy |
||
Line 1:
{{ProgLangCompare}}
Devised by [[Niklaus Wirth]] in the late 1960s and early 1970s, [[Pascal (programming language)|Pascal]] is a [[programming language]]. Originally produced by [[Borland]] Software Corporation, [[Embarcadero Delphi]] is composed of an IDE, set of standard libraries, and a Pascal-based language commonly called either [[Object Pascal]], Delphi Pascal, or simply 'Delphi' (Embarcadero's current documentation refers to it as 'the Delphi language (Object Pascal)'<ref>http://docwiki.embarcadero.com/RADStudio/XE2/en/Delphi_Reference</ref>). Since first released, it has become the most popular commercial Pascal implementation.
1. The way procedures and functions can be passed as parameters differs: Delphi requires explicit procedural types to be declared where Standard Pascal does not.
2. Delphi does not support so called 'intraprocedural gotos', in which [[goto]] statements may reference targets outside the current procedure/function body.
▲== Differences between the languages ==
3
4. Given a variant record in Standard Pascal, the size of a particular variant can be specified. Delphi does not support this form of 'sized' dynamic variable allocation:
▲3. No file buffer variable handling. Standard Pascal has file "buffer variables", and "get" and "put" procedures to operate on them. This functionality is not present in Borland Delphi.
<source lang="pascal">
</source>
▲Where t is a variant record tag type.
▲5. The functions "pack" and "unpack" are not implemented.
6. The Delphi compiler does not treat { and (*, } and *)
<source lang="pascal">
Line 37 ⟶ 28:
</source>
is not valid in
7.
8. Numbers and booleans are not printed out in their
<source lang="pascal">
Line 55 ⟶ 46:
</source>
However, Standard Pascal requires it to be equivalent to the following (TotalWidth is implementation-defined):
<source lang="pascal">
Line 62 ⟶ 53:
</source>
Similarly, for booleans,
<source lang="pascal">
Line 71 ⟶ 60:
</source>
is equivalent to
<source lang="pascal">
Line 78 ⟶ 67:
</source>
in Delphi, but
<source lang="pascal">
Line 85 ⟶ 74:
</source>
in ISO 7185
9. Temporary files are not supported
10. Notwithstanding the fact Delphi still allows using much of the traditional Pascal RTL, Delphi-specific library functionality is generally implemented in ordinary Delphi code that uses, rather than adds to, compiler-provided intrinsics. This philosophy contrasts to Standard Pascal, whose RTL must be provided by the compiler. For example, in Standard Pascal, the 'file' type is an intrinsic type - sort of like a record, but another compiler-defined type alongside records. In contrast, the TFileStream class in Delphi is an ordinary Delphi class written in ordinary Delphi code. Similarly, the Read, ReadLn, Write and WriteLn standard procedures have signatures that are not themselves legal Pascal signatures. While Delphi still implements them, only vary rarely do Delphi-specific RTL routines require similarly special handling: rather, the language was evolved to include features such as 'open arrays', default parameters and procedural overloading that can be used by user-written routines too.
== References ==
<references />
▲9. Temporary files are not supported. Executing reset() or rewrite() results in an error under Delphi. Under standard Pascal it opens a temporary file that exists only for the run of the program.
== See also ==
|