On 09/04/08 14:51, Ajit Thakkar wrote:
> On Wed, Apr 9, 2008 at 7:01 AM, Jürgen Krämer<[EMAIL PROTECTED]>  wrote:
>>   Bram Moolenaar wrote:
>>   >
>>   >  Antony Scriven wrote:
>>   >
>>   >>  On 08/04/2008, Bram Moolenaar<[EMAIL PROTECTED]>  wrote:
>>   >>
>>   >>   >  The main problem with floating point is that the usual
>>   >>   >  notation already has a meaning:
>>   >>   >
>>   >>   >         echo 123.456
>>   >>   >            123456
>>   >>   >
>>   >>   >  [...]
>>   >>
>>   >>  How many people actually do that? Should they be doing that?
>>   >>  IMHO I'd force people to use whitespace for concatenation in
>>   >>  this case (i.e.  123 . 456) and have 123.456 be a floating
>>   >>  point number. That's how Perl works, for example. --Antony
>>   >
>>   >  Search in existing scripts and you will find examples of doing string
>>   >  concatenation like this.  I don't want to break existing scripts in some
>>   >  obscure way.
>>   >
>>
>>   what about a command similar to scriptencoding which would enable
>>   support for floating point numbers in this particular script? Or just
>>   allows to write them without the need to use a "marker"? "Marked"
>>   floating point numbers would then always be allowed.
>
> I like this suggestion. A mechanism that allows a script writer to
> declare a script as one that uses unmarked floating point numbers
> would be a good compromise. It would allow old scripts to remain
> unchanged even if they use a dot to concatenate literal numbers. Most
> authors of new scripts that use floating point numbers would find one
> added command/setting per script a small price to pay for being able
> to use standard notation for floating point numbers.
>
> Ajit

I'm not sure this would be productive in the long run: you would still 
have to type the & when entering floating-point literals at the command 
line, so that "script-only" command would get in the way of learning 
"true" Vim floating-point language, the way mswin.vim gets in the way of 
learning "true" normal-mode commands.

Once you'll have learnt that, in Vim, floating-point literals are 
distinguished by an & prefix (and MUST be typed that way at the 
keyboard), it will "feel normal" to write them the same way in scripts.

OTOH, when you use ":scriptencoding latin1" in a script created while 
'encoding ' is set to UTF-8, you still type é (e-acute) as é, it is 
entered into memory as a UTF-8 é, translated to a Latin1 é when the 
script is saved to disk, read back with no translation when sourced and 
correctly interpreted as é after the ":scriptencoding" command, but you 
never see it as anything else than é. Similarly for any other letter.

How many times will we have to repeat: Vim is not Notepad, Vim is not 
Emacs, Vim is not BASIC and Vim is not C. Don't try to force it to 
behave as one of them, that's not how it works.


Best regards,
Tony.
-- 
Newlan's Truism:
        An "acceptable" level of unemployment means that the government
economist to whom it is acceptable still has a job.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui