Skip to content

Instantly share code, notes, and snippets.

@tbrowder
Last active May 13, 2016 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbrowder/4b4b2fd29a6aafd938436c04222cb782 to your computer and use it in GitHub Desktop.
Save tbrowder/4b4b2fd29a6aafd938436c04222cb782 to your computer and use it in GitHub Desktop.
Code question in per6/doc/htmlify.p6
# 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
@tbrowder
Copy link
Author

tbrowder commented May 13, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment