From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Shrinking the C core Date: Mon, 11 Sep 2023 22:10:33 +0100 Message-ID: References: <87ledwx7sh.fsf@yahoo.com> <877cpfybhf.fsf@yahoo.com> <873503y66i.fsf@yahoo.com> <87pm2oe9a0.fsf@neko.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36680"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, Drew Adams , arthur.miller@live.com, acm@muc.de, luangruo@yahoo.com, emacs-devel@gnu.org To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 11 23:08:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfo9L-0009J3-3V for ged-emacs-devel@m.gmane-mx.org; Mon, 11 Sep 2023 23:08:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfo8a-0001Gu-2T; Mon, 11 Sep 2023 17:08:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfo8Z-0001Gj-Cc for emacs-devel@gnu.org; Mon, 11 Sep 2023 17:08:03 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfo8X-00043v-3v; Mon, 11 Sep 2023 17:08:03 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-502a7e1bdc7so4272276e87.0; Mon, 11 Sep 2023 14:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694466479; x=1695071279; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P6ev/5UFx9TWAM+FNvR2WofU5xsOOztf49SBfsV+3Qw=; b=PkdEmewjKvsfZD1z2M6KEOpNhMBherAAIRoJALMpgqP1gAvBd5Gvg6p2tq9f9kKxZj Hlg0Ws18EEOwENbjdDtMMal4sBYPblVvtow4xT86dT3i04vysk8cgemIJg/9qV8VLr38 /mqfRGtF+1DU7m2ysfz14yyucEfZPkODOQg4eE83vdYUTAvFoTjB+wug+FGJLqAFBavY ORsYdDDqEJuFoRL5ovgsTu2hFqYpq7likgsnR4fGy+25K88h+rJ8a6h6KruJKs7skx3F JGOx668zeuYym4dISCIJEcHmYBdSksamkkJJv+tAkQZ3huDPguWfT8sLyTnmCNzHdigW ra2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694466479; x=1695071279; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P6ev/5UFx9TWAM+FNvR2WofU5xsOOztf49SBfsV+3Qw=; b=p4TyiRed2LPWhIFy5fUPzQ7FToKvfA0ouoR4JEZzDobLenp2n9ERGXDu3I+6TCr/2r ZTssnT5zo2sSk0g2T72DXe8muwCxIrJmI+iFjPKadjARsguQyX1fB/1njpIEzNN5TJUx lz+wlwC1SRrtpLczT2QEsi6ksaCaibUEv3V3XGeDPe3t1xOYtnC7FRtmpXFSNl17LT5L 7/iJcubkEavjvC0djlKewLdEjUgb/S7WAUTWUaDzN3CoxUVNq7pX52+1fjrjHyTrLuQ2 X9TEKpF7ukg5kcR9/XTJKH3dCXw/gIrKJtI1QKsP4z1XcQbQf6XY1PMv7TB8BZN4YkqG Uy+g== X-Gm-Message-State: AOJu0YwQg/ekArMni9SLOB61pQfgxVEgpotynCiFZ/ji/YeJ1QkGS54Y /L1JI8oa+r0aQGiG3SxYMhCYy7EjYgfM+1YIFZs= X-Google-Smtp-Source: AGHT+IFjeHxGEvweewU+/+l8aMcdPqC1UFfKBWvkhQ0X/Pck9RaYLMR3zwKN784w8GQydk2tyu+8izLam06iG7qyGLs= X-Received: by 2002:a05:6512:398f:b0:4fb:893e:8ffc with SMTP id j15-20020a056512398f00b004fb893e8ffcmr10172726lfu.17.1694466478368; Mon, 11 Sep 2023 14:07:58 -0700 (PDT) In-Reply-To: <87pm2oe9a0.fsf@neko.mail-host-address-is-not-set> Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310481 Archived-At: On Mon, Sep 11, 2023 at 9:37=E2=80=AFPM Tomas Hlavaty wrot= e: > not really, it seems that CL:SORT is a bad example The example was for comparing to Emacs's lisp 'sort', where IMO it's much easier to do (cl-sort things-having-foo #'< :key #'foo) than (sort things-having-foo (lambda (a b) (< (foo a) (foo b)))) As to the advantage of @key key vs &optional key it is -- in my eyes, at least -- that you already know its meaning from many other functions. > (btw why two functions and not extra stablep keyword argument?) Why not? Maybe that makes passing sort and stable-sort to higher order functions more practical? > it could have been defined as: > > sort sequence predicate &optional key =3D> sorted-sequence > stable-sort sequence predicate &optional key =3D> sorted-sequence > > and the same could be done in elisp which would be backwards compatible Sure, but if according to your conjecture Elisp's grew a &optional arg, why couldn't it grow a &key arg and be backwards compatible? > > Let's look at a traditional Elisp macro define-minor-mode. > > the usual CL argument list does not seem to be able to express arguments > of such shape > > it looks like whoever extended the original argument list did it > "weirdly" using custom ad-hoc single-use argument list parser. Quite likely the cl machinery wasn't available at the time... But yes, Greenspun's 10th. > > are maintenance hazards, the macro now accepts keyword arguments > > in CL, the arguments would normally be in a list before body, something > like > > (define-minor-mode MODE ([KEYWORD VAL ... ]) [DOC] &rest BODY) OK, but this is irrelevant. This is a macro, not a function. For all practical purposes it was extended with keyword arguments. In fact you could have used cl-lib's cl-destructuring-bind. Jo=C3=A3o