On 08/10/14 15:05, Francis (Grizzly) Smit wrote:
I have found this bug in the current git version of rakudo:


23:16:34 grizzlysmit@rakbat:~/Projects/perl/perl6/testing0$ perl6 --version This is perl6 version 2014.09-165-g19d2de5 built on MoarVM version 2014.09-14-g0df2d6f
00:01:10 grizzlysmit@rakbat:~/Projects/perl/perl6/testing0$ cat ./bug.p6
#!/usr/bin/env perl6
use v6;
say Str.^attributes;
00:01:16 grizzlysmit@rakbat:~/Projects/perl/perl6/testing0$ ./bug.p6
No such method 'gist' for invocant of type 'BOOTSTRAPATTR'
  in method gist at src/gen/m-CORE.setting:7733
  in sub say at src/gen/m-CORE.setting:15838
  in block <unit> at ./bug.p6:3


the result is the same if Str is replaced with a literal string or Int


Hi,

I can tell you why this doesn't work and why it maybe shouldn't:

Str is a class that's needed extremely early in the build process, so we create it in the "bootstrap" phase. The regular Attribute class isn't available there, yet. That's why we use BOOTSTRAPATTR instead. That one doesn't have a gist method to pretty-print itself.

However, what it does have (and has to have) is a "name" method. So this code works fine:

#!/usr/bin/env perl6
use v6;
.name.say for Str.^attributes;


HTH
  - timotimo

Reply via email to