Path: utzoo!mnetor!uunet!husc6!think!ames!amdahl!nuchat!peter From: peter@nuchat.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga Subject: Re: Anyone seen a good Amiga Pascal lately ? Why not Modula-2? Message-ID: <844@nuchat.UUCP> Date: 23 Mar 88 12:36:28 GMT References: <2688@crash.cts.com> <821@nuchat.UUCP> <823@sdcc8.ucsd.EDU> Organization: Public Access - Houston, Tx Lines: 79 In article <823@sdcc8.ucsd.EDU>, cs178abu@sdcc8.ucsd.EDU (John Schultz) writes: > In article <821@nuchat.UUCP> peter@nuchat.UUCP (Peter da Silva) writes: > >Does the Benchmark compiler track changes to the .DEF module and recompile > >affected modules if you change it? > I haven't tried it yet, but I believe that a version key is > is checked during compilation (import phase). If the versions don't > match, an error message would be generated. That's what my experience has lead me to believe would be the case, too... > Basically, only variables, types, and procedure prototypes > are in the def mods; they aren't changed very often. Looks like a > make equivalent would be useful in that case... Do other M2 > compilers have that feature? (wouldn't be too hard to do) The .DEF modules are basically the equivalents of the .h files in 'C'. Make supports this: you just set up your makefile dependencies to reflect this. There are tools out there that build the makefile automatically. Suppose you have foo.c, foo.h, and bar.c. foo.h contains the defines for foo.c. The way I generally do this is like so: ---------- foo.h #ifndef GLOBAL #define GLOBAL extern #endif GLOBAL int var1, var2, var3; GLOBAL char *var4; GLOBAL int func1(); GLOBAL char *func2(); ---------- foo.c #include #include #define GLOBAL #include "foo.h" ... ---------- bar.c #include #include #include "foo.h" ... ---------- Makefile foo: foo.o bar.o ln -o foo foo.o bar.o foo.c: foo.h bar.c: foo.h ---------- This takes a bit more setup, but it does make sure everything's synched. And you only have to set this stuff up once. If I change foo.c, and I don't change foo.h, I'll get a type-clash or an undefined variable if the change to foo.c requires a change in foo.h. Most of the time nothing is needed: how often do you change your interfaces? If I change foo.h, then both foo.c and bar.c get recompiled automatically. I can forget about the dependencies once I have set them up. Most of the time the change is in a structure, and nothing needs to be done to bar.c except recompile to get the offsets right. > Actually, the best method would be to recompile the offending > modules as they are imported. The user would then need to save those > newly modified modules (both defs & mods in some cases) to permanent > storage. This could get kind of hairy... How would make handle it? See above. Since everythings in permanent storage most of the time there's no problem. You probably lose some speed that way, but you gain from not having to hold your compilers hand when you cross the street :->. I believe that Markus is working on something like this for M2Amiga. -- -- a clone of Peter (have you hugged your wolf today) da Silva `-_-' -- normally ...!hoptoad!academ!uhnix1!sugar!peter U -- Disclaimer: These aren't mere opinions... these are *values*.