From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Brinkhoff Newsgroups: gmane.emacs.devel Subject: Re: RFC: User-defined pseudovectors Date: Thu, 10 Oct 2013 18:40:03 +0200 Organization: nocrew Message-ID: <851u3tcc64.fsf@junk.nocrew.org> References: <85k3hlcqvm.fsf@junk.nocrew.org> <5256A2FD.4020208@yandex.ru> <5256AE86.20500@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1381423235 19457 80.91.229.3 (10 Oct 2013 16:40:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Oct 2013 16:40:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 18:40:38 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VUJHx-0001Ux-RB for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2013 18:40:37 +0200 Original-Received: from localhost ([::1]:49354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJHw-00046X-Va for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2013 12:40:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJHj-00045G-NU for emacs-devel@gnu.org; Thu, 10 Oct 2013 12:40:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUJHd-0007qW-Fe for emacs-devel@gnu.org; Thu, 10 Oct 2013 12:40:23 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJHd-0007pe-9n for emacs-devel@gnu.org; Thu, 10 Oct 2013 12:40:17 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VUJHa-0001EW-74 for emacs-devel@gnu.org; Thu, 10 Oct 2013 18:40:14 +0200 Original-Received: from c-4957e555.012-14-67626717.cust.bredbandsbolaget.se ([85.229.87.73]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Oct 2013 18:40:14 +0200 Original-Received: from lars by c-4957e555.012-14-67626717.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Oct 2013 18:40:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-4957e555.012-14-67626717.cust.bredbandsbolaget.se User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:6+ZWyOODObm+J3b9P8PQGi8vgoY= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164067 Archived-At: Dmitry Antipov 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.