lua-users home
lua-l archive

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


On Mon, Aug 28, 2017 at 9:27 PM, Soni L. wrote:

On 2017-08-28 03:19 PM, Egor Skriptunoff wrote:
On Mon, Aug 28, 2017 at 7:29 PM, Soni L. wrote:

    A while back I talked about component syntax, which I described as
    `a:b.c()` and `a:[b].c()`.


And what does this syntax mean?


a:b.c() -> a.b.c(a)

a:[b].c() -> a[b].c(a)


I did not understand your example with "circle(5,5,2)", but I think this syntax could be useful with "with" operator:

with a do
  .f();  -- a.f()
  :f();  -- a:f()
end
with a:b do
  .c();     -- a.b.c(a)
  .d.e();   -- a.b.d.e(a)
  .d:e();   -- a.b.d.e(a.b.d)
end