Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-09 Thread Nicolas
Thank you Tom.

Le samedi 8 juillet 2023 à 22:28:16 UTC+2, Tom M a écrit :

> I don't think Vim 9 script has the kind of introspection you are asking 
> for.
>
>
> The v:throwpoint variable might help, as mentioned in :help 
> throw-variables.
>
> Tom
>
>

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/3a766d1c-af77-4dad-8b36-8c817056a1e1n%40googlegroups.com.


Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-08 Thread Tom M


I don't think Vim 9 script has the kind of introspection you are asking 
for.


The v:throwpoint variable might help, as mentioned in :help throw-variables.

Tom

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/7294b449-ee5f-4785-83af-2b72ea1ec5b0n%40googlegroups.com.


Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-07 Thread Nicolas
This deal with  is displaying last tree called function and line.

echomsg
expand('')->split('')[-1]->substitute('\d\+_\(\w\+\)\[\(\d\+\)\]',
'\1: \2', "")

Thank you Bram.
Nicolas

Le ven. 7 juil. 2023 à 21:57, Nicolas  a écrit :

> Oh thank you a lot Bram and all of you. It's helpful to know where we
> come from.
> In code, in Life too ;)
>
> Thank you
> Nicolas
>
> Le ven. 7 juil. 2023 à 04:19, Bram Moolenaar  a
> écrit :
>
>>
>> Yegappan wrote:
>>
>> > On Tue, Jul 4, 2023 at 1:11 PM Lifepillar 
>> wrote:
>> > >
>> > > On 2023-07-04, Nicolas  wrote:
>> > > > Hi,
>> > > >
>> > > > Is there an equivalence in vim9 of  __FILE__, __LINE__, and
>> __FUNCTION__
>> > > > usage in C++
>> > > ><
>> https://stackoverflow.com/questions/597078/file-line-and-function-usage-in-c
>> >
>> > >
>> > >
>> > > For __LINE__ and __FUNCTION__, I don't know what "equivalent"
>> > > alternative to suggest, but if you elaborate on what your goal is, it
>> > > will be easier to help.
>> > >
>> >
>> > You can try using 

Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-07 Thread Nicolas
Oh thank you a lot Bram and all of you. It's helpful to know where we come
from.
In code, in Life too ;)

Thank you
Nicolas

Le ven. 7 juil. 2023 à 04:19, Bram Moolenaar  a écrit :

>
> Yegappan wrote:
>
> > On Tue, Jul 4, 2023 at 1:11 PM Lifepillar 
> wrote:
> > >
> > > On 2023-07-04, Nicolas  wrote:
> > > > Hi,
> > > >
> > > > Is there an equivalence in vim9 of  __FILE__, __LINE__, and
> __FUNCTION__
> > > > usage in C++
> > > ><
> https://stackoverflow.com/questions/597078/file-line-and-function-usage-in-c
> >
> > >
> > >
> > > For __LINE__ and __FUNCTION__, I don't know what "equivalent"
> > > alternative to suggest, but if you elaborate on what your goal is, it
> > > will be easier to help.
> > >
> >
> > You can try using 

Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-06 Thread Bram Moolenaar


Yegappan wrote:

> On Tue, Jul 4, 2023 at 1:11 PM Lifepillar  wrote:
> >
> > On 2023-07-04, Nicolas  wrote:
> > > Hi,
> > >
> > > Is there an equivalence in vim9 of  __FILE__, __LINE__, and __FUNCTION__
> > > usage in C++
> > >
> >
> >
> > For __LINE__ and __FUNCTION__, I don't know what "equivalent"
> > alternative to suggest, but if you elaborate on what your goal is, it
> > will be easier to help.
> >
> 
> You can try using 

Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Yegappan Lakshmanan
On Tue, Jul 4, 2023 at 1:11 PM Lifepillar  wrote:
>
> On 2023-07-04, Nicolas  wrote:
> > Hi,
> >
> > Is there an equivalence in vim9 of  __FILE__, __LINE__, and __FUNCTION__
> > usage in C++
> >
>
>
> For __LINE__ and __FUNCTION__, I don't know what "equivalent"
> alternative to suggest, but if you elaborate on what your goal is, it
> will be easier to help.
>

You can try using 

Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Lifepillar
On 2023-07-04, Nicolas  wrote:
> Hi Life,
>
> My Main goal is to add prefix of vim9script current '__FUNCTION__' to my
> debug message.

Something along these lines, perhaps?

vim9script

def Debug(F: func)
  echo string(F)
enddef

def Foo()
  Debug(Foo)
enddef

def Bar()
  Foo()
  Debug(Bar)
enddef

Bar()

I don't think Vim 9 script has the kind of introspection you are asking
for.

Life.

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/u820gq%245pn%242%40ciao.gmane.io.


Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Nicolas
Hi Life,

My Main goal is to add prefix of vim9script current '__FUNCTION__' to my 
debug message.

Thank you for help
Nicolas

Le mardi 4 juillet 2023 à 22:11:31 UTC+2, Lifepillar a écrit :

> On 2023-07-04, Nicolas  wrote:
> > Hi,
> >
> > Is there an equivalence in vim9 of __FILE__, __LINE__, and __FUNCTION__
> > usage in C++
> ><
> https://stackoverflow.com/questions/597078/file-line-and-function-usage-in-c
> >
>
> The closest to __FILE__ is likely  (`:help `). I use this
> snippet to get the path of the current script:
>
> const PATH = resolve(expand(':p'))
>
> Or to source a file in the same directory as the current script:
>
> source :h/some_other_script.vim
>
> For __LINE__ and __FUNCTION__, I don't know what "equivalent"
> alternative to suggest, but if you elaborate on what your goal is, it
> will be easier to help.
>
> Life.
>
>

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/d1d2044e-f81e-43e5-90b1-453ba95130c7n%40googlegroups.com.


Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Lifepillar
On 2023-07-04, Nicolas  wrote:
> Hi,
>
> Is there an equivalence in vim9 of  __FILE__, __LINE__, and __FUNCTION__
> usage in C++
>

The closest to __FILE__ is likely  (`:help `). I use this
snippet to get the path of the current script:

const PATH = resolve(expand(':p'))

Or to source a file in the same directory as the current script:

source :h/some_other_script.vim

For __LINE__ and __FUNCTION__, I don't know what "equivalent"
alternative to suggest, but if you elaborate on what your goal is, it
will be easier to help.

Life.

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/u81ucu%2410nc%241%40ciao.gmane.io.


vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Nicolas
Hi,

Is there an equivalence in vim9 of  __FILE__, __LINE__, and __FUNCTION__ 
usage in C++ 

 ?

Thank you
Nicolas

-- 
-- 
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/9cee7656-de28-4a93-84cb-3f0d8c2b5e98n%40googlegroups.com.