Re: Question about doc style

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...
irv said...

I notice that in many (most?) of the docs, an example is given like the following:

include std/console.e  
namespace console  

Secondly, "we" know that the second line is just reminding us that a namespace has already been assigned to std/console.e (don't we?).

As I understand it, the second line is a brand new namespace applying to this file, whereas

include std/console.e as console 

would be the one that (needlessly) replicates the existing namespace already defined within std/console.e.

That is correct, except that a file's namespace has to be declared before any other line of code in that file, (except comments, I think) so putting it after the include std/console.e line is just going to result in a "Unknown namespace used" error.

We can't cause trouble by doing that, because Eu catches the error. But if it is invalid, then the docs shouldn't show it as if it was. A slight change so that it's clearer, such as:

include std/console.e 
-- all console.e functions have the default namespace "console:" 

That would avoid implying that you should ever add a namespace x line after an include.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu