понедельник, 19 декабря 2022 г. в 00:33:24 UTC+11, Bram Moolenaar: 

>
>
>
>
> For object members most languages use the "this." prefix. But not 
> everywhere, which makes it inconsistent. A good example is a 
> constructor where object members that are also an argument need to be 
> prefixed with "this." to avoid a name collision, while other object 
> members are used without "this.". I find that very confusing. Example: 
>
> SomeObject(String name) 
> { 
> this.name = name; 
> gender = Gender.unknown; 
> } 
>
>  
I would go with this.name and this.gender while accessing the variables.
 

>
> One thing I'm not yet sure about is the declaration. Currently it works 
> like this: 
>
> this.name: string 
> this.gender: Gender 
>
> and 

var name: string
var gender: Gender

to declare them. 

-- 
-- 
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/5e7c4f18-1652-45b8-9f24-bf5bba8df051n%40googlegroups.com.

Raspunde prin e-mail lui