Loading ...
Sorry, an error occurred while loading the content.

Re:

Expand Messages
  • Bram Moolenaar
    Charles - ... I think we can add a remark in the docs that is an empty string when there are no arguments. I don t see a good reason to change the
    Message 1 of 3 , Jun 3, 2005
    • 0 Attachment
      Charles -

      > When there are no arguments, <f-args> will create no arguments.
      > That appears not to be the case for <q-args>, as shown by sourcing
      >
      > fun! Problem(...)
      > echomsg " ----- "
      > echomsg " a:0=".a:0
      > if a:0 > 0
      > echomsg " a:1<".a:1.">"
      > endif
      > endfun
      > com -nargs=? PRBLM call Problem(<q-args>)
      > PRBLM
      >
      > Its not clear from the documentation (at least, not to me) that <q-args>
      > should have this behavior of inventing an argument (I assume its "")
      > when there are none provided.
      >
      > Just thought I'd point it out.

      I think we can add a remark in the docs that <q-args> is an empty string
      when there are no arguments. I don't see a good reason to change the
      behavior. As it is now it also works for a function that takes one
      argument. It would fails if <q-args> doesn't produce an empty string
      when there is no argument.

      - Bram

      --
      How To Keep A Healthy Level Of Insanity:
      16. Have your coworkers address you by your wrestling name, Rock Hard Kim.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.