aboutsummaryrefslogtreecommitdiff
path: root/Tools/MathematicaMisc/MapLookup.m
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/MathematicaMisc/MapLookup.m')
-rw-r--r--Tools/MathematicaMisc/MapLookup.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/MathematicaMisc/MapLookup.m b/Tools/MathematicaMisc/MapLookup.m
index faa553c..7c3153a 100644
--- a/Tools/MathematicaMisc/MapLookup.m
+++ b/Tools/MathematicaMisc/MapLookup.m
@@ -27,6 +27,9 @@ VerifyMap[m_] :=
ThrowError["Expecting a map (list of rules) but found", m]];
Map[VerifyRule, m]];
+lookup[map_, key_, default_] :=
+ lookupDefault[map, key, default];
+
lookup[map_, key_] :=
Module[{values},
VerifyMap[map];