Decl::EventContext - base class implementing an event context in a declarative structure.
Version 0.01
Each node in a Decl structure that can respond to events can inherit from this class to get the proper machinery in place.
Decl
Called during object creation to set up fields and such.
Returns $self.
Registers and fires closures by name. This is the mechanism used by the 'on' tag in the core semantics. This is actually a command-line interface; fire runs the Text::ParseWords parse_line function on its input, and gives the event closure any list elements that come after the first word.
fire
parse_line
Given the name of a Decl event, finds the code referred to in its callable closure.
TODO: this is not covered by unit testing!
Each event context can return a semantic handler. For example, a form knows that its core semantics are "wx"; a Word document knows that its core semantics are "ms-word", and so on. The semantic handlers are a good place to put common functionality for a given semantic domain, so they're useful in code snippets in a given context.
The default is to return the core semantics.
Michael Roberts, <michael at vivtek.com>
<michael at vivtek.com>
Please report any bugs or feature requests to bug-decl at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Decl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-decl at rt.cpan.org
Copyright 2010 Michael Roberts.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Decl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Decl
CPAN shell
perl -MCPAN -e shell install Decl
For more information on module installation, please visit the detailed CPAN module installation guide.