|
Hi, On 14 Jun 2019, at 13:27, Paul Ducklin <pducklin@outlook.com> wrote: Here’s something I don’t understand. Yeah, well, I also wanted to nearly ask myself as well, but then did not want to start a flamewar. From my point of view I would prefer “local” without the controversial <> notation as well: local const foo = 123 I understand that change would render existing code incompatible which already used “const” for their own variables (well, seriously?, … their bad ;-) I also understand the controversial and wired-looking <> notation is more flexible for the future. But do we really need that (keeping Lua small and such)? Well, one could probably roll their own syntactic sugar to translate “ const “ to “ <const> “ though. Btw. I have not looked at the implementation details, but it would be cool if a global: local const debug = false could be used by the compiler to optimize all the debug conditionals away in the bytecode, … at least that would be one useful use case for myself. Thanks, René We don’t annotate variable declarations with <tofinalize> when they have a finalizer - we just set a __gc metamethod and that tells Lua it’s a <tofinalize> variable automatically. -- ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin, https://exactcode.com |