From 552913ca2a0fa7603d774a8fc5d1d313719f1703 Mon Sep 17 00:00:00 2001 From: Will Coleda Date: Mon, 30 Nov 2009 12:26:48 -0500 Subject: [PATCH] add basic args check to [string] --- src/PmTcl/commands/string.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PmTcl/commands/string.pm b/src/PmTcl/commands/string.pm index 90e7e58..b5c498f 100644 --- a/src/PmTcl/commands/string.pm +++ b/src/PmTcl/commands/string.pm @@ -1,4 +1,9 @@ -our sub string($cmd, *@args) { +our sub string(*@args) { + if +@args <1 { + error('wrong # args: should be "string subcommand ?argument ...?"'); + } + my $cmd := @args.shift(); + if $cmd eq 'toupper' { return pir::upcase(@args[0]); } elsif $cmd eq 'compare' { @@ -12,6 +17,8 @@ our sub string($cmd, *@args) { } else { return 1; } + } else { + return 'XXX'; } }