NAME ^

src/builtins/guts.pir - subs that are part of the internals, not for users

SUBS ^

!EXPORT(symbols, from :named('from') [, to :named('to')] )

Export symbols in namespace from to the namespace given by to. If to isn't given, then exports into the HLL global namespace. This function differs somewhat from Parrot's Exporter PMC in that it understands how to properly merge MultiSub PMCs.

!VAR

Helper function for implementing the VAR and .VAR macros.

!COPYPARAM

Copies a param for the is copy trait, taking account of any ObjectRef and dereferencing it so we really do copy the underlying value.

!DOTYPECHECK

Checks that the value and the assignee are type-compatible and does the assignment.

!TYPECHECKPARAM

Checks the type of a parameter.

!SAMETYPE_EXACT

Takes two types and returns true if they match exactly (not accounting for any subtyping relations, etc).

!CREATE_SUBSET_TYPE

Creates a subset type. Basically, we make an anonymous subclass of the original type, attach the refinement and override ACCEPTS. We also chase up to find a real, non-subtype and stash that away for fast access later.

!TOPERL6MULTISUB

At the moment, we don't have the abilility to have Parrot use our own MultiSub type, nor are we ready to (because built-ins need to get Perl 6 signatures first). So for now we just transform multis in user code like this.

!SETUP_ARGS

Sets up the @*ARGS global. We could possibly use the args pmc coming directly from Parrot, but currently Parrot provides it as a ResizableStringArray and we need Undefs for non-existent elements (RSA gives empty strings).

!keyword_class(name)

Internal helper method to create a class.

!keyword_role(name)

Internal helper method to create a role.

!keyword_grammar(name)

Internal helper method to create a grammar.

!keyword_enum(name)

Internal helper method to create an enum class.

!keyword_does(class, role)

Internal helper method to implement the functionality of the does keyword.

!keyword_has(class, attr_name, type)

Adds an attribute with the given name to the class or role.

!ADD_TO_WHENCE

Adds a key/value mapping to what will become the WHENCE on a proto-object (we don't have a proto-object to stick them on yet, so we put a property on the class temporarily, then attach it as the WHENCE clause later).

!PROTOINIT

Called after a new proto-object has been made for a new class or grammar. It finds any WHENCE data that we may need to add.

!anon_enum(value_list)

Constructs a Mapping, based upon the values list.


parrot