From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.user Subject: =?UTF-8?Q?Re:_Syntax_locations_are_ambiguous:_can_we_track_source_'offse?= =?UTF-8?Q?t'_and_'length'=3F?= Date: Tue, 03 Aug 2021 21:29:52 +0200 Message-ID: References: <771a6e88782e288143be269b14751b761523e4c1.camel@planete-kraus.eu> 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="3590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-548-g3a0b1fef7b-fm-20210802.001-g3a0b1fef To: "Vivien Kraus" , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Aug 03 21:30:53 2021 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 1mB07n-0000iA-7a for guile-user@m.gmane-mx.org; Tue, 03 Aug 2021 21:30:53 +0200 Original-Received: from localhost ([::1]:34292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB07l-0003ke-CJ for guile-user@m.gmane-mx.org; Tue, 03 Aug 2021 15:30:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB07M-0003jQ-FF for guile-user@gnu.org; Tue, 03 Aug 2021 15:30:24 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:52781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mB07J-0007TT-M6 for guile-user@gnu.org; Tue, 03 Aug 2021 15:30:24 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9334F3200926; Tue, 3 Aug 2021 15:30:17 -0400 (EDT) Original-Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Tue, 03 Aug 2021 15:30:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm3; bh=WqEzX nKkj1Ml5dLxzv16UvlP6IMPH0zUFH6MIn1tD70=; b=bB31kIxnVyJwBjH6b01FS 4jgT55irrH8hwHMLLcT30gtjXmOsUDTqEtpkEgN3pI8O6TmV3BGdPCXmuKbVIzke XzLMR/IbT/Ac4ZtJOz7gaH5sgmDQfWOvHiHWpomtWoj/67yz4vz1lhefFdBxgywS qYlBAWVipHhBFR0dcMOcnuwzFH2T5VVoHyCwkwe/QS+uWlHvyGS6IGTkRTD4Dvhy bapbSonjrQPHrKGJ63VUmshJL2NbTgUn7qnb7cRnrA96ZXmnrOOpx+xg23X6SY4N gbrFkzEpOUTGZTQXsbnEFEd/oZfUF/k55lr3H4m44ze22DP2nWK7bieG6MUOZs3F g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=WqEzXnKkj1Ml5dLxzv16UvlP6IMPH0zUFH6MIn1tD 70=; b=whDWws7Y1upH07sFGpWV3gSDZUpjxs6ehVkfhd7kHTA9JicNgrVXRNiFL hoXSt2LL+2uBVs0ocUZeMQK2PrsXVZJ/m65zkZUH2ooakXVW/NREfbZ8gnnMEQf+ 3xm4UP4BIovEuh7DGVzFJRUmjUI87aSgeZpZlxaKHXctGFo6s0jpRUnk3vCHQ8m6 yzfUSDwzQCD13OpDAI6rO6VaKByWAt9i4y4ViBWBqFO+RBnTT+1vU1OYLuluWIGt SvkR2cVqTE17wMr35fpAf47OlJubDfIHIi0k7ihgBbgmAC2X+5kYnwf0tUwtzX/K cUI9gIf/UBA8i4Exw17/71w28bJcg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrieeggddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpefnihhn uhhspgeujhpnrhhnshhtrghmuceolhhinhhushdrihhnthgvrhhnvghtsehfrghsthhmrg hilhdrshgvqeenucggtffrrghtthgvrhhnpeekleevieevleejffetieeltdelkeevtedu heefheduieffffdttdegjeeihedtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehlihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmhgrihhl rdhsvg X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id AE82BFA0AA4; Tue, 3 Aug 2021 15:30:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <771a6e88782e288143be269b14751b761523e4c1.camel@planete-kraus.eu> Received-SPF: pass client-ip=64.147.123.19; envelope-from=linus.internet@fastmail.se; helo=wout3-smtp.messagingengine.com 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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:17663 Archived-At: On Tue, 3 Aug 2021, at 00:50, Vivien Kraus via General Guile related dis= cussions wrote: > Dear guilers, >=20 > I=E2=80=99m playing with syntaxes as first-class objects, and I notice= that the > syntax source location is ambiguous: >=20 > (syntax-case > (call-with-input-string "(a\r b)" read-syntax) () > ((a b) > (values (syntax-source #'a) (syntax-source #'b)))) >=20 > =3D> >=20 > $1 =3D ((line . 0) (column . 1)) > $2 =3D ((line . 0) (column . 1)) >=20 > This is obviously because of #\return. Well, if anything this has confused the guile reader. It is probably a b= ug: I suspect it resets the column because it anticipates a windows-styl= e newline. But are you often dealing with lonely "\r" in sources? Using either \n = (unix-style) or \r\n (window-style) will give you the correct results.