1. ver 4.0 builtin_chosen_warning ???
- Posted by bernie Sep 05, 2008
- 1032 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
2. Re: ver 4.0 builtin_chosen_warning ???
- Posted by mattlewis (admin) Sep 05, 2008
- 1016 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
Basically, it's part of the new symbol resolution. In 3.1, if compare() were defined somewhere in code, it would override the built-in version. That only happens now if it is defined with the override keyword, which is an indication that it is meant to override the built-in.
The compare() in map.e is not meant to override the built-in, and is not declared with override. In order to call it, you would need to use a qualified call (i.e., use a namespace).
The logic behind the warning is that you might have meant to call the map version of compare(), since both the built-in and the map version of compare() are in scope, but forgot to use the namespace to qualify the call. So it issues the warning you saw to indicate what's going on. There is also a namespace for built-in routines: eu. Using that would also avoid the warning.
Matt
3. Re: ver 4.0 builtin_chosen_warning ???
- Posted by bernie Sep 05, 2008
- 1009 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
Basically, it's part of the new symbol resolution. In 3.1, if compare() were defined somewhere in code, it would override the built-in version. That only happens now if it is defined with the override keyword, which is an indication that it is meant to override the built-in.
The compare() in map.e is not meant to override the built-in, and is not declared with override. In order to call it, you would need to use a qualified call (i.e., use a namespace).
The logic behind the warning is that you might have meant to call the map version of compare(), since both the built-in and the map version of compare() are in scope, but forgot to use the namespace to qualify the call. So it issues the warning you saw to indicate what's going on. There is also a namespace for built-in routines: eu. Using that would also avoid the warning.
Matt
Matt:
There is a problem with that because I used 'include map.e as sm'
and the interpreter should not even be looking at namespace sm:compare()
4. Re: ver 4.0 builtin_chosen_warning ???
- Posted by mattlewis (admin) Sep 05, 2008
- 1029 views
There is a problem with that because I used 'include map.e as sm' and the interpreter should not even be looking at namespace sm:compare()
Yes, but when you used compare() you did not qualify it.
Matt
5. Re: ver 4.0 builtin_chosen_warning ???
- Posted by euphoric (admin) Sep 05, 2008
- 999 views
There is a problem with that because I used 'include map.e as sm' and the interpreter should not even be looking at namespace sm:compare()
Yes, but when you used compare() you did not qualify it.
If we write 'include map.e as sm,' doesn't that put the map.e compare() into a namespace that requires the namespace qualifier, or does it just make it convenient for avoiding conflicts? I guess it depends on how it's defined in map.e, eh?
6. Re: ver 4.0 builtin_chosen_warning ???
- Posted by mattlewis (admin) Sep 05, 2008
- 1000 views
If we write 'include map.e as sm,' doesn't that put the map.e compare() into a namespace that requires the namespace qualifier, or does it just make it convenient for avoiding conflicts? I guess it depends on how it's defined in map.e, eh?
It just enables you to qualify references to identifiers in the file with the namespace. It does not make it so that you must use a fully qualified identifier. This is different behavior from other languages such as C (ha! now some of you just had knee jerk reactions for, and some against this), but it the way namespaces in euphoria have always worked.
Matt
7. Re: ver 4.0 builtin_chosen_warning ???
- Posted by DerekParnell (admin) Sep 05, 2008
- 1023 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
It means that your program uses 'compare()' somewhere, and this is just letting you know that your program is calling the built-in compare() rather than the one inside map.e. In the past, Euphoria would have called the map:compare() without telling you.
To get rid of this message, add 'eu:' to the compare() calls in your program. 'eu:' is the namespace for built-in routines.
8. Re: ver 4.0 builtin_chosen_warning ???
- Posted by bernie Sep 05, 2008
- 990 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
It means that your program uses 'compare()' somewhere, and this is just letting you know that your program is calling the built-in compare() rather than the one inside map.e. In the past, Euphoria would have called the map:compare() without telling you.
To get rid of this message, add 'eu:' to the compare() calls in your program. 'eu:' is the namespace for built-in routines.
I think that the warning message is worded so that it will confuse new users. It seems that the error messages are being targeted to developers and not ordinary users.
9. Re: ver 4.0 builtin_chosen_warning ???
- Posted by ne1uno Sep 05, 2008
- 973 views
- Last edited Sep 06, 2008
Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
It means that your program uses 'compare()' somewhere, and this is just letting you know that your program is calling the built-in compare() rather than the one inside map.e.
I think that the warning message is worded so that it will confuse new users.
I've reported about find() in std/regex.e too, I think some are missing that the message, is pointing at a use of compare() in std/map.e and is obviously worded wrong, because if it had replaced find in regex.e or compare in map.e the unittests would fail.
10. Re: ver 4.0 builtin_chosen_warning ???
- Posted by DerekParnell (admin) Sep 05, 2008
- 969 views
- Last edited Sep 06, 2008
I think that the warning message is worded so that it will confuse new users. It seems that the error messages are being targeted to developers and not ordinary users.
I'm sure the assumption is that developers test their own programs before sending out into the wild, so developers should be able to see these message before their intended audience does.
11. Re: ver 4.0 builtin_chosen_warning ???
- Posted by DerekParnell (admin) Sep 05, 2008
- 969 views
- Last edited Sep 06, 2008
I've reported about find() in std/regex.e too
Good catch. The standard library should be using the "eu:" namespace so that these sort of messages are not generated by the library itself. I'll check it out.
12. Re: ver 4.0 builtin_chosen_warning ???
- Posted by ne1uno Sep 05, 2008
- 986 views
- Last edited Sep 06, 2008
I've reported about find() in std/regex.e too
Good catch. The standard library should be using the "eu:" namespace so that these sort of messages are not generated by the library itself. I'll check it out.
well, not really. I just ran a few tests and I now aggree with the warning a little more. in regex the find used is re:find and is unqualified and there is no warning. not sure why. yet the re:find is properly chosem.
but in a test program that has include std/regex.e and uses find if you qualify the find, eu:find or re:find there is no warning. if your program has include std/map.e and has no use of compare, again no warning. so it appears now to be working as designed. I think that warning should be reworded somehow all the same.
13. Re: ver 4.0 builtin_chosen_warning ???
- Posted by DerekParnell (admin) Sep 05, 2008
- 991 views
- Last edited Sep 06, 2008
in regex the find used is re:find and is unqualified and there is no warning. not sure why. yet the re:find is properly chosem.
Because that's how its supposed to work. If a local routine exists with the same name as a built-in, the local routine takes priority. If you need to use the built-in instead, inside the local scope, use the 'eu:' namespace.
in a test program that has include std/regex.e and uses find if you qualify the find, eu:find or re:find there is no warning.
Which is what namesace qualification is suposed to do
if your program has include std/map.e and has no use of compare, again no warning.
Yes, the warning only occurs if you use the symbol.
I think that warning should be reworded somehow all the same.
What would you suggest?
14. Re: ver 4.0 builtin_chosen_warning ???
- Posted by ChrisB (moderator) Sep 06, 2008
- 997 views
Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
How about
Warning ( function built-in to interpreter chosen over exported function): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
Chris
15. Re: ver 4.0 builtin_chosen_warning ???
- Posted by CChris Sep 06, 2008
- 978 views
What the heck does mean ??? what compare() ??? What global/export function ??? Where in my 3,371 line program ??????????????? Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e Press Enter...
It means that your program uses 'compare()' somewhere, and this is just letting you know that your program is calling the built-in compare() rather than the one inside map.e. In the past, Euphoria would have called the map:compare() without telling you.
To get rid of this message, add 'eu:' to the compare() calls in your program. 'eu:' is the namespace for built-in routines.
You can more simply add without warning "builtin_chosen_warning" at the top of your program. Any set of warnings can be enabled/disabled in 4.0.
CChris
16. Re: ver 4.0 builtin_chosen_warning ???
- Posted by CChris Sep 06, 2008
- 964 views
Warning ( builtin_chosen_warning ): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
How about
Warning ( function built-in to interpreter chosen over exported function): built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
Chris
The two line format is provided so that, if user wishes to suppress or re-enable the warning, s/he gets the exact string to use right on screen. This is why the name of the warning class is explicitly mentioned.
Your wording just says the same thing twice, or am I getting it wrong?
CChris
17. Re: ver 4.0 builtin_chosen_warning ???
- Posted by ChrisB (moderator) Sep 06, 2008
- 961 views
Warning ( builtin_chosen_warning ):
built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
How about
Warning ( function built-in to interpreter chosen over exported function):
built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
Chris
The two line format is provided so that, if user wishes to suppress or re-enable the warning, s/he gets the exact string to use right on screen. This is why the name of the warning class is explicitly mentioned.
Your wording just says the same thing twice, or am I getting it wrong?
CChris
Hi
No, you're not wrong, I should have used the creole formatting (keep getting caught out by that) - it is as I suggest above in the quote. However the warning is more verbose, more English, and (perhaps) more comprehensible to the likes of me, who will no doubt come across these new warnings, and like Bernie, have little idea what they mean.
Chris
18. Re: ver 4.0 builtin_chosen_warning ???
- Posted by bernie Sep 06, 2008
- 970 views
Warning ( builtin_chosen_warning ):
built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
How about
Warning ( function built-in to interpreter chosen over exported function):
built-in compare() chosen over global/export function in: D:\#EU40\INCLUDE\std/map.e
Chris
The two line format is provided so that, if user wishes to suppress or re-enable the warning, s/he gets the exact string to use right on screen. This is why the name of the warning class is explicitly mentioned.
Your wording just says the same thing twice, or am I getting it wrong?
CChris
Hi
No, you're not wrong, I should have used the creole formatting (keep getting caught out by that) - it is as I suggest above in the quote. However the warning is more verbose, more English, and (perhaps) more comprehensible to the likes of me, who will no doubt come across these new warnings, and like Bernie, have little idea what they mean.
Chris
Why doesn't the message just say: Namespace Conflict: Program has declared compare() with the name as function in D:\#EU40\INCLUDE\std/map.e
19. Re: ver 4.0 builtin_chosen_warning ???
- Posted by mattlewis (admin) Sep 06, 2008
- 974 views
Why doesn't the message just say: Namespace Conflict: Program has declared compare() with the name as function in D:\#EU40\INCLUDE\std/map.e
Is that meant to be an error? It's not clear from what you posted. I don't think that it should be.
Matt
20. Re: ver 4.0 builtin_chosen_warning ???
- Posted by bernie Sep 06, 2008
- 977 views
Why doesn't the message just say: Namespace Conflict: Program has declared compare() with the name as function in D:\#EU40\INCLUDE\std/map.e
Is that meant to be an error? It's not clear from what you posted. I don't think that it should be.
Matt
Matt: Yes I'am saying that ' builtin_chosen_warning ' should be dumped. The way it reads is confusing. I sounds like it is choosing an option for you and hitting return will continue your program which is not true. Namespace errors should all fall under one class of error. Namespace Conflict Error: This forces users to learn the proper use of the namespace features. Bernie
21. Re: ver 4.0 builtin_chosen_warning ???
- Posted by CChris Sep 06, 2008
- 989 views
Why doesn't the message just say: Namespace Conflict: Program has declared compare() with the name as function in D:\#EU40\INCLUDE\std/map.e
Is that meant to be an error? It's not clear from what you posted. I don't think that it should be.
Matt
Matt: Yes I'am saying that ' builtin_chosen_warning ' should be dumped. The way it reads is confusing. I sounds like it is choosing an option for you and hitting return will continue your program which is not true. Namespace errors should all fall under one class of error. Namespace Conflict Error: This forces users to learn the proper use of the namespace features. Bernie
But it is not an error at all.
It is perfectly ok to define a routine with the same name as a builtin, and so was it in 3.1.
What has changed is that there are two ways:
- using global/public/export. Then the routine is not supposed to shadow the built-in. It was assumed (I don't agree with this opinion) that it would be confusing to have the interpreter silently choose the built-in, which it should do, so there is a warning enabled by default.
- using override. This shadows the builtin, just like in 3.1.
Again, you may consider this not to be relevant, and can disable the warning.
CChris
22. Re: ver 4.0 builtin_chosen_warning ???
- Posted by SDPringle Sep 07, 2008
- 962 views
Bernie,
Why don't you just suggest the wording that you think would be the most clear to end users (meaning Euphoria programmers who are programming in EUPHORIA such as yourself).
Shawn Pringle
23. Re: ver 4.0 builtin_chosen_warning ???
- Posted by DerekParnell (admin) Sep 07, 2008
- 971 views
The wording has been changed to ...
Warning ( builtin_chosen ): The built-in XXXX() over rides the global/public XXXX() in: FILENAME
24. Re: ver 4.0 builtin_chosen_warning ???
- Posted by SDPringle Sep 07, 2008
- 941 views
Could we suggest a little help, also like:
Use eu namespace to explicitly choose builtin or map namespace to choose custom function.
Shawn
25. Re: ver 4.0 builtin_chosen_warning ???
- Posted by CChris Sep 07, 2008
- 972 views
Could we suggest a little help, also like:
Use eu namespace to explicitly choose builtin or map namespace to choose custom function.
Shawn
The help would rather read like:
Use the override qualifier for your routine to shadow the built-in one.
Or somesuch. CChris