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

bad "handles" example in doc/Language/subscripts.pod6 #1438

Closed
coke opened this issue Aug 7, 2017 · 5 comments
Closed

bad "handles" example in doc/Language/subscripts.pod6 #1438

coke opened this issue Aug 7, 2017 · 5 comments
Labels
bug Error of some kind, from a typo to errors in the examples. docs Documentation issue (primary issue type)

Comments

@coke
Copy link
Collaborator

coke commented Aug 7, 2017

This sample code:

    class HTTP::Header does Associative is Iterable {
        subset StrOrArrayOfStr where Str | ( Array & {.all ~~ Str} );

        has %!fields of StrOrArrayOfStr
                     handles <AT-KEY EXISTS-KEY DELETE-KEY push
                              iterator list kv keys values>;

        method Str { #`[not shown, for brevity] }
    }

Is presented as an example of handles, but if you run it, you get:

===SORRY!=== Error while compiling -
Class HTTP::Header can't pun role Iterable because it has required methods: iterator. Did you mean to use "does" instead?
at -:1

and if you fix that, you get:

Method 'iterator' must be implemented by HTTP::Header because it is required by roles: Iterable.

So this sample code isn't doing what it claims to.

@coke coke added the docs Documentation issue (primary issue type) label Aug 7, 2017
zoffixznet added a commit that referenced this issue Aug 7, 2017
@zoffixznet
Copy link
Contributor

zoffixznet commented Aug 7, 2017

The first one is a proper error, it sould be does instead of is (fixed in 492896f)

Method 'iterator' must be implemented by HTTP::Header because it is required by roles: Iterable.

I'd call that a rakudo bug; it fails to see the handles is providing iterator method. This is already reported as a more direct bug when actual method is present, but I mentioned this case with handles as well.

So... this ticket looks to be fixed to me, now.

@coke
Copy link
Collaborator Author

coke commented Aug 7, 2017

Ideally, we'd reference the RT in the user-visible code, and remove the skip once the bug is fixed.

@coke coke added the bug Error of some kind, from a typo to errors in the examples. label Aug 26, 2017
@JJ JJ added the TPF Grant label Apr 2, 2018
@JJ
Copy link
Contributor

JJ commented Apr 2, 2018

Checking that the RT bug is still open.

@JJ
Copy link
Contributor

JJ commented Apr 2, 2018

There's a patch submitted: rakudo/rakudo#1170, but it has not been accepted yet.

@JJ JJ removed the JJ TPF Grant label May 14, 2018
@JJ
Copy link
Contributor

JJ commented May 14, 2018

Of course, we could/should rewrite the example...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error of some kind, from a typo to errors in the examples. docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

3 participants