Am 21.01.2015 um 14:28 schrieb P.G.:
> On Wed, 21 Jan 2015 08:38:38 +0100, Bernd Oppolzer wrote:
>> It was the decision of the PL/1 language designers to make
>> the language more user friendly to the C community. You don't have to
>> use such language elements, if you don't like it. I see it this way:
>> PL/1 is such a powerful language, that it even allows different
>> programming styles. Or: why not allow language constructs, as long
>> as it is clear to the programmer, what the new language element does
>> and as long as the spirit of the language is not broken?
> Are you saying that as an accommodation to C programmers PL/I
> has recently provided pointers with types, with increments by element
No, I don't think so.
I'm not aware of all the extensions to the PL/1 language of the last
years; there are some which I don't use like DEFINEd STRUCTURES,
ORDINAL TYPEs etc. ... mainly because the compatibility to the (long)
existing features is not so good, IMHO. But pointers that increment in
an other way than per address ... I don't think that that exists.
No, the things I had in mind was the assignments including increment
etc, the things like A += expression; etc ... works with other kinds
of operators, too, of cours, not only addition. And that you can add
an offset to a pointer simply by using the + sign. And, if C
programmers want to use functions like memset or memcpy, they can,
although there are other (PL/1) names for those functions (PLIMOVE
>> BTW: variable ++; is not still possible in PL/1 for several good reasons.
> I'm naive. What's a good reason (other than economy of language design)
> for not providing "variable ++"? (And what of "++ variable"?) One
> possibility might be lexical ambiguity.
Some speculation on my part:
in C, everything is an expression; a ++ and ++ a are two very
different expressions, and this idea does not fit well into the PL/1
The assignment a += 5; in C is an expression, too (and may be assigned
to other variables and used, whereever expressions are allowed in C).
But it is no problem to take this kind of syntax over to PL/1, WITHOUT
assigning a value to the assignment A += 5; (that is: without
violating the language).
A = B = C;
has a total different meaning than
a = b = c;
This has to do with:
In C, assignment and comparison are two different operators, = and ==,
but in PL/1, the same operator = is used for both.
> -- G.
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to firstname.lastname@example.org with the message: INFO IBM-MAIN