lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Am 10.05.2016 um 15:58 schrieb Viacheslav Usov:
On Tue, May 10, 2016 at 3:34 PM, steve donovan
<steve.j.donovan@gmail.com <mailto:steve.j.donovan@gmail.com>> wrote:

    On Tue, May 10, 2016 at 3:27 PM, Viacheslav Usov <via.usov@gmail.com
    <mailto:via.usov@gmail.com>> wrote:
    > Still: what speaks against implementing a new Lua compilation mode
    where
    > everything must be explicitly declared to be either local or
    global, and
    > anything not so declared would result in a compilation error?

    Ah, but if it isn't backward-compatible, there's the inevitable
    problem...



We will need some new syntax, invalid today, which will mean "past this
line, globals must be explicit". Because it is invalid today, it will
not break any existing code.

Cheers,
V.


Meanwhile i like the untyped parameters. If i want variable parameters, I throw the values in a table with named fields and hand over the table to the subroutine. If i need to check the custom type of a value i use oop/classes and check the class type. - works great and is much more flexible than strict typing.

If i would need strict typing, i would use a different language.
It took some time to get familiar with the lua philosophy, but meanwhile i like it. And i like the very conservative way, Roberto implement new features - even he throw away my wishes. ;P

Ulrich.