-- | get the value of an attribute from the given attribute table
--
getAttr                      :: Attr a => AttrTable a -> NodeInfo -> a
getAttr at node =
    case nameOfNode node of
        Nothing  -> onlyPosErr "getAttr" at (posOfNode node)
        Just aid ->
          case at of
            (SoftTable   fm  _) -> NameMap.findWithDefault undef (nameId aid) fm
            (FrozenTable arr _) -> let (lbd, ubd) = bounds arr
                                   in
                                   if (aid < lbd || aid > ubd) then undef else arr!aid

-- | set the value of an, up to now, undefined attribute from the given
-- attribute table
--
getAttr                      :: Attr a => AttrTable a -> NodeInfo -> a
getAttr at node =
    case nameOfNode node of
        Nothing  -> onlyPosErr "getAttr" at (posOfNode node)
        Just aid ->
          case at of
            (SoftTable   fm  _) -> NameMap.findWithDefault undef (nameId aid) fm
            (FrozenTable arr _) -> let (lbd, ubd) = bounds arr
                                   in
                                   if (aid < lbd || aid > ubd) then undef else arr!aid

-- | set the value of an, up to now, undefined attribute from the given
-- attribute table
--
getAttr at node =
    case nameOfNode node of
        Nothing  -> onlyPosErr "getAttr" at (posOfNode node)
        Just aid ->
          case at of
            (SoftTable   fm  _) -> NameMap.findWithDefault undef (nameId aid) fm
            (FrozenTable arr _) -> let (lbd, ubd) = bounds arr
                                   in
                                   if (aid < lbd || aid > ubd) then undef else arr!aid

-- | set the value of an, up to now, undefined attribute from the given
-- attribute table
--