> 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 ?

I would not call it intuitive at all.  This syntax with the "new"
keyword comes from the first object-oriented languages.  More recent
languages have moved away from it, because it is a very strange
construct.

The best example is Dart, which started out using "new" like other
languages, but dropped it in Dart 2.  Unfortunately completely dropping
it has backwards compatibility problems, thus now "new" is optional and
it's recommended to leave it out.  As an indication it's important to
make the right choice from the start.

I'm sure the proposed syntax is simple and straightforward, it will be
easy to get used to.


-- 
-rwxr-xr-x  1 root          24 Oct 29  1929 /bin/ed
-rwxr-xr-t  4 root      131720 Jan  1  1970 /usr/ucb/vi
-rwxr-xr-x  1 root  5.89824e37 Oct 22  1990 /usr/bin/emacs

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/20221223161524.88B281C0AA4%40moolenaar.net.

Raspunde prin e-mail lui