On Mon, 19 Dec 2022 at 00:33, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> One thing I'm not yet sure about is the declaration.  Currently it works
> like this:
>
>         this.name: string
>         this.gender: Gender
>
> Notice that there is no "var" keyword.  It's not needed to recognize the
> declaration.  I can't think of a good reason to add "var" here, other
> than that a declaration would be expected to always have "var".  Well, I
> don't have that expectation.


This following currently defines a field and is, without context,
indistinguishable from any other assignment.  Is that intended?

this.name = "Somebody"

As methods still require :def I think it would be more consistent to not
special case field declarations and still require the :var.

For class members most languages use the "static" keyword.  It's a bit
> of a weird word, but I suppose most people are used to it, and I can't
> find a popular language that has a good alternative.
>
> If we leave out "var" for object members, I suppose we should also leave
> it out for class members.  We then get:
>
>         static oneClassMember: number
>         static twoClassMember: string
>
> I think this looks fine.  Any objections?
>

It seems from the documentation that static fields can be referenced as
bare identifiers?  This feels a bit unexpected to me given that instance
fields are always qualified.

Regards,
Doug

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJ1uvoD%2BS7WmQiORM2_agzWWjy-72p%2B07QhEcWmmg1TZJ-YrOw%40mail.gmail.com.

Raspunde prin e-mail lui