Richard Heathfield wrote:
> Phlip said:
>
>>>> Last I heard no compiler actually implements the C++ Standards. If so,
>>>> by that logic, no true C++ program has ever been written!
>>> I think you might be able to say that no C++ program has been compiled
>>> by
>>> a compiler that fully implements the C++ standard. There is no
>>> requirement for a compiler to exist for a program to be written. Is
>>> there?
>> Theeennnn... you can write a program that's well-formed and well-behaved
>> for both C and C++, right?
>
> Yes, that can be done. Below, I quote Jeremy Dilatush's "Hello world"
> program, which is (almost!) legal as C, as TCL, as Perl, and as a shell
> script.
>
> I am not sure which side of the argument, if any, this program supports!
>
> #define NAME hello.c
> #define DESCRIP many languages at once (tcl, perl 4 & 5, sh, C)
> #define AUTHOR Jeremy Dilatush
> #define DATE 7/31/96
> #define dummy \
> eval qq[qq? 2> /dev/null
> #if 0
> #\
> echo 'Hello world!'; exit 0 # shell part
> puts "Hello world!"; exit 0
> #endif
>
> /* C part */
>
> #include <stdio.h>
>
> int main(void)
> {
> printf ("Hello world!\n");
> return 0;
> }
>
> #define dummy2(perl) \
> ?]; print "Hello world!\n"; exit 0 # perl part
>
>
That's almost like turning hamburger into cow. ;)
LR