From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thuna Newsgroups: gmane.emacs.devel Subject: Re: Quality of life improvements to macroexp.el Date: Thu, 18 Jul 2024 15:42:32 +0200 Message-ID: <87msme6cl3.fsf@gmail.com> References: <87ikx62j5e.fsf@gmail.com> <87frs7da94.fsf@jeremybryant.net> <5421CEBD-571B-4C1C-9B55-F72DC4C89E5A@gmail.com> 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="39714"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 18 17:29:11 2024 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 1sUT4B-000AEl-51 for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Jul 2024 17:29:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sUT3Q-0002ui-QS; Thu, 18 Jul 2024 11:28:24 -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 1sURP5-0006wR-C5 for emacs-devel@gnu.org; Thu, 18 Jul 2024 09:42:39 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sURP3-0002hX-M1 for emacs-devel@gnu.org; Thu, 18 Jul 2024 09:42:39 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-427b1d4da32so2319945e9.0 for ; Thu, 18 Jul 2024 06:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721310155; x=1721914955; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SjS59fKCI1cMN5slZTatG9CmS9abm1823q6Xp3Sg82U=; b=P4fkl3WKPAxXVegELX+h7W1a5bMmBEFBQitVQl+KqHIvKvA0y03N1AIy9fnXjyY3Yc oRuEXyKxp8tA1JKE5KAe2ufPdvTl+a8GD+dS/fJy8cr0wgrVbOjmVinplOwhL66DKRVu jJOKWs37TfjXbMWAf/EBq9X9QaSrn3sOi3pIDCkmj2TtuzLi6+rCOrw0gS7sY0mEo4z6 M0m7dOyk+TuV5PGzobDb/8k2F9yNO3tAIekIQnQCJah/jBAIUL2MZAPEu2Eg3oeiE2Gk wxSEnImamNF007janO7vmiqVuy2nwOokz9ngDXh0CWyNYlwixan9ejNKT8XiXyUO2lD4 Sdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721310155; x=1721914955; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SjS59fKCI1cMN5slZTatG9CmS9abm1823q6Xp3Sg82U=; b=AC6aGnd3nm5kbrgpD2X+tly4pR5g+nQYcjwH5FChYfMWMcjS9qMJ8kofL6Z2+W27eo oJPkUmfygwybtRDQ8vdBTgor9A4ACqM5xXPV4gVSyRmnmnq1JshUUQXfe328nJkldsjz YuzA2y7EJRpEcWLFNQAQTSHKuFkOKwsPa+5WlMtjy9RclBTgCTrjD+F3cnfkGSdDNsK+ nkijTAYmdTZ6J+U9rKVntQnv743xbJGj/qEKrkpo2dPvf+JnVV0rBYYCT0sEzRruhHTk mMEdLt+ad0LAVLknY9R9PfGHDtWeCYt3uzTkoWlmVusyq8mkRPS+eU1bFvxyzvuAGlHh IdlQ== X-Gm-Message-State: AOJu0YzMXut2zh8P/tEXXG9FEryFpUI/67rkw9qJU4ZEoMr3Fvay0HSN cTRxFN2dlBhzgMzzKunQMMNlBSxVTcMvQDJdVtfBgjfEJ0txl4l1ff29RQ== X-Google-Smtp-Source: AGHT+IE/pThi0LjN9coz2CL76SQY3hMFReL7gidLqA1T3CLQbEEslun9AphNETU2wrq4FdAAqJW1iA== X-Received: by 2002:a05:600c:4f41:b0:426:5e32:4857 with SMTP id 5b1f17b1804b1-427d2af395dmr9441425e9.0.1721310155221; Thu, 18 Jul 2024 06:42:35 -0700 (PDT) Original-Received: from thuna-lis3 ([85.106.105.81]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2b3176bsm13911245e9.48.2024.07.18.06.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 06:42:34 -0700 (PDT) In-Reply-To: <5421CEBD-571B-4C1C-9B55-F72DC4C89E5A@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=thuna.cing@gmail.com; helo=mail-wm1-x331.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-Mailman-Approved-At: Thu, 18 Jul 2024 11:28:22 -0400 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:321795 Archived-At: Mattias Engdeg=C3=A5rd writes: > Hello Thuna, > >> I was just looking into using macroexp.el and found some features that I >> felt were lacking. These were: 1. accepting multiple forms in >> `macroexp-if' and `macroexp-let*', 2. flattening of `progn's in >> `macroexp-progn' and `macroexp-unprogn', 3. getting rid of branches in >> `macroexp-if' in case the TEST is constant (and consequently a way to >> tell whether a constant form is nil or non-nil). I've went through the >> rest of macroexp.el and haven't found anything else that stood out, >> though I might change my mind as I keep using it. > > If they aren't in Emacs, it may be because nobody else has felt the need = for them. > > Perhaps there is a misunderstanding of macros like `macroexp-progn`: thei= r purpose is not to produce 'short' or 'neat' output, but to avoid consing = more than necessary during the macro-expansion phase. It's just a (compilat= ion) performance hack, and not a very important one either. I expect that a non-insignificant number of people use packages such as macrostep (or plain-old `macroexpand-1') to view expansions of forms while debugging issues. To that end I would consider keeping a 'neat' output a desirable if not significant goal. Of course, it should not come at massive costs, so I would consider my sample implementations of `macroexp-progn' and `macroexp-unprogn' as discardable, given the heavy recursion.