unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* [r6rs] abusive request for help on "unbound variable" error
@ 2010-11-18 21:25 Marco Maggi
  2010-11-19 11:48 ` Marco Maggi
  2010-11-20 22:32 ` Andy Wingo
  0 siblings, 2 replies; 7+ messages in thread
From: Marco Maggi @ 2010-11-18 21:25 UTC (permalink / raw)
  To: guile-user

Ciao,

  sorry for being abusive in this request; I am developing a
small  experimental  package[1] and  so  far  it works  with
Larceny,  Mosh,  Petite  Chez,  Racket, Vicare  and  Ypsilon
(meaning that  it passes the  tests I have written  so far);
for this  reason I  am somewhat confident  that the  code is
"correct".

  With       Guile's       master      branch       checkout
8d10ccae79ff46f0ebea92ba36acfaebafba8d86        on        an
i686-pc-linux-gnu I get the following error:

;;; compiling ./tests/test-functional.sps
;;; WARNING: compilation of ./tests/test-functional.sps failed:
;;; key vm-error, throw_args (vm-run "VM: Unbound variable: ~s" (#<variable 8506618 value: #<undefined>>))
guile: uncaught throw to vm-error: (vm-run "VM: Unbound variable: ~s" (#<variable 8506618 value: #<undefined>>))

it is cryptic to say the least; commenting out all the tests
from the "test-functional.sps" file  the error goes away, it
seems that the form:

(define-type +
  ((<fixnum> <fixnum> -> <fixnum>)      fx+)
  ((<flonum> <flonum> -> <flonum>)      fx+)
  ((<number> <number> -> <number>)      +))

at line 67 is enough to trigger the error.  I wonder if some
kind  soul can  try it  and/or suggest  how to  inspect this
further; if  you do,  just running "make  gtest" in  the top
source directory will run the test with Guile.

TIA

P.S. It appears that some  or all the bindings from the R6RS
libraries:

  (rnrs arithmetic fixnums)
  (rnrs arithmetic flonums)

are not re-exported by (rnrs).

[1] <https://github.com/marcomaggi/toy-functional>
-- 
Marco Maggi



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-18 21:25 [r6rs] abusive request for help on "unbound variable" error Marco Maggi
@ 2010-11-19 11:48 ` Marco Maggi
  2010-11-19 11:52   ` Marco Maggi
  2010-11-20 22:32 ` Andy Wingo
  1 sibling, 1 reply; 7+ messages in thread
From: Marco Maggi @ 2010-11-19 11:48 UTC (permalink / raw)
  To: guile-user

"Marco Maggi" wrote:
> P.S. It  appears that  some or all  the bindings  from the
> R6RS libraries:
>
>  (rnrs arithmetic fixnums)
>  (rnrs arithmetic flonums)
>
> are not re-exported by (rnrs).

This is wrong; it  is the "guile-r6rs" executable that, when
used  interactively, does  not import  the R6RS  bindings by
default as I expected.

  Sorry for the noise.
-- 
Marco Maggi



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-19 11:48 ` Marco Maggi
@ 2010-11-19 11:52   ` Marco Maggi
  0 siblings, 0 replies; 7+ messages in thread
From: Marco Maggi @ 2010-11-19 11:52 UTC (permalink / raw)
  To: guile-user

"Marco Maggi" wrote:
> This  is wrong;  it is  the "guile-r6rs"  executable that,
> when used interactively, does not import the R6RS bindings
> by default as I expected.

This is my own script, it does not come with Guile...
-- 
Marco Maggi



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-18 21:25 [r6rs] abusive request for help on "unbound variable" error Marco Maggi
  2010-11-19 11:48 ` Marco Maggi
@ 2010-11-20 22:32 ` Andy Wingo
  2010-11-21  7:35   ` Marco Maggi
  1 sibling, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2010-11-20 22:32 UTC (permalink / raw)
  To: Marco Maggi; +Cc: guile-user

On Thu 18 Nov 2010 22:25, Marco Maggi <marco.maggi-ipsu@poste.it> writes:

>   With       Guile's       master      branch       checkout
> 8d10ccae79ff46f0ebea92ba36acfaebafba8d86        on        an
> i686-pc-linux-gnu I get the following error:

Glad you found your problem in other mails.

FYI though, I think you will find that many things have improved since
June, regarding R6RS.

Happy hacking,

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-20 22:32 ` Andy Wingo
@ 2010-11-21  7:35   ` Marco Maggi
  2010-11-21 22:12     ` Andreas Rottmann
  0 siblings, 1 reply; 7+ messages in thread
From: Marco Maggi @ 2010-11-21  7:35 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-user

"Andy Wingo" wrote:
>On Thu 18 Nov 2010 22:25, Marco Maggi <marco.maggi-ipsu@poste.it> writes:
>
>>   With      Guile's      master      branch      checkout
>> 8d10ccae79ff46f0ebea92ba36acfaebafba8d86       on      an
>> i686-pc-linux-gnu I get the following error:
>
> Glad you found your problem in other mails.

I  have  not.  I  was  wrong  regarding  bindings not  being
re-exported (I forgot what my local scripting infrastructure
did);  but I  still get  the "unbound  variable"  error from
Guile.

  The   only   thing   I   can  guess   (after   trying   to
comment/uncomment random forms) is that it is a problem with
the expander possibly in its interaction with compiled code,
because all the other  R6RS implementations work fine.  Also
I have found this: when  I run the test with "--autocompile"
(starting with a clean cache) I get the error:

GUILE_LOAD_PATH=. guile -l guile-r6rs-setup.scm --autocompile -s ./tests/test-annotated-types.sps
;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-autocompile argument to disable.
;;; compiling guile-r6rs-setup.scm
[...]
;;; WARNING: compilation of ./tests/test-annotated-types.sps failed:
;;; key vm-error, throw_args (vm-run "VM: Unbound variable: ~s" (#<variable 851b5e8 value: #<undefined>>))
guile: uncaught throw to vm-error: (vm-run "VM: Unbound variable: ~s" (#<variable 851b5e8 value: #<undefined>>))
make: *** [gtest] Error 1

but  when  running  with  "--no-autocompile" (with  a  clean
cache) I get:

GUILE_LOAD_PATH=. guile -l guile-r6rs-setup.scm --no-autocompile -s ./tests/test-annotated-types.sps
Backtrace:
In ice-9/boot-9.scm:
  62: 19 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 389: 18 [eval # #]
In ice-9/boot-9.scm:
1858: 17 [save-module-excursion #<procedure 825ceb8 at ice-9/boot-9.scm:1871:3 ()>]
1149: 16 [load "./tests/test-annotated-types.sps" #f]
1051: 15 [%start-stack load-stack ...]
1056: 14 [#<procedure 825ce28 ()>]
In unknown file:
   ?: 13 [primitive-load "./tests/test-annotated-types.sps"]
In ice-9/eval.scm:
 458: 12 [#<procedure 8133ba0 at ice-9/eval.scm:451:4 (exp)> (let () # #t)]
In ice-9/psyntax.scm:
1223: 11 [chi-top (let () (define-type-annotation + (# fx+) ...) ...) () ...]
2074: 10 [chi-let (let () (define-type-annotation + (# fx+) ...) ...) () ...]
1421: 9 [parse ((# . #) (# . #)) () () ...]
1072: 8 [syntax-type (define-type-annotation + # # ...) (#) (# #) ...]
1368: 7 [chi-macro #<procedure 843de70 at ice-9/eval.scm:377:13 (a)> # # ...]
In ice-9/eval.scm:
 389: 6 [eval # #]
 389: 5 [eval # #]
 349: 4 [eval #<memoized (assert (identifier? <3>))> (# # # # . #)]
 356: 3 [eval #<memoized assert> (# # # # . #)]
In unknown file:
   ?: 2 [memoize-variable-access! #<memoized assert> #<directory # 8458828>]
In ice-9/boot-9.scm:
 115: 1 [#<procedure 80a82f8 at ice-9/boot-9.scm:109:6 (thrown-k . args)> unbound-variable ...]
In unknown file:
   ?: 0 [catch-closure unbound-variable #f "Unbound variable: ~S" (assert) #f]

ERROR: Unbound variable: assert
make: *** [gtest] Error 1

I do use ASSERT in the code, but I do no strange things with
its binding.   Unfortunately I have  no time to dive  in the
internals of Scheme implementations.
-- 
Marco Maggi



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-21  7:35   ` Marco Maggi
@ 2010-11-21 22:12     ` Andreas Rottmann
  2010-11-21 22:27       ` Andreas Rottmann
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Rottmann @ 2010-11-21 22:12 UTC (permalink / raw)
  To: Marco Maggi; +Cc: Andy Wingo, guile-user

Marco Maggi <marco.maggi-ipsu@poste.it> writes:

> "Andy Wingo" wrote:
>>On Thu 18 Nov 2010 22:25, Marco Maggi <marco.maggi-ipsu@poste.it> writes:
>>
>>>   With      Guile's      master      branch      checkout
>>> 8d10ccae79ff46f0ebea92ba36acfaebafba8d86       on      an
>>> i686-pc-linux-gnu I get the following error:
>>
>> Glad you found your problem in other mails.
>
> I  have  not.  I  was  wrong  regarding  bindings not  being
> re-exported (I forgot what my local scripting infrastructure
> did);  but I  still get  the "unbound  variable"  error from
> Guile.
>
>   The   only   thing   I   can  guess   (after   trying   to
> comment/uncomment random forms) is that it is a problem with
> the expander possibly in its interaction with compiled code,
> because all the other  R6RS implementations work fine.  Also
> I have found this: when  I run the test with "--autocompile"
> (starting with a clean cache) I get the error:
>
> GUILE_LOAD_PATH=. guile -l guile-r6rs-setup.scm --autocompile -s ./tests/test-annotated-types.sps
> ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;;       or pass the --no-autocompile argument to disable.
> ;;; compiling guile-r6rs-setup.scm
> [...]
> ;;; WARNING: compilation of ./tests/test-annotated-types.sps failed:
> ;;; key vm-error, throw_args (vm-run "VM: Unbound variable: ~s" (#<variable 851b5e8 value: #<undefined>>))
> guile: uncaught throw to vm-error: (vm-run "VM: Unbound variable: ~s" (#<variable 851b5e8 value: #<undefined>>))
> make: *** [gtest] Error 1
>
Yep, that's the unfortunatly quite non-descriptive error you'll get when
a module exports a binding it does not define.

> but  when  running  with  "--no-autocompile" (with  a  clean
> cache) I get:
>
[...]
> ERROR: Unbound variable: assert
> make: *** [gtest] Error 1
>
> I do use ASSERT in the code, but I do no strange things with
> its binding.   Unfortunately I have  no time to dive  in the
> internals of Scheme implementations.
>
Indeed `assert' is missing from Guile ATM, but I've submitted a patch a
while ago that fixes that (among other things):

<http://lists.gnu.org/archive/html/guile-devel/2010-10/msg00098.html>

I hope that someone gives that patch a review soon (*hint* *hint*)...

Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [r6rs] abusive request for help on "unbound variable" error
  2010-11-21 22:12     ` Andreas Rottmann
@ 2010-11-21 22:27       ` Andreas Rottmann
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Rottmann @ 2010-11-21 22:27 UTC (permalink / raw)
  To: Marco Maggi; +Cc: Andy Wingo, guile-user

Andreas Rottmann <a.rottmann@gmx.at> writes:

> Indeed `assert' is missing from Guile ATM, but I've submitted a patch a
> while ago that fixes that (among other things):
>
> <http://lists.gnu.org/archive/html/guile-devel/2010-10/msg00098.html>
>
Uh, sorry, that one doesn't apply anymore -- here's the refreshed one:

<http://lists.gnu.org/archive/html/guile-devel/2010-11/msg00072.html>

Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-21 22:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 21:25 [r6rs] abusive request for help on "unbound variable" error Marco Maggi
2010-11-19 11:48 ` Marco Maggi
2010-11-19 11:52   ` Marco Maggi
2010-11-20 22:32 ` Andy Wingo
2010-11-21  7:35   ` Marco Maggi
2010-11-21 22:12     ` Andreas Rottmann
2010-11-21 22:27       ` Andreas Rottmann

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).