lua-users home
lua-l archive

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


It was thus said that the Great Thiago L. once stated:
> 
> On 20/05/2014 18:24, Coroutines wrote:
> >On Tue, May 20, 2014 at 2:22 PM, Thiago L. <fakedme@gmail.com> wrote:
> >>So I wanna do a t:[var]() operator (which's pretty much t:name() but it
> >>takes a var instead of a name) and I have no idea of how to do it...
> >a[var](a)
> >
> >     -- that guy  :p
> >
> I want bytecode...

  He has a point.

	local a = x:a()

        9       [7]     GETGLOBAL       0 -1    ; x
        10      [7]     SELF            0 0 -4  ; "a"
        11      [7]     CALL            0 3 2

	local b = x.a(x)

        12      [8]     GETGLOBAL       1 -1    ; x
        13      [8]     GETTABLE        1 1 -4  ; "a"
        14      [8]     GETGLOBAL       2 -1    ; x
        15      [8]     CALL            1 3 2

  -spc