[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: table.unpack question.
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 26 May 2013 15:09:20 +0200
2013/5/25 Pierre-Yves Gérardy <firstname.lastname@example.org>:
> So you can't determine it from the Lua side.
I can't agree that "pure Lua" or "the Lua side" means only whatever you
can pass to the Lua executable.
Two quotes from the very start of the Reference Manual.
> Lua is implemented as a library, written in clean C, the common subset
> of Standard C and C++.
Coupled with the prominence of the Lua API in the Manual (treated before
the standard libraries and the executable, this IMHO adds up to:
Writing a C program that interacts with Lua solely via the official
C API is no less "pure Lua" than writing it in the scripting language.
> The Lua distribution includes a sample host program called `lua`, which
> uses the Lua library to offer a complete, standalone Lua interpreter,
> for interactive or batch use.
And this says:
If you want to write your own read-evaluate-print loop, do so; the
one in the distribution is only a sample.
So: if there is an elegant solution possible by exploiting something in the
official API, I say go for it.