Skip to content

Conversation

jstuder-gh
Copy link
Contributor

This is a powerful way of sorting, but it's not currently apparent that
it can be done this way in the documentation.

This is a powerful way of sorting, but it's not currently apparent that
it can be done this way in the documentation.

Also, in this section have infix:<cmp> link to a page documenting the
various instances of the cmp operator.

Also, added myself to credits.
@jstuder-gh
Copy link
Contributor Author

I'm hoping to get some feedback on the style of this. For instance the %()'s in the sort example. Is it better to use that or the curly braces? I like the % prefixed parens as it can't be confused for a Block, but I don't see it as much in Perl6 examples. TIMTOWTDI is great, but I suppose it could be confusing or off-putting to the Perl newcomer reading the docs if the syntax used in the examples is inconsistent.

Also, regarding the . notation, is this intentional? I've actually never seen a hash value accessed in this way but was experimenting. I was wondering if since the dot prefix allows for method calls on the topic variable, if it would work for hash access too and it turns out it does. I kind of like this notation as it is easier to type but I don't want to start any bad habits (or start documenting bad habits).

@Tyil
Copy link
Member

Tyil commented Oct 24, 2017

I personally prefer the %() style as well, it makes intention clear and is less confusing, as {} are also used for a few other things. I don't think there's anything wrong using it in the docs either.

On the . notation, I am not sure. A more experienced Perl monk might be able to give a good answer here.

@bduggan
Copy link
Member

bduggan commented Oct 24, 2017

Also, regarding the . notation, is this intentional? I've actually never seen a hash value accessed in this way but was experimenting. I was wondering if since the dot prefix allows for method calls on the topic variable, if it would work for hash access too and it turns out it does. I kind of like this notation as it is easier to type but I don't want to start any bad habits (or start documenting bad habits).

There are a lot of occurrences of this syntax in the test suite (I found many by grepping for .<), so it is okay. For instance: here and here.

@rafaelschipiura
Copy link
Contributor

Yes, indexing into the topic with a dot is fine.

@rafaelschipiura rafaelschipiura merged commit 26ab764 into Raku:master Oct 24, 2017
@jstuder-gh
Copy link
Contributor Author

Thanks everyone for the clarification.

@jstuder-gh jstuder-gh deleted the sort_multiple branch October 29, 2017 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants