From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vijay Marupudi Newsgroups: gmane.lisp.guile.user Subject: Re: reserved-keyword in macro Date: Wed, 02 Feb 2022 19:52:37 -0500 Message-ID: <87bkzou5yi.fsf@vijaymarupudi.com> References: <6f5e23754b7523f30e31d9006b0a5a1127d503cb.camel@telenet.be> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23295"; mail-complaints-to="usenet@ciao.gmane.io" To: Damien Mattei , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Feb 03 02:14:13 2022 Return-path: Envelope-to: guile-user@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 1nFQhQ-0005md-KD for guile-user@m.gmane-mx.org; Thu, 03 Feb 2022 02:14:13 +0100 Original-Received: from localhost ([::1]:47288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFQhO-0002Tk-6b for guile-user@m.gmane-mx.org; Wed, 02 Feb 2022 20:14:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFQfy-0002SL-Dn for guile-user@gnu.org; Wed, 02 Feb 2022 20:12:43 -0500 Original-Received: from mail-co1nam11on2106.outbound.protection.outlook.com ([40.107.220.106]:9024 helo=NAM11-CO1-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 1nFQfu-0005vg-SK for guile-user@gnu.org; Wed, 02 Feb 2022 20:12:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKjea2PmKXtl26f0rkLrpjkELfOwQ1OWgWNTe/TvXJYhvrrdMhWCtz23BRala8qaenca+TWj4nJnxCq2yPYyVwJY7FmjamzK7RC1fUGtZkVIDBpj4OzqJ8yDuw3MK+7u/3oTMaRXE9KpRA/LQU+QZcPXUPejxLh/H11ZsArE8BjCEfrCee5vuqy9Ea0mQlc7UXFgmLxpgbqDg/RLXQOq/mBj+u0tOcoDC8Jw12rUxJIirGVyvBL9fdPqV3/xgR2UAF8DNrphxuT4fLK894TPJ+zoAFTEkIzPULouK+7mqfmBni8oCaXp6emCbzRLDeoOkv5Vc9LcAueAfVKUgeorww== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5RVfztKayr9EP72QuG33IEcizKESmPJolONv3crXz+k=; b=KaNrQ07por8v1IqHTN8dsyfZ1QnlKPIdH3x+WYrJPhLnAqkCn0qmcumV2eR3kaUIfjpTUy66Qw6oApHSkfH8q105woMQR5asf+5xys++aJHX4ABNti+D0tuopvpAYvDT/ja6uX0ushHJrTd9gPd/t8ZNNPtaomkRJe3WxaZfRf0DNNsR1ZrZRGsCbTg1FNBGOVBmW2QH+1SHQKgcz7fRNESI8uaFnLGPIBRCFLBb47yhZbWEpzLb29W3+CYcZZzYTBLH71+HJf5oGSRMHfibBLlnRvrWMn6SBN9jhZm5n0qmBf6RCl3MKBArzDFvLc45IXpVkh/+LIz/ii8dxziXmw== 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=gatech.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5RVfztKayr9EP72QuG33IEcizKESmPJolONv3crXz+k=; b=PoPPCBW92FnAqre+oM3B9/X45/dG+zUiToEoT5R/TnZW7UG5d073B2RBXLtOyUwNZjbXrKaaWbGPXVToCl9rwLf9xvMN52M0eGdsEgwImNcK0A+yBlZX+MmVMkRzEXmw2kwd7YDss/xkwhBQIl4xpDYlrEJLdxT5HYm6rvMCYH0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=gatech.edu; Original-Received: from BN8PR07MB5793.namprd07.prod.outlook.com (2603:10b6:408:9c::19) by BN7PR07MB5140.namprd07.prod.outlook.com (2603:10b6:408:21::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Thu, 3 Feb 2022 00:52:50 +0000 Original-Received: from BN8PR07MB5793.namprd07.prod.outlook.com ([fe80::e11f:6b87:d3e8:b079]) by BN8PR07MB5793.namprd07.prod.outlook.com ([fe80::e11f:6b87:d3e8:b079%3]) with mapi id 15.20.4951.012; Thu, 3 Feb 2022 00:52:50 +0000 In-Reply-To: X-ClientProxiedBy: BN0PR04CA0173.namprd04.prod.outlook.com (2603:10b6:408:eb::28) To BN8PR07MB5793.namprd07.prod.outlook.com (2603:10b6:408:9c::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62eb46d0-821b-4cb7-67b9-08d9e6af8087 X-MS-TrafficTypeDiagnostic: BN7PR07MB5140:EE_ X-Microsoft-Antispam-PRVS: X-GT-Tenant: 042d12d7-75fe-4547-b5b6-0573f80f829d X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CCgioxxhnnCD2rX7RtoYSFUajgIv2WHuLjP75LHNELDdSH+F1ijCQSpGtpRIvBwBFyAaKwhZ5o23nBBL30iqymzEpeDcFZGgwRJAu8qOAASKbVvmUd1r0LB25Pez8ULrmcPtKEzJIvAQb7eGjrrlALxJOdzVeWzspDDWuKwo2vj2Jc3ZYdAez4VjoVVIbtTpVQ8ZMB23rUrGqZBIM1wPjW2zYb4maAExB3hB3au1MfkkznuuooRaKTKlVRYcFHoPJxwULJQNGwR+0v7Jpx2YNlOpnZ6OQcwF+a5vJ2bHqtQAqwzP/mpFElCy7MecadGOCkaQW7whVY+RhJM7SvcuC2Fhuni+EQNM+2hXiy0HbFGeQArozST5d8SrqZoVw5Cevj3VGcYKXHVJckMCsPVg7eEmPlhfilK525UM0c1Ynux7JLDUSrp/gW/GnCua1B5QYSG35Dr5e8dPD+fxWGD6KK0BT/9uDB4MCpf1VwoHdHAWaEIOZMbXmZ5++x/buKFsNyYd9ulG/LRYwXiue2A5ksngV5RMTigatdjOLQZYa+X+vmnEo1NhbrFqbqGLDU7WGPOoNbiFPBv7KA9fJ8jpKsxEX8XdGBEmefpSx4BTfUVG6Y396mAyrRpsBdzU9LTjdvHGkM4Zxb+2IOq7ZBSOPQ/CffOU9TMfBi2KmlBCrHc2NRrkc+nzyB0QYFApc8ALvO87gfcTlqk6zMgzbX/OKmVDxubRG2Dp8yfvxHOdj0w= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR07MB5793.namprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8676002)(186003)(66476007)(66556008)(8936002)(5660300002)(9686003)(2906002)(26005)(6666004)(66946007)(6506007)(508600001)(86362001)(36756003)(110136005)(38100700002)(316002)(6486002)(6512007)(75432002)(786003)(3480700007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?M7J0b7uEcjU9sY0XWApfiMsz1LWfzT+sxaQAqJHUD95Ru5aEDKBqfsYR56mf?= =?us-ascii?Q?pDN+sYtFzDs0Bx+EtjvOh/vNXy+4qX9eMpu1dsN2WzqILe+bZIKoakIrb++D?= =?us-ascii?Q?tAMYkmDVOas0mABPJ7MYMRMkeVuByzYN5gQbMeTX6ReZ4OMdPBrNNG+LdrQR?= =?us-ascii?Q?0LYQv0JVEh4UgHt3qPZNGRdcLeCMqrV+/36F9kOFZA06CC7Z7PwLSVW+YOYj?= =?us-ascii?Q?yf0OLN3nHvKbLcQ6nWFvCiUrk92J4/M0bbs+YvpwVjNXLY0mmZ59B7aykQS3?= =?us-ascii?Q?Z1N8BTl9hKciKUZ19J8aQ30ZYjKCb0XxdD4QEGojzd8BJ9LXIX0+wPE80/Ti?= =?us-ascii?Q?K9/Z4foSLXyAKKFJbjJGxK0BuAK4M3AnZsANDkk7sBr+nV/VbOhzmJzTRVEz?= =?us-ascii?Q?7tL13hRHorL+z4+Rg60OJp0HaoVkDKOzuN/Ee+veBHHj+y+Ico84NQhkl9KS?= =?us-ascii?Q?mWN2QYP6hkwfTcmMCXKbA6aBJ2GX1fzqWdXCHGCaB/B4fP7l8H2xRJLs33Yo?= =?us-ascii?Q?j7Ihk6JyTo4c0oe2Wz4cbQmrI3bxytG0O8o9Faf18KjnKrYd+uXqnmUYnzqK?= =?us-ascii?Q?sJpQlji9+TaQ68xmYvD0PX6JwKTXsQSMzNntLAyvBP36JaWJCGMPptufypd1?= =?us-ascii?Q?Ck X-OriginatorOrg: gatech.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 62eb46d0-821b-4cb7-67b9-08d9e6af8087 X-MS-Exchange-CrossTenant-AuthSource: BN8PR07MB5793.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2022 00:52:50.4345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 482198bb-ae7b-4b25-8b7a-6d7f32faa083 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qRwklCpckaf+oN2QAWmqe9ygSTuvqDo3O12b5P9qL5x20VCse2gN1Vji4DSUtOAtDKygrd+vBiiT7XBP/HaY5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB5140 Received-SPF: pass client-ip=40.107.220.106; envelope-from=vijaymarupudi@gatech.edu; helo=NAM11-CO1-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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17988 Archived-At: Hi Damien, I tried to run the code you provided. I ran ----------------------------------------------------------------- (define-syntax <- (syntax-rules ($bracket-apply$) ((_ ($bracket-apply$ container index) expr) (let ((value expr)) ;; to avoid compute it twice (cond ((vector? container) (vector-set! container index value)) ((hash-table? container) (hash-table-set! container index value)) (else (array-set! container index value)));) value)) ((_ ($bracket-apply$ array index1 index2 ...) expr) (let ((value expr)) (if (vector? array) (array-n-dim-set! array value index1 index2 ...) (array-set! array index1 index2 ... value));) (newline) value)) ((_ (var ...) expr) (begin (display expr) (newline) (let ((expr-list (call-with-values (lambda () expr) list))) (assign-var (var ...) expr-list) expr-list))) ((_ var expr) (begin (set! var expr) var)) ((_ var var1 var2 ...) (<- var (<- var1 var2 ...))))) (define T (make-vector 5)) (<- ($bracket-apply$ T 2) 1) ----------------------------------------------------------------- After I ran that, T was #(# # 1 # #) Is that was you are looking for? > "A literal matches an input expression if the input expression is an > identifier with the same name as the literal, and both are unbound13 > . > " as $bracket-apply$ is already bind to a definition the pattern will > not be matched: It's possible, as in my case, I did not have it bound, and it seems to have worked the way you expected? ~ Vijay