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 » Developing U++ » U++ Developers corner » Some questions about witz
Re: Some questions about witz [message #37323 is a reply to message #37319] Sat, 22 September 2012 09:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
dolik.rce wrote on Fri, 21 September 2012 17:34

Is this solution correct?



Not really. See IsValueArray/IsValueMap, they are the same because ValueArray is compatible with ValueMap (they are convertible).

But hopefully it is now fixed this way (please check):

Value Compiler::ExeBracket::Eval(ExeContext& x) const
{
	Value m = value->Eval(x);
	Value q = index->Eval(x);
	if(IsNumber(q) && m.Is<ValueArray>()) {
		ValueArray va = m;
		int i = q;
		if(i >= 0 && i < va.GetCount())
			return va[i];
	}
	if(IsValueMap(m)) {
		ValueMap map = m;
		return map[q];
	}
	return Value();	
}


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skylark modules?
Next Topic: U++ GUI over existing code
Goto Forum:
  


Current Time: Mon Jun 09 03:34:48 CEST 2025

Total time taken to generate the page: 0.04845 seconds