Skip to content

Commit

Permalink
Improve example and reorder some POD
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Dec 18, 2010
1 parent 7447b4e commit 8ff5b7c
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions docs/embed.pod
Expand Up @@ -16,6 +16,7 @@ embed.pod - Parrot embedding system

interp = Parrot_new(NULL);
if (!interp) {
fprintf(stderr, "Cannot create Parrot interpreter!\n");
return 1;
}

Expand Down Expand Up @@ -92,10 +93,18 @@ All function signatures follow the form of:

Foo->Bar

where C<Foo> and C<Bar> are a list of zero or more Parrot datatypes. The
datatypes on the left of the arrow are function arguments being passed in and
the datatypes on the right are the datatype being returned. No spaces are
allowed in a function signature.
where C<Foo> and C<Bar> are a list of zero or more Parrot datatypes. C<Foo>
and C<Bar> are individually called 'type signatures'. The datatypes on the
left of the arrow are function arguments being passed in and the datatypes on
the right are the datatype being returned. No spaces are allowed in a
function signature.

There are four datatypes that can be used in Parrot function signatures:

I <=> Parrot_Int
N <=> Parrot_Float (Numeric)
S <=> Parrot_String
P <=> Parrot_PMC

Here are some example function signatures and what they mean:

Expand All @@ -113,12 +122,6 @@ Here are some example function signatures and what they mean:

TODO: Multiple return values?

There are four datatypes that can be used in Parrot function signatures:

I <=> Parrot_Int
N <=> Parrot_Float (Numeric)
S <=> Parrot_String
P <=> Parrot_PMC

There is also the C<Pi> datatype, which may only appear at the beginning of a
function signature. It stands for "PMC invocant" and basically means SELF. C<Pi>
Expand Down

0 comments on commit 8ff5b7c

Please sign in to comment.