[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Module modularity
- From: Geoff Leyland <geoff_leyland@...>
- Date: Thu, 18 Sep 2014 13:50:17 +1200
Hi,
I’m the author of lua-csv [1]. It’s a single Lua file and it parses CSV. No surprises there.
Embedded in lua-csv is a little column mapping tool that allows you to say “I’m looking for a column named ‘distance’ or ‘how far’ and in the table I get, I want it to be named ‘length’ and have the value in the column multiplied by 25.4 since I work in mm, not inches”. It’s just over 100 lines of code.
I also have some as-yet-unreleased code for reading some other formats - notably dbf and shapefiles, and these used to use the same bit of code, until I pushed lua-csv out and decided one file was better than two.
So, module writers, any opinions on the best way to package these?
- split lua-csv in two, with a column manager module that’s kind of useless on its own, but which lua-csv depends on, and then release lua-dbf and lua-shapfile also depending on the column manager?
- just push them out separately all containing an initially similar copy of the same 100 or so lines of column map code?
- some other bright idea?
Cheers,
Geoff
[1] https://github.com/geoffleyland/lua-csv