Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Do not know how to load code from <foo>" due to wrong capitalization of <Foo> #4540

Open
p6rt opened this issue Sep 17, 2015 · 4 comments
Open
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Sep 17, 2015

Migrated from rt.perl.org#126088 (status was 'open')

Searchable as RT126088$

@p6rt
Copy link
Author

p6rt commented Sep 17, 2015

From @raiph

See http://irclog.perlgeek.de/perl6/2015-09-17#i_11235064

What a user tried

use Inline​::Perl5;
use SNMP.pm​:from<perl5>;

Note the lowercase 'p' in 'perl5'.

(A similar case applies to 'Java' vs 'java' and presumably 'Python' vs 'python' etc.)

What they got

Do not know how to load code from perl5

What to do

Perhaps loader names would best be case insensitive (but maybe that's not perlish) or a 'did you mean?' response based on available loaders is warranted (that seems p6ish).

@p6rt
Copy link
Author

p6rt commented Oct 3, 2015

From @peschwa

On Thu Sep 17 13​:32​:26 2015, raiph wrote​:

See http://irclog.perlgeek.de/perl6/2015-09-17#i_11235064

What a user tried

use Inline​::Perl5;
use SNMP.pm​:from<perl5>;

Note the lowercase 'p' in 'perl5'.

(A similar case applies to 'Java' vs 'java' and presumably 'Python' vs
'python' etc.)

What they got

Do not know how to load code from perl5

What to do

Perhaps loader names would best be case insensitive (but maybe that's
not perlish) or a 'did you mean?' response based on available loaders
is warranted (that seems p6ish).

< psch> huh, we've removed the deprecation warnings for "use ...​:from<java>" but still allow it..?
< psch> i suppose that ties in with RT #​126088
< ShimmerFairy> isn't :from<foo> an important part of the use declaration? (Or am I missing something?)
< psch> ShimmerFairy​: :from<java> was deprecated in favor of :from<Java>
< psch> ShimmerFairy​: which is what the ticket is about, for the lazy :)
< ShimmerFairy> psch​: ah, so it's just the from<> adverb assuming anyone would be silly enough to try and make a distinction between 'java'
  and 'Java' :P
< psch> i'm inclined to say ".lc the language name when registering the loader" as a resolution for the ticket, fwiw
< psch> oh, and also ".lc the :from-value when looking for a loader" of course
< ShimmerFairy> psch​: or .fc , since that's generally the nicer way to do caseless comparison
< ShimmerFairy> (in Unicode land, specifically)
< psch> ShimmerFairy​: right, Unicode land is somewhat uncharted for me :)
< ShimmerFairy> psch​: so, it'd be something like given $from.fc { when "java".fc { ... } ... } , to give you an idea :
< psch> m​: say &fc
<+camelia> rakudo-moar 03a9e7​: OUTPUT«===SORRY!=== Error while compiling /tmp/xWLPMCGXlW␤Undeclared routine​:␤ &fc used at line 1. Did
  you mean '&uc', '&lc', '&tc'?␤␤»
< ShimmerFairy> m​: say "FoO".fc
<+camelia> rakudo-moar 03a9e7​: OUTPUT«Method 'fc' not found for invocant of class 'Str'␤ in block <unit> at /tmp/wsCsRTQMXL​:1␤␤»
< psch> the remaining question would be if we require the module loader to be registered with the .fc name or do assume we have to do it
  ourselves
< ShimmerFairy> I think for clarity in the code that does the actual comparison, it'd be best to have it do .fc on both.
12​:23 < ShimmerFairy> (It would also let module loader writers care less :P)

@p6rt
Copy link
Author

p6rt commented Oct 3, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

Still reproducible (2017.11,HEAD(e5b660e)). Yes, the error message could be better.

On 2015-09-17 13​:32​:26, raiph wrote​:

See http://irclog.perlgeek.de/perl6/2015-09-17#i_11235064

What a user tried

use Inline​::Perl5;
use SNMP.pm​:from<perl5>;

Note the lowercase 'p' in 'perl5'.

(A similar case applies to 'Java' vs 'java' and presumably 'Python' vs
'python' etc.)

What they got

Do not know how to load code from perl5

What to do

Perhaps loader names would best be case insensitive (but maybe that's
not perlish) or a 'did you mean?' response based on available loaders
is warranted (that seems p6ish).

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant