Re: No call for Ada (was Re: Announcing new scripting/prototyping language)
From: Rob Thorpe (robert.thorpe_at_antenova.com)
Date: 02/11/04
- Next message: pcouas_at_infodev.fr: "IBM javaxcomm.jar"
- Previous message: Preben Randhol: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- In reply to: Ludovic Brenta: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Next in thread: David Starner: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Feb 2004 11:31:30 -0800
Ludovic Brenta <ludovic.brenta@insalien.org> wrote in message news:<m3fzdlyrh1.fsf@insalien.org>...
...
> which is not possible in C:
>
> typedef enum { YES, NO, MAYBE, MAYBE_NOT } assessment_t;
>
> void P (assessment_t A) { }
>
> int main () {
> P (42); // no compiler check!
> return 0;
> }
In C enums are interchangable with ints so there is no error, though
there maybe the compiler should give a warning.
A C++ compiler should check
I got:
bash-2.05b$ g++ -Wall fiddle.cpp
fiddle.cpp: In function `int main()':
fiddle.cpp:6: error: invalid conversion from `int' to `assessment_t'
- Next message: pcouas_at_infodev.fr: "IBM javaxcomm.jar"
- Previous message: Preben Randhol: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- In reply to: Ludovic Brenta: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Next in thread: David Starner: "Re: No call for Ada (was Re: Announcing new scripting/prototyping language)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|