Re: ver 4.0 Name Space Question ?

new topic     » goto parent     » topic index » view thread      » older message » newer message
bernie said...
DerekParnell said...
bernie said...
-- LIBA.e -- 
public constant 
foo1 = 1, 
foo2 = 2 
 
public function foobarr1() 
return 0 
end function 
 
public function foobarr2() 
return 0 
end function 
 

and this ...

-- LIBB.e -- 
-- No I want to pass on just the constants not 
-- the public functions from LIBA.e. 
   

Ok. Code like this then ...

-- LIBA.e -- 
public constant 
foo1 = 1, 
foo2 = 2 
 
export function foobarr1() 
return 0 
end function 
 
export function foobarr2() 
return 0 
end function 
 

and this ...

-- LIBB.e -- 
-- I want to pass on just the constants not 
-- the functions from LIBA.e.   
public include LIBA.e 

The export scope modifier is used for this purpose. It works just like public except that these symbols are only ever passed up one level only. In other words, if a file wants to use an export symbol, that file must include it explicitly.

You still do a public include to expose the public symbols but any exported symbols are not seen by files that include LIBB.e

Thanks Derek !

Now I understand the difference between export and public.

Who is ever in charge of that Developers group had better
give you a raise for being so good at explaining.

Derek's explanation should be IN the EU4 docs!

And in relation to those docs, about include,

What does "N.B." MEAN?

And since, after "An identifier marked as public or export...", an explanation for public is given, there needs to be an explantion for export also, either just before or just after the explanation for public.

Dan

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu