English 中文(简体)
Parrot - Datatypes
  • 时间:2024-12-22

Parrot - Datatypes


Previous Page Next Page  

The Parrot CPU has four basic data types:

    IV

    An integer type; guaranteed to be wide enough to hold a pointer.

    NV

    An architecture-independent floating-point type.

    STRING

    An abstracted, encoding-independent string type.

    PMC

    A scalar.

The first three types are pretty much self-explanatory; the final type - Parrot Magic Cookies, are spghtly more difficult to understand.

What are PMCs?

PMC stands for Parrot Magic Cookie. PMCs represent any complex data structure or type, including aggregate data types (arrays, hash tables, etc.). A PMC can implement its own behavior for arithmetic, logical and string operations performed on it, allowing for language-specific behavior to be introduced. PMCs can be built in to the Parrot executable or dynamically loaded when they are needed.

Advertisements