[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Colon notation in object-oriented programming
- From: Peter Aronoff <telemachus@...>
- Date: Sun, 5 Mar 2017 09:42:36 -0500
Petri Häkkinen <email@example.com> wrote:
> On Mar 5, 2017, at 1:32 PM, Dirk Laurie <firstname.lastname@example.org> wrote:
> > io.open("results.txt","w"):write(table.concat(results,"\n")):close()
> > Without colon notation, how far can we get?
> If there we no implicit self and no ':' sugar this would be written
> something like this:
> local file = io.open("results.txt", "w")
> io.write(file, table.concat(results, "\n"))
For what it’s worth, as someone who came to Lua without much OO experience,
I do exactly this now. I find procedural (or imperative) style far clearer.
We have not been faced with the need to satisfy someone else's
requirements, and for this freedom we are grateful.
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System