[Top][All Lists]

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

Re: RFC: User-defined pseudovectors

From: Lars Brinkhoff
Subject: Re: RFC: User-defined pseudovectors
Date: Thu, 10 Oct 2013 18:40:03 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Dmitry Antipov <address@hidden> writes:
> > Why make-typed-pseudovector & the rest can't be done in elisp?

Because the entire point is to be able to create a new Lisp type, and
there currently is no way to do that in Lisp.

> Plus, if we really need the ability to add builtin Lisp types to
> interface foreign DSOs, I'll vote to design this on top of
> Lisp_Misc.

That may well be better, I don't know.

I just now stumbled over this in lisp.h:

> To define a new data type, add one more Lisp_Misc subtype or one
> more pseudovector subtype.  Pseudovectors are more suitable for
> objects with several slots that need to support fast random access,
> while Lisp_Misc types are for everything else. A pseudovector object
> provides one or more slots for Lisp objects, followed by struct
> members that are accessible only from C.  A Lisp_Misc object is a
> wrapper for a C struct that can contain anything you like.

For my primary use case (Common Lisp data types, structs, and class
instances), I'm inclined to believe that pseudovectors are better.
But it may well be that Lisp_Misc is better for FFI datatypes.

reply via email to

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