Mikolaj Machowski wrote:

> Dnia Wednesday 09 of April 2008, Bram Moolenaar napisa=B3:
> >
> > Now the patch is attached, hopefully that works better.
> 
> Thanks, this one is working.
> 
> One bug:
> 
> :echo 1.90+&90
> 280,000000
> 
> :echo 1.90-&90
> 100,000000
> 
> OK, but

Actually, that is not OK.  You are adding a floating point number to a
string.  I intended there be no automatic conversion.  Especially in
this case, since the writer apparently forgot the "&" before the "1.90".

> :echo 1.90*&90
> E806: using Float as a String
> E15: Illegal expression: 1.90*&90
> 
> :echo 1.90/&90
> E806: using Float as a String
> E15: Illegal expression: 1.90/&90

That's OK.

> These two:
> 
> :echo &1.90*&90
> :echo &1.90/&90
> 
> Work.

Which is also OK.

> What about slightly more verbose solution?
> 
> Make float() not reduced to one variable but as "environment" where
> *all* variables are treated as float but outside of that are treated as
> strings. Example:
> 
> :let a = float("2/4")
> :echo a
> 0.5
> :let b = a . "+5"
> :echo b
> 0.5+5
> :let c = float(a . "+5")
> :echo c
> 5.5

Hmmm.

-- 
       We're knights of the Round Table
       Our shows are formidable
       But many times
       We're given rhymes
       That are quite unsingable
       We're opera mad in Camelot
       We sing from the diaphragm a lot.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Raspunde prin e-mail lui