1. warning from Euphoria

Warning ( resolution_warning ): Irregular.ew:24 - identifier 'allocate' in 'machine.e' is not included

What is this trying to tell me?

new topic     » topic index » view message » categorize

2. Re: warning from Euphoria

Never mind, I figured it out.

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

3. Re: warning from Euphoria

judith evans said...

Warning ( resolution_warning ): Irregular.ew:24 - identifier 'allocate' in 'machine.e' is not included

That is a bit of a confusing message. I wonder if we can come up with a better message... I was thinking:

Warning ( resolution_warning ): 
        Irregular.ew:24 - identifier 'allocate' in 'machine.e' is not directly included 

but that's not totally true. For instance, you could have:

-- lib.e 
global function abc() ... 
 
-- mycommon.e 
include lib.e 
 
-- myprog.ex 
include mycommon.e 

and abc() will resolve correctly. What you cannot have is brother/sister includes...

-- mylib.e 
global function abc() ... 
 
-- mycommon.e 
include mylib.e 
 
-- other.e 
abc() 
 
-- myprog.ex 
include mycommon.e 
include other.e 

In the above situation, other.e use to see abc() because include mycommon.e included it, but this is pretty bad practice. Rearrange your include files and all sorts of things begin to break, not to mention, you look at other.e and say, now, where does abc() come from? So, this very problem is what that warning is talking about.

Jeremy

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

4. Re: warning from Euphoria

Which would be totally utterly and completely and forever resolved by forward includes (?)

Chris

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

5. Re: warning from Euphoria

ChrisB said...

Which would be totally utterly and completely and forever resolved by forward includes (?)

I am not totally sure how this would solve the above problem? Basically you do not want a brother/sister file affecting each other. So, let's say you have a brother file that defines say_hello(). You do not want the ability in the sister file to define a forward reference to say_hello() and access it from the brother file? That solves nothing, as it's still obscure, where is say_hello() actually defined at? The correct solution is to include the files you need in your own file.

I know there are sometimes circular dependencies, but to borrow the classic phrase that is tossed around all the time, refactor. Now, a forward declaration will fix problems in the same file, for instance you want to use function abc() in def() but abc() is not defined yet because it uses def() as well. Thus, a forward reference would fix that, and that is nice at times. I do not see, however, how this would fix brother/sister file includes.

Jeremy

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

6. Re: warning from Euphoria

ChrisB said...

Which would be totally utterly and completely and forever resolved by forward includes (?)

This is a bit cryptic to me. Could you explain what you mean by "forward includes"?

Matt

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

7. Re: warning from Euphoria

I meant, of course forward referincing.

Chris

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

8. Re: warning from Euphoria

Grrr - referencing

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

9. Re: warning from Euphoria

Hi

In the olden days, when I programmed (dabbled more correctly), I had a heck of a job including files because each of the files that I had incleded had to say what else was included and define each of the functions to be included (or something, I basically gave up in the end, mot=re hassle than it was worth, and stuffed as much as I could in one file as possible)

Euphorias include system is much nicer, and the forward ref issue is easy to work round, with routine_ids, and function shuffling, but wouldn't it be nice not to worry about that?

Brother sister circular includes, when they did occur, could be resolved by the programmer using namespaces where the program required it, with the interpreter stopping with a warning when the situation arose.

As I say no biggy, but I'll just keep chucking it in every now and again. I kept on about a decent forum, and look what we've got now! (cheers btw)

Chris

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

10. Re: warning from Euphoria

No, that's a separate issue. This warning is about the enhanced symbol conflict resolution that's in 4.0. Consider that you have been using libfoo from the archive. It is made up of multiple files, and one of those files exposes a global procedure named foo. Now suppose, that someone else releases libbar, which is also pretty cool, and you want to use it in your application. It's also made up of multiple files, and one of those exposes a global variable named foo.

Suppose that you included libfoo first in the application. Whenever any part of libfoo tries to call "foo", the interpreter knows exactly what it means, because there's only one of them. But later in the program, you've included libbar. Now, when parts of libbar try to use its "foo" variable, the interpreter has a choice to make. Which global did you really mean?

If the file in which it is being referenced has included the file where "foo" is defined, then the interpreter is now smart enough to figure that you must mean that one (assuming that you didn't *also* include libfoo, or something else that exposes something called foo, in which case you need to qualify the reference with a namespace). This warning is telling you that you're using a symbol from a file that was never included into the file.

To make the warning go away, you need to either include the file where the symbol is defined, or include some other file that includes the file. For instance, if you include win32lib, then all of the exposed symbols that are defined in its many files are considered included into that file.

But you may have other files that rely on other files to have previously included something. This may not be so bad in your application, but it can cause conflicts when people use third party code, and previously, the only way to fix it was to modify the third party code.

In Judith's case, machine.e had already been included, but not by the file that was calling allocate.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu