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: Fri, 11 Oct 2013 08:00:10 +0200 Organization: nocrew Message-ID: <85mwmgbb4l.fsf@junk.nocrew.org> References: <85k3hlcqvm.fsf@junk.nocrew.org> <8561t5cclt.fsf@junk.nocrew.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1381471235 32481 80.91.229.3 (11 Oct 2013 06:00:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Oct 2013 06:00:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 11 08:00: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 1VUVm9-0005m2-ME for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 08:00:37 +0200 Original-Received: from localhost ([::1]:52551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUVm8-0004pd-Tl for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 02:00:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUVlz-0004nP-7v for emacs-devel@gnu.org; Fri, 11 Oct 2013 02:00:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUVlt-0001Rc-D1 for emacs-devel@gnu.org; Fri, 11 Oct 2013 02:00:27 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUVlt-0001RU-6i for emacs-devel@gnu.org; Fri, 11 Oct 2013 02:00:21 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VUVlr-0005cN-RC for emacs-devel@gnu.org; Fri, 11 Oct 2013 08:00:19 +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 ; Fri, 11 Oct 2013 08:00:19 +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 ; Fri, 11 Oct 2013 08:00:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 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:z2z6wXLBkTY9OrHQnuX2HrCDvns= 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:164073 Archived-At: As long as you work inside Emacs, I agree there's no great need for user-defined types, because Emacs Lisp already provides the data structures that are commonly needed. And you can pass around lists or vectors which provides a 99% solution in most cases. But with an FFI, I would argue that the situation changes. When you want to interface with code written in other languages, it seems to me that the need increases. Most other languages have some kind of user-defined record types, and they are used quite liberally. Stefan Monnier writes: > I understand it might be handy for your Common-Lisp implementation, > but you can already define your own `vectorp' to get the same result. I don't see that I could define one which would accept any vector wich any content, and be able to tell a "proper vector" apart from user- defined types. >> (cond >> ((vectorp x) (frob-vector x)) >> ((foop x) (frob-foo x)))) > > So similarly the above code should check `foop' before `vectorp'. That would still fail for the input [foo]. > Maybe the Guile guys are more likely to be wiling to make changes to > their system in order to better support some other language. No change is needed. Guile already has user-defined record types, which is exactly what I want. Maybe I should just wait for GuileEmacs, but as you wrote elsewhere its schedule is somewhat undependable.