Also handle extra columns in CSV parsing.

This commit is contained in:
Dimitri Fontaine 2014-01-23 15:15:42 +01:00
parent 516ef08c37
commit 3f61c66a79
2 changed files with 4 additions and 3 deletions

View File

@ -263,8 +263,8 @@
,(field-name-as-symbol name))))))
`(lambda (row)
(declare (optimize speed) (type list row))
(destructuring-bind (&optional ,@args) row
(declare (ignorable ,@args))
(destructuring-bind (&optional ,@args &rest extra) row
(declare (ignorable ,@args) (ignore extra))
(vector ,@newrow))))))))
;; allow for some debugging
(if compile (compile nil projection) projection))))

View File

@ -45,5 +45,6 @@ LOAD CSV
5|another month 13, stress retry path|2006-13-10|
6|some null date to play with||
7|and a ragged line|
8|and another line|2014-01-22|
8|and a line with extra columns|2014-01-23|hello|there|
9|and another line|2014-01-22|