lua-users home
lua-l archive

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


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

I'd like to bring this up again, this time with a more concrete example.

I've been playing with SVG, and here's an example of how this syntax could be used:

circle(5, 5, 2):fill(rgb(192, 128, 16)):stroke(rgb(0, 0, 0)):stroke.width(px(1))

Currently, this has to be written as:

circle(5, 5, 2):fill(rgb(192, 128, 16)):stroke(rgb(0, 0, 0)):stroke_width(px(1))

Which IMO just isn't quite as nice.

I'd still like to insist on `a:[b].c()` because of those of us who use types. With `a:[b].c()`, one could implement a fully functional trait system.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.