'Add a constant to the environment, return its index.'

def add_const(self, const):

    if isinstance(const, str):
        const = utils.intern(const)
    for (index, val) in enumerate(self.env.consts):
        if (val is const):
            break
    else:
        index = len(self.env.consts)
        self.env.consts.append(const)
    return index
