In my tests with Lua Lanes, multithreaded programming using multiple
Lua states, I've come to the wish to embed separate chunks of Lua
code, within surrounding chunks. This can currently be done by using
strings, but has a few limitations to it:
thread [[
local a,b,c= ...
-- ...
return xx
]]
- Chunks embedded as strings are compiled (syntax checked) at runtime
(the 'thread' call), not at compile time
- Chunks embedded will have their own line numbering, not that of the
actual (surrounding) source file
- Chunk source takes up space (as a string) when it could actually be
stored as a byte-compiled 'chunk'
One could have a special syntactic format of declaring 'sub-chunks',
solving all the above issues at once. Maybe this could even be done as
a tkn fltr ;) --not saying the word, i bet there's already people
fltering out such posts!--