11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.3 Packages • 89The final output shows that every statement has been reached bythe test cases. This functionality is very useful for interactively developingunit tests for Maple programs.Note: The source presented here for the coverage package has beensimplified for presentation in printed form. The full source code is availablein the samples directory of your Maple installation.The Shapes PackageModules permit the construction of packages with hierarchical structure.This cannot be done with table-based implementations of packages. Thissection presents:• How to organize your source code for a (potentially) large packagethat has a nontrivial substructure.• A description of the Shapes package, including details of its designand implementation• Hints related to source code organization.The mathematical functionality of this package is trivial. It providesthe means to compute areas and circumferences of various planar figures,which are called shapes.Note: Only portions of the source code for this package are shown here.The fully commented source code can be found in the samples directoryof your Maple installation.The Shapes package is organized into sev-Source Code Organizationeral source files:shapes.mplpoint.mplsegment.mplcircle.mplsquare.mpltriangle.mpl

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!