Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created June 7, 2016 01:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save gfldex/872d6bc23da3aa4b9dc75def8dce32d1 to your computer and use it in GitHub Desktop.
Types have three functions in Perl 6. They provide value checks at runtime and
if possible at compile time to allow meaningful error messages. If types are
supplied, the multi disparcher can choose the right candidate to call. And
lastly types make garentees reguarding the interface of a Perl 6 object or a
native object provided by the NCI.
There is a strong connection between the build in types and the type system
itself. Any container that is not declared with a type will be typed as Any.
Any in turn inherits methods from Mu. Together they provide the first round of
methods for basic type conversions to Bool, Str and List. Introspection is
also provided by Mu. As any container got a type the most basic functions like
stringification, boolification, definedness and serialisation are guaranteed
for any type defined by the setting and with the type declarators below.
Foreign objects that are imported via the NCI may not do so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment