From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: unknown location: definition in expression context in subform optname-from of "_^" Date: Thu, 26 Jan 2012 21:59:09 -0500 Message-ID: References: <4F20CEE7.4000403@gmail.com> <1327551746.85660.YahooMailNeo@web37907.mail.mud.yahoo.com> <4F21BFFC.8040300@gmail.com> <87d3a6ovhs.fsf@netris.org> <4F21F635.4020404@gmail.com> <8762fxq3rr.fsf@netris.org> <4F220F84.5090601@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327633161 23401 80.91.229.12 (27 Jan 2012 02:59:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 27 Jan 2012 02:59:21 +0000 (UTC) Cc: Mark H Weaver , guile-devel@gnu.org To: Bruce Korb Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 27 03:59:17 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rqc1z-0007qC-Ke for guile-devel@m.gmane.org; Fri, 27 Jan 2012 03:59:15 +0100 Original-Received: from localhost ([::1]:33901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rqc1z-0007mx-2Y for guile-devel@m.gmane.org; Thu, 26 Jan 2012 21:59:15 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rqc1w-0007ms-HU for guile-devel@gnu.org; Thu, 26 Jan 2012 21:59:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rqc1v-00068F-Ch for guile-devel@gnu.org; Thu, 26 Jan 2012 21:59:12 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:56142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rqc1u-000685-PQ for guile-devel@gnu.org; Thu, 26 Jan 2012 21:59:11 -0500 Original-Received: by iadk27 with SMTP id k27so1914682iad.0 for ; Thu, 26 Jan 2012 18:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RTnDOfkBjTax6+2v2dxmWxy6lANZMJDLTIbqzyzqu7I=; b=Kp6dJ/vv18E8v9aEj9zgBhqQTnf8kPIGtNd38e/2sqbscnGW+CieOjcWTP/MxHMZ0O 4Cc2aumIz9axTfEH/XYMqRMkJww2JebNXlMaS5zu6+e50x5IT2UbW5xgVQzXdSBSy8Q9 uqjR7bmraepqDZAhJyFJX6KFB0vS6T3N0i2b0= Original-Received: by 10.50.104.199 with SMTP id gg7mr4693003igb.8.1327633150142; Thu, 26 Jan 2012 18:59:10 -0800 (PST) Original-Received: by 10.42.158.6 with HTTP; Thu, 26 Jan 2012 18:59:09 -0800 (PST) In-Reply-To: <4F220F84.5090601@gmail.com> X-Google-Sender-Auth: ZlC_cWPGYKxrumveLf7vrgHSJtQ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13702 Archived-At: Hello, > =A0 =A0 =A0 =A0/* Read expressions from that port; ignore the values. =A0= */ > =A0 =A0 =A0 =A0for (;;) { > =A0 =A0 =A0 =A0 =A0 =A0SCM form =3D scm_read(port); > =A0 =A0 =A0 =A0 =A0 =A0if (SCM_EOF_OBJECT_P(form)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0ans =3D scm_primitive_eval_x(form); > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0return ans; > =A0 =A0} > } > > Every evaluation comes from here and in this instance, "pzFile" > pointed to "/path/to/aginfo.tpl" and "line" was set to 163. > Therefore, the location should *NOT* have been unknown and > in fact, the displayed line number ought to have been 171. > > Why that failed I would very much want to know so that I can > fix this ag_scm_c_eval_string_from_file_line() thingy. I am not an expert, but this is my guess about what's happening: you get the form from the file with scm_read. scm_read returns a regular s-expression, not a syntax object. Then you pass this form to scm_primitive_eval_x. scm_primitive_eval_x has a plain syntax-object with no way to know where it came from, so it prints "unknown location". The reason the standard Guile interpreter knows where things came from is that it parses files as syntax, not s-expressions, and syntax objects have embedded file and line information. But note that I didn't say that you could do this. I don't know of an interface to this functionality (although I believe this example shows that we need one). Noah