Algol 68 - PowerPoint PPT Presentation

About This Presentation
Title:

Algol 68

Description:

Procedural Abstraction: Can define new procedures and functions for generalizing tasks. ... All procedures defined are values, with their names as values: Can ... – PowerPoint PPT presentation

Number of Views:101
Avg rating:3.0/5.0
Slides: 7
Provided by: sciBrook
Category:

less

Transcript and Presenter's Notes

Title: Algol 68


1
Algol 68
  • Third language in the Algol Language Family
  • An extension to Algol 60's capabilities
  • Code blocks
  • Variable Scopes
  • Algol 68 was known for its orthogonality
  • The goal was to develop a language with few
    language restrictions.
  • Intended to make the language easier to learn

2
Algol 68
  • Algol 68 Basic Features
  • Common Language Services IF ... THEN ...
    ELSE,ELSE-IF, WHILE, DO ... WHILE, FOR ... NEXT
  • Procedural Abstraction Can define new procedures
    and functions for generalizing tasks.
  • Dynamic Arrays Arrays, of any type, can shrink
    and grow dynamically. This is also called flex
    arrays. Arrays can be of any dimensions.
  • Array Slicing Using special syntax, new arrays
    can be created from old arrays.

3
Algol 68
  • Algol 68 Basic Features
  • Operator Definition And Overloading Users can
    create new operators, overload existing operators
    using user types and change the priority of
    operators.
  • Highly Orthogonal. Examples
  • 3 (a c 4) 2
  • X IF a lt 2 THEN 3.2 ELSE 5.2 FI
  • IF a lt 2 x THEN y FI 3.5
  • Strong Type Checking
  • Users can use system-provided modes or can
    define new modes through new structures or
    unions.

4
Algol 68
  • Algol 68 Basic Features
  • Support for call-by-value as well as
    call-by-reference.
  • All procedures defined are values, with their
    names as values Can use Algol 68 for some
    functional programming.
  • Algol 68 Library Support
  • I/O facilities provided through
    architecture-independent transput (unlike what
    was provided with Algol 68.)
  • Current implementations provide support for
    scientific code libraries.

5
Algol 68
  • Examples

PROC factorial (INT x)INT BEGIN (x 1 OR
x 0xx factorial(x-1)) END PROC map and
print (INT x, PROC (INT)INT
proc)VOID BEGIN FOR i FROM LWB x TO UPB x
DO print(proc(xi) OD END
6
Algol 68
  • More Examples of Orthogonality

REF INT size LOC INT read(size) REFINT a
LOC1sizeINT could also be done as REFINT r
LOC1(REF INT iLOC INT read(i)i)INT
Write a Comment
User Comments (0)
About PowerShow.com