From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Some new vector procedures (vector-{memq, apply, to-string, ...}) Date: Sun, 21 Apr 2019 08:50:05 +0300 Message-ID: <83mukjaovm.fsf@gnu.org> References: <8736md90v0.fsf@gmail.com> <83lg05b1jk.fsf@gnu.org> <87lg047h9n.fsf@gmail.com> <83y344a97a.fsf@gnu.org> <87bm107d7q.fsf@gmail.com> <83tvesa3w1.fsf@gnu.org> <877ebo6s63.fsf@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="146013"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Alex Gramiak , Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 21 07:50:36 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hI5N1-000bnl-Ph for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 07:50:32 +0200 Original-Received: from localhost ([127.0.0.1]:49277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI5N0-00014Z-Mm for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 01:50:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI5Mu-00014M-GE for emacs-devel@gnu.org; Sun, 21 Apr 2019 01:50:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI5Ms-0000ms-DV; Sun, 21 Apr 2019 01:50:23 -0400 Original-Received: from [176.228.60.248] (port=4948 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hI5Mn-0008L2-Ew; Sun, 21 Apr 2019 01:50:19 -0400 In-reply-to: <877ebo6s63.fsf@gmail.com> (message from Alex Gramiak on Sat, 20 Apr 2019 19:52:36 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:235727 Archived-At: > From: Alex Gramiak > Cc: emacs-devel@gnu.org > Date: Sat, 20 Apr 2019 19:52:36 -0600 > > > Vectors are used quite rarely in Emacs Lisp, IME. > > Not enough suitable vector procedures doesn't help, though. Emacs Lisp > is certainly not a general-purpose language, but that doesn't mean that > it has to be missing particular language features/types that improve > efficiency as long as it doesn't add a lot of complexity. I actually think it means precisely that: we don't need to expand the language just because some feature is missing, we should do that only if said feature is important for implementing Emacs features. The dynamic nature of Emacs on the one hand, and the efficient implementation of lists OTOH, are the main reasons why vectors are rarely used in ELisp programs. I think most of the uses are for objects whose structure and size are known in advance, and for objects that are read-only from the Lisp side. When we needed a vector-like object that could change its structure dynamically, we invented char-tables. > > Every additional primitive means a burden. More importantly, we > > should IMO be consistent in how we design and implement families of > > functions, which is why I still think we should extend seq.el > > (possibly some of that with internal C primitives, if needed), instead > > of starting a new family. > > I'm not sure what you mean here by internal C primitives if it's not > similar to vector-memq/member. Do you just mean expose a single > `sequence-memq' and keep the new type-specific implementations internal? When a C implementation is justified, yes. Anyway, I think I spoke enough about this. I will now let Nicolas and others to chime in. Thanks.