[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A Question of Style
- From: James McKaskill <james@...>
- Date: Tue, 29 Nov 2011 08:49:17 -0500
At work, we have a logging application which uses lua to filter and
decode CAN messages. In that case we actually use both styles as
scripts are a mixture of very simple scripts that are only 10-20 lines
long (e.g. decode can frame with this ID pull out a particular byte
and graph it) or much longer with modules (e.g. simulate an entire
control loop).
#2 makes it very easy to write simple scripts for people unfamiliar
with lua (just define a "filter_can" function that takes these
arguments). #1 is very useful for modules (otherwise half your code is
just handing in messages from the main script), but is slightly more
complex on the C side since it has to maintain a list of callback
functions for each callback.
-- James