Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 is currently offline  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));
}
Previous Topic: ESC_STRING and other questions
Next Topic: ESC and Classes...
Goto Forum:
  


Current Time: Thu Mar 28 14:38:56 CET 2024

Total time taken to generate the page: 0.00764 seconds