|
|
| Jensen.algol |
real procedure SIGMA(x, i, n); value n; real x; integer i, n; begin real s; s := 0; for i := 1 step 1 until n do s := s + x; SIGMA := s; end |
![]() | This is the famous example by Jensen that demonstrates
the power of call-by-name. It allows to sum up an expression
x that depends on a variable i:
|
|
| Copyright © 2002 Andreas Borchert, converted to HTML on May 02, 2002 |