lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Sep 17, 2014 at 9:50 PM, Geoff Leyland
<geoff_leyland@fastmail.fm> wrote:
> 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

Generalize the shared code into a standalone module which those modules use?

-- 
Sent from my Game Boy.