473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

C and Algol68

The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

Bart
Dec 7 '07 #1
35 2264
Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?
http://cm.bell-labs.com/cm/cs/who/dmr/chist.html is "from the horse's
mouth". Try reading that.
Dec 7 '07 #2
Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?
How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.
Dec 7 '07 #3
Tim Prince wrote:
Bartc wrote:
>The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.
I would have thought via /BCPL/, not Pascal, thus accounting for {}-blocks
(not begin-end nor if-endif style) and `return` statements (rather than
assigning to function-identifiers).

--
Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England

Dec 7 '07 #4

"Mark Bluemel" <ma**********@pobox.comwrote in message
news:fj**********@aioe.org...
Bartc wrote:
>The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

http://cm.bell-labs.com/cm/cs/who/dmr/chist.html is "from the horse's
mouth". Try reading that.
Ok, thanks. So it was syntax such as +:= which became +=.

The rest is pretty interesting too (for me as an amateur language designer)
and explains a few odd things about C.

Dec 7 '07 #5
"Mark Bluemel" <ma**********@pobox.comwrote in message
news:fj**********@aioe.org...
Bartc wrote:
>I'm intrigued: how exactly did Algol68 influence C, if at all?

http://cm.bell-labs.com/cm/cs/who/dmr/chist.html is "from the horse's
mouth". Try reading that.
Oh, and the following is probably more significant than += ops:
"The scheme of type composition adopted by C owes considerable debt to Algol
68, although it did not, perhaps, emerge in a form that Algol's adherents
would approve of."

I think a few other people would agree with that sentiment too.

Bart
Dec 7 '07 #6
Chris Dollin wrote:
Tim Prince wrote:
>Bartc wrote:
>>The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?
How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.

I would have thought via /BCPL/, not Pascal, thus accounting for {}-blocks
(not begin-end nor if-endif style) and `return` statements (rather than
assigning to function-identifiers).
Certainly correct, in terms of the original development of C. Slight
resemblance to Pascal certainly helped bring more people on board, as
BCPL was not known to many of us. All of the above are mentioned as
influences in

http://cm.bell-labs.com/cm/cs/who/dmr/chist.html
Dec 7 '07 #7
Chris Dollin <ch**********@hp.comwrites:
Tim Prince wrote:
>Bartc wrote:
>>The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.

I would have thought via /BCPL/, not Pascal, thus accounting for
{}-blocks
BCPL did not have {}. It used $( and $).

The most obvious Algol 68'isms are casts and compound assignments
(though B also had these, I think they originate in Algol 68). The
most obvious -- the void keyword -- is red-herring since it was not in
C-as-designed only in C-as-standardised.

Obviously I am ignoring the plain fact that all procedural languages
owe a lot to Algol (and thus indirectly to Algol 68).

--
Ben.
Dec 7 '07 #8
Ben Bacarisse <be********@bsb.me.ukwrites:
Obviously I am ignoring the plain fact that all procedural languages
owe a lot to Algol (and thus indirectly to Algol 68).
I fail to understand how owing to Algol (ie. Algol 58 or Algol 60), means
than one owe to Algol 68 which is quite different (I'm not even sure they
share a common non trivial subset).

Yours,

--
Jean-Marc
Dec 7 '07 #9
In article <dB******************@newssvr13.news.prodigy.nettp*****@nospamcomputer.org writes:
Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.
Algol 68 did not really exist in 1968. But the C syntax comes mostly
from BCPL. In principle that is not very different. Both Pascal and
Algol 68 derive their syntax from Algol 60, and BCPL derives its syntax
from JOVIAL, a parallel development to Algol 60, from the initial, but
never implemented, Algol 58.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 8 '07 #10
In article <CY*****************@fe2.news.blueyonder.co.uk"Bar tc" <ba***@freeuk.comwrites:
>
"Mark Bluemel" <ma**********@pobox.comwrote in message
news:fj**********@aioe.org...
Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68 but
gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?
http://cm.bell-labs.com/cm/cs/who/dmr/chist.html is "from the horse's
mouth". Try reading that.

Ok, thanks. So it was syntax such as +:= which became +=.
Also the type system (as is written on that page). I think also the
concept of "void" comes from Algol 68 (although in Algol 60 "void"
variables actually could exist, they could have only a single value:
"empty").
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 8 '07 #11
In article <px*************@news.bourguet.orgJean-Marc Bourguet <jm@bourguet.orgwrites:
Ben Bacarisse <be********@bsb.me.ukwrites:
Obviously I am ignoring the plain fact that all procedural languages
owe a lot to Algol (and thus indirectly to Algol 68).

I fail to understand how owing to Algol (ie. Algol 58 or Algol 60), means
than one owe to Algol 68 which is quite different (I'm not even sure they
share a common non trivial subset).
Not that. But Algol 68 was designed certainly with Algol 60 strongly in
mind. The early reports about Algol 68 showed much more similarity to
Algol 60 than later versions. I have seen some five or six versions
of the report, and each was deviating stronger from Algol 60.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 8 '07 #12
Ben Bacarisse wrote:
Chris Dollin <ch**********@hp.comwrites:
>Tim Prince wrote:
>>Bartc wrote:

The Wikipedia entry for C says the language was influenced by
Algol68 but gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not
Fortran as early as 1968? Much was passed on via Pascal, but
that doesn't diminish the reported influence.

I would have thought via /BCPL/, not Pascal, thus accounting for
{}-blocks

BCPL did not have {}. It used $( and $).

The most obvious Algol 68'isms are casts and compound assignments
(though B also had these, I think they originate in Algol 68).
The most obvious -- the void keyword -- is red-herring since it
was not in C-as-designed only in C-as-standardised.

Obviously I am ignoring the plain fact that all procedural
languages owe a lot to Algol (and thus indirectly to Algol 68).
I think that Algol 60 probably was the more influential. Algol 68
is generally considered to be a backwards step. Pascal was one of
the protests against it.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Dec 8 '07 #13
Ben Bacarisse wrote:
Chris Dollin <ch**********@hp.comwrites:
>Tim Prince wrote:
>>Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68
but gives no further details.

I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.

I would have thought via /BCPL/, not Pascal, thus accounting for
{}-blocks

BCPL did not have {}. It used $( and $).
Yes. (Oxford BCPL used section-brackets, actually, and I hacked a
BCPL compiler to use {} as well as $().)

It was the use of symbol-brackets-rather-than-begin-end that
chris@hp was referring to.
The most obvious Algol 68'isms are casts and compound assignments
(though B also had these, I think they originate in Algol 68).
Algol 60, IIRC, had compound assignments, and BCPL had compound
assignments of a different (and in my view more useful) form.
Obviously I am ignoring the plain fact that all procedural languages
owe a lot to Algol (and thus indirectly to Algol 68).
Yes to the former, but for the latter I think it's rather less
clear.

--
Far-Fetched Hedgehog
"Who do you serve, and who do you trust?" /Crusade/

Dec 8 '07 #14
In article <47***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>I think that Algol 60 probably was the more influential. Algol 68
is generally considered to be a backwards step. Pascal was one of
the protests against it.
I'm not sure about that "generally". Certainly some people at the
time didn't like Algol 68, and it was considered hard to implement
(though easy by today's standards). I can't see how you can describe
it as a backward step though: can you give an example?

-- Richard
--
:wq
Dec 8 '07 #15
Chris Dollin <eh@electrichedgehog.netwrites:
Ben Bacarisse wrote:
>Chris Dollin <ch**********@hp.comwrites:
>>Tim Prince wrote:

Bartc wrote:
The Wikipedia entry for C says the language was influenced by Algol68
but gives no further details.
>
I'm intrigued: how exactly did Algol68 influence C, if at all?

How about most of the C syntax which was in Algol but not Fortran as
early as 1968? Much was passed on via Pascal, but that doesn't diminish
the reported influence.

I would have thought via /BCPL/, not Pascal, thus accounting for
{}-blocks

BCPL did not have {}. It used $( and $).

Yes. (Oxford BCPL used section-brackets, actually, and I hacked a
BCPL compiler to use {} as well as $().)
and I see that "modern" BCPL uses them to the exclusion of the old ${
and $}. Still, I doubt they were in BCPL when it was influencing B &
C, but I accept that you intended:
It was the use of symbol-brackets-rather-than-begin-end that
chris@hp was referring to.
>The most obvious Algol 68'isms are casts and compound assignments
(though B also had these, I think they originate in Algol 68).

Algol 60, IIRC, had compound assignments, and BCPL had compound
assignments of a different (and in my view more useful) form.
Algol 60 actually re-dates me! I had a book about it as historical
curiosity when I started in 1977 but I don't recall any of the syntax.

BCPL did not have compound assignments, at least at first. Neither
the original spec nor the reference manual I have from about 1979
shows them, but you are quite right that they are in there now (I did
not know, so thanks for bringing me up-to-date). I note, though, that
I can find only 6 uses (in one program) out of more than 113,000 lines
of BCPL in Martin Richard's examples. I don't think they were there
early enough to have got into B from BCPL, but I have no date for
their addition into BCPL.
>Obviously I am ignoring the plain fact that all procedural languages
owe a lot to Algol (and thus indirectly to Algol 68).

Yes to the former, but for the latter I think it's rather less
clear.
Agreed. The last part of my statement is close to meaningless. It
was late!

<even more off-topic digression>
One version of Algol 68 (Algol 68C) added displacement operators.
They did the same as +:= (etc.) but returned the old value, so you got
a range of expressions like C's postfix ++ and -- but for all
operators. E.g. (trying to remember the syntax) x &:=: 1 masks all
but the bottom bit in x but returns what x used to have in it.
</digression>

--
Ben.
Dec 8 '07 #16
Richard Tobin wrote:
CBFalconer <cb********@maineline.netwrote:
>I think that Algol 60 probably was the more influential. Algol
68 is generally considered to be a backwards step. Pascal was
one of the protests against it.

I'm not sure about that "generally". Certainly some people at
the time didn't like Algol 68, and it was considered hard to
implement (though easy by today's standards). I can't see how
you can describe it as a backward step though: can you give an
example?
No, I am just supplying things from long dumped memory.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com

Dec 8 '07 #17
In article <47***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
>>I think that Algol 60 probably was the more influential. Algol
68 is generally considered to be a backwards step. Pascal was
one of the protests against it.
>I'm not sure about that "generally". Certainly some people at
the time didn't like Algol 68, and it was considered hard to
implement (though easy by today's standards). I can't see how
you can describe it as a backward step though: can you give an
example?
>No, I am just supplying things from long dumped memory.
I suspect that your view may have been common 25 years ago, but today
I think that Algol 68 can be seen as being in the main line of
programming language history, with Pascal as a dead end. This may
just reflect my ignorance of Pascal however.

-- Richard

--
:wq
Dec 8 '07 #18
Ben Bacarisse wrote:
BCPL did not have compound assignments, at least at first. Neither
the original spec nor the reference manual I have from about 1979
shows them,
I'm pretty sure they were there there by 1975/6, which is when I was
introduced to BCPL.

(Did you mean 19/6/9?)
I note, though, that
I can find only 6 uses (in one program) out of more than 113,000 lines
of BCPL in Martin Richard's examples.
Sadly I no longer have source to hand. The bad thing about BCPL's
compound assignment (for those late to class, it permits the LHS
and RHS to have several elements each, and assigns corresponding
elements) is that the evaluation rules are not quite good enough
for it to be /really/ useful; one wants some kind of guarantee about
when the addresses of targets are computed and when the assignments
happen.)

--
Well-Specified Hedgehog
"Life is full of mysteries. Consider this one of them." Sinclair, /Babylon 5/

Dec 8 '07 #19
In article <XV******************@fe1.news.blueyonder.co.ukChr is Dollin <eh@electrichedgehog.netwrites:
....
Algol 60, IIRC, had compound assignments,
You remember incorrectly. The only compounds you could build with
Algol 60 were arrays, and you had no array assignments.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 9 '07 #20
In article <fj***********@pc-news.cogsci.ed.ac.ukri*****@cogsci.ed.ac.uk (Richard Tobin) writes:
In article <47***************@yahoo.com>,
CBFalconer <cb********@maineline.netwrote:
I think that Algol 60 probably was the more influential. Algol 68
is generally considered to be a backwards step. Pascal was one of
the protests against it.

I'm not sure about that "generally". Certainly some people at the
time didn't like Algol 68, and it was considered hard to implement
(though easy by today's standards).
I still wonder at that. In (I think) 1976 CDC had an Algol 68 compiler,
full-fledged (not restricted like Algol 68-R). The compiler had been
built in a few years by a team of five people without any previous
experience in compiler building. I think many people had problems with
the definition through a 2-level grammar. On the other hand, that made
the features in the language fully orthogonal in many cases, and allowed
what is now many times seen as a semantic error (e.g. type mismatch on
assignment) a syntactic error.

BTW, the same has been said about Algol 60. I have still, somewhere, a
report from Princeton that describes how to handle arrays in Algol 60.
I can't see how you can describe
it as a backward step though: can you give an example?
I liked Algol 68 very much and have done quite a lot in it. It gave
full-fledged operator overloading, including user defined operators,
which could make the description of mathematical problems very simple.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 9 '07 #21
Chris Dollin <eh@electrichedgehog.netwrites:
Algol 60, IIRC, had compound assignments, and BCPL had compound
assignments of a different (and in my view more useful) form.
Prompted by a different message else thread I think we have crossed
wires. If you mean the form:

a, b, c := 1, 2, 99

then, yes, that was there even in the 1969 MIT version of BCPL (but I
don't remember that in Algol 60). But of course, that form of
multiple assignment never made it into B or C so I missed your point.

I was meaning assignment operators that are "compounded" with a binary
operator. Probably not the right terminology at all, but I don't know
what they are called in general. I was saying that these probably got
into B from Algol 68. There were not in the early BCPL (but do seem
to have added at some point).

--
Ben.
Dec 9 '07 #22
In article <87************@bsb.me.ukBen Bacarisse <be********@bsb.me.ukwrites:
....
<even more off-topic digression>
One version of Algol 68 (Algol 68C) added displacement operators.
They did the same as +:= (etc.) but returned the old value, so you got
a range of expressions like C's postfix ++ and -- but for all
operators. E.g. (trying to remember the syntax) x &:=: 1 masks all
but the bottom bit in x but returns what x used to have in it.
</digression>
You did not need Algol 68C for that. You could define them in Algol 68
proper.
'op' &:= = (('ref' 'bits' i, 'bits' j) 'bits':
(i := i & j; i);
is the definition for the standard operator, while
'op' &:=: = (('ref' 'bits' i, 'bits' j) 'bits':
('bits' k := i; i := i & j; k);
would do what you describe.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 9 '07 #23
In article <Js********@cwi.nl>, Dik T. Winter <Di********@cwi.nlwrote:
>I think many people had problems with
the definition through a 2-level grammar.
I've heard other people say that, though it surprises me that people
who might consider implementing it would be put off by that.
It's certainly interesting to compare the grammar in the Algol-68R
Users Guide with that of the Revised Report - it's very simple (and
not I think just because of the restrictions).

-- Richard
--
:wq
Dec 9 '07 #24
Dik T. Winter wrote:
In article <XV******************@fe1.news.blueyonder.co.ukChr is Dollin
<eh@electrichedgehog.netwrites: ...
Algol 60, IIRC, had compound assignments,

You remember incorrectly. The only compounds you could build with
Algol 60 were arrays, and you had no array assignments.
Wrong sense of "compound assignment"; it's the assignments that are
compound, not the values: `a := b := c;`. If I'm remembering correctly.

--
Both Real And Imaginary Hedgehog
"I just wonder when we're going to have to sit down and re-evaluate
our decision-making paradigm." /Sahara/

Dec 9 '07 #25
Ben Bacarisse wrote:
Chris Dollin <eh@electrichedgehog.netwrites:
>Algol 60, IIRC, had compound assignments, and BCPL had compound
assignments of a different (and in my view more useful) form.

Prompted by a different message else thread I think we have crossed
wires. If you mean the form:

a, b, c := 1, 2, 99

then, yes, that was there even in the 1969 MIT version of BCPL (but I
don't remember that in Algol 60). But of course, that form of
multiple assignment never made it into B or C so I missed your point.

I was meaning assignment operators that are "compounded" with a binary
operator. Probably not the right terminology at all, but I don't know
what they are called in general. I was saying that these probably got
into B from Algol 68. There were not in the early BCPL (but do seem
to have added at some point).
Aaaaaaaaaaaaaaaaah!

OK, we have an agreement: I did mean the multiple form you exhibit
above. Terminology is responsible for too many wars ...

--
Oops Hedgehog
A rock is not a fact. A rock is a rock.

Dec 9 '07 #26
On Dec 9, 4:09 am, rich...@cogsci.ed.ac.uk (Richard Tobin) wrote:
In article <475AB673.DAD2B...@yahoo.com>,

CBFalconer <cbfalco...@maineline.netwrote:
>I think thatAlgol60 probably was the more influential. Algol
68 is generally considered to be a backwards step. Pascal was
one of the protests against it.
I'm not sure about that "generally". Certainly some people at
the time didn't likeAlgol68, and it was considered hard to
implement (though easy by today's standards). I can't see how
you can describe it as a backward step though: can you give an
example?
No, I am just supplying things from long dumped memory.

I suspect that your view may have been common 25 years ago, but today
I think thatAlgol68 can be seen as being in the main line of
programming language history, with Pascal as a dead end. This may
just reflect my ignorance of Pascal however.

-- Richard

--
:wq
Here are some published references:
* http://cm.bell-labs.com/cm/cs/who/dmr/chist.pdf
* http://groups.google.co.uk/group/com...7b6f5c81502cf5

Since K&R C, with the advent of C99 a few more bits of what was
ALGOL68 has move into C. For example the procedure argument
declarations.

In regard to K&R C, don't forget that Steve Bourne was imported by
AT&T from Cambridge University where he worked on the ALGOL68C
compiler. amoung other things he worked on an ALGOL68 Compiler at
AT&T (I would expect it was a port of ALGOL68C). I believe he
create the Algol Debugger for Unix, what we now know as "adb".
( http://www.roesler-ac.de/wolfram/acro/credits.htm#adb )

What is equally interesting is the influence of ALGOL68 on Python via
Lambert Meertens' ABC programming language.
Adriaan van Wijngaarden was the "party ideologist" for ALGOL-68, and
was also based in Mathematisch Centrum Amsterdam. Lambert Meertens'
worked with Wijngaarden on the first revision of ALGOL-68.

Other notable people from this center include along with Guido van
Rossum. Here is his comment on ALGOL68 http://www.amk.ca/python/writing/gvr-interview
(1998).

ALGOL-X: IMHO ALGOL-60 was much more Fortran like, certainly better
the Fortran IV. The proponents of ALGOL-60 went on to propose ALGOL-
X, and eventually created ALGOL-W.

ALGOL-Y: I believe that ALGOL-68 grew from the ALGOL Y branch. ALGOL-
Y apparently included some functional programming techniques that
didn't make it into ALGOL-68. But to be clear, I have never seen the
ALGOL-Y suggestions.

N

Dec 10 '07 #27
On Dec 9, 10:42 am, "Dik T. Winter" <Dik.Win...@cwi.nlwrote:
'op' &:= = (('ref' 'bits' i, 'bits' j) 'bits':
(i := i & j; i);
is the definition for the standard operator, while
'op' &:=: = (('ref' 'bits' i, 'bits' j) 'bits':
('bits' k := i; i := i & j; k);
would do what you describe.
BTW: I just discovered that gcc has implemented some more feature from
ALGOL-68.

ALGOL 68:
INT result := ( INT sum; FOR i TO 100 sum+:=i OD; sum )

C: (gcc)
int result = ({ int sum,i; for(i=1; i<=100; i++)sim+=i; sum; })

deja-vu?

N
Dec 10 '07 #28
In article <41******************@fe3.news.blueyonder.co.ukChr is Dollin <eh@electrichedgehog.netwrites:
Dik T. Winter wrote:
In article <XV******************@fe1.news.blueyonder.co.ukChr is Dollin
<eh@electrichedgehog.netwrites: ...
Algol 60, IIRC, had compound assignments,
You remember incorrectly. The only compounds you could build with
Algol 60 were arrays, and you had no array assignments.

Wrong sense of "compound assignment"; it's the assignments that are
compound, not the values: `a := b := c;`. If I'm remembering correctly.
But also Fortran had that.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 10 '07 #29
In article <Cd******************@fe2.news.blueyonder.co.ukChr is Dollin <eh@electrichedgehog.netwrites:
Ben Bacarisse wrote:
Chris Dollin <eh@electrichedgehog.netwrites:
Algol 60, IIRC, had compound assignments, and BCPL had compound
assignments of a different (and in my view more useful) form.
Prompted by a different message else thread I think we have crossed
wires. If you mean the form:
a, b, c := 1, 2, 99
then, yes, that was there even in the 1969 MIT version of BCPL (but I
don't remember that in Algol 60).
....
OK, we have an agreement: I did mean the multiple form you exhibit
above. Terminology is responsible for too many wars ...
And that form was not present in Algol 60.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 10 '07 #30
In article <9c**********************************@b40g2000prf. googlegroups.comNevilleDNZ <ne********@gmail.comwrites:
On Dec 9, 10:42 am, "Dik T. Winter" <Dik.Win...@cwi.nlwrote:
'op' &:= = (('ref' 'bits' i, 'bits' j) 'bits':
(i := i & j; i);
is the definition for the standard operator, while
'op' &:=: = (('ref' 'bits' i, 'bits' j) 'bits':
('bits' k := i; i := i & j; k);
would do what you describe.

BTW: I just discovered that gcc has implemented some more feature from
ALGOL-68.

ALGOL 68:
INT result := ( INT sum; FOR i TO 100 sum+:=i OD; sum )
Yes, nearly every statement could be used as an expression.
C: (gcc)
int result = ({ int sum,i; for(i=1; i<=100; i++)sim+=i; sum; })

deja-vu?
Indeed.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 10 '07 #31
In article <9c**********************************@b40g2000prf. googlegroups.com>,
NevilleDNZ <ne********@gmail.comwrote:
>BTW: I just discovered that gcc has implemented some more feature from
ALGOL-68.

ALGOL 68:
INT result := ( INT sum; FOR i TO 100 sum+:=i OD; sum )

C: (gcc)
int result = ({ int sum,i; for(i=1; i<=100; i++)sim+=i; sum; })
I wouldn't assume that was taken from Algol 68. The idea that
arbitrary code can be wrapped up in an expression is more or less
universal now. Algol 68 may have been an influence in that of course,
but it didn't invent the idea. Consider Lisp for example.

-- Richard

--
:wq
Dec 10 '07 #32
On Dec 10, 11:03 pm, rich...@cogsci.ed.ac.uk (Richard Tobin) wrote:
I wouldn't assume that was taken from Algol 68. The idea that
arbitrary code can be wrapped up in an expression is more or less
universal now. Algol 68 may have been an influence in that of course,
but it didn't invent the idea. Consider Lisp for example.
It certainly is deja-vu thou.

It has taken some 31 years for such ideas to get into C99?
These features were recognised in the 1960s.

BTW: I forgot to initialise sum in the example above.... :(

N
Dec 11 '07 #33
In article <0d**********************************@s19g2000prg. googlegroups.com>,
NevilleDNZ <ne********@gmail.comwrote:
>I wouldn't assume that was taken from Algol 68. The idea that
arbitrary code can be wrapped up in an expression is more or less
universal now. Algol 68 may have been an influence in that of course,
but it didn't invent the idea. Consider Lisp for example.
>It certainly is deja-vu thou.

It has taken some 31 years for such ideas to get into C99?
That feature (using arbitrary statements as expressions) is not in
C99.
>These features were recognised in the 1960s.
That's not much of an argument in itself. C doesn't have to have
every feature, no matter how long ago it was invented. On the
other hand, this particular feature is very useful and would be
easy enough to implement.

-- Richard
--
:wq
Dec 11 '07 #34
On Mon, 10 Dec 2007 00:24:27 GMT, "Dik T. Winter" <Di********@cwi.nl>
wrote:
In article <41******************@fe3.news.blueyonder.co.ukChr is Dollin <eh@electrichedgehog.netwrites:
Dik T. Winter wrote:
>
In article <XV******************@fe1.news.blueyonder.co.ukChr is Dollin
<eh@electrichedgehog.netwrites: ...
Algol 60, IIRC, had compound assignments,

You remember incorrectly. The only compounds you could build with
Algol 60 were arrays, and you had no array assignments.
>
Wrong sense of "compound assignment"; it's the assignments that are
compound, not the values: `a := b := c;`. If I'm remembering correctly.

But also Fortran had that.
No it didn't, and it still doesn't. (Well, Fortran doesn't have := at
all, but I assume you meant the obvious equivalent using =.)
Nor do Pascal and Ada, and COBOL, and PL/I. (In COBOL you can MOVE a
single item or value to multiple destinations -- but each separately,
not converting to the first and then that to the second etc.)

But I don't call that compound; I call it chained.

Fortran (now) and PL/I and Ada have array and structure assignments,
which generically I call aggregate or composite. There's also (rarer)
quasi-composite multivalue or tuple assignment e.g. (X,Y,Z):=(1,2,3).

C uses 'compound' (and so do I) for forms like x -= 3, which AIUI A68
had as already noted elsethread. And FWLIW COBOL has some specific
(simple) cases though not the general operators.

- formerly david.thompson1 || achar(64) || worldnet.att.net
Dec 24 '07 #35
In article <44********************************@4ax.comDavid Thompson <da************@verizon.netwrites:
On Mon, 10 Dec 2007 00:24:27 GMT, "Dik T. Winter" <Di********@cwi.nl>
wrote:
....
Wrong sense of "compound assignment"; it's the assignments that are
compound, not the values: `a := b := c;`. If I'm remembering correctly.
But also Fortran had that.

No it didn't, and it still doesn't. (Well, Fortran doesn't have := at
all, but I assume you meant the obvious equivalent using =.)
Indeed, and I remembered wrong. Probably because I never was a real
user of Fortran.
But I don't call that compound; I call it chained.

Fortran (now) and PL/I and Ada have array and structure assignments,
which generically I call aggregate or composite.
You could also define them in Algol 68. The assignment was there, but you
can define other operators, including compound operators, and operators
on compounds.
C uses 'compound' (and so do I) for forms like x -= 3, which AIUI A68
had as already noted elsethread.
It is simply a consequence of how operators are handled in the syntax of
Algol 68.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Dec 27 '07 #36

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
17
by: Keith H Duggar | last post by:
Can anyone point me to the origin and history of the dot syntax for accessing structures? Were there languages prior to C that used it? Who invented it? etc.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.