1. From scratch: include

I sent my Euphoria to the recycle bin, downloaded Euphoria 4.0.1 and am starting from scratch to recreate my binary tree program using simplest commands. But I have run into trouble right off the bat. My first line of code is:

include std/filesys.e

Execution results in error message:

namespace has not been declared
namespace filesys

I am puzzled by the swap between \ and /,
But more urgently, should I have included some file that declares "namespace"?

new topic     » topic index » view message » categorize

2. Re: From scratch: include

Is OE "4.0.1" a typo? Let us assume you are using 4.1.0 instead.

Windows uses backwards \ as a separator. Linux uses / as a separator. Win10 can use both forms (even if it sticks to the backwards style.)

Try running a minimal program, one line:

include std/filesys.e 

This shouid run with nothing happening; it just loads some routines but does nothing with them.

If you examine the "filesys.e" file you will see the first statement is:

namespace filesys 

A "namespace" is an extra identifier ( in this example filesys ) you can prefix to to an existing identifier (for a variable or function or ... ) It is something used in an emergency when you use the same name in two files--add a namespace prefix and duplicate names now become different.

So, not something to worry about now.

I am using Linux, with / separators.

The next program you should run is:

include std/filesys.e 
puts(1, current_dir() ) 

I have never seen a "namespace not declared error before" The error suggests a typo somewhere or a real puzzle that must be solved.


new topic     » goto parent     » topic index » view message » categorize

3. Re: From scratch: include

The symptoms are consistent with a user running 3.1 accidentally. The new command line name for the interpreter is 'eui'.

new topic     » goto parent     » topic index » view message » categorize

4. Re: From scratch: include

Thanks Tom and SDPringle,
It works fine when I use eui, Allen

new topic     » goto parent     » topic index » view message » categorize


Quick Links

User menu

Not signed in.

Misc Menu