lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 14 September 2011 21:22, Rob Hoelz <rob@hoelz.ro> wrote:
> - Assigning booleans to Vim variables will coerce them to Vim numbers,
>  but no coercion will take place on the way back.  We'll need to use
>  constructs like if w.my_variable ~= 0 then ... end or if
>  toboolean(w.my_variable) then ... end.  However, Vim functions that
>  are known to return boolean values can coerce their outputs to
>  boolean, so we can still do if haslocaldir() then ... end.

It's possible that if I devoted time to trying to write a script using
this system I'd come to a different conclusion, but my instinct is to
prefer the solution above. It's the least surprising and the simplest.
Sure, the conversion between Lua and vimscript is lossy, but at least
it's easy to understand.

Alex