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.

344 • Appendix A: Internal Representation and Manipulationfunction are handled in the kernel. However, if an expansion of a sum to alarge power is required, then the internal expand calls the external Maplelibrary function ‘expand/bigpow‘ to resolve it. Functions such as diff,evalf, series, and type make extensive use of this feature.Thus, for example, the basic function diff cannot differentiate anyfunction. All of that functionality resides in the Maple library in proceduresnamed ‘diff/functionName‘. This is a fundamental feature ofMaple since it permits:• Flexibility (changing the library)• Personal tailoring (by defining your refined handling functions)• Readability (much of the Maple functionality is visible at the userlevel)Maple allows the kernel to remain small by unloading non-essential functionsto the library.A.2 Internal Representations of Data TypesThe parser and some internal functions are responsible for building all thedata structures used internally by Maple. All the internal data structureshave the same general format:Header Data 1 . . . Data nThe header field, stored in one or more machine words, encodes thelength of the structure and its type. Additional bits are used to recordsimplification status, garbage collection information, persistent store status,and various information about specific data structures (for example,whether or not a for loop contains a break or next).The length is encoded in 26 bits on 32-bit architectures, resulting ina maximum single object size of 67, 108, 863 words (268, 435, 452 bytes,or 256 megabytes). On 64-bit architectures, the length is stored in 32bits, for a maximum object size of 4, 294, 967, 295 words (34, 359, 738, 360bytes, or 32 gigabytes).Every structure is created with its own length, and that length doesnot change during the existence of the structure. Furthermore, the contentsof most data structures are never changed during execution, becauseit is unpredictable how many other data structures may be referring to

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

Saved successfully!

Ooh no, something went wrong!