50464Re: Floating point syntax
- Jun 6, 2008Bram 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.Absolutely.
> 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.
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 withIs it worth changing it for just one script? I would say no. If a
> doing floating point this way, we still need to find that one script
> that breaks.
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.
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>