[slim-vim] Slim-vim, future and milestones. (V0.1!!!)

Larry Clapp larry at theclapp.org
Fri Jul 14 10:12:36 CDT 2006


On Fri, Jul 14, 2006 at 05:46:46AM -0400, Larry Clapp wrote:
> On Thu, Jul 13, 2006 at 03:37:32PM -0700, Brad Beveridge wrote:
> > I remember this bug now - the issue is in Vim7.  It if_ecl.c there
> > is a call to eval_to_string, which calls into Vim's eval.c module.
> > If you look at eval_to_string, you can either get back a Vim List
> > (which at the moment our FFI can't parse), or a string that uses
> > \n as an item seperator.  I changed if_ecl.c to output the later.
> > I don't have the code in front of me as a complete unit, so I
> > can't really be more specific, sorry.
> 
> I found it.  I'd like to make it return a Lisp list.
> 
> > Hope that helps.  If it does, can you please check the change in
> > to the Vim7 repo?
> 
> I will when I make them.  :)

VIM:EXPR used to return only strings.  I've fixed it to return a
number for a number, a string for a string, and a Lisp list for a Vim
list.

In particular, (vim:funcall "tabpagebuflist") now returns a Lisp list
of Lisp numbers:

  % vim
  :sb
  :ecl (print (vim:funcall "tabpagebuflist"))
  => (1 1)
  :ecl (print (vim:tabpagebuflist))
  => (0 0)

VIM:VAR assumed that VIM:EXPR would return only a string; I fixed it
too.  Now if VIM:EXPR returns a string, but it looks like a number,
VIM:VAR will parse it and return the number; if it's not a string,
VIM:VAR just returns it.

Since VIM:VAR now knows the difference between numbers and strings, I
removed VIM:VAR-S and VIM:VAR-N.  If you want a numeric variable as a
string use PRIN1-TO-STRING or whatever; if you want a string variable
as a number, use PARSE-INTEGER.

Here's the changelog, which I'll also CC to the Changelog for July
thread.

> Fri Jul 14 11:04:34 EDT 2006  Larry Clapp <larry at theclapp.org>
>   * Added Vim FFI for tabpagenr and tabpagebuflist
> 
>   vim:tabpagenr takes an optional argument, but if you provide it,
>   it must be NIL or string= "$", or it's silently ignored.
> 
> Fri Jul 14 10:03:56 EDT 2006  Larry Clapp <larry at theclapp.org>
>   * Make VIM:VAR work with the new VIM:EXPR; delete VAR-S and VAR-N
> 
> Fri Jul 14 09:26:55 EDT 2006  Larry Clapp <larry at theclapp.org>
>   * Make VIM:EXPR work with more types of Vim data: numbers, strings, lists
> 
>   Doesn't work with Dictionaries yet.
> 
>   - A Vim number may become a fixnum or a bignum.
>   - A Vim string becomes a Lisp string.
>   - A Vim list becomes a Lisp list (recursively).
>   - A Vim dictionary displays an error ("E685: Internal error:
>     vim_type_to_cl_object(VAR_DICT)")
> 
>   Changed vim:funcall to only call parse-integer on the returned
>   value if the returned type is STRING *and* the given function is
>   supposed to return an integer.  (Previously vim:expr *always*
>   returned strings.)
> 
>   Also added some comments and docstrings.

-- Larry



More information about the slim-vim mailing list