πŸ“˜ Built-in types in Perl 6

Perl 6 allows using typed variables. To tell the compiler that the variable is typed, you simply need to name the type while declaring the variable.

Some of the types available in Perl 6 are obvious and do not need comments:

Bool, Int, Str
Array, Hash, Complex

Some might require a small comment:

Num, Pair, Rat

The Num type is used to handle floating-point variables, and a Pair is a β€œkey; value” pair. The Rat type introduces rational numbers with numerators and denominators.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s