help-marst
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Algol60 - Question/Suggestions


From: Andrew Makhorin
Subject: Re: Algol60 - Question/Suggestions
Date: Wed, 16 May 2001 15:50:47 +0400

-----Original Message-----
From: Hedberg, Christer <address@hidden>
To: 'address@hidden' <address@hidden>
Subject: Algol60 - Question/Suggestions


>Hello,
>
>my name is Christer Hedberg.
>
>Having used Algol60  whilst studing at the Stockholm University in the 70s,
>I am pretty interested in the language ( not only from a nostalgic point of
>view ).
>
>As the languages as well as the areas where they are used, having
>substantially
>expanded over the years, i have the following Question :
>
>How is is possible to perform String'-manipulation in Algol ?
>( the way you do it declaring a variable a 'string' in Basic or 'char *' in
>C )
>
>If not possible have you any intention in adding this facility to the
>language ?
>( f.e by expanding the usage of 'string' )
>To my opinion this would be very nice as nowadays your're not just
>restricted
>to performing numeric calculation when writing a program..
>
>Rgds,
>
>Christer Hedberg
>
>address@hidden
>

Thank you for your interest in GNU MARST.

The main goal of the marst development was to implement the *real*
Algol 60 as this language is described in the "Modified Report" without
any restrictions and extensions in order that people would be able to
run Algol 60 programs. This is normal, because to-day Algol 60 is not
used for programming and therefore this ancient language is interesting
only in historical aspects.

Although Algol 60 is mainly designed for numeric computations, it may
also be used for character string processing as well. The main principle
is to use integer arrays for representing character strings (in the same
way as, say, in C). For example:

procedure strcpy(target, source);
integer array target, source;
begin integer k;
      k := 0;
      for k := k+1 while source[k] != 0 do target[k] := source[k];
      target[k] := 0
end;

The only issue is string input/output. The standard solution is to
consider values of array elements as ASCII codes. Then it is possible to
write i/o procedures (which are to be used instead standard procedures
instring and outstring). For example:

procedure read string(channel, str);
value channel; integer channel; integer array str;
begin integer k; Boolean break;
      k := 0; break := false;
      for k := k+1 while !break do
      begin integer t;
            inchar(channel, "...ASCII character set...", t);
            if t = <end of string>
               then break := true; else str[k] := t
      end;
      str[k] := 0
end;

where <end of string> is a code (integer number) choosing to indicate
end of string in the input character stream.

Please see the official GNU web page about GNU MARST at
<http://www.gnu.org/software/marst/marst.html>

You also can visit my own web page dedicated to GNU MARST at
<http://mai2.rcnet.ru/~mao/marst/index.htm>


Best regards,

Andrew Makhorin
the author and maintainer of GNU MARST





reply via email to

[Prev in Thread] Current Thread [Next in Thread]