On 22/12/25 1:07 PM, Bram Moolenaar wrote:
With 9.0.1094, in the script that follows, attempting to read a
classMember through an instance fails;
echomsg c.classMember
should it?
No, an object does not provide a class member.
I suppose requiring the class name makes it most clear, but I recall
mention that classnames can get long. I suppose a getter could be added.
How can you access the getter without referring to the class?
Assuming c is an object
c.GetClassMember()
where the method GetClassMember() returns the classMember that was
declared static.
Can a class method (or should it be called class function?) be static?
Nothing *is* static, the "static" keyword is used to change the meaning
of items.
I should have said "can a method/function defined in a class be declared
static?"
One way to look at it: is it the case that any method can be invoked as
MyClass.SomeMethod()
and as long as "SomeMethod()" doesn't reference a variable like
"this.someVar" then it's OK?
-ernie
--
--
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/a7f5447f-2dbe-30ce-0bae-c3a4e98aec68%40raelity.com.