[stringtemplate-interest] Using ST maps on C#

Natan Vivo nvivo.misc at gmail.com
Fri Nov 9 15:39:10 PST 2007


Hi!

I'm developing an application with StringTemplate using the C# version.

I was loading a map from a group file and I saw that the map doesn't handle
the "default" value the same way as in the template. When I get a map using
GetMap(name), it seems to return a simple hashtable, and if I set the
default value in the map, it adds a "_default_" key with the value. If the
value is "key", the value is an empty string.

So, my question is: is the official way of detecting if the value is the key
to check if _default_ == String.Empty?


Now, if I can suggest something, it would be nice if GetMap returned a
custom implementation of Hashtable that mimics the behavior of the map on
ST. We can extend the hashtable and override the current indexer, so that if
the value is not found, it returns the default value, and if that is the
key, it returns it exactly like the map.

Thanks for this great library!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20071109/176d0083/attachment.html 


More information about the stringtemplate-interest mailing list