lua-users home
lua-l archive

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


> On 17 Sep 2018, at 23.57, Sean Conner <sean@conman.org> wrote:
>  While I agree with that (yes, I'm not a fan of OOP myself) I do find the
> ':' notation worthwile as a form of scope for functions (mostly with
> userdata).  I find:
> 
>    config = tls.config()
>    config:protocols("all")
>    config:verify_client(true)
>    config:ca_file("trust_these")
>    config:cert_file("my_cert")
> 
>    server = tls.server()
>    server:configure(config)
> 
>    connection = server:accept_socket(s)
> 

I agree, ’:’ can be useful for data description.

 [ I forgot I use it in my custom shader DSL for describing struct fields:

struct ”vertex”
  : float3 ”position”
  : float4 ”color”

]

So, I take back that ’:’ should be removed. But my (strong) opinion on OOP still stands :)

Petri