emacs-devel
[Top][All Lists]
Advanced

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

Re: RFC: User-defined pseudovectors


From: Stefan Monnier
Subject: Re: RFC: User-defined pseudovectors
Date: Thu, 10 Oct 2013 16:43:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>   (defun frob (x)
>     (cond
>      ((vectorp x)   (frob-vector x))
>      ((foop x)      (frob-foo x))))

> In the case of an FFI, a wrapper may want to be able to pass a vector
> or a "struct" (something like a pseudovector) to Emacs, and have Lisp
> code be able to tell the difference.

In Elisp, such type-overlaps are common.  E.g. you should first check
`functionp' before `consp' if you can accept both lists and functions.
So similarly the above code should check `foop' before `vectorp'.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]