Revision as of 02:24, 22 April 2007 editNevilleDNZ (talk | contribs)Extended confirmed users3,542 editsm add xreference template← Previous edit | Revision as of 02:52, 22 April 2007 edit undoNevilleDNZ (talk | contribs)Extended confirmed users3,542 editsm add links to appropriate ALGOL 68 & C++ sectionsNext edit → | ||
Line 3: | Line 3: | ||
] doesn't have: | ] doesn't have: | ||
* nested functions, | * ] - nested functions, | ||
* definable operator symbols and priorities, | * ] - definable operator symbols and priorities, | ||
* garbage collection, | * garbage collection, | ||
* ''use before define'', | * ''use before define'', | ||
* |
* ] using complex formatting declarations, | ||
* assignment operation symbol (to avoid confusion with equal sign), | * ] - assignment operation symbol (to avoid confusion with equal sign), | ||
* |
* ] (and slice operations on them, but in layered libraries), | ||
* automatic ]s, | |||
* automatic UNIONs, | |||
* CASE expressions, | * ], | ||
* nonlocal GOTO | * nonlocal ] | ||
* intuitive declaration syntax due to its origin from ]. | * intuitive declaration syntax due to its origin from ]. | ||
] doesn't have: | ] doesn't have: | ||
* public/private access protection, | * public/private access protection, | ||
* overloaded procedures (in contrast to operators), | * ] (in contrast to operators), | ||
* explicit memory allocation and deallocation, | * explicit memory allocation and deallocation, | ||
* forward declarations, | * forward declarations, | ||
* textual preprocessing (header files), | * textual ] (header files), | ||
* confusion between &- and pointer-style, | * confusion between &- and pointer-style, | ||
* comment lines (only bracketed comments), | * ] lines (only bracketed comments), | ||
* hierarchical classes. | * ]. | ||
==Code Example== | ==Code Example== |
Revision as of 02:52, 22 April 2007
The nearest living sibling to ALGOL 68 may be C++, making this a good comparison candidate:
C++ doesn't have:
- PROC - nested functions,
- OP and PRIO - definable operator symbols and priorities,
- garbage collection,
- use before define,
- formatted transput using complex formatting declarations,
- := - assignment operation symbol (to avoid confusion with equal sign),
- array (and slice operations on them, but in layered libraries),
- automatic UNIONs,
- CASE expressions,
- nonlocal GOTO
- intuitive declaration syntax due to its origin from C.
ALGOL 68 doesn't have:
- public/private access protection,
- overloaded procedures (in contrast to operators),
- explicit memory allocation and deallocation,
- forward declarations,
- textual preprocessing (header files),
- confusion between &- and pointer-style,
- comment lines (only bracketed comments),
- hierarchical classes.
Code Example
Mode declaration
A new mode (type) may be declared using a mode declaration:
int max=99;
mode newtype = struct (
long real a, b, c, short int i, j, k, ref real r
);
This has the similar effect as the following C++ code:
const int max=99;
typedef class {
public: double a, b, c; short i, j, k; float &r;
} newtype;
Note that for ALGOL 68 only the newtype name appears to the left of the equality, and most notably the construction is made - and can be read - from left to right without regard to priorities.
External references
- A comparison of PASCAL and ALGOL 68 - Andrew S. Tanenbaum - June 1977.