Ernie Rael wrote:

> >> Doing
> >>
> >>      def T()
> >>      enddef
> >>      echo T->get('name')
> >>      echo T
> >>      finish
> >>
> >> produces this output
> >>
> >>      <80><fd>R34_T
> >>      <SNR>34_T
> >>
> >> Is this expected? I just saw `T->get('name') and thought I could
> >> use it to replace a spot where I'm extracting the name from `string(T)`.
> > I get:
> >
> >     E121: Undefined variable: T
> >     E121: Undefined variable: T
> >
> > When I prepend "vim9script" then I do get the output you mention.
> >
> > The output looks OK, you get the internal name of a script-local
> > function.  Either the byte-code version or the printable version with
> > <SNR>.  Note that you can also get the printable version with:
> >
> >       echo function('T')->get('name')
> 
> Thanks. Now I get it; it's magic. (easier for me to understand than delving
> into byte-code version and what I'd do with it.)
> 
> Never having learned vimscript, seems there are some things I'm not
> easily getting a feel for, since with vim9script...

See ":help get()" and go down a few lines.

-- 
If I tell you "you have a beautiful body", would you hold it against me?

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230319174910.B3AE21C1466%40moolenaar.net.

Raspunde prin e-mail lui