Home » Extra libraries, Code snippets, applications etc. » U++ Esc Interpreter, Esc Macros and templates » missing lambda
missing lambda [message #18823] |
Fri, 24 October 2008 21:13 |
jale
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
Hi,
When we call Esc::Execute(...
could not be interesting to throw an exception if the function name doesn't exist
That's the original code...
EscValue Execute(ArrayMap<String, EscValue>& global, const char *name, int op_limit)
{
int ii = global.Find(String(name));
Vector<EscValue> arg;
if(ii >= 0 && global[ii].IsLambda())
return Execute(global, NULL, global[ii], arg, op_limit);
return EscValue();
}
It could be something like...
EscValue Execute(ArrayMap<String, EscValue>& global, const char *name, int op_limit)
{
int ii = global.Find(String(name));
Vector<EscValue> arg;
if(ii >= 0 && global[ii].IsLambda())
return Execute(global, NULL, global[ii], arg, op_limit);
else
throw CParser::Error("Lambda doesn't exist " + String(name));
}
|
|
|
Goto Forum:
Current Time: Thu Mar 28 14:38:56 CET 2024
Total time taken to generate the page: 0.00764 seconds
|