public Expr Parse(ParserContext pcon, object form)
{
int argCount = RT.count(form) - 1;
if (argCount != 1)
{
IPersistentMap exData = new PersistentArrayMap(new Object[] { FormKey, form });
throw new ExceptionInfo("Wrong number of args (" +
argCount +
") passed to quote",
exData);
}
object v = RT.second(form);
if (v == null)
{
return(Compiler.NilExprInstance);
}
else if (v is Boolean)
{
if ((bool)v)
{
return(Compiler.TrueExprInstance);
}
else
{
return(Compiler.FalseExprInstance);
}
}
else if (Util.IsNumeric(v))
{
return(NumberExpr.Parse(v));
}
else if (v is string)
{
return(new StringExpr((String)v));
}
else if (v is IPersistentCollection && ((IPersistentCollection)v).count() == 0)
{
return(new EmptyExpr(v));
}
else
{
return(new ConstantExpr(v));
}
}