1. EuGTK - get vs get conflict

What is the best way to handle this conflict?

 A namespace qualifier is needed to resolve 'get'because 'get' is declared as a global/public symbol in:    ./GtkEngine.e 
    /usr/share/euphoria/include/std/get.e                                                                                                                                  
                                                                                                                                                                           
    filename = get(dlgSaveDiet,"filename")  

new topic     » topic index » view message » categorize

2. Re: EuGTK - get vs get conflict

Hi,
what is the "get" reference in ./GtkEngine.e ?

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

3. Re: EuGTK - get vs get conflict

Jerry_Story said...

What is the best way to handle this conflict?

 A namespace qualifier is needed to resolve 'get'because 'get' is declared as a global/public symbol in:    ./GtkEngine.e 
    /usr/share/euphoria/include/std/get.e                                                                                                                                  
                                                                                                                                                                           
    filename = get(dlgSaveDiet,"filename")  

As the message suggests....qualify the use of get() with a namespace.

I assume that you're trying to use the get() defined in EuGTK. If EuGTK defines a default namespace, then you could use that. Otherwise, you'll need to do something like:

include eugtk.e as gtk 
 ... 
filename = gtk:get(dlgSaveDiet,"filename") 

A default namespace is declared at the top of a file. It must be the first non-comment euphoria statement:

-- file foo.e 
 
namespace foo 
 

That allows users to use the foo namespace qualifier without needing to specify their own. The standard library does this. For get.e, the namespace is stdget.

Matt

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

4. Re: EuGTK - get vs get conflict

I suppose I should add "namespace gtk" to the GtkEngine - there's no downside to this, is there?

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

5. Re: EuGTK - get vs get conflict

irv said...

I suppose I should add "namespace gtk" to the GtkEngine - there's no downside to this, is there?

Not really. Users aren't forced to use it, and the parser is fairly smart about detecting namespace qualifiers vs other symbols. BTW, default namespaces are considered to be of public scope.

Matt

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

6. Re: EuGTK - get vs get conflict

mattlewis said...
irv said...

I suppose I should add "namespace gtk" to the GtkEngine - there's no downside to this, is there?

Not really. Users aren't forced to use it, and the parser is fairly smart about detecting namespace qualifiers vs other symbols. BTW, default namespaces are considered to be of public scope.

Matt

What happens if two files have the same default namespace and thus conflict?

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

7. Re: EuGTK - get vs get conflict

jimcbrown said...
mattlewis said...
irv said...

I suppose I should add "namespace gtk" to the GtkEngine - there's no downside to this, is there?

Not really. Users aren't forced to use it, and the parser is fairly smart about detecting namespace qualifiers vs other symbols. BTW, default namespaces are considered to be of public scope.

What happens if two files have the same default namespace and thus conflict?

Same thing as if they have two other symbols named the same. The user of the two files will have to create his own namespaces to disambiguate (i.e., include <file> as <namespace>). The local namespace will override any default namespaces, just like other local symbols override symbols from other files.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu