[svn] r6188: nemerle/trunk: NEWS lib/hashtable.n ncc/typing/MacroRegistry.n

malekith svnadmin at nemerle.org
Tue Apr 11 14:04:22 CEST 2006


Log:
Change Hashtable.Item to throw exception for unknown keys.

Author: malekith
Date: Tue Apr 11 14:04:20 2006
New Revision: 6188

Modified:
   nemerle/trunk/NEWS
   nemerle/trunk/lib/hashtable.n
   nemerle/trunk/ncc/typing/MacroRegistry.n

Modified: nemerle/trunk/NEWS
==============================================================================
--- nemerle/trunk/NEWS	(original)
+++ nemerle/trunk/NEWS	Tue Apr 11 14:04:20 2006
@@ -1,3 +1,9 @@
+0.9.3, Apr 2006
+
+  Backward incompatible library changes:
+    * The NC.Hashtable indexer was changed to follow SCG.Dictionary behavior
+      of throwing exception when the key is not found.
+
 0.9.2, Jan 21 2006
   This version brings a bunch of new features and of course several bugfixes.
   We now require mono 1.1.11+ or MS.NET 2.0.

Modified: nemerle/trunk/lib/hashtable.n
==============================================================================
--- nemerle/trunk/lib/hashtable.n	(original)
+++ nemerle/trunk/lib/hashtable.n	Tue Apr 11 14:04:20 2006
@@ -178,25 +178,6 @@
       ht
     }
 
-    /**
-     * Unsafe access to the underlying hashtable
-     */
-    public new Item [key : 'a] : 'b
-    {
-      get
-      {
-        if (ContainsKey (key))
-          base [key]
-        else
-          Nemerle.Extensions.DefaultValue ('b)
-      }
-
-      set
-      {
-        base [key] = value
-      }
-    }
-
     public new Remove (key : 'a) : void
     {
       _ = base.Remove (key)

Modified: nemerle/trunk/ncc/typing/MacroRegistry.n
==============================================================================
--- nemerle/trunk/ncc/typing/MacroRegistry.n	(original)
+++ nemerle/trunk/ncc/typing/MacroRegistry.n	Tue Apr 11 14:04:20 2006
@@ -50,10 +50,7 @@
 
     internal GetSyntaxExtensions (name_space : NamespaceTree.Node) : list [SyntaxDefinition]
     {
-      match (extensions [name_space]) {
-        | null => []
-        | definition => definition
-      }
+      extensions.Get (name_space).WithDefault ([])
     }
 
     public AddOperatorDefinition (info : OperatorDefinition) : void



More information about the svn mailing list