From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.bugs Subject: bug#61660: [feature request] optimization of case-lambda Date: Thu, 23 Feb 2023 20:00:04 +0100 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_F34ADE83-2623-4EDD-B3D7-51826DE61386" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6110"; mail-complaints-to="usenet@ciao.gmane.io" To: 61660@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Thu Feb 23 20:01:27 2023 Return-path: Envelope-to: guile-bugs@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 1pVGqN-0001UY-KF for guile-bugs@m.gmane-mx.org; Thu, 23 Feb 2023 20:01:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVGq1-0003pG-3c; Thu, 23 Feb 2023 14:01:05 -0500 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 1pVGpy-0003os-Q2 for bug-guile@gnu.org; Thu, 23 Feb 2023 14:01:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVGpy-0005hA-DK for bug-guile@gnu.org; Thu, 23 Feb 2023 14:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVGpy-00007P-3w for bug-guile@gnu.org; Thu, 23 Feb 2023 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: lloda Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 23 Feb 2023 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61660 X-GNU-PR-Package: guile Original-Received: via spool by 61660-submit@debbugs.gnu.org id=B61660.1677178816378 (code B ref 61660); Thu, 23 Feb 2023 19:01:02 +0000 Original-Received: (at 61660) by debbugs.gnu.org; 23 Feb 2023 19:00:16 +0000 Original-Received: from localhost ([127.0.0.1]:35346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVGpD-000061-Rh for submit@debbugs.gnu.org; Thu, 23 Feb 2023 14:00:16 -0500 Original-Received: from mta-09-3.privateemail.com ([68.65.122.19]:25013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVGpB-00005j-Tv for 61660@debbugs.gnu.org; Thu, 23 Feb 2023 14:00:14 -0500 Original-Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id 7427F1800234 for <61660@debbugs.gnu.org>; Thu, 23 Feb 2023 14:00:07 -0500 (EST) Original-Received: from [192.168.1.105] (unknown [51.154.167.214]) by mta-09.privateemail.com (Postfix) with ESMTPA id 14EE318000B3 for <61660@debbugs.gnu.org>; Thu, 23 Feb 2023 14:00:06 -0500 (EST) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10553 Archived-At: --Apple-Mail=_F34ADE83-2623-4EDD-B3D7-51826DE61386 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Patch attached, tests tbd. Thoughts? --Apple-Mail=_F34ADE83-2623-4EDD-B3D7-51826DE61386 Content-Disposition: attachment; filename=0001-peval-reduces-some-inlined-case-lambda-calls.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-peval-reduces-some-inlined-case-lambda-calls.patch" Content-Transfer-Encoding: quoted-printable =46rom=20a1f605598a7a49b2971072c8db635b788e209e3a=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Llorens=20=0ADate:=20= Thu,=2023=20Feb=202023=2017:38:10=20+0100=0ASubject:=20[PATCH]=20peval=20= reduces=20some=20inlined=20case-lambda=20calls=0A=0A*=20= module/language/tree-il/peval.scm=20(peval):=20Reduce=20multiple=20case=20= lambda=0A=20=20in=20=20trees=20according=20to=20the=20number=20of=20= arguments.=20Lambda=20cases=0A=20=20with=20more=20than=20required=20args=20= (either=20optional,=20keyword,=20or=20rest=0A=20=20arguments)=20are=20= ignored.=0A---=0A=20module/language/tree-il/peval.scm=20|=2015=20= +++++++++++++++=0A=201=20file=20changed,=2015=20insertions(+)=0A=0Adiff=20= --git=20a/module/language/tree-il/peval.scm=20= b/module/language/tree-il/peval.scm=0Aindex=207945fd9b9..5c9799edb=20= 100644=0A---=20a/module/language/tree-il/peval.scm=0A+++=20= b/module/language/tree-il/peval.scm=0A@@=20-1668,6=20+1668,21=20@@=20= top-level=20bindings=20from=20ENV=20and=20return=20the=20resulting=20= expression."=0A=20=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(log=20'inline-end=20result=20exp)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20result)))))=0A+=20=20=20=20=20=20=20=20=20=20=20= (($=20=20src-proc=20meta=20body)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20;;=20If=20there=20are=20multiple=20cases=20and=20one=20matches=20= nargs,=20omit=20all=20the=20others.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (or=20(and=20(lambda-case-alternate=20body)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(let=20((nargs=20(length=20orig-args)))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(let=20loop=20((body=20= body))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (match=20body=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(#f=20#f)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(($=20=20src-body=20req=20opt=20rest=20= kw=20inits=20gensyms=20body=20alt)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(if=20(and=20(not=20opt)=20(not=20= rest)=20(not=20kw)=20(=3D=20nargs=20(length=20req)))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (revisit-proc=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(make-lambda=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20src-proc=20meta=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(make-lambda-case=20src-body=20req=20opt=20rest=20kw=20inits=20= gensyms=20body=20#f)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(loop=20alt)))))))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(make-call=20src=20(for-call=20orig-proc)=20= (map=20for-value=20orig-args))))=0A=20=20=20=20=20=20=20=20=20=20=20=20= (($=20=20_=20_=20_=20vals=20_)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20Attempt=20to=20inline=20`let'=20in=20the=20operator=20position.=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=0A--=20=0A2.30.2=0A=0A= --Apple-Mail=_F34ADE83-2623-4EDD-B3D7-51826DE61386--