lua-users home
lua-l archive

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




On Wed, Jul 4, 2018, 5:24 PM Sean Conner <sean@conman.org> wrote:
It was thus said that the Great Gregg Reynolds once stated:
> On Wed, Jul 4, 2018, 4:42 PM Sean Conner <sean@conman.org> wrote:
>
> > It was thus said that the Great Gregg Reynolds once stated:
> > > Ok, but what does that have to do with spelling?
> >
> >   I mispelled 'baz' as 'baa'
>
> Haha! But that screws up your example.

  Okay, fine:

        int foo()
        {
          int baz;
          // lots of code here
          return baa;
        }

and

        function foo()
          local baz
          -- lots of code here
          return baa
        end

Better?  C will compilain about 'baa' not being defined, while Lua will
silently treat 'baa' as a global value and return nil.

Yep. But it has nothing to do with "spelling". Compilers are stupid, and they certainly do not have spelling rules.

  -spc (I still get bit by this in Lua, but luacheck helps here)