Misplaced Pages

Comparison of ALGOL 68 and C++: Difference between revisions

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 10:09, 30 April 2007 editNevilleDNZ (talk | contribs)Extended confirmed users3,542 editsm External references: Category:Articles with example ALGOL 68 code← Previous edit Revision as of 04:36, 10 May 2007 edit undoNevilleDNZ (talk | contribs)Extended confirmed users3,542 editsm External references: http://remus.rutgers.edu/cs314/s2004/ryder/lectures/Types2-23New-2up.pdf C/C++/Pascal & Algol68Next edit →
Line 45: Line 45:
== External references == == External references ==
* - ] - June 1977. * - ] - June 1977.
* - Apr 2004 - retrieved May 10, 2007
* - Apr 2004 - retrieved May 10, 2007
* - Apr 2004 - retrieved May 10, 2007
* - Apr 2004 - retrieved May 10, 2007


] ]

Revision as of 04:36, 10 May 2007

Comparison of
programming languages

Comparison of individual
languages

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:

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

Categories:
Comparison of ALGOL 68 and C++: Difference between revisions Add topic