Groups | Search | Server Info | Login | Register


Groups > comp.lang.misc > #11696

Algol 68 - to be or not to be a Local Range

From Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups comp.lang.misc
Subject Algol 68 - to be or not to be a Local Range
Date 2025-12-20 13:28 +0100
Organization A noiseless patient Spider
Message-ID <10i64p2$16li1$1@dont-email.me> (permalink)

Show all headers | View raw


This was something new to me; I learned that in

     INT n = 8;
     [n] REF [] INT tri;
     FOR i TO n DO
         tri[i] := LOC [i] INT     # LOC is okay #
     OD;

between the DO and the OD there's no Local Range!
With the consequence that the LOC element will be
accessible outside the FOR loop!

And that the Local Range "gets into existence" by
some (even unrelated) declaration, so that in

     INT n = 8;
     [n] REF [] INT tri;
     FOR i TO n DO
         INT j := n;   # establishes local range #
         tri[i] := LOC [i] INT       # => error  #
     OD;

the same (previously valid) code becomes an error
only by existence of the "spurious" declaration.

I find that quite irritating; I'd have expected
that even a closed clause without any declaration
would constitute an (albeit "empty") Local Range.

What's the rationale behind that design decision?

Janis

Back to comp.lang.misc | Previous | NextNext in thread | Find similar


Thread

Algol 68 - to be or not to be a Local Range Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-20 13:28 +0100
  Re: Algol 68 - to be or not to be a Local Range Andy Walker <anw@cuboid.co.uk> - 2025-12-20 14:01 +0000
    Re: Algol 68 - to be or not to be a Local Range Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-20 17:39 +0100
      Re: Algol 68 - to be or not to be a Local Range Andy Walker <anw@cuboid.co.uk> - 2025-12-22 17:35 +0000
        Re: Algol 68 - to be or not to be a Local Range Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-22 19:10 +0100
        Re: Algol 68 - to be or not to be a Local Range Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-12-22 21:17 +0000
    Re: Algol 68 - to be or not to be a Local Range Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-12-21 01:59 +0000
      Re: Algol 68 - to be or not to be a Local Range Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-12-21 05:47 +0100

csiph-web