[comp.lang.modula2] ShortCompare

HPA111@DE0HRZ1A.BITNET (Michael Drechsler) (08/03/88)

Hello all,
I need a short objective compare of the possibilities of M2 and C but I
don't know much about C (when I see a program then I only can say that
it is written in C or not :-) and I currently don't have enough time to
read through a whole C book. So I ask you to help me please. I have
tried to list the features of the two languages, from the view of a M2
programmer. Would you please be so kind and fill in the missing entries
(or correct them) and then send the list to HPA111@DE0HRZ1A.BITNET

 given in Modula-2         | equivalent in C
---------------------------|--------------------------------
CONST declarations         |
TYPE declarations          |
enumeration types          | enum
subrange types             |
SET types                  |
ARRAY types                | yes
RECORD types               | struct
variant RECORDs            | union
PROCEDURE types            |
VAR declarations           |
                           |
IF THEN ELSE END           | if (test) stmt1 else stmt2
ELSIF                      | no
FOR DO END                 | for (init;test;reinit) stmt
WHILE DO END               | while (test) stmt
REPEAT UNTIL               |
LOOP EXIT END              |
CASE OF ELSE END           | swith case default:
WITH DO END                |
                           |
internal procs & functions | yes
recursive procs            | yes
call by value              | yes
call by reference          | yes, with address operator
open array parameters      |
                           |
separate compilation       | no, but external proc compil.
something like modules     | no
                           |
low levels for             | yes
    system programming     |
address computation        | yes
coroutines and processes   | no
---------------------------|---------------------------------
???                        | ??? (something else, that is not
                           |     defined in M2)

Thanks alot for your help,
Michael

SINBV@NOBERGEN.BITNET ("Bjoern Asle VALDE +47 21 32 46", 5) (08/05/88)

>  Hello all,
>  I need a short objective compare of the possibilities of M2 and C but I
>  don't know much about C (when I see a program then I only can say that
>  it is written in C or not :-) and I currently don't have enough time to
>  read through a whole C book. So I ask you to help me please. I have
> ......
Well, what I give you *is* a reference to a book, so it migth not be
all that helpfull, but anyway... Your question is  discussed in a
objective and informative way in a book by C.A. Wiatrowski  and
R.S. Wiener -- "From C to Modula-2 ...and back. Bridging the language gap."

Cheers; _Bjoern_