On Tuesday, 27 December 2022 at 11:14:33 UTC+11 Christopher Plewright wrote:

>
>
> Another possibility occurred to me, that you could keep;  *function* and 
> *endfunction*
> That could still be used to always mean *static *functions - as that 
> essentially does now already - I mean, because there was no such thing as 
> object member methods in vimscript before classes were added. 
> So, if you say *function* and *endfunction*, when defined inside a class, 
> means a static function of that class.   You wouldn't need the word static 
> for that.
>
> Because... you now have the opportunity to add;  *method* and *endmethod* 
> to define object member methods.   ie. instead of *def *and *enddef*.   I 
> find *def *and *enddef *a bit too generic,  but that is just my opinion.  
>  Again, this is relying on a certain meaning of the word *method*, which 
> I dont think is uncommon, but as you said it doesn't necessarily always 
> have that meaning either.  
>
> If you did this then *static *wouldn't need to be used for functions or 
> methods.   That would just leave *static* for variables.  And, I think "
> *s:*" is very close in meaning already to how I understand *static*, (it 
> implies certain lifetime and accessibility), and so you could say that an 
> *s:* variable, when declared inside a class definition, is a static 
> variable.   
>
> If you did these couple of things, then you wouldn't need to use the word "
> *static*" anywhere.
>

Apologies all,  I've just re-read the vim9.txt doco, and now realise some 
of these suggestions don't fit.  There is already a rationalised 
delineation between *function *and *def *for vim9.    And, the idea of 
using s: for static, is overloading the meaning and could cause confusion 
for those expecting it to be accessible for the whole script, to suddenly 
find its only accessible within the class.   So, overloading s: not a good 
idea.  And, even though another prefix might work, for example *c:* to mean 
that it is static class scoped, but then people already know what static 
means anyway, so no need to introduce something brand new, unless its 
actually helpful.

  

-- 
-- 
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/4612e555-b4fc-465e-9902-d3217e5f86c3n%40googlegroups.com.

Raspunde prin e-mail lui