The latest commits show the syntax <toclose> being adopted instead of *toclose.
Aesthetically I find the new syntax to be nicer, but this still has
the problem that the previous syntax had; which is that the symbol '<'
has meaning in expressions therefore using this symbol (like the *
symbol) may restrict the ability to use extensions inside expressions.
Of course extensions will always be restricted to local declarations
in which case it doesn't matter.
Regards
Dibyendu
I have a new idea about the syntax of <toclose>, what about this?
local function get_content(filename)
local f: toclose = assert(io.open(filename, "rb"))
return f:read "*a"
end
just use :, it's just like the type annotation, and it opens a way to makes Lua support (optional) type declarations.
--
regards,
Xavier Wang.