Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > d92aa75c2d384ff9f513aed09a46f703 > files > 805

parrot-doc-3.1.0-2.mga1.i586.rpm

# Copyright (C) 2001-2008, Parrot Foundation.

=head1 NAME

examples/subs/multi_retvals.pir - Subroutine example

=head1 SYNOPSIS

    % ./parrot examples/subs/multi_retvals.pir

=head1 DESCRIPTION

Call a sub with multiple return values.

=head1 SEE ALSO

F<docs/imcc/syntax.pod>
F<docs/imcc/calling_conventions.pod>

=cut

.sub example :main
  ($I0, $I1, $I99) = foo(7, 8, "nine")
  print "return: "
  print $I0
  print " "
  print $I1
  print " "
  print $I99
  print "\n"
.end

.sub foo
  .return( 10, 11, 12 )
.end

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: