* Runtime error (already posted to the main group, sorry)
@ 2002-11-14 13:56 jblazi
2002-11-14 19:51 ` Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: jblazi @ 2002-11-14 13:56 UTC (permalink / raw)
I getting the following runtime error when my code is running:
ERROR: In procedure eval-string:
ERROR: Wrong type argument in position 1: 1050843
Here is the code. I use Cygwin on Win2K and wxWindows and the code is in a cpp
file.
static SCM test_function(SCM n)
{
printf("Die Zahl ist %d\n",SCM_INUM(n));
return SCM_UNSPECIFIED;
}
bool KApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame*)NULL,-1,"Konstruktionsprogramm");
widget = new MainWidget(frame);
setupMenus();
frame->Show(true);
SetTopWindow(frame);
dateiname = NULL;
geo_init();
scm_init_guile();
scm_c_define_gsubr("test_function", 1, 0, 0,(SCM (*)())test_function);
scm_eval_string((scm_unused_struct*)"(test_function 4)");
return true;
}
Can anybody help me?
TIA,
--
Janos Blazi
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Runtime error (already posted to the main group, sorry)
2002-11-14 13:56 Runtime error (already posted to the main group, sorry) jblazi
@ 2002-11-14 19:51 ` Marius Vollmer
0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2002-11-14 19:51 UTC (permalink / raw)
Cc: bug-guile
jblazi <jblazi@gmx.de> writes:
> scm_eval_string((scm_unused_struct*)"(test_function 4)");
You can not just cast a char* to a SCM. Where did you get that idea?
(Maybe there is some misleading stuff in the manual, that's why I
ask.)
You should either use scm_c_eval_string,
scm_c_eval_string ("(test_function 4)");
wich can work directly with C strings, or use scm_str2string to
convert the C string into a Scheme string:
scm_c_eval_string (scm_str2string ("(test_function 4)"));
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-14 19:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-14 13:56 Runtime error (already posted to the main group, sorry) jblazi
2002-11-14 19:51 ` Marius Vollmer
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).