From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: FW: [External] : Re: Why is defun not executed during load-file? Date: Mon, 7 Jun 2021 14:18:56 +0000 Message-ID: References: <87k0nfesns.fsf@zoho.eu> <87mtsbd31w.fsf@zoho.eu> <87a6oad81r.fsf@zoho.eu> <87a6o22z81.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emanuel Berg To: "Help-Gnu-Emacs (help-gnu-emacs@gnu.org)" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 07 16:19:49 2021 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 1lqG6W-0006aD-Rn for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Jun 2021 16:19:48 +0200 Original-Received: from localhost ([::1]:51032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqG6V-0001Vx-Qd for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Jun 2021 10:19:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqG5s-0001Qh-Nx for help-gnu-emacs@gnu.org; Mon, 07 Jun 2021 10:19:08 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:34180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqG5q-0008B7-8A for help-gnu-emacs@gnu.org; Mon, 07 Jun 2021 10:19:08 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157E9mAt118141; Mon, 7 Jun 2021 14:19:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=+xSeXNdcxkIo0P44rVendVB3+rsAyDNXVSVQutIDulI=; b=nMeEHmFXkrAI7vworHkBOwoYqbOuJSyJ5AVJv4UAw0Zo2HS15y/dXH183FTVBStkYSDg 4wb2zK+CCS5+3Qw4HbBhgPfj0RcxsvevMERH0I2lxYkV58RsVenaZZ7s9vJ8LDakNh/s 7jrQRiEXRsEzIuatDGRAZoPrQqoMO3ZqgifIZmlMlUC0y78cd3SJhLUNac4GSn6czJdo fpHunZY0NAqppnaQc0G+Y35gIyRGp31LDIItD+kOeOl9xBHxgBpNwusSQUtrbNmp0klh Lt2Q6sSJO95Z+wraAj5gtdYNgxtBoEjNkdbKtWIpC2Bptux2WbDWTDb3UryJCd0e7tJI FQ== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 39017nb6cb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 14:18:59 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 157EAKa2067884; Mon, 7 Jun 2021 14:18:59 GMT Original-Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2040.outbound.protection.outlook.com [104.47.51.40]) by userp3030.oracle.com with ESMTP id 38yxctvu0h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Jun 2021 14:18:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bX+zfPWOYkF7/F3yNmXA+s1oNWcBe8fRSpC0tO68gxwf6OCKxTZ65CcU7qh/xn+Pz/Lh6cxovILvCGcTTITfwU5+Ytkvaa0u17hFkHYG2XC4a9+p0/TDEsbKSKhDkNTWQ1TAhFPaNrA0Ha/4JEc08xFdndCzl86N+/31jlc3zz9/jq/9H01FKNKrOEe2r3qySixazHl685HxhSNN2eba1FuMFS4Cl8WVBVYDFcNGCdj4H2gK6/t4bdCfMDXiQqdtwF0dqRREnsQ4o0F0hSGJggbNV/ul04Y8yLklB5CpnQ6B0eCAFZquqhulnEvGT0/eQlGsBYuFcUHEQmBgHW76Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+xSeXNdcxkIo0P44rVendVB3+rsAyDNXVSVQutIDulI=; b=mKSYuWF0eJu6URzf2frBtrs2htP/oEMMrGz4/d+fc25siJyXhOhBIiJlpNXHn7NXPTeVQFY8pbEXzk1+wBdwT+6uHyJwJOJQG1NVNc++dTo2n5rIoNi4wQ2o9KBv5CQ/cYQjkOvAi2ZYhMLSl0VKYiUgUxFchtttt60UJyhwrbmRQy0SB4EgFZdAChe8knNXFZVXlM54xi2eY9fVSNrUyVzNEDc6aqPjprGJ1C3nI/uqKoPwUcNT9fywVBv8daSb820OcwzbVAkFbNdlzbH3Wv9kPT44UUKvs9ShP5xr+jp1PocyuxHU0tfzIAI7XDx+FUky50fG/noOAfbcL7CXHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+xSeXNdcxkIo0P44rVendVB3+rsAyDNXVSVQutIDulI=; b=aMhG/asQySvkR+Vt+Xpx8ZDggy4S3s0ppHfKk/dhMObvSWcoatgO5eYL9PVYP2EFcECQ9a9LDWCYDJsAKjSvrc0TR5Bh3sgyQYrdsLY8B/EKXX/wkDb67xsvjB3266QnMXNBMf+GhGLf5LJ4e+K7OO33Iqv5dkWT8i71zvE+A3Y= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SA2PR10MB4636.namprd10.prod.outlook.com (2603:10b6:806:11e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Mon, 7 Jun 2021 14:18:57 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494%6]) with mapi id 15.20.4195.030; Mon, 7 Jun 2021 14:18:57 +0000 Thread-Topic: [External] : Re: Why is defun not executed during load-file? Thread-Index: AQHXW0OZxLrwGypw0k2vXGWqE5fGCqsIkzCggAAGUGA= Accept-Language: en-US Content-Language: en-US authentication-results: gnu.org; dkim=none (message not signed) header.d=none;gnu.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 04da9435-f987-4954-64e7-08d929bf3005 x-ms-traffictypediagnostic: SA2PR10MB4636: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3at5hu6Puf6JdiYxOu+YePhVEIv0W9xiN0WbjpTFZo0S/AnlcANxofz8yiallhnIqTqTXH3nkyI6iLuGIaumUJ0zXX60akKIr3/SVu90ovgzUznlU7+TAkyp7j3gDy8kmihTADw1bj/VDS/4/PmWiqn1bRJHMkhJ+O8lCEs46ieYSbpdYMRHiyP9jkRNrNopF1TWNcRls43094+ZYdqVdz1t8OaqknuD/HnLC+yHMoM8pAvNqSaaQkaB9mvvWGFmXIA4gOxuEYsUN1ZmfUIe2PcS30bn5ZtZuFbRjVAOad854NWIkhtWJIDmKV1ziLVbi1UGQSjBnks3k4Xzje9wZtMgsCvR5/ht5Y6ohFJDvOkuWe1CYvxhZe1tVu3OaURX637430PXuwfvEgfHA7X103nhHdp9cwM+KcVOOO2I/qoZabBvcxwKlpoz7aGFXfE2SdC3lyTdcjO0VFJDoltgSS93CEC6yFZgincvlSkfJ1URJ1htD1J0Hyu8gAIhuRGPtzswCOWoXPNEzE6LDF4QpajZ4EzWyWyf4LmVmbNUoevc8Zvgp4mxbE4R64NvT/OrDF4A4DhhCKuNZ2n6nNjHrYaT0zpa94BZN1YO2AThjodaZfW0Rb8wO9uKvMKxkaVazm+t8mBjo+Z0iKTEe4fn7Db2QgR9Uzj/uUOogn7OYdxsbQViZByG6B7ykDoV69cSRmdHiCrvVw5VXkPJEAWglFZlezimFeA+RwtvATQbE1w= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(346002)(39860400002)(366004)(136003)(376002)(396003)(7696005)(5660300002)(83380400001)(9686003)(55016002)(52536014)(8676002)(66446008)(6506007)(64756008)(44832011)(66946007)(26005)(66556008)(66476007)(8936002)(186003)(76116006)(86362001)(122000001)(316002)(38100700002)(33656002)(478600001)(966005)(4326008)(2906002)(71200400001)(6916009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?gipyl44WOMd26U/kvN2lwUbN46dWJnA0Dw46ZBEtufJ9w14BjS9oXtPIkMPB?= =?us-ascii?Q?4+SFCLyNcyRYD2mV4ZZkrQL7cNVet+U8e+hRScVVhLWI4GmMsUjmikCHfjim?= =?us-ascii?Q?nDP09OaxaO7ppf4lOC4QScBuubU3su3UVzaSYfRQpmJxa+bNTZMshFiJYh6B?= =?us-ascii?Q?5Q5FkoDPZh5QO8wRGCq4CRAV4A1fYnI2iQ5BAfiDpc5XyNrqrkwJpzIZ/0/W?= =?us-ascii?Q?9rxJYg4z+uq+YlEGARRsGEzieMIF4rEUzfAiMVrbNY5aKhqo7QCx7BWNlyBS?= =?us-ascii?Q?s8mW6b5fURhFvlHf8tSQjnifQpQ0KfkgNKbj78KoRiwGiHKrckTI6748ZlMY?= =?us-ascii?Q?XMdXxm8IKz++3MI0AaZjUMH4ng2P1U1Ocg5TwKETQur9gO3x9LK+sTSK8NWl?= =?us-ascii?Q?J8sRWTboB4R2w0P9JDBo0OGaQ2aMWnsKHAiqHKD4KZrTv7kPacNVvUBMYJpK?= =?us-ascii?Q?sZyQDmV/wZ+K6/HCXu7H/Vc1QkR68Io6kZ8K+WdVi/dpdm4H3bzNHEsxKcAg?= =?us-ascii?Q?GXmWQPCP+6o8cXTx4CotyhEGRg3uEe2I6/wODwMdGgHRFSKxO9Wk1qwFBtDq?= =?us-ascii?Q?GOfbKk+IaNQBMvtUnJRZIz9+XiyrXudT9F6hKWIilf/tQfFZuk8Wl7io1+/m?= =?us-ascii?Q?RT3D x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04da9435-f987-4954-64e7-08d929bf3005 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2021 14:18:56.9951 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bNsZ0jA1FJn7Gca6FYXKK9vhtVXSzxgWHmwuGW2/MYrdMPZV/xzRvZXAZ84bWgaVv7KKEB99pqSEJNMw3zR3vw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4636 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10008 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 mlxlogscore=885 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070105 X-Proofpoint-GUID: eAra0Y0j4Gmd4JHMernuR1awoHEdTWn8 X-Proofpoint-ORIG-GUID: eAra0Y0j4Gmd4JHMernuR1awoHEdTWn8 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10008 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106070105 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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:130595 Archived-At: > >> Hm ... interesting. Yeah, maybe we should start do that more? > > > > Not really: it's better to avoid macros when you can. > > But it's better to use macros than to use `eval`. >=20 > Ah, that's what I thought all along but it sounded cool when > Mr Adams said it wasn't evaluated anymore but reduced (?) ... Mr. Adams also said: If you mean use `defmacro' more or something, then let me be clear that I'm NOT suggesting that. I'm not suggesting that people should define more Lisp macros. In general, don't define a macro if a function will do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ what you want. I just wanted to point out that I think the supposed difficulty or bugginess of defining macros is due partly (largely?) to the fact that we (all of us) write macros much less often than we write functions. > Can one summarize in human language without references to Lisp > perhaps when macros are used? I used them so seldom I don't > know why people use them, even. I guess I did so good now I'm > ignorant instead. Syntax transformation: sexp1 to sexp2, followed typically (and automatically) by evaluation of sexp2. Without the evaluation step (i.e., with only "expansion"), a macro just substitutes one sexp (that's an expression - syntax) for another. When do you want to do syntax transformation? Typically to define a domain-specific language (which nevertheless has Lisp-like syntax). And "DSL" here can mean just define some accessor functions (macros) that speak more directly to the purpose/intent/meaning of the thing accessed. Another typical use is to define a control structure, that is, something that need not evaluate all of its args before invoking the body. E.g., a conditional or other predicate. You can't define something like `if' with `defun' in Elisp. You can defined it as a macro. I said all of this before, with examples: https://lists.gnu.org/archive/html/help-gnu-emacs/2021-05/msg01157.html