From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Compiling a recursive macro Date: Sat, 13 Jun 2020 11:49:21 +0200 Message-ID: <87h7vfi9cu.fsf@web.de> References: <22b55d6d-f719-98d9-f8c8-e72e7fc43497@gmail.com> <87lfkt47bl.fsf@web.de> <87ftb1469o.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102320"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Douglas Lewan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 11:50:58 2020 Return-path: Envelope-to: geh-help-gnu-emacs@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 1jk2oU-000QV4-7h for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 11:50:58 +0200 Original-Received: from localhost ([::1]:53940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jk2oS-0007Wk-Ua for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 05:50:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk2n0-0007WR-96 for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 05:49:26 -0400 Original-Received: from mout.web.de ([212.227.15.4]:41433) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk2my-0006d4-I2 for help-gnu-emacs@gnu.org; Sat, 13 Jun 2020 05:49:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1592041762; bh=9hi88jFVd0CDn2Qy459J2vmpb+0zKijFcuXR3UKYuiE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=pdCXkw5Wdhf5XpgJDDIfTdK7QauJbLrtuzNSfRFTACclcsOZcj0q6rNnbQ1EsLsTu +os98LiVuMyRWW00wOQYXzOEXueIcwveAPrzv8ojzZPtJEXRi1BJaxsp7B5zFt8jRE +zk+hKuAdyZMTs5LYG5G5Kd70Y9MIxpWKf73ZHOk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.217.119.187]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M3Ez3-1jlQlg3YEv-003dvM; Sat, 13 Jun 2020 11:49:21 +0200 In-Reply-To: (Douglas Lewan's message of "Thu, 11 Jun 2020 22:10:19 -0400") X-Provags-ID: V03:K1:MnLrK+UTjDvlsQ9/ppOF9TwjxuFos0d27cirrinZYeEVoYr8ghr I1kQ8N/gn28ZWEXwbw34Dk0H9ek/FXF9pUwHJ7ChAraW8GsSpMK7TnqqPFgS3ev7JsMLZbd SpwkYc+UxbpeNZsIHOZMqhD7n/5t+Ws7tTxZG+dgLkBcQuJCGDrIgqVLmAnD3MUrkaFbgBV QYRhnLZKDf/R3EZ+t5ouA== X-UI-Out-Filterresults: notjunk:1;V03:K0:I1BXp30JCj0=:UTBiE2YykUuxO/sZzasMWj 0Mq6YSeBjJMQc4kh4vhsUHp3Fd+s1ha7FQnwPHZBB5x1b0Bo1ays035E1fTNHLtEY9poTO0JP s+9TowNw/lj8oI/MU3pNi5JetVCSj3Ois1M54ImBnyucdqV4dx8t8AnoaMXt+7r/lRO28Py62 LuiZSYPES175M7wp7e4+dxNm2DNxUNUUCg5h5ej6wDpNF9MpbC4dMdFSkDpaSmFAsE6Uhrf/o mMRQ2h+SqweTRHmgEMQb4DIbWjHBHlmAvvanFyFufOOMAe9+X6LtvsW6kCt/aFDkmDGtVgrhk adKXD1Wc0UJuDIgM1T9y/hAVQmT0v1NJ6KGrri8s5tn3/tknHxIb7Mm228TU8lDSQOZbhwIBf U5JrMgIjeMMzz2pMR8IAWiXl0pfVuv62UErVg668NwpRHkgl3RWAQECTEE4+Rx/s2+nU6E8p3 Tdbdj+hvFRVDQJyjD2Eb9g/aGgwaqfEYeG6yvOfye7Y296g6g0T1GZPhWJ7Ctjhs0yOC0Ssxw 6JQTsX4i2FyQw5n+HOcWOkpAhfMFItyg5Uxe92D1J8gQZY+Nlp5fbCbDzAKxKPDfqqK9R6+tc hkalmXEn+hzw0kjo49dtkzDKmAIEzdCOycR1V2Pwp0R1UoHf8VDVLPamC4ZvYAOU+AkibV58H Suh0GUDI3fLzw0Nq5c1KMHY34dzx0JTP39uHoV4ftPtFEi2uWg8jrV9Y7flVO4n8XdoKoy0QH anCW2XKak8FHbS57gnp4wq/r7jpkCWCFEy/2I+xuzLXfAg7Dw8x9qs7F6LCHhCGm1wSV5xPA Received-SPF: pass client-ip=212.227.15.4; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/13 05:36:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123365 Archived-At: Douglas Lewan writes: > I managed to lose the last response to my original question, the one > with the case_ macro. Here it is for reference: BTW, if you didn't know: `macroexpand-1', `macroexpand' and `macroexpand-all' are your fried when playing with macros. BTW2, a small problem with your posted version is that it adds one `let' binding per branch, but only the outermost is needed: (macroexpand-all '(case_ x ((1 2) t) (3 nil))) ==> (let ((#1=#:g772 x)) (if (member #1# '(1 2)) t (let ((#2=#:g773 #1#)) ;; <--- here (if (member #2# '3) nil nil)))) That is not harmful but a bit inelegant and inefficient. Michael.