lua-users home
lua-l archive

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

 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).