Subject: starting repl from C broken

From: Tristan Colgate <[email-masked]>
Date: Mon, 24 Oct 2011 12:29:23 +0100

Hi,

The folliowing fails for me on current master:

#include <libguile.h>

static void
inner_main (void *closure, int argc, char **argv)
{
 scm_c_use_module("system repl repl");
 scm_c_eval_string("(start-repl)");
}

int
main (int argc, char **argv)
{
 scm_boot_guile (argc, argv, inner_main, 0);
 return 0; /* never reached */
}

I get:

Backtrace:
In ice-9/boot-9.scm:
 162: 14 [catch #t #<catch-closure ed3680> ...]
 170: 13 [#<procedure e8f6e0 ()>]
In unknown file:
  ?: 12 [catch-closure]
  ?: 11 [call-with-input-string "(start-repl)" ...]
In ice-9/boot-9.scm:
2082: 10 [save-module-excursion #<procedure 11cf240 at
ice-9/eval-string.scm:65:9 ()>]
In ice-9/eval-string.scm:
 44: 9 [read-and-eval #<input: string ce2680> #:lang ...]
 37: 8 [lp (start-repl)]
In system/repl/repl.scm:
 135: 7 [start-repl # # #f]
In system/repl/common.scm:
 135: 6 [make-repl # #f]
In system/base/language.scm:
 58: 5 [lookup-language #]
In ice-9/boot-9.scm:
2476: 4 [#<procedure e832a0 at ice-9/boot-9.scm:2464:4 (name
#:optional autoload version #:key ensure)> # ...]
2733: 3 [try-module-autoload (language # spec) #f]
 550: 2 [map #<procedure e86a20 at ice-9/boot-9.scm:2733:31 (elt)> (language #)]
2734: 1 [#<procedure e86a20 at ice-9/boot-9.scm:2733:31 (elt)> #]
In unknown file:
  ?: 0 [symbol->string #]

ERROR: In procedure symbol->string:
ERROR: In procedure symbol->string: Wrong type argument in position 1
(expecting symbol): #<<language> name: scheme title: Scheme reader:
#<procedure 104a020 at language/scheme/spec.scm:34:16 (port env)>
printer: #<procedure write (_ #:optional _)> parser: #f compilers:
((tree-il . #<procedure compile-tree-il (x e opts)>)) decompilers:
((tree-il . #<procedure decompile-tree-il (x env opts)>)) evaluator:
#<procedure 1050dc0 at language/scheme/spec.scm:45:16 (x module)>
joiner: #f make-default-environment: #<procedure 1050d40 at
language/scheme/spec.scm:48:16 ()>>

Some code along these lines has been working OK on 2.0+ for a while,
not quite sure when it broke.

--
Tristan Colgate-McFarlane
----
  "You can get all your daily vitamins from 52 pints of guiness, and a
glass of milk"

-- 
Tristan Colgate-McFarlane
----
  "You can get all your daily vitamins from 52 pints of guiness, and a
glass of milk"