On Jul 21, 5:54 pm, Matt Wozniski <m...@drexel.edu> wrote:
> That's exactly what raising an exception does.  When you get an
> exception, why are you printing out a message about that exception,
> and then ignoring that it ever happened?  Why not just :throw
> something in s:ProjGetInfo() and :catch it in the caller?
>

When I was writing programs for school in Java (seems like forever
ago), I remember that not being careful with what you placed inside
try...catch blocks, you ended up eating memory REALLY fast. I think
that had something to do with Java trying to discard/restore pretty
much everything within the try or something like that if it failed.

It looks like Vim's implementation is just a sort of instant return-
through-all-callers, it doesn't try to undo anything. Are there any
side effects of a try...catch in Vim, performance related or
otherwise, that one should be aware of?

Additionally, what on earth does :echoerr do in relation to all this?
>From my trial-and-error above, it DOESN'T seem to exit a function,
even if defined with the "abort" keyword. Neither of these work as I
expect (i.e. abcd and defg both get the value 123 instead of 0):

function AbErr() abort
  let g:abcd=0
  echoerr 'fooblarg'
  let g:abcd=123
endfu

fun NoAbErr()
  let g:defg=0
  echoerr 'blargfoo'
  let g:defg=123
endfu

Does echoerr need to be in a try...catch to be useful in a situation
like this?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to