Martin Guy |
One of our users thought they might be able to say:
> local columns = { c1, c2, c3, c4, c5, c6, c7, c8 } > pio.pin.setlow( columns ) and I had to tell them to use > local columns = { c1, c2, c3, c4, c5, c6, c7, c8 } > pio.pin.sethigh(unpack(columns)) I've tried coding this change, and it added another 100 bytes of object code. Fortunately, eLua's pio code is structured is such that it only has to be done in one place and automatically applies to all the pio.pin.set* functions. Is this worth applying to make their Lua coding simpler, or should they just use unpack() to keep our code simpler? M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Hi,
On Mon, Oct 10, 2011 at 5:01 PM, Martin Guy <[hidden email]> wrote:
One of our users thought they might be able to say: I'd leave it as it is now. It forces people to learn a bit more Lua and I think this is generally a good thing :) Best, Bogdan _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Martin Guy |
On 10 October 2011 16:05, Bogdan Marinescu <[hidden email]> wrote:
> I'd leave it as it is now. It forces people to learn a bit more Lua and I > think this is generally a good thing :) Ok. And you know how I feel about keeping the code size small... M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
I've added a Recipes page where we can put examples like this in the
future. There are plenty of other things that could be added there, and I'll try to remember to put them in when I run across them: http://wiki.eluaproject.net/Recipes On Mon, Oct 10, 2011 at 9:09 AM, Martin Guy <[hidden email]> wrote: > On 10 October 2011 16:05, Bogdan Marinescu <[hidden email]> wrote: >> I'd leave it as it is now. It forces people to learn a bit more Lua and I >> think this is generally a good thing :) > > Ok. And you know how I feel about keeping the code size small... > > M > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
sweetlilmre |
Could I suggest that the code change for the 'auto-unpack' be kept somewhere as a reference as well? I would certainly be interested in looking at it and it might be useful in future. On Oct 10, 2011 5:56 PM, "James Snyder" <[hidden email]> wrote:
I've added a Recipes page where we can put examples like this in the _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
On Mon, Oct 10, 2011 at 3:29 PM, Peter Edwards <[hidden email]> wrote:
> Could I suggest that the code change for the 'auto-unpack' be kept somewhere > as a reference as well? If you want, you could take a look at the ADC code (src/modules/adc.c) and look at the adc_sample function, you'll find an example of how to unpack a table. -jsnyder > > I would certainly be interested in looking at it and it might be useful in > future. > > On Oct 10, 2011 5:56 PM, "James Snyder" <[hidden email]> wrote: >> >> I've added a Recipes page where we can put examples like this in the >> future. There are plenty of other things that could be added there, >> and I'll try to remember to put them in when I run across them: >> http://wiki.eluaproject.net/Recipes >> >> On Mon, Oct 10, 2011 at 9:09 AM, Martin Guy <[hidden email]> wrote: >> > On 10 October 2011 16:05, Bogdan Marinescu <[hidden email]> >> > wrote: >> >> I'd leave it as it is now. It forces people to learn a bit more Lua and >> >> I >> >> think this is generally a good thing :) >> > >> > Ok. And you know how I feel about keeping the code size small... >> > >> > M >> > _______________________________________________ >> > eLua-dev mailing list >> > [hidden email] >> > https://lists.berlios.de/mailman/listinfo/elua-dev >> > >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev > > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > > eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Martin Guy |
In reply to this post by sweetlilmre
On 10 October 2011 22:29, Peter Edwards <[hidden email]> wrote:
> Could I suggest that the code change for the 'auto-unpack' be kept somewhere > as a reference as well? Erm, I deleted it when I saw that it was unneeded complexity as far as eLua's objectives are concerned. I can probably redo it without much trouble and post it as a patch M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Martin Guy |
In reply to this post by jbsnyder
> If you want, you could take a look at the ADC code (src/modules/adc.c)
> and look at the adc_sample function, you'll find an example of how to > unpack a table. That's the example I copied it from :) tho' functionally I think it's better with a switch statement on the object type - that way on bad values it reports "expected number, table or string" instead of "expected string". But 20 extra bytes are 20 extra bytes... :) M _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Free forum by Nabble | Edit this page |