From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add inspection command "source (, src)" which shows Scheme code of loaded module Date: Mon, 1 Apr 2013 12:22:43 +0800 Message-ID: References: <1364651860.2730.71.camel@Renee-desktop.suse> <87zjxk7fjy.fsf@tines.lan> <1364734048.2730.97.camel@Renee-desktop.suse> <874nfq52jk.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1364790169 23399 80.91.229.3 (1 Apr 2013 04:22:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Apr 2013 04:22:49 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 01 06:23:16 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UMWH2-0008U6-NF for guile-devel@m.gmane.org; Mon, 01 Apr 2013 06:23:12 +0200 Original-Received: from localhost ([::1]:34845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMWGd-0008Eh-Tv for guile-devel@m.gmane.org; Mon, 01 Apr 2013 00:22:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMWGb-0008Eb-35 for guile-devel@gnu.org; Mon, 01 Apr 2013 00:22:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UMWGZ-0004x9-Ps for guile-devel@gnu.org; Mon, 01 Apr 2013 00:22:45 -0400 Original-Received: from mail-ie0-x22e.google.com ([2607:f8b0:4001:c03::22e]:45919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UMWGZ-0004x4-LU for guile-devel@gnu.org; Mon, 01 Apr 2013 00:22:43 -0400 Original-Received: by mail-ie0-f174.google.com with SMTP id aq17so1965035iec.19 for ; Sun, 31 Mar 2013 21:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=kkfiqlBHvj3/k/RlD0N+eaOfrm9HMqHhGzijuSac/KM=; b=pFZloEtC5J2yni2jyHdhtTCa8Qkf1XW9mW5ZTgsf1cj1SnX2excpUqTFUKAmQU9xt/ nwY8z+bH1QAXkdqthzzERlYKjfPsTaKGjtNi5QxmvM47sWXFRPiRAnKD0xvqOi0l6ZtK DxSExQQFBxz6qk9w52KBZqAdbd2e9im6xuORNnWNAPx8RzbxudNeO12nqmh/KEgalekJ vgX1aXOex9scZbptEQENscKGIHAQ3UP72BDK1kuc47/h3WJmgS2uLkTzLxGzd1Bun8Jx kohncpXbJSbHT17Vmn4dtGY018R2A8uZXoASNCCeo0splZ3yHouEO27m6+uNx/e/XS9l 5iKQ== X-Received: by 10.50.12.201 with SMTP id a9mr2979774igc.10.1364790163129; Sun, 31 Mar 2013 21:22:43 -0700 (PDT) Original-Received: by 10.64.26.168 with HTTP; Sun, 31 Mar 2013 21:22:43 -0700 (PDT) In-Reply-To: <874nfq52jk.fsf@tines.lan> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22e 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:16080 Archived-At: On 1 April 2013 11:54, Mark H Weaver wrote: > Daniel Hartwig writes: >> these two points are enough information to obtain the unmodified >> source from the file. > > This is enough to get the original characters, but then there's the > other problem I mentioned: reader directives such as #!curly-infix > earlier in the file. > > For this reason, I think we need to use 'read' from the beginning of the > file, and look at the source properties of the returned datums to find > the right top-level datum. In most cases, a top-level datum is what is > desired, but in some cases not. In general, you will need to traverse > the sublists of a top-level datum to find the right one. Ah yes, right. Not such a trivial task after all. I had neglected that such reader directives will sufficiently alter the meaning of the file. I think I will stick to =E2=80=98geiser-edit-symbol-at-point=E2=80=99 :-)