unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Noah Lavine <noah.b.lavine@gmail.com>
To: guile-devel@gnu.org
Subject: Difference Between REPL and Script Usage?
Date: Sat, 29 Jan 2011 12:38:16 -0500	[thread overview]
Message-ID: <AANLkTikKh6UwsfVuYGNga7gWJ0oUNR3ygvf21uwAcku2@mail.gmail.com> (raw)

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 [#<procedure 1012453a0 at ice-9/boot-9.scm:2253:4 (name
#:optional autoload version #:key ensure)> # ...]
2531: 16 [try-module-autoload (ice-9 peg) #f]
1863: 15 [save-module-excursion #<procedure 101660a80 at
ice-9/boot-9.scm:2532:17 ()>]
2542: 14 [#<procedure 101660a80 at ice-9/boot-9.scm:2532:17 ()>]
In unknown file:
   ?: 13 [primitive-load-path "ice-9/peg" #f]
In ice-9/eval.scm:
 458: 12 [#<procedure 1010be240 at ice-9/eval.scm:452:4 (exp)>
(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 #<procedure 1016b9630 at ice-9/eval.scm:378:13 (a)> # # ...]
In ice-9/eval.scm:
 350: 5 [eval # #]
 350: 4 [eval # #]
 356: 3 [eval #<memoized safe-bind-f> (# # # # ...)]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized safe-bind-f> #<directory
# 101669cf0>]
In ice-9/boot-9.scm:
 115: 1 [#<procedure 1012cc9b0 at ice-9/boot-9.scm:110:6 (thrown-k .
args)> 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



             reply	other threads:[~2011-01-29 17:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-29 17:38 Noah Lavine [this message]
2011-01-30 12:21 ` Difference Between REPL and Script Usage? Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikKh6UwsfVuYGNga7gWJ0oUNR3ygvf21uwAcku2@mail.gmail.com \
    --to=noah.b.lavine@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).