Hi Bram,
Before everything becomes unchangeable, can I suggest to use
"new ClassName" instead of "ClassName.new" to create an instance ?
According to the description in `vim9class.txt`:
> An object can only be created by a class. A class provides:
> - A new() method, the constructor, which returns an object for the class.
> This method is invoked on the class name: MyClass.new().
An object can be created by:
var pos = TextPosition.new(1, 1)
Is it possible to change it to:
var pos = new TextPosition(1, 1)
this makes me feel more nature/familiar.
Since the vim9-class is built from scratch without any backward-compatible
problems,
why not choose some intuitive grammars ?
在2022年12月20日星期二 UTC+8 17:49:10<[email protected]> 写道:
> For what it's worth, I feel that the formal "var memberVariable : Type"
> syntax for member is (while more verbose) more likely to stand out. The
> `var` keyword is a signpost and so is likely to be syntax highlighted.
> Simple `memberVariable : Type` doesn't stand out anywhere and contains
> mostly identifiers without keywords.
>
> Additionally, I personally prefer the symmetry with local variables. If
> all declarations look the same, then it's one less rule to remember.
>
> You can then also use const: `const memberVarConstant : Type` maybe?
>
> On Tuesday, December 20, 2022 at 12:30:50 AM UTC [email protected] wrote:
>
>>
>>> The difference between a regular method and a constructor is that for a
>>> constructor it is very common to assign the argument to an object
>>> member.
>>>
>>> The idea comes from Dart, and I don't think Dart supports this for
>>> anything but constructors.
>>>
>>
>> That's a good point, it is usually constructors where it get tedious.
>> I really appreciate your considered replies.
>> Thanks
>>
>>
>
--
--
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/541eca9a-be1e-452c-87a8-6ff1bb4ee839n%40googlegroups.com.