Skip to content

Instantly share code, notes, and snippets.

@alabamenhu
Last active November 11, 2019 23:06
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 alabamenhu/b7179258120923a917970eb1c2d12ab1 to your computer and use it in GitHub Desktop.
Save alabamenhu/b7179258120923a917970eb1c2d12ab1 to your computer and use it in GitHub Desktop.
Pod extract
What I'm thinking of is a way to allow something like this:
#######################################################################
=begin pod
=head1 Dog
{{|An animal that tends to bark}}. Many people really like how playful
they can be, and they're particularly known to be really great friends
to humans.
=end pod
class Dog {
method bark { say "bow wow" }
}
#######################################################################
Even though there's nothing directly attached to Dog, the goal would be
to have the text in {{}} (or some other delimiter) return be counted as
equivalent to having said
#| An animal that barks
class Dog { … }
As a potential extension of this, it might not be a bad idea to expand it
even further so that in the discussion, one could casually reference each
method in the larger pod, but have it all be attached. Such that
#######################################################################
=begin pod
=head1 Dog
{{|An animal that tends to bark}}. Many people really like how playful
they can be, and they're particularly known to be really great friends
to humans. To {{Dog.bark| say “hello!”}}, most dogs will bark.
=end pod
class Dog {
method bark { say "bow wow" }
}
#######################################################################
For which we could then say:
Dog.WHY --> "An animal that tends to bark"
Dog.bark.WHY --> "say “hello!”"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment