This project is read-only.

Parse doesn't throw some errors

Jul 15, 2011 at 9:52 AM

First, hello and thank you VERY much for your great job. 

My problem: I've tried to make a stupid r-console application, and I'm not happy with the way the function REngine.Parse work, because it prevents errors to be thrown. For example, if you evaluate the command "_p<-3", the result of parse is null, and I think it should be an error.

My solution: for my simple purpose, I've removed the vector legth check in Parse on this way (bold removed):


	private SymbolicExpression Parse(string statement, StringBuilder incompleteStatement)
			IntPtr s = Proxy.Rf_mkString(incompleteStatement.ToString());

			using (new ProtectedPointer(this, s))
				ParseStatus status;
				ExpressionVector vector = new ExpressionVector(this, Proxy.R_ParseVector(s, -1, out status, NilValue.DangerousGetHandle()));
				if (vector.Length == 0)
					return null;

				switch (status)

My configuration: Source 391c1b0c5b9a 

My question: I'm not sure about the side effects, and about the sense of this check, and would be happy to learn about it.