On 23/08/25 2:07 PM, bfrg wrote:
If "public" is omitted, shouldn't class members and method be private by default just like "def" functions and script variables are script-local by default unless prefixed with "export"?

In general, I would also like it to be symmetric. So, either introducing "public" and "private" together, or no modifier keyword at all.

Any opinion/comment on "read-only" access in favor of adding Getters?

Would "export" be better than "public" in class definitions?

In the latter case an underscore indicates private class members and methods whereas public ones don't have an underscore.

And another issue: why isn't this thread shown in GitHub Discussions? Wasn't the whole point of enabling Discussions so that more people can participate in such decision making?
On Friday, August 25, 2023 at 6:11:34 AM UTC+2 Doug Kearns wrote:

    On Fri, 25 Aug 2023 at 13:18, Yegappan Lakshmanan
    <[email protected]> wrote:

        Hi all,

        The following item is in the todo.txt file for implementing
        private
        methods in a class:

         - Private methods?
                either: private def Func()
                    or: def _Func()
            Perhaps use "private" keyword instead of "_" prefix?

        Function and method names always start with an uppercase
        letter.  So
        if we use the
        "_" prefix for a private method name then it will diverge from
        that. So I have
        implemented this using the "private" keyword.

        Any opinions?


    Thanks very much for keeping the ball rolling on this.

    For others, there was some previous discussion[1] about it on the
    list when Bram asked for opinions.  My recollection is that both
    you and he were in favour of the "_" prefix for call-site
    identification purposes?

    My personal preference would be for the modifier keyword with a
    symmetric, even if possibly redundant, "public".  I think this is
    justifiable on the grounds of it meeting the "less weird"
    requirement for Vim9 script.  While I'm sure there are others,
    JavaScript is the only language I can think of off the top of my
    head that defaults to public and uses a sigil for private access.

    Thanks again,
    Doug

    1.
    https://groups.google.com/g/vim_dev/c/yYpFNUHdRho/m/xjgrKqMoBQAJ?pli=1


--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/394f9be0-0aef-4c32-9da0-a90ac499723fn%40googlegroups.com <https://groups.google.com/d/msgid/vim_dev/394f9be0-0aef-4c32-9da0-a90ac499723fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/b004fd8a-8246-0e6d-5e79-e16943f6c2ad%40raelity.com.

Raspunde prin e-mail lui