50457Re: Floating point syntax
- Jun 4, 2008Bram Moolenaar wrote:
> [...]I've explained how I did the search in my email on that thread.
>> The second was a proposal to represent floats as numbers with decimal
>> points but no additional punctuation which was implicit in this report
>> from Ilya Bobir:
>> - I did a search for vim scripts that use concatenation operation
>> between two numbers without interleaving space. It appears that
>> Google Code Search was able to find only 39 matches and all were
>> false positives.
>> Nobody gave any reply to the message.
> I wonder how you do that search.
Probably you missed it, so I include this email here. Here it goes:
Ilya Bobir wrote:
> Bram Moolenaar wrote:If something is hard to understand, please ask, I'll try to explain
>> I would still like feedback on the format of floating point numbers:
> I did a search for vim scripts that use concatenation operation between two
> numbers without interleaving space. It appears that Google Code Search was
> able to find only 39 matches and all where false positives.
> Here is the query:
> And here is a regex I've used (along with explanations). Maybe someone will
> double check to make sure I did not mistake.
> lang:vim | Vim script language.
> ^\s*[^"\ ] | In order to exclude comments the line should
> | start with anything but ".
> ( | Catches different kind of strings.
> " ( \\. | [^"] )* " | Double quoted strings along with escapes
> | inside the string.
> | ' [^']* ' | Single quoted strings.
> | [^"] | All the rest is OK. And there maybe some
> | staff preceding the digits.
> )* |
> \s\d+\.\d+\s | A pattern that I was looking for - two numbers
> | concatenated without an interleaving space
> | that are not part of a longer sequence.
> -menu | menu command uses dot separated numbers to set
> | priority. There are plenty of them and all
> | are false positives, so remove all lines with
> | "menu" string in them.
another way. English is not my native language and sometimes I really
have no clue whether what I write is understandable at all =)
> And if you manage to come up with theThe number of matches is the number of lines that have two numbers
> right pattern, what the number of matches actually means.
concatenated without interleaving spaces. A real match would mean that
adding a "common" syntax for floats into Vim script would break a script
with the match.
It appeared that all 39 matches was false positives meaning that all of
them was really something else and was matched only because the pattern
I've used it not perfect. I checked all 39 matches by hand. You can
easily see them by following a link in my original e-mail that I've
To sum it up, it appears that among all the vim scripts that are indexed
by Google there are none that use the "common" float syntax to
concatenate two numbers. This means using the "common" syntax for
floats will not break any of these scripts.
There still is a chance that some scripts use dynamically generated
expressions that have two numbers concatenated without interleaving
spaces but it is unlikely as one does not need a concatenation operation
to concatenate numbers when building a dynamic expression - you can just
put them in the result side by side.
> Ben Schmidt wrote:If there are no scripts that use two numbers with a dot in between
>> I would like to note, though, that this doesn't solve the problem for
>> exponent notation. However, I suspect a search of vim scripts containing
>> numbers of that form would yield even less results, though I have not
>> tried it. The search also doesn't take into account expressions that may
>> be built dynamically in vim scripts rather than being hard coded, but
>> again, I doubt many if any of these exist.
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?
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 >>