[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal for a standard way of defining custom operators in Lua
- From: TNHarris <telliamed@...>
- Date: Wed, 24 Jul 2013 15:24:25 -0400
On Wednesday, July 24, 2013 09:13:05 AM Duncan Cross wrote:
> I have the opposite view: using a third-party macro system is not the
> "overkill" solution, introducing a feature in the language is. I just
> don't see custom operators as such a massively useful thing across
> many real usage domains to justify the added core complexity.
Makes me think of the Einstein mis-quote, "everything should be as simple as
possible, but no simpler". You want user-defined operators, which means
dynamically changing the behavior of the interpreter. Isn't that just what
Metalua does? So how much of Metalua are you going to reimplement in order to
achieve this goal? If you think Metalua is too complicated, perhaps you should
be exploring the route of making a simpler Metalua, rather than a more
complicated Lua.
My immediate reaction to new operators is: what's wrong with functions? An
expression "A @ B" can be written just as easily as "at(A,B)". The former is
only preferrable if you have an aesthetic attachment to infix notation.
Otherwise, they're identical and a function call has the added benefit of
being a complete statement.
--
tom <telliamed@whoopdedo.org>