Skip to content

Commit

Permalink
add args-handling to [llength]
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Nov 28, 2009
1 parent 3f3c9a4 commit 6ebafe5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/PmTcl/Commands.pm
Expand Up @@ -162,9 +162,12 @@ our sub lindex($list, $pos) {
return @list[$pos];
}

our sub llength($list) {
our sub llength(*@args) {
if +@args != 1 {
error('wrong # args: should be "llength list"')
}
my @list :=
PmTcl::Grammar.parse($list, :rule<list>, :actions(PmTcl::Actions) ).ast;
PmTcl::Grammar.parse(@args[0], :rule<list>, :actions(PmTcl::Actions) ).ast;

return +@list;
}
Expand Down

0 comments on commit 6ebafe5

Please sign in to comment.