summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-08-15 16:12:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-08-15 16:12:26 (GMT)
commit34d0a97402b92ffaea87cbe40088ac100e9c6361 (patch)
tree0bd96b89a971cb665cd28766ae7ad0adbd133f6e /generic/tclProc.c
parent57d60cf82bf56303dec39e6c75de99fa56e770f7 (diff)
downloadtcl-34d0a97402b92ffaea87cbe40088ac100e9c6361.zip
tcl-34d0a97402b92ffaea87cbe40088ac100e9c6361.tar.gz
tcl-34d0a97402b92ffaea87cbe40088ac100e9c6361.tar.bz2
* generic/tclProc.c (ProcWrongNumArgs): [Bug 3045010]: Make the
handling of passing the wrong number of arguments to [apply] somewhat less verbose when a lambda term is present.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index e4ca35b..64d3f13 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclProc.c,v 1.179 2010/03/05 14:34:04 dkf Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.180 2010/08/15 16:12:27 dkf Exp $
*/
#include "tclInt.h"
@@ -1106,13 +1106,15 @@ ProcWrongNumArgs(
desiredObjs = TclStackAlloc(interp,
(int) sizeof(Tcl_Obj *) * (numArgs+1));
+ if (framePtr->isProcCallFrame & FRAME_IS_LAMBDA) {
+ desiredObjs[0] = Tcl_NewStringObj("lambdaExpr", -1);
+ } else {
#ifdef AVOID_HACKS_FOR_ITCL
- desiredObjs[0] = framePtr->objv[skip-1];
+ desiredObjs[0] = framePtr->objv[skip-1];
#else
- desiredObjs[0] = ((framePtr->isProcCallFrame & FRAME_IS_LAMBDA)
- ? framePtr->objv[skip-1]
- : Tcl_NewListObj(skip, framePtr->objv));
+ desiredObjs[0] = Tcl_NewListObj(skip, framePtr->objv);
#endif /* AVOID_HACKS_FOR_ITCL */
+ }
Tcl_IncrRefCount(desiredObjs[0]);
defPtr = (Var *) (&framePtr->localCachePtr->varName0 + localCt);
@@ -1286,7 +1288,7 @@ InitResolvedLocals(
codePtr->flags &= ~TCL_BYTECODE_RESOLVE_VARS;
/*
- * Initialize the array of local variables stored in the call frame. Some
+ * Initialize the array of local variables stored in the call frame. Some
* variables may have special resolution rules. In that case, we call
* their "resolver" procs to get our hands on the variable, and we make
* the compiled local a link to the real variable.