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

50464Re: Floating point syntax

Expand Messages
  • Ben Schmidt
    Jun 6, 2008
    • 0 Attachment
      Bram Moolenaar wrote:
      > Tony Mechelynck wrote:
      >
      >> On 04/06/08 21:40, Ilya Bobir wrote:
      >> [...]
      >>> If there are no scripts that use two numbers with a dot in between
      >>> without interleaving spaces then it follows that there are none that
      >>> have these kind of numbers with an exponent appended. And it means that
      >>> if the float syntax will be smart enough to tell a float without an
      >>> exponent from a concatenation then adding an exponent as a suffix will
      >>> not introduce any ambiguity. Am I missing something?
      >>>
      >>> Ilya Bobir
      >> What about 2.e32 ?
      >
      > I think it's OK to not allow that and insist on using "2.0e32".
      > Just like you can't do ".5" but need to use "0.5" instead.
      [...]
      > This actually makes sense, so we should keep this backwards compatible.
      > The reasoning that "2.0" is currently not used is that it's not useful to
      > have this in a Vim script, you would write "20" instead.

      Absolutely.

      Another corner case that I believe wasn't searched for with the regex is
      simply 2e32 which is presently valid and almost equivalent to the above
      (I think it is two expressions side by side which :echo then
      concatenates with a space between).

      > I'm not saying I have accepted the backwards compatibility problem with
      > doing floating point this way, we still need to find that one script
      > that breaks.

      Is it worth changing it for just one script? I would say no. If a
      handful of scripts, perhaps, because that may indicate that there are
      many more in the wild that aren't publicly accessible, but just one I'm
      not sure is enough evidence to go on.

      Ben.




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 15 messages in this topic