From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Docs for &optional and &rest arguments together Date: Wed, 30 Dec 2020 13:19:47 +0100 Message-ID: References: <87o8icq958.fsf@gnus.org> 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="9431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 30 13:20:42 2020 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 1kuaT4-0002KV-DZ for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Dec 2020 13:20:42 +0100 Original-Received: from localhost ([::1]:59532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kuaT3-0006US-FA for ged-emacs-devel@m.gmane-mx.org; Wed, 30 Dec 2020 07:20:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuaSI-00064w-D9 for emacs-devel@gnu.org; Wed, 30 Dec 2020 07:19:54 -0500 Original-Received: from mail-am7eur06olkn2063.outbound.protection.outlook.com ([40.92.16.63]:3040 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kuaSG-0003NF-25 for emacs-devel@gnu.org; Wed, 30 Dec 2020 07:19:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XGW4/fs6m6NNwcmkX+e0jYxMSljiMEP/IaRKsny1w7PAlvs8YiCzkxyP/2GgG4Mxqc12mRlZt0UUHYFqzsRORcMS7f1u4IHLymzfgbZodiD+Z4TN01quhRxsHhf4s5TaiU5UIzbeTtiWMsyWMN1VmqdUbOaocDYzm/y/82/pjmYbWlutfo2NMsCCe9VSPW4zAT7++TbHalfmxvlY1xE8pXKnL/EqK110g22WiuclDaVzurRzqLPmMBhB0ttXcahaQjXJCyPgvI+1z3UQDPTuq46RpOUg9vrNwAt+8CAfGjY5k8Ok4uE0n040uNkL0TpuE01y7jyuhJevaKUe0VgmGA== 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=+aUX4/m45yq4QZPI1Dp00jfi234A0HFpZ6ecWwawnUQ=; b=JYcTQKFP5jSQuN6nAT7rbU0UwDT3kCjK4CO1fvWR9sMh7zqrEZVGGhbrdqq2RH+Qz6q4st5OQiqM/flksJ70qKdb6sCLZGmy2TB49dSEUQrifP4zQIaYopHKKBIkCwsY3Q1HLRRiUTbK/vvtID2fCG1dkuDq0+HsZLr6+789HPG0o0JAf2dYwxhYD8Zd8NVZl9vULdTibSuBItIr8vJMGglvuuGa5n4RWu7dgWRt1d+bEAcvMDrlJVtoPjsPfKJ/eUYfWSQ1RlJMmGlhSOVPt0NaDUer+rhh5qiV5CUie4yNeHTBMA7dsnOajNBRKwpUxEYjuBZqAsljcIiY04G2jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+aUX4/m45yq4QZPI1Dp00jfi234A0HFpZ6ecWwawnUQ=; b=HUXBVSGzutbetj17CXdtlNnLlvziZU26wCnvHv4JnTEg0VNDjvJdg8/ZoFua9ldbtY7oQlpuoCK7Nr7ueMwydOlS5xRvq06oJq0P02AS1AuvjRPIP/jX/K6Qwo1hW5CVXdISvtSyPdBPcIz5E8cytj2150VSuQbyStCXZVCNNCNuyaO2rf75yBDWCTX6wl1KUBs75ZgjBSVMJA+tIK86qtpSEB4CzzVY1Tao4c+TjBlR6i+trJSUYQMr5u9JLHv/hGk9WNEVsJUSV/uFmXtRHh1yBz5D5RBiJsMAW2tb2tEdkT1j9rgrCajwxrckHi2nl4acKCsBCUfulFXI/0CWAg== Original-Received: from DB8EUR06FT064.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::44) by DB8EUR06HT027.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::444) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Wed, 30 Dec 2020 12:19:48 +0000 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com (2a01:111:e400:fc35::40) by DB8EUR06FT064.mail.protection.outlook.com (2a01:111:e400:fc35::413) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Wed, 30 Dec 2020 12:19:48 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:78E4134433660A1E42A960CBAED2B5BFF84E53C63BE9F96AA68FFBDB0D213CCE; UpperCasedChecksum:A12F5FDB84747CA28859E401C0EA4933BD9BE17E532F001FA7FD2B476F455554; SizeAsReceived:8664; Count:47 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993]) by AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993%7]) with mapi id 15.20.3700.031; Wed, 30 Dec 2020 12:19:48 +0000 In-Reply-To: <87o8icq958.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 30 Dec 2020 04:12:51 +0100") X-TMN: [LKd5zAx+QpmfNjcr0tBFFfpu7xC0SeBf] X-ClientProxiedBy: AM7PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:20b:130::16) To AM0PR06MB6577.eurprd06.prod.outlook.com (2603:10a6:208:19a::23) X-Microsoft-Original-Message-ID: <87ft3niizg.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM7PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:20b:130::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Wed, 30 Dec 2020 12:19:47 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: cde61891-70fe-4b2f-f83a-08d8acbd3384 X-MS-TrafficTypeDiagnostic: DB8EUR06HT027: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QeRhDA0Dp7fBVpcHG4AeVcCUfWqCNcBZ7AUYjd2fwUjDe1JFcwcxbb2zAxqL+iKxyMRPegOCl9pOVX7VttBtTO1K7GdCR6ZzyrHke26gSGwmvDS9RLfC8ZWRumETD1EbDUIsL2+AcDcv2pT26tI7gplidKjKzrFC60aePBxGOYVtYMLk15n8zicYhKBMmAriKTsJr2v++rn0X0PJqeGWSVDimuKYE6dO6LkX2I475aj5BmHPsbqTCSrPVVlVwiJtNudvlE4d6Nb5g6FOps5nXw8JsXs9yyqaMTp6ae9Jn5A= X-MS-Exchange-AntiSpam-MessageData: VB7qzQjWd/G1v3O8KlencL5JqwavwCky2pILWjvh6VXMwILpKkd7Hy6m2DSWnkB7TxjDFgnrhLJhuUG74nB7MBZZrIv4QIp5DJL5W3HWdBUTD44bR7sBqclNA6E5DRtH/c7WCfbBk9Kqtiv3LGqqww== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2020 12:19:48.4918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: cde61891-70fe-4b2f-f83a-08d8acbd3384 X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT064.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR06HT027 Received-SPF: pass client-ip=40.92.16.63; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.23 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" Xref: news.gmane.io gmane.emacs.devel:262123 Archived-At: Lars Ingebrigtsen writes: > Arthur Miller writes: > >> (required-vars=E2=80=A6 >> [&optional [optional-vars=E2=80=A6]] >> [&rest [rest-var]]) >> >> But when I use it, I still have to pass a nil for the "optional" >> argument, which I think is also not so strange either, otherwise how >> will Emacs now where "optional" argument list ends and where "rest" >> argument list starts? No? > > Right. > >> If actual arguments for the optional and rest variables are omitted, >> then they always default to nil." >> >> https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.= html >> >> I get the impression that I actually can omit the optional argument(s) >> even when followed by the &rest keyword. > > The paragraph just below this one, though, describes in detail what > happens with a mixed &optional and &rest argument list, so that's not my > impression when reading that node. "A call to the function requires one actual argument for each of the required-vars. There may be actual arguments for zero or more of the optional-vars, and there cannot be any actual arguments beyond that unless the lambda list uses &rest. In that case, there may be any number of extra actual arguments." "If actual arguments for the optional and rest variables are omitted, then they always default to nil. There is no way for the function to distinguish between an explicit argument of nil and an omitted argument. However, the body of the function is free to consider nil an abbreviation for some other meaningful value. This is what substring does; nil as the third argument to substring means to use the length of the string supplied." Which part of the doc does it say that &optional argument when used together with &rest, makes &optional argument mandatory, i.e. can not be ommitted when calling a function or macro?