public static Atom newAtom(Object value) {
        if (value instanceof Boolean) {
            return AtomBoolean.createAtomBoolean(((Boolean) value).booleanValue());
        } else if (value.toString().equals(AtomBoolean.T) || value.toString().equals(AtomBoolean.F)) {
            return AtomBoolean.createAtomBoolean(value.toString().equals(AtomBoolean.T));
        } else if (value instanceof Number) {
            return new AtomNumber((Number) value);
        } else if (value instanceof InputStream) {
            return new AtomPort((InputStream) value);
        } else if (value instanceof OutputStream) {
            return new AtomPort((OutputStream) value);
        } else {
            Number num = getNumber(value.toString());
            if (num != null) {
                return new AtomNumber(num);
            }

            String str = getString(value.toString());
            if (str != null) {
                return new AtomString(str);
            }

            String cstr = getChar(value.toString());
            if (cstr != null) {
                return new AtomChar(cstr);
            }

            return new AtomSymbol(value.toString());
        }
    }