Re: Ternary operator patch
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Ternary operator patch
- From: Andre Leiradella <andre@...>
- Date: 2010年9月12日 22:36:56 -0300
On 12/09/2010 21:58, joao lobato wrote:
But I sometimes daydream about making all of Lua's statements into
expressions, removing 'stat' altogether.
Honestly, I'd vote to keep the ternary operator out of the base
language (just like classes, exceptions, monads, continuations,
actors, macros, cons cells, arrays, fixed-point arithmetic, matrices).
If you like OOP, go for Java, C++, C# and the likes;
I've tried hard to find an object-oriented scripting language to no
avail, at least not one mature, well maintained, easily embedable,
small, fast (insert more reasons why you love Lua here) as Lua.
But I don't miss a ternary operator. The lack of a ternary operator
doesn't play a role in the grand scheme of things but I think the lack
of proper OOP does. For every third-party library I want to use that
implements some kind of OOP with metatables I have to know how that
particular implementation works. How do I instantiate objects? Can I
extend existing classes? How? How do I call inherited methods?
I end up wrapping the API of third-party libraries, object-oriented or
not, in my own classes with my own class system so I can have a
consistent way of doing things throughout my application.
Off-topic, I know. Sorry.
If you like FP, go for Haskell or Lisps;
If you want to do systems' programming in an interpreted language, go
for Python or Ruby.
Frankly, for me Lua is an imperative language with simple syntax augmented with:
- first class functions (and coroutines, lexical scoping, tail calls);
- the almighty table (data structure, namespace, metatable,
environment, switch statement, object, class, functor),
And It should be used either has an embedded language or for data description.
Frankly, my knee-jerk reaction to something like this is always: "This
guy is complaining that he can't use is hammer like a screwdriver",
but I'm the first to recognize that I've never used Lua for anything
other than having fun (nor have I contributed very positively to any
discussion in this list).
- References:
- Re: Ternary operator patch, Henk Boom
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Geoff Leyland
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Jonathan Castello
- Re: Ternary operator patch, Roberto Ierusalimschy
- Re: Ternary operator patch, Enrico Tassi
- Re: Ternary operator patch, Doug Rogers
- Re: Ternary operator patch, joao lobato