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: Difference Between REPL and Script Usage? Date: Sat, 29 Jan 2011 12:38:16 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1296322715 7405 80.91.229.12 (29 Jan 2011 17:38:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 17:38:35 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 29 18:38:31 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjEkp-000612-0Q for guile-devel@m.gmane.org; Sat, 29 Jan 2011 18:38:31 +0100 Original-Received: from localhost ([127.0.0.1]:40166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEko-0004G5-Bk for guile-devel@m.gmane.org; Sat, 29 Jan 2011 12:38:30 -0500 Original-Received: from [140.186.70.92] (port=39385 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEkc-0004BN-7O for guile-devel@gnu.org; Sat, 29 Jan 2011 12:38:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjEkb-0004II-3p for guile-devel@gnu.org; Sat, 29 Jan 2011 12:38:17 -0500 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:57281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjEkb-0004I7-1R for guile-devel@gnu.org; Sat, 29 Jan 2011 12:38:17 -0500 Original-Received: by gyd10 with SMTP id 10so1866831gyd.0 for ; Sat, 29 Jan 2011 09:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=pt1rq+QYXFrUNH4DZEN/789GD6NvH2NOblUl0tJQIP0=; b=Qeq2EII9guHIfZZTQrVMSD5ERs9hzqcIbYbJS0Tg9eWcqC9KO40HZgUSbIorKxbGYO qV78iEkzM7B++Lh3zJGE7y4x/8ijlEEl5JVBLbo2AruCcTzkrevx/ohaunV4XXQ/+qRe UEMQqoaO++PcnR9WDIYZz0H2gq868Kt8gCKgA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=DZ6gkpXDCfNayCghnWG61yOY59WmmzKtoAiySlXzFcXFqIuWF533HlTpCkO0Gbik7j wRePotkLw/vVWRSgJPOyfmwtn1BpyMo9DsgT1NZRh2B2rMFXVnbltfkoprFo36LqpV/A Y0MsGUbWSmvfQ3b4d8mcITRiTu3ETs9LVvFdg= Original-Received: by 10.146.86.12 with SMTP id j12mr6049939yab.27.1296322696267; Sat, 29 Jan 2011 09:38:16 -0800 (PST) Original-Received: by 10.147.32.7 with HTTP; Sat, 29 Jan 2011 09:38:16 -0800 (PST) X-Google-Sender-Auth: wkCIoebqAMZUepRF1epDGclYPmc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11403 Archived-At: Hello all, I have encountered a strange behavior in Guile, and I'm not sure what to do about it. It happened when I was trying to test peg.scm. I ran the test like this: ./check-guile peg.test Testing /Users/noah/Desktop/guile/guile/meta/guile ... peg.test with GUILE_LOAD_PATH=/Users/noah/Desktop/guile/guile/test-suite Running peg.test ;;; note: source file /Users/noah/Desktop/guile/guile/test-suite/tests/peg.test ;;; newer than compiled /Users/noah/Desktop/guile/guile/cache/guile/ccache/2.0-0.T-LE-8/Users/noah/Desktop/guile/guile/test-suite/tests/peg.test.go ;;; note: source file /Users/noah/Desktop/guile/guile/module/ice-9/peg.scm ;;; newer than compiled /Users/noah/Desktop/guile/guile/cache/guile/ccache/2.0-0.T-LE-8/Users/noah/Desktop/guile/guile/module/ice-9/peg.scm.go Backtrace: In ice-9/boot-9.scm: 2409: 19 [resolve-imports (((srfi srfi-1)) ((ice-9 pretty-print)) ((ice-9 peg)) ...)] 2340: 18 [resolve-interface (ice-9 peg) #:select ...] 2265: 17 [# # ...] 2531: 16 [try-module-autoload (ice-9 peg) #f] 1863: 15 [save-module-excursion #] 2542: 14 [#] In unknown file: ?: 13 [primitive-load-path "ice-9/peg" #f] In ice-9/eval.scm: 458: 12 [# (eval-when # # # ...)] In ice-9/psyntax.scm: 908: 11 [chi-top-sequence (# # # # ...) () (#) ...] 1151: 10 [chi-top (define (cg-generic-ret accum name ...) (safe-bind # #)) () ...] 1508: 9 [chi-simple-lambda (# . #) () (()) ...] 1357: 8 [parse (((# # # # #) . #(syntax-object # # #))) () () () () () ()] 1007: 7 [syntax-type (safe-bind # #) (# # # # ...) (# # #) ...] 1304: 6 [chi-macro # # # ...] In ice-9/eval.scm: 350: 5 [eval # #] 350: 4 [eval # #] 356: 3 [eval # (# # # # ...)] In unknown file: ?: 2 [memoize-variable-access! # #] In ice-9/boot-9.scm: 115: 1 [# unbound-variable ...] In unknown file: ?: 0 [catch-closure unbound-variable #f "Unbound variable: ~S" (safe-bind-f) #f] ERROR: In procedure catch-closure: ERROR: Unbound variable: safe-bind-f But got an error. To see what was wrong, I opened guile and did "(use-modules (ice-9 peg))". That worked fine. So I closed my guile interpreter and ran the test again. This time it worked. noah-lavines-macbook:guile noah$ ./check-guile peg.test Testing /Users/noah/Desktop/guile/guile/meta/guile ... peg.test with GUILE_LOAD_PATH=/Users/noah/Desktop/guile/guile/test-suite Running peg.test ;;; note: source file /Users/noah/Desktop/guile/guile/test-suite/tests/peg.test ;;; newer than compiled /Users/noah/Desktop/guile/guile/cache/guile/ccache/2.0-0.T-LE-8/Users/noah/Desktop/guile/guile/test-suite/tests/peg.test.go Totals for this test run: passes: 21 failures: 0 unexpected passes: 0 expected failures: 0 unresolved test cases: 0 untested test cases: 0 unsupported test cases: 0 errors: 0 So it looks like somehow loading things in the repl acts differently than loading them when Guile is a script interpreter. I'm not sure why this happened, but the behavior seems quite bad. Noah