lua-users home
lua-l archive

Re: Ideas about colon operator syntax (and a patch in the work)

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


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.

AltStyle によって変換されたページ (->オリジナル) /