Hi,

Tony Mechelynck wrote:
> 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:
>>>
>>>   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.
> 
> 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.

in my proposal I forgot to mention that on the command line
floating-point literals should be entered/enterable without the &. It
shouldn't be too difficult to teach users to separate two integer
literals with space-dot-space.

> 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.

Yes, but being able to use the same style for basic parts of a
programming language (like integer, string and floating-point literals)
as in other well-known languages makes learning a new language or just
a new aspect of it much easier.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

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

Raspunde prin e-mail lui