Difference between revisions of "Extended Pascal"

From Free Pascal wiki
(exponentiation)
(enhancements)
Line 6: Line 6:
 
* Modularity and separate compilation (implemented with new keywords '''module''', '''import''', '''export''', '''only''', '''qualified''' and '''protected''').
 
* Modularity and separate compilation (implemented with new keywords '''module''', '''import''', '''export''', '''only''', '''qualified''' and '''protected''').
 
* Direct access file handing (via '''SeekRead''', '''SeekWrite''', '''SeekUpdate''' and '''update''' procedures, and the '''position''', '''LastPosition''' and '''empty''' functions as well as an ''update file mode'').  
 
* Direct access file handing (via '''SeekRead''', '''SeekWrite''', '''SeekUpdate''' and '''update''' procedures, and the '''position''', '''LastPosition''' and '''empty''' functions as well as an ''update file mode'').  
 +
* The procedure '''extend''' prepares an existing file for appending data
 +
* The declaration parts of a program (labels, constants, types, variables, procedures, and functions) can appear in any order
 +
* Complex numbers
  
 
== Reserved Words ==
 
== Reserved Words ==
 
In addition to all the [[Standard Pascal#Reserved Words|reserved words of Standard Pascal]] the following (referred to as ''word-symbols'' in the ISO 10206 document) have been added to Extended Pascal:
 
In addition to all the [[Standard Pascal#Reserved Words|reserved words of Standard Pascal]] the following (referred to as ''word-symbols'' in the ISO 10206 document) have been added to Extended Pascal:
  
* and_then (short circuit version of and - right side not evaluated if not necessary)
+
* and_then (short circuit version of "and"; right side not evaluated if not necessary)
 
* bindable
 
* bindable
 
* export  
 
* export  
Line 16: Line 19:
 
* module
 
* module
 
* only
 
* only
* or_else (short circuit version of or - right side not evaluated if not necessary)
+
* or_else (short circuit version of "or"; right side not evaluated if not necessary)
 +
* otherwise (used with the '''case''' statement and ''variant records'')
 
* pow (exponentiation for integer, real and complex numbers to real and integer powers)
 
* pow (exponentiation for integer, real and complex numbers to real and integer powers)
 
* protected
 
* protected
* qualified  
+
* qualified
 +
* restrictive
 
* value
 
* value
  

Revision as of 12:39, 17 September 2017

Extended Pascal is the name given to the version of Pascal specified in International Organization for Standardization (ISO) standard 10206. It specifies an enhanced version of the Standard Pascal language that was specified in the ISO 7185 specification. The 214-page ISO 10206 document was published in May 1991 and not been revised since.

Support in Free Pascal for Extended Pascal is planned, and will be via compiler mode extpas.

Enhancements to Standard Pascal

  • Modularity and separate compilation (implemented with new keywords module, import, export, only, qualified and protected).
  • Direct access file handing (via SeekRead, SeekWrite, SeekUpdate and update procedures, and the position, LastPosition and empty functions as well as an update file mode).
  • The procedure extend prepares an existing file for appending data
  • The declaration parts of a program (labels, constants, types, variables, procedures, and functions) can appear in any order
  • Complex numbers

Reserved Words

In addition to all the reserved words of Standard Pascal the following (referred to as word-symbols in the ISO 10206 document) have been added to Extended Pascal:

  • and_then (short circuit version of "and"; right side not evaluated if not necessary)
  • bindable
  • export
  • import
  • module
  • only
  • or_else (short circuit version of "or"; right side not evaluated if not necessary)
  • otherwise (used with the case statement and variant records)
  • pow (exponentiation for integer, real and complex numbers to real and integer powers)
  • protected
  • qualified
  • restrictive
  • value

Symbols

In addition to all the symbols of Standard Pascal the following have been added to Extended Pascal:

  • ** (exponentiation for integer, real and complex numbers to real and integer powers)
  • >< (computes a set symmetric difference)
  • =>

External links