Queue/Definition: Difference between revisions
Content added Content deleted
m (Order of sections.) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: future-proof for 5.36, explicit :prototype) |
||
Line 4,783: | Line 4,783: | ||
<syntaxhighlight lang="perl">use Carp; |
<syntaxhighlight lang="perl">use Carp; |
||
sub |
sub my push :prototype(\@@) {my($list,@things)=@_; push @$list, @things} |
||
sub |
sub maypop :prototype(\@) {my($list)=@_; @$list or croak "Empty"; shift @$list } |
||
sub empty (@) {not @_}</syntaxhighlight> |
sub empty :prototype(@) {not @_}</syntaxhighlight> |
||
Example: |
Example: |