Like all true hybrids, Shamans are remarkably versatile. They can heal, they can melee, they can nuke. And like all true hybrids, they can only do one of these things, and then only if they properly gear and spec for it. While it is possible and worthwhile to really push the borders of the inherent multi-tasking of the class, most folks pick a role and stick with it, either because (as is my case) they don't have the gear to do anything more than their generally designated role or because they don't really want to. My resto shaman cannot DPS. Not even because of spec, but because he simply has not the gear for a DPS role and as a result there's no point in him attempting it. If I had good enough enhancement gear, I would probably try and DPS a lot more, but with the limitations of what he's carrying around in his bags it's simply not possible.
Your spec is like an aptitude: it defines what your character will have the most options in. As a resto shaman, I have plenty of added punch to my healing, talents like Healing Way, Improved Chain Heal, Earth Shield and Nature's Blessing. But I'm lacking the offensive punch of the talents from Elemental for my spells, which means even if I had the gear, my shocks and lightning bolts are not going to match up to a shaman who has spent the points. I won't have Lightning Overload or Elemental Precision. And if I try and mix it up in melee, I lack the ability to Dual Wield, the enhanced weapon buffs of Elemental Weapons or the bite of Weapon Mastery. I still have the basics that Elemental and Enhancement shamans use in combat, of course, and they still have the basics of shaman healing, but there is always a noticeable drop in performance when doing something outside of your spec.
Of course, some of you are probably saying "tell us something we don't know" while still others are ready to point out that even if an enhancement shaman can't heal as well as a resto shaman, he can still heal. And that's actually a good point. An enhancement shaman or an elemental shaman can, in fact, still heal. This leads to an often overlooked aspect of the class - basically, you bring a shaman along on a run because a shaman, in addition to whatever DPS or healing he or she can provide in a main role, can also provide what I like to call 'panic button' capacity.