From: Warren on
Heh, heh... today I got several COBOL compile
errors, telling me that Ada is leaking into my
day job:

...
END EVALUATE

(Should be END-EVALUATE)

IF RET-CODE /= 0 THEN

(you get the idea). I never had this problem with
C/C++ :)

Warren
From: Adam Beneschan on
On Mar 19, 10:24 am, Warren <ve3...(a)gmail.com> wrote:
> Heh, heh... today I got several COBOL compile
> errors, telling me that Ada is leaking into my
> day job:
>
>     ...
>     END EVALUATE
>
> (Should be END-EVALUATE)
>
>     IF RET-CODE /= 0 THEN
>
> (you get the idea). I never had this problem with
> C/C++ :)

I wonder how many programmers have had Ada leak into their C/C++ and
have written something like

if (code /= 0) { ... }

This is valid C, so the compiler won't complain, but it will not quite
do what you want.

:)
-- Adam
From: Björn Persson on
Adam Beneschan wrote:

> if (code /= 0) { ... }
>
> This is valid C, so the compiler won't complain

Are you sure? ;-)

int main(int argc, char** argv) {
int code = 1;
if(code /= 0) {
return 1;
}
return 0;
}

[beorn(a)hactar tester]$ LANG=en gcc ada_not_equal.c
ada_not_equal.c: In function 'main':
ada_not_equal.c:3: warning: division by zero

That's even without the otherwise indispensable -Wall.

The problem I have most often when I switch languages is that I get =, :=
and == mixed up.

--
Bj�rn Persson
PGP key A88682FD

From: Gautier write-only on
It is more the "Ada style" that has leaked in my VB coding, like

Sub Mix(ByVal code As Char, ....
' declarations here and not scattered anywhere...
Dim li As String
Dim bid As String
Dim fi, fo As Integer
Dim first_line As Boolean
' begin
first_line = True
'
fi = FreeFile()
FileOpen(fi, name_1, OpenMode.Input)
While Not EOF(fi)
...

Now I've simplified things, making GCC leaking itself into the day
job :-).
G.
From: Warren on
Bj�rn Persson expounded in news:80l74nFptU1(a)mid.individual.net:

> Adam Beneschan wrote:
>
>> if (code /= 0) { ... }
>>
>> This is valid C, so the compiler won't complain
>
> Are you sure? ;-)
>
> int main(int argc, char** argv) {
> int code = 1;
> if(code /= 0) {
> return 1;
> }
> return 0;
> }
>
> [beorn(a)hactar tester]$ LANG=en gcc ada_not_equal.c
> ada_not_equal.c: In function 'main':
> ada_not_equal.c:3: warning: division by zero
>
> That's even without the otherwise indispensable -Wall.
>
> The problem I have most often when I switch languages is that I get =,
> := and == mixed up.

Yep, I've been having to backspace over some := in my
awk scripts lately also.

Warren