Skip to content

Commit

Permalink
Adding some information and links for is repr values
Browse files Browse the repository at this point in the history
Just an enumeration and links to the NativeCall where they are
explained more extensively. Refs #1863 and #1957
  • Loading branch information
JJ committed Jun 8, 2018
1 parent daadb38 commit e10e3e7
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/Language/traits.pod6
Expand Up @@ -10,6 +10,30 @@ or changing the implementation. That kind of concept is implemented in Perl 6
via L<roles|/language/glossary#Roles>; in this context, Perl 6 calls I<traits>
specifically those that change the internal representation of the class or type.
Traits are used extensively in L<native calls|/language/nativecall> to
L<specify the
representation|/language/nativecall#Specifying_the_native_representation> of the
data structures that are going to be handled by the native functions via the
C<is repr> suffix; at the same time, C<is native> is used for the routines that
are actually implemented via native functions. These are the representations
that can be used:
=item X<CStruct> corresponds to a C<struct> in the C language. It is a composite
data structure which includes different and heterogeneous lower-level data
structures; see L<this|/language/nativecall#Structs> for examples and further
explanations.
=item X<CPPStruct>, similarly, correspond to a C<struct> in C++. However, this
is Rakudo specific for the time being.
=item X<CPointer> is a pointer in any of these languages. It is a dynamic data
structure that must be instantiated before being used, can be
L<used|/language/nativecall#Basic_use_of_Pointers> for classes whose methods are
also native.
=item X<CUnion> is going to use the same representation as an C<union> in C; see
L<this|/language/nativecall#CUnions> for an example.
=end pod
Expand Down

0 comments on commit e10e3e7

Please sign in to comment.