Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Mathematica 9, I used to be able to do

rules = Dispatch[{'a' -> 1, 'b' -> 2}]

to extract the rules from Dispatchwrapped list of rules. In Mathematica 10 the following error is raised:

Part::partd: Part specification Dispatch[...][[1]] is longer than depth of object. >>

Is this a bug? I am using only the trial version currently. I got aware of it because it breaks the AutomaticUnits package.

share|improve this question
up vote 11 down vote accepted

No, this is not a bug. Dispatch tables are now atomic:

Dispatch[{"a" -> 1, "b" -> 2, "c" -> 3}] // AtomQ

As noted by user 18w here we can use Normal to recover the rules.

Dispatch[{"a" -> 1, "b" -> 2, "c" -> 3}] // Normal
{"a" -> 1, "b" -> 2, "c" -> 3}
share|improve this answer
And (they became atoms) for good reason, Dispatch tables with symbols in them were hard to use properly. See Performance of Dispatch and lists of Rules. Maybe I should see if I can simplify my answer to your "Why is there no PositionFunction in Mathematica?" Q&A. There was another issue with performance I think. – Jacob Akkerboom Jul 14 '14 at 13:37
Sweet, Dispatch now works with Verbatim! The example in my answer (below "This may be because Dispatch just does not work well with Verbatim. Example:") now works! – Jacob Akkerboom Jul 14 '14 at 13:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.