From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.devel Subject: Re: Confusing Error Message Date: Wed, 14 Mar 2012 01:27:48 +0000 Message-ID: <87ehswq8dn.fsf@Kagami.home> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1331688503 13006 80.91.229.3 (14 Mar 2012 01:28:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Mar 2012 01:28:23 +0000 (UTC) Cc: guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 14 02:28:22 2012 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 1S7d0n-0006Tg-UG for guile-devel@m.gmane.org; Wed, 14 Mar 2012 02:28:22 +0100 Original-Received: from localhost ([::1]:60160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7d0n-00088P-1C for guile-devel@m.gmane.org; Tue, 13 Mar 2012 21:28:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7d0R-000856-3s for guile-devel@gnu.org; Tue, 13 Mar 2012 21:28:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7d0P-0006fL-3g for guile-devel@gnu.org; Tue, 13 Mar 2012 21:27:58 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:43758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7d0O-0006f4-QE for guile-devel@gnu.org; Tue, 13 Mar 2012 21:27:57 -0400 Original-Received: by werj55 with SMTP id j55so1532726wer.0 for ; Tue, 13 Mar 2012 18:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=p7vqny+MIUClUe69UPZaq+epGiAKGe/nTKlpwEi2vWo=; b=ZjOFDjsd3P7Zs+uaALJ1NclDZCkxwf/Z+ifQBhPTAuAp+iyUtaZrJG7VTM6pfEUrrM 5xLzdIynOkDBDS+AW8144zPWTSOBZZXMkqVZLPF4bF2+cpOtrqelnY8E7tPj1ly5ba7E zyrrQKiaHzmkFzdfBTrHPXPU/vZcvZOCFyDhZkRTeOqduhNc56Sve8OAUpUKMz2sEuZT 468olTGbXdwduWx1EkZs2j981DDhrBctyFGch23+ZB2i1jOQ6LJdARMklAiJIrK/nDgx C/qPF9E45OBNX4kU7KFvxV5l/oYuvKWFZGK1S4BHmkt3T0To/pZh0Zw7c8r5w0CVv0t3 grhw== Original-Received: by 10.216.137.156 with SMTP id y28mr373893wei.61.1331688474148; Tue, 13 Mar 2012 18:27:54 -0700 (PDT) Original-Received: from Kagami.home (host86-151-78-130.range86-151.btcentralplus.com. [86.151.78.130]) by mx.google.com with ESMTPS id p10sm10221570wic.0.2012.03.13.18.27.52 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Mar 2012 18:27:53 -0700 (PDT) In-Reply-To: (Noah Lavine's message of "Tue, 13 Mar 2012 20:43:29 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.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:14097 Archived-At: Noah Lavine writes: > Hello, > > I just got a confusing error while making a Guile module. I was > writing a module, and wanted to use the compile function - the one > that exists by default in the REPL environment. However, when I used > the compile function in a module and tried to load that module, I got > an unbound variable error for the name 'compile'! Coincidentally, I also came across this during my current (as yet unfinished) trek though the manual to find wrong and non-self contained examples. (patches coming soon) Section 10.4.1 describes the following "quine" that doesn't actually work :) ((lambda (x) ((compile x) x)) =E2=80=99(lambda (x) ((compile x) x))) > However, I think this could have been very confusing to a new user. > It's not intuitive that a function that is available by default at the > REPL is not available in a module. I don't even know where to go to > look up what things are available in a module and what are not. I don't think there are that many included though: (ice-9 top-repl) includes (ice-9 r5rs) (ice-9 session) (ice-9 regex) and (ice-9 threads). The define-module for (guile-user) at the bottom of boot-9.scm also autoloads (system base compile) I think (ice-9 threads) and (ice-9 regex) could be confusing for new users; (ice-9 session) less so. As for looking up: if a module is imported at the repl, then using the ",a" meta commmand is helpful, though you could just use "apropos" from (ice=E2=88=929 session) directly. Mostly I rely on geiser, which will displ= ay it in emacs' minibuffer if my point is on the identifier, or I'll get the info from C-c C-d C-d. If the module isn't imported, the repl (and therefore geiser) is less helpful, and I'll just search the manual. > Was this limitation on purpose? If so, I'd like to know what's going > on so I can document it more. If not, there's a bug in the current > master. I guess it is, NEWS says "Correctly written scripts load the modules they require at the top of the file and should not be affected by this change.", that's ages ago though -- "Changes since Guile 1.3.2:". Looks to me like a case of "it's that way, because it's always been that way" Just my =C2=A30.02. --=20 Ian Price "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"