Path: utzoo!attcan!uunet!zephyr.ens.tek.com!tektronix!nosun!qiclab!m2xenix!puddle!p2.f70.n226.z1.fidonet.org!Jon.Guthrie From: Jon.Guthrie@p2.f70.n226.z1.fidonet.org (Jon Guthrie) Newsgroups: comp.lang.modula2 Subject: Re: How to make libraries smaller? Message-ID: <5313.26709F16@puddle.fidonet.org> Date: 2 Jun 90 17:30:31 GMT Sender: ufgate@puddle.fidonet.org (newsout1.26) Organization: FidoNet node 1:226/70.2 - Programmer's Connec, Columbus OH Lines: 22 >> Simply collect all global types and variables into one module and >> import all that stuff in each of the other partitions. > I can see that this makes lots of sense for global types (very similar > to C's typedef in an #include file), and will indeed work. But will > variables be the SAME variables in all the modules that import it, or > will they be DIFFERENT? It depends...if you IMPORT a TYPE (call it Type1) and then declare a variable of type Type1 with the name FOO in module BAR1 and declare another variable of Type1 named FOO in module BAR2 then the variables will be different. If, however, you declare a Type1 variable named FOO in the included file and IMPORT that into BAR1 and BAR2 then FOO will be the same variable in both modules. Clear? (Try it, it works!) ...You trust them with your fortunes, let them guard your lives -- uucp: uunet!m2xenix!puddle!226!70.2!Jon.Guthrie Internet: Jon.Guthrie@p2.f70.n226.z1.fidonet.org