1. allison
  2. pynie


pynie / src / builtins / lists.pir

=head1 NAME

src/builtins/lists.pir - List operations

=head1 Functions

=over 4


.namespace []

.sub 'listmaker'
    .param pmc args  :slurpy
    unless null args goto have_args
    args = new [ 'list' ]
    .return (args)

.sub 'tuplemaker'
    .param pmc args  :slurpy
    .local pmc ret
    ret = new 'FixedPMCArray'
    if null args goto no_args
    set ret, args
    .return (ret)

.sub 'dictmaker'
    .param pmc args  :slurpy
    .local pmc result
    .local pmc iterator
    .local pmc key, value

    result = new [ 'dict' ]

    if null args goto done
    iterator = iter args

    unless iterator goto done
    key = shift iterator
    value = shift iterator
    result[key] = value

    .return (result)


=head1 AUTHOR

Patrick Michaud <pmichaud@pobox.com> is the current author and
maintainer.  Patches and suggestions can be sent to
<parrot-dev@lists.parrot.org> or <perl-compiler@perl.org> .


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