Giter Site home page Giter Site logo

bp6-bug's Introduction

Bug report

Instead of packaging this up, I'm posting this here so the repo can be easily cloned and tested.

I'm seeing a bug that appeared after lexical module loading was introduced, which is tied to the name of the class and how deep it is in the path.

[cjfields@Chriss-MacBook-Air lex-bp6]$ tree .
.
├── SeqIO.pl6
└── lib
    ├── Bio
    │   ├── SeqIO
    │   │   └── fasta.pm6
    │   ├── SeqIO.pm6
    │   └── fasta.pm6
    └── fasta.pm6

3 directories, 5 files

In the script and the directory structure, note that three modules are named similarly, e.g. fasta, Bio::fasta, and Bio::SeqIO::fasta. The pluggable Bio::SeqIO dynamically loads the module passed.

The test script:

use v6;

use lib './lib';

use Test;

# Pluggable module
use Bio::SeqIO;

# Uncomment these lines and the tests pass
#use Bio::fasta;
#use Bio::SeqIO::fasta;

# passes
lives-ok {Bio::SeqIO.new(format  => 'fasta')}, 'simple path';

# These next two fail w/ 'No such symbol' errors
lives-ok {Bio::SeqIO.new(format  => 'Bio::fasta')}, 'one level deep';
lives-ok {Bio::SeqIO.new(format  => 'Bio::SeqIO::fasta')}, 'two levels deep';

Note the commented use statements; these should be loaded dynamically. When running this, the last two tests fail:

[cjfields@Chriss-MacBook-Air lex-bp6 (master)]$ perl6 SeqIO.pl6
ok 1 - simple path
not ok 2 - one level deep

# Failed test 'one level deep'
# at SeqIO.pl6 line 18
# Can't load Bio::fasta: No such symbol 'Bio::fasta'
not ok 3 - two levels deep

# Failed test 'two levels deep'
# at SeqIO.pl6 line 19
# Can't load Bio::SeqIO::fasta: No such symbol 'Bio::SeqIO::fasta'

If you uncomment the line, they pass:

[cjfields@Chriss-MacBook-Air lex-bp6 (master)]$ cat SeqIO.pl6
use v6;

use lib './lib';

use Test;

# Pluggable module
use Bio::SeqIO;

# Uncomment these lines and the tests pass
use Bio::fasta;
use Bio::SeqIO::fasta;

# passes
lives-ok {Bio::SeqIO.new(format  => 'fasta')}, 'simple path';

# These next two fail w/ 'No such symbol' errors
lives-ok {Bio::SeqIO.new(format  => 'Bio::fasta')}, 'one level deep';
lives-ok {Bio::SeqIO.new(format  => 'Bio::SeqIO::fasta')}, 'two levels deep';

[cjfields@Chriss-MacBook-Air lex-bp6 (master)]$ perl6 SeqIO.pl6
ok 1 - simple path
ok 2 - one level deep
ok 3 - two levels deep
[cjfields@Chriss-MacBook-Air lex-bp6 (master)]$

bp6-bug's People

Contributors

cjfields avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.