[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ideas about colon operator syntax (and a patch in the work)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 29 Apr 2014 15:30:49 +0200
2014-04-29 14:49 GMT+02:00 Thomas Jericke <tjericke@indel.ch>:
> require "string"
> local text = "I can shout!"
> print(text:upper) --> I CAN SHOUT!
Another plausible semantics for the same notation would be
specialization of the first argument (forgot the correct technical
term) so that `f = text:upper` means the same as
f = function(...) return text:upper(...) end
This has probably been proposed and shot down on the list,
but I can't find it.
Now would I be willing to sacrifice the syntax space for that
eventuality in favour of typing two characters fewer in the case
of a member function called with no arguments? That is the
question.