Hi,
I've derived from CustomSymbolDictionary to add specific variables to a
scope (see seshadripv's blog). What I would expect from a method called
TryGetExtraValue is that only if the scope (where the
IAttributesCollection was added in the constructor) cannot find the
SymbolId, the ExtraValue-method is called. But it seems that this method
is called on each request.
Therefore one needs to have a base scope, which is given to the
SymbolDictionary and evaluations take place in an additional scope
created with the IAttributesCollection in the constructor.
protected override bool TryGetExtraValue(SymbolId key, out object value)
{
if (baseScope.TryGetVariable(SymbolTable.IdToString(key), out value))
return true;
// ...
}
As the baseScope only has TryGetVariable(string), I need to convert the
SymbolId to a string and baseScope probably converts the string back
again to SymbolId.
Is there a way to work more directly with the IAttributesCollection?
Thanks,
Christian
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com