Check that dimension specification for a grid is a list of positive integers.
Lookup the symbol defined in the alist. If error is non-nil it should be a string describing the class of types, and this function will signal an error if the type wasn't found.