Last active
May 13, 2016 21:25
-
-
Save tbrowder/4b4b2fd29a6aafd938436c04222cb782 to your computer and use it in GitHub Desktop.
Code question in per6/doc/htmlify.p6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# consider the following code from perl6/doc/htmlify.p6 starting at line 772: | |
pod-table($*DR.lookup($kind, :by<kind>)\ | |
.grep({$category ⊆ .categories})\ # XXX | |
.categorize(*.name).sort(*.key)>>.value | |
.map({[ | |
.map({.subkinds // Nil}).unique.join(', '), | |
pod-link(.[0].name, .[0].url), | |
.&summary | |
]}) | |
# why won't this work instead: | |
pod-table($*DR.lookup($kind, :by<kind>) # no backslash | |
.grep({$category ⊆ .categories}) # no backslash | |
.categorize(*.name).sort(*.key)>>.value | |
.map({[ | |
.map({.subkinds // Nil}).unique.join(', '), | |
pod-link(.[0].name, .[0].url), | |
.&summary | |
]}) | |
# it won't work because of Perl 6 parsing and lexing rules--see reference provided by geekosaur: | |
# http://design.perl6.org/S02.html#Unspaces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lizmat thinks the backslashes are no longer needed--I'll try the code after changing them.
Later...it seems they are needed. See ending comment in the gist above.