lua-users home
lua-l archive

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


Seeing that integers were added, it's not too far fetched to see arrays as well.
But, it should be implemented nicely. Using '@' (at) where ... works fine, and has worked fine, seems like a major distraction for me. 

Simplification is a bad thing. You might as well say we should use + to concatenate strings now, too. That's simpler, right?

No. What we need is concisification™ (Yes, made up word. But you get the point). Using `..` for concatenation makes some amount of sense:  "some..thing" . Using `...` for varargs makes sense, to the same degree: "they did this, that, and then ..."

At "..." being problematic: It's not.

If we want ... as a list/array:
function foo(a, b, ...) local args = [...] end -- or what have you

- Advert

On Fri, Jan 19, 2018 at 3:36 PM, Elias Hogstvedt <eliashogstvedt@gmail.com> wrote:
I honestly don't understand this response but I'll try.

I'm not familiar with Perl 6, does it use @ as var arg? We can use another symbol if the symbol is important, it was just the best I think of. Using "..." seems problematic if you want it to be treated as an object (...:unpack() looks strange)

A language doesn't have to take the world by storm. What I mainly like about Lua is its simple syntax, simple library and yet powerful _expression_. I've grown to love this principle about the language and I'm proposing an idea on how to take it even further in that direction. Some people prefer more syntax to write less code (see moonscript) but I assume people who like us like more of the opposite.

The core idea here is really to make the language have less cognitive load, less rules and easier to learn and understand. C++ on the other hand does not to have this goal so we don't expect people to know everything about C++ at their fingertips.




On Fri, Jan 19, 2018 at 4:02 PM, KHMan <keinhong@gmail.com> wrote:
On 1/19/2018 10:45 PM, Elias Hogstvedt wrote:
Can you elaborate regardless? It introduces 1 more type, removes the vararg type and some functions that deals with var args. The end result are less lua functions and fewer exceptions to remember.

Who uses @ as vararg? Who uses ... as vararg?

Why hasn't Perl 6 taken the world by storm?

How many coders have all of C++ at the tip of their fingers?

Cognitive loads.


[snip]

On Fri, Jan 19, 2018 at 12:50 PM, KHMan wrote:

    On 1/19/2018 6:26 PM, Elias Hogstvedt wrote:

        Lua was my first language and the language I've been using
        the most for 10~ years. I want to point this out becuase I
        don't want to be the guy who's coming from X language that
        want changes in Lua because it's different from his
        favorite language. I'm not really expecting any change but
        it's fun to think about language design and I'm looking
        for feedback.

    [snip snip snip]


        I believe this would simplify and make the language easier
        to understand.


    'Simplify'.

    Really?

    (That's all I'm going to say, ha ha. :-p I'll leave it to
    others to argue it out.)


--
Cheers,
Kein-Hong Man (esq.)
Selangor, Malaysia