Some bad cases for read_matrix (file contents on left, results on right):
4+5 => [[4,5]]
, => [false,false]
<zero-length file=""> => matrix() << correct
<file with="" one="" empty="" line=""> => matrix([false]) << should be matrix([])
-x => matrix([-x]) (== -1 * x) << should be error
-1*x => matrix([[-1,?*,x]]))
"a => matrix(["a "])</file></zero-length>
Results depend on the input file name (!!!):
In file t10.csv:
1,-x,"sdf" => [1, -x, "sdf"]
Identical contents, but named t10.com:
1,-x,"sdf" => matrix([ 1, ?, , -x , ?, , "sdf" ])
BTW if you want to test these, note that ? is Lisp's , and will actually have a value; you need to quote it.
The different behavior based on input file name is actually described in manual section 73.1.2:
"If the file name ends in something other than
.csv' and
separator_flag' is not specified, `space' is assumed."So the t10.com case should presumably be returning matrix(["1,-x,\"sdf\""]) (because there are no spaces) or giving an error (because that is not numerical).