public static InvokeConstructor ( |
||
t | ||
args | object | |
return | object |
protected override object Read(PushbackTextReader r, char eq) { if (!RT.booleanCast(RT.READEVAL.deref())) { throw new Exception("EvalReader not allowed when *read-eval* is false."); } Object o = read(r, true, null, true); if (o is Symbol) { return(RT.classForName(o.ToString())); } else if (o is IPersistentList) { Symbol fs = (Symbol)RT.first(o); if (fs.Equals(THE_VAR)) { Symbol vs = (Symbol)RT.second(o); return(RT.var(vs.Namespace, vs.Name)); //Compiler.resolve((Symbol) RT.second(o),true); } if (fs.Name.EndsWith(".")) { Object[] args = RT.toArray(RT.next(o)); return(Reflector.InvokeConstructor(RT.classForName(fs.Name.Substring(0, fs.Name.Length - 1)), args)); } if (Compiler.NamesStaticMember(fs)) { Object[] args = RT.toArray(RT.next(o)); return(Reflector.InvokeStaticMethod(fs.Namespace, fs.Name, args)); } Object v = Compiler.maybeResolveIn(Compiler.CurrentNamespace, fs); if (v is Var) { return(((IFn)v).applyTo(RT.next(o))); } throw new Exception("Can't resolve " + fs); } else { throw new ArgumentException("Unsupported #= form"); } }